Categorygithub.com/hashicorp/go-azure-sdk/resource-managerauthorization2020-04-01-previewroleassignments
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/authorization/2020-04-01-preview/roleassignments
Documentation
The roleassignments
SDK allows for interaction with the Azure Resource Manager Service authorization
(API Version 2020-04-01-preview
).
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/authorization/2020-04-01-preview/roleassignments"
Client Initialization
client := roleassignments.NewRoleAssignmentsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer
Example Usage: RoleAssignmentsClient.Create
ctx := context.TODO()
id := roleassignments.NewScopedRoleAssignmentID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "roleAssignmentValue")
payload := roleassignments.RoleAssignmentCreateParameters{
// ...
}
read, err := client.Create(ctx, id, payload)
if err != nil {
// handle the error
}
if model := read.Model; model != nil {
// do something with the model/response object
}
Example Usage: RoleAssignmentsClient.CreateById
ctx := context.TODO()
id := roleassignments.NewRoleIdID("roleIdValue")
payload := roleassignments.RoleAssignmentCreateParameters{
// ...
}
read, err := client.CreateById(ctx, id, payload)
if err != nil {
// handle the error
}
if model := read.Model; model != nil {
// do something with the model/response object
}
Example Usage: RoleAssignmentsClient.Delete
ctx := context.TODO()
id := roleassignments.NewScopedRoleAssignmentID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "roleAssignmentValue")
read, err := client.Delete(ctx, id, roleassignments.DefaultDeleteOperationOptions())
if err != nil {
// handle the error
}
if model := read.Model; model != nil {
// do something with the model/response object
}
Example Usage: RoleAssignmentsClient.DeleteById
ctx := context.TODO()
id := roleassignments.NewRoleIdID("roleIdValue")
read, err := client.DeleteById(ctx, id, roleassignments.DefaultDeleteByIdOperationOptions())
if err != nil {
// handle the error
}
if model := read.Model; model != nil {
// do something with the model/response object
}
Example Usage: RoleAssignmentsClient.Get
ctx := context.TODO()
id := roleassignments.NewScopedRoleAssignmentID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "roleAssignmentValue")
read, err := client.Get(ctx, id, roleassignments.DefaultGetOperationOptions())
if err != nil {
// handle the error
}
if model := read.Model; model != nil {
// do something with the model/response object
}
Example Usage: RoleAssignmentsClient.GetById
ctx := context.TODO()
id := roleassignments.NewRoleIdID("roleIdValue")
read, err := client.GetById(ctx, id, roleassignments.DefaultGetByIdOperationOptions())
if err != nil {
// handle the error
}
if model := read.Model; model != nil {
// do something with the model/response object
}
Example Usage: RoleAssignmentsClient.List
ctx := context.TODO()
id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012")
// alternatively `client.List(ctx, id, roleassignments.DefaultListOperationOptions())` can be used to do batched pagination
items, err := client.ListComplete(ctx, id, roleassignments.DefaultListOperationOptions())
if err != nil {
// handle the error
}
for _, item := range items {
// do something
}
Example Usage: RoleAssignmentsClient.ListForResource
ctx := context.TODO()
id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group")
// alternatively `client.ListForResource(ctx, id, roleassignments.DefaultListForResourceOperationOptions())` can be used to do batched pagination
items, err := client.ListForResourceComplete(ctx, id, roleassignments.DefaultListForResourceOperationOptions())
if err != nil {
// handle the error
}
for _, item := range items {
// do something
}
Example Usage: RoleAssignmentsClient.ListForResourceGroup
ctx := context.TODO()
id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group")
// alternatively `client.ListForResourceGroup(ctx, id, roleassignments.DefaultListForResourceGroupOperationOptions())` can be used to do batched pagination
items, err := client.ListForResourceGroupComplete(ctx, id, roleassignments.DefaultListForResourceGroupOperationOptions())
if err != nil {
// handle the error
}
for _, item := range items {
// do something
}
Example Usage: RoleAssignmentsClient.ListForScope
ctx := context.TODO()
id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group")
// alternatively `client.ListForScope(ctx, id, roleassignments.DefaultListForScopeOperationOptions())` can be used to do batched pagination
items, err := client.ListForScopeComplete(ctx, id, roleassignments.DefaultListForScopeOperationOptions())
if err != nil {
// handle the error
}
for _, item := range items {
// do something
}
# Functions
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NewRoleIdID returns a new RoleIdId struct.
NewScopedRoleAssignmentID returns a new ScopedRoleAssignmentId struct.
ParseRoleIdID parses 'input' into a RoleIdId.
ParseRoleIdIDInsensitively parses 'input' case-insensitively into a RoleIdId note: this method should only be used for API response data and not user input.
ParseScopedRoleAssignmentID parses 'input' into a ScopedRoleAssignmentId.
ParseScopedRoleAssignmentIDInsensitively parses 'input' case-insensitively into a ScopedRoleAssignmentId note: this method should only be used for API response data and not user input.
No description provided by the author
ValidateRoleIdID checks that 'input' can be parsed as a Role Id ID.
ValidateScopedRoleAssignmentID checks that 'input' can be parsed as a Scoped Role Assignment ID.
# Constants
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Structs
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
RoleIdId is a struct representing the Resource ID for a Role Id.
ScopedRoleAssignmentId is a struct representing the Resource ID for a Scoped Role Assignment.
# Type aliases
No description provided by the author