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/cosmosdb/2022-05-15/rbacs Documentation

The rbacs SDK allows for interaction with the Azure Resource Manager Service cosmosdb (API Version 2022-05-15).

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/cosmosdb/2022-05-15/rbacs"

Client Initialization

client := rbacs.NewRbacsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: RbacsClient.SqlResourcesCreateUpdateSqlRoleAssignment

ctx := context.TODO()
id := rbacs.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group")

payload := rbacs.SqlRoleAssignmentCreateUpdateParameters{
	// ...
}


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

Example Usage: RbacsClient.SqlResourcesCreateUpdateSqlRoleDefinition

ctx := context.TODO()
id := rbacs.NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "roleDefinitionIdValue")

payload := rbacs.SqlRoleDefinitionCreateUpdateParameters{
	// ...
}


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

Example Usage: RbacsClient.SqlResourcesDeleteSqlRoleAssignment

ctx := context.TODO()
id := rbacs.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group")

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

Example Usage: RbacsClient.SqlResourcesDeleteSqlRoleDefinition

ctx := context.TODO()
id := rbacs.NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "roleDefinitionIdValue")

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

Example Usage: RbacsClient.SqlResourcesGetSqlRoleAssignment

ctx := context.TODO()
id := rbacs.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group")

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

Example Usage: RbacsClient.SqlResourcesGetSqlRoleDefinition

ctx := context.TODO()
id := rbacs.NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountValue", "roleDefinitionIdValue")

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

Example Usage: RbacsClient.SqlResourcesListSqlRoleAssignments

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

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

Example Usage: RbacsClient.SqlResourcesListSqlRoleDefinitions

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

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