package
0.20240715.1103416
Repository: https://github.com/hashicorp/go-azure-sdk.git
Documentation: pkg.go.dev

# README

github.com/hashicorp/go-azure-sdk/resource-manager/hardwaresecuritymodules/2021-11-30/dedicatedhsms Documentation

The dedicatedhsms SDK allows for interaction with the Azure Resource Manager Service hardwaresecuritymodules (API Version 2021-11-30).

This readme covers example usages, but further information on using this SDK can be found in the project root.

Import Path

import "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids"
import "github.com/hashicorp/go-azure-sdk/resource-manager/hardwaresecuritymodules/2021-11-30/dedicatedhsms"

Client Initialization

client := dedicatedhsms.NewDedicatedHsmsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: DedicatedHsmsClient.DedicatedHsmCreateOrUpdate

ctx := context.TODO()
id := dedicatedhsms.NewDedicatedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dedicatedHSMValue")

payload := dedicatedhsms.DedicatedHsm{
	// ...
}


if err := client.DedicatedHsmCreateOrUpdateThenPoll(ctx, id, payload); err != nil {
	// handle the error
}

Example Usage: DedicatedHsmsClient.DedicatedHsmDelete

ctx := context.TODO()
id := dedicatedhsms.NewDedicatedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dedicatedHSMValue")

if err := client.DedicatedHsmDeleteThenPoll(ctx, id); err != nil {
	// handle the error
}

Example Usage: DedicatedHsmsClient.DedicatedHsmGet

ctx := context.TODO()
id := dedicatedhsms.NewDedicatedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dedicatedHSMValue")

read, err := client.DedicatedHsmGet(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: DedicatedHsmsClient.DedicatedHsmListByResourceGroup

ctx := context.TODO()
id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group")

// alternatively `client.DedicatedHsmListByResourceGroup(ctx, id, dedicatedhsms.DefaultDedicatedHsmListByResourceGroupOperationOptions())` can be used to do batched pagination
items, err := client.DedicatedHsmListByResourceGroupComplete(ctx, id, dedicatedhsms.DefaultDedicatedHsmListByResourceGroupOperationOptions())
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Example Usage: DedicatedHsmsClient.DedicatedHsmListBySubscription

ctx := context.TODO()
id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012")

// alternatively `client.DedicatedHsmListBySubscription(ctx, id, dedicatedhsms.DefaultDedicatedHsmListBySubscriptionOperationOptions())` can be used to do batched pagination
items, err := client.DedicatedHsmListBySubscriptionComplete(ctx, id, dedicatedhsms.DefaultDedicatedHsmListBySubscriptionOperationOptions())
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Example Usage: DedicatedHsmsClient.DedicatedHsmListOutboundNetworkDependenciesEndpoints

ctx := context.TODO()
id := dedicatedhsms.NewDedicatedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dedicatedHSMValue")

// alternatively `client.DedicatedHsmListOutboundNetworkDependenciesEndpoints(ctx, id)` can be used to do batched pagination
items, err := client.DedicatedHsmListOutboundNetworkDependenciesEndpointsComplete(ctx, id)
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Example Usage: DedicatedHsmsClient.DedicatedHsmUpdate

ctx := context.TODO()
id := dedicatedhsms.NewDedicatedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dedicatedHSMValue")

payload := dedicatedhsms.DedicatedHsmPatchParameters{
	// ...
}


if err := client.DedicatedHsmUpdateThenPoll(ctx, id, payload); err != nil {
	// handle the error
}