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/notificationhubs/2023-09-01/hubs Documentation

The hubs SDK allows for interaction with the Azure Resource Manager Service notificationhubs (API Version 2023-09-01).

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-sdk/resource-manager/notificationhubs/2023-09-01/hubs"

Client Initialization

client := hubs.NewHubsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: HubsClient.NotificationHubsCheckNotificationHubAvailability

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

payload := hubs.CheckAvailabilityParameters{
	// ...
}


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

Example Usage: HubsClient.NotificationHubsCreateOrUpdate

ctx := context.TODO()
id := hubs.NewNotificationHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceValue", "notificationHubValue")

payload := hubs.NotificationHubResource{
	// ...
}


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

Example Usage: HubsClient.NotificationHubsCreateOrUpdateAuthorizationRule

ctx := context.TODO()
id := hubs.NewNotificationHubAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceValue", "notificationHubValue", "authorizationRuleValue")

payload := hubs.SharedAccessAuthorizationRuleResource{
	// ...
}


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

Example Usage: HubsClient.NotificationHubsDebugSend

ctx := context.TODO()
id := hubs.NewNotificationHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceValue", "notificationHubValue")

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

Example Usage: HubsClient.NotificationHubsDelete

ctx := context.TODO()
id := hubs.NewNotificationHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceValue", "notificationHubValue")

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

Example Usage: HubsClient.NotificationHubsDeleteAuthorizationRule

ctx := context.TODO()
id := hubs.NewNotificationHubAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceValue", "notificationHubValue", "authorizationRuleValue")

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

Example Usage: HubsClient.NotificationHubsGet

ctx := context.TODO()
id := hubs.NewNotificationHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceValue", "notificationHubValue")

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

Example Usage: HubsClient.NotificationHubsGetAuthorizationRule

ctx := context.TODO()
id := hubs.NewNotificationHubAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceValue", "notificationHubValue", "authorizationRuleValue")

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

Example Usage: HubsClient.NotificationHubsGetPnsCredentials

ctx := context.TODO()
id := hubs.NewNotificationHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceValue", "notificationHubValue")

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

Example Usage: HubsClient.NotificationHubsList

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

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

Example Usage: HubsClient.NotificationHubsListAuthorizationRules

ctx := context.TODO()
id := hubs.NewNotificationHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceValue", "notificationHubValue")

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

Example Usage: HubsClient.NotificationHubsListKeys

ctx := context.TODO()
id := hubs.NewNotificationHubAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceValue", "notificationHubValue", "authorizationRuleValue")

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

Example Usage: HubsClient.NotificationHubsRegenerateKeys

ctx := context.TODO()
id := hubs.NewNotificationHubAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceValue", "notificationHubValue", "authorizationRuleValue")

payload := hubs.PolicyKeyResource{
	// ...
}


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

Example Usage: HubsClient.NotificationHubsUpdate

ctx := context.TODO()
id := hubs.NewNotificationHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceValue", "notificationHubValue")

payload := hubs.NotificationHubPatchParameters{
	// ...
}


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