roleassignments

package
v0.20230807.1063129 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 7, 2023 License: MPL-2.0 Imports: 13 Imported by: 0

README

github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2022-04-01/roleassignments Documentation

The roleassignments SDK allows for interaction with the Azure Resource Manager Service authorization (API Version 2022-04-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/authorization/2022-04-01/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.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group")

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.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group")

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.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group")

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.ListForResource

ctx := context.TODO()
id := roleassignments.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 := roleassignments.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 := roleassignments.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
}

Example Usage: RoleAssignmentsClient.ListForSubscription

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PossibleValuesForPrincipalType

func PossibleValuesForPrincipalType() []string

func ValidateScopedRoleAssignmentID

func ValidateScopedRoleAssignmentID(input interface{}, key string) (warnings []string, errors []error)

ValidateScopedRoleAssignmentID checks that 'input' can be parsed as a Scoped Role Assignment ID

Types

type CreateByIdOperationResponse

type CreateByIdOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *RoleAssignment
}

type CreateOperationResponse

type CreateOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *RoleAssignment
}

type DeleteByIdOperationOptions

type DeleteByIdOperationOptions struct {
	TenantId *string
}

func DefaultDeleteByIdOperationOptions

func DefaultDeleteByIdOperationOptions() DeleteByIdOperationOptions

func (DeleteByIdOperationOptions) ToHeaders

func (o DeleteByIdOperationOptions) ToHeaders() *client.Headers

func (DeleteByIdOperationOptions) ToOData

func (o DeleteByIdOperationOptions) ToOData() *odata.Query

func (DeleteByIdOperationOptions) ToQuery

type DeleteByIdOperationResponse

type DeleteByIdOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *RoleAssignment
}

type DeleteOperationOptions

type DeleteOperationOptions struct {
	TenantId *string
}

func DefaultDeleteOperationOptions

func DefaultDeleteOperationOptions() DeleteOperationOptions

func (DeleteOperationOptions) ToHeaders

func (o DeleteOperationOptions) ToHeaders() *client.Headers

func (DeleteOperationOptions) ToOData

func (o DeleteOperationOptions) ToOData() *odata.Query

func (DeleteOperationOptions) ToQuery

type DeleteOperationResponse

type DeleteOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *RoleAssignment
}

type GetByIdOperationOptions

type GetByIdOperationOptions struct {
	TenantId *string
}

func DefaultGetByIdOperationOptions

func DefaultGetByIdOperationOptions() GetByIdOperationOptions

func (GetByIdOperationOptions) ToHeaders

func (o GetByIdOperationOptions) ToHeaders() *client.Headers

func (GetByIdOperationOptions) ToOData

func (o GetByIdOperationOptions) ToOData() *odata.Query

func (GetByIdOperationOptions) ToQuery

type GetByIdOperationResponse

type GetByIdOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *RoleAssignment
}

type GetOperationOptions

type GetOperationOptions struct {
	TenantId *string
}

func DefaultGetOperationOptions

func DefaultGetOperationOptions() GetOperationOptions

func (GetOperationOptions) ToHeaders

func (o GetOperationOptions) ToHeaders() *client.Headers

func (GetOperationOptions) ToOData

func (o GetOperationOptions) ToOData() *odata.Query

func (GetOperationOptions) ToQuery

func (o GetOperationOptions) ToQuery() *client.QueryParams

type GetOperationResponse

type GetOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *RoleAssignment
}

type ListForResourceCompleteResult

type ListForResourceCompleteResult struct {
	Items []RoleAssignment
}

type ListForResourceGroupCompleteResult

type ListForResourceGroupCompleteResult struct {
	Items []RoleAssignment
}

type ListForResourceGroupOperationOptions

type ListForResourceGroupOperationOptions struct {
	Filter   *string
	TenantId *string
}

func DefaultListForResourceGroupOperationOptions

func DefaultListForResourceGroupOperationOptions() ListForResourceGroupOperationOptions

func (ListForResourceGroupOperationOptions) ToHeaders

func (ListForResourceGroupOperationOptions) ToOData

func (ListForResourceGroupOperationOptions) ToQuery

type ListForResourceGroupOperationResponse

type ListForResourceGroupOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]RoleAssignment
}

type ListForResourceOperationOptions

type ListForResourceOperationOptions struct {
	Filter   *string
	TenantId *string
}

func DefaultListForResourceOperationOptions

func DefaultListForResourceOperationOptions() ListForResourceOperationOptions

func (ListForResourceOperationOptions) ToHeaders

func (ListForResourceOperationOptions) ToOData

func (ListForResourceOperationOptions) ToQuery

type ListForResourceOperationResponse

type ListForResourceOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]RoleAssignment
}

type ListForScopeCompleteResult

type ListForScopeCompleteResult struct {
	Items []RoleAssignment
}

type ListForScopeOperationOptions

type ListForScopeOperationOptions struct {
	Filter   *string
	TenantId *string
}

func DefaultListForScopeOperationOptions

func DefaultListForScopeOperationOptions() ListForScopeOperationOptions

func (ListForScopeOperationOptions) ToHeaders

func (ListForScopeOperationOptions) ToOData

func (ListForScopeOperationOptions) ToQuery

type ListForScopeOperationResponse

type ListForScopeOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]RoleAssignment
}

type ListForSubscriptionCompleteResult

type ListForSubscriptionCompleteResult struct {
	Items []RoleAssignment
}

type ListForSubscriptionOperationOptions

type ListForSubscriptionOperationOptions struct {
	Filter   *string
	TenantId *string
}

func DefaultListForSubscriptionOperationOptions

func DefaultListForSubscriptionOperationOptions() ListForSubscriptionOperationOptions

func (ListForSubscriptionOperationOptions) ToHeaders

func (ListForSubscriptionOperationOptions) ToOData

func (ListForSubscriptionOperationOptions) ToQuery

type ListForSubscriptionOperationResponse

type ListForSubscriptionOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]RoleAssignment
}

type PrincipalType

type PrincipalType string
const (
	PrincipalTypeDevice           PrincipalType = "Device"
	PrincipalTypeForeignGroup     PrincipalType = "ForeignGroup"
	PrincipalTypeGroup            PrincipalType = "Group"
	PrincipalTypeServicePrincipal PrincipalType = "ServicePrincipal"
	PrincipalTypeUser             PrincipalType = "User"
)

func (*PrincipalType) UnmarshalJSON

func (s *PrincipalType) UnmarshalJSON(bytes []byte) error

type RoleAssignment

type RoleAssignment struct {
	Id         *string                   `json:"id,omitempty"`
	Name       *string                   `json:"name,omitempty"`
	Properties *RoleAssignmentProperties `json:"properties,omitempty"`
	Type       *string                   `json:"type,omitempty"`
}

type RoleAssignmentCreateParameters

type RoleAssignmentCreateParameters struct {
	Properties RoleAssignmentProperties `json:"properties"`
}

type RoleAssignmentOperationPredicate

type RoleAssignmentOperationPredicate struct {
	Id   *string
	Name *string
	Type *string
}

func (RoleAssignmentOperationPredicate) Matches

type RoleAssignmentProperties

type RoleAssignmentProperties struct {
	Condition                          *string        `json:"condition,omitempty"`
	ConditionVersion                   *string        `json:"conditionVersion,omitempty"`
	CreatedBy                          *string        `json:"createdBy,omitempty"`
	CreatedOn                          *string        `json:"createdOn,omitempty"`
	DelegatedManagedIdentityResourceId *string        `json:"delegatedManagedIdentityResourceId,omitempty"`
	Description                        *string        `json:"description,omitempty"`
	PrincipalId                        string         `json:"principalId"`
	PrincipalType                      *PrincipalType `json:"principalType,omitempty"`
	RoleDefinitionId                   string         `json:"roleDefinitionId"`
	Scope                              *string        `json:"scope,omitempty"`
	UpdatedBy                          *string        `json:"updatedBy,omitempty"`
	UpdatedOn                          *string        `json:"updatedOn,omitempty"`
}

func (*RoleAssignmentProperties) GetCreatedOnAsTime

func (o *RoleAssignmentProperties) GetCreatedOnAsTime() (*time.Time, error)

func (*RoleAssignmentProperties) GetUpdatedOnAsTime

func (o *RoleAssignmentProperties) GetUpdatedOnAsTime() (*time.Time, error)

func (*RoleAssignmentProperties) SetCreatedOnAsTime

func (o *RoleAssignmentProperties) SetCreatedOnAsTime(input time.Time)

func (*RoleAssignmentProperties) SetUpdatedOnAsTime

func (o *RoleAssignmentProperties) SetUpdatedOnAsTime(input time.Time)

type RoleAssignmentsClient

type RoleAssignmentsClient struct {
	Client *resourcemanager.Client
}

func NewRoleAssignmentsClientWithBaseURI

func NewRoleAssignmentsClientWithBaseURI(sdkApi sdkEnv.Api) (*RoleAssignmentsClient, error)

func (RoleAssignmentsClient) Create

Create ...

func (RoleAssignmentsClient) CreateById

CreateById ...

func (RoleAssignmentsClient) Delete

Delete ...

func (RoleAssignmentsClient) DeleteById

DeleteById ...

func (RoleAssignmentsClient) Get

Get ...

func (RoleAssignmentsClient) GetById

GetById ...

func (RoleAssignmentsClient) ListForResource

ListForResource ...

func (RoleAssignmentsClient) ListForResourceComplete

ListForResourceComplete retrieves all the results into a single object

func (RoleAssignmentsClient) ListForResourceCompleteMatchingPredicate

func (c RoleAssignmentsClient) ListForResourceCompleteMatchingPredicate(ctx context.Context, id commonids.ScopeId, options ListForResourceOperationOptions, predicate RoleAssignmentOperationPredicate) (result ListForResourceCompleteResult, err error)

ListForResourceCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (RoleAssignmentsClient) ListForResourceGroup

ListForResourceGroup ...

func (RoleAssignmentsClient) ListForResourceGroupComplete

ListForResourceGroupComplete retrieves all the results into a single object

func (RoleAssignmentsClient) ListForResourceGroupCompleteMatchingPredicate

ListForResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (RoleAssignmentsClient) ListForScope

ListForScope ...

func (RoleAssignmentsClient) ListForScopeComplete

ListForScopeComplete retrieves all the results into a single object

func (RoleAssignmentsClient) ListForScopeCompleteMatchingPredicate

func (c RoleAssignmentsClient) ListForScopeCompleteMatchingPredicate(ctx context.Context, id commonids.ScopeId, options ListForScopeOperationOptions, predicate RoleAssignmentOperationPredicate) (result ListForScopeCompleteResult, err error)

ListForScopeCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (RoleAssignmentsClient) ListForSubscription

ListForSubscription ...

func (RoleAssignmentsClient) ListForSubscriptionComplete

ListForSubscriptionComplete retrieves all the results into a single object

func (RoleAssignmentsClient) ListForSubscriptionCompleteMatchingPredicate

ListForSubscriptionCompleteMatchingPredicate retrieves all the results and then applies the predicate

type ScopedRoleAssignmentId

type ScopedRoleAssignmentId struct {
	Scope              string
	RoleAssignmentName string
}

ScopedRoleAssignmentId is a struct representing the Resource ID for a Scoped Role Assignment

func NewScopedRoleAssignmentID

func NewScopedRoleAssignmentID(scope string, roleAssignmentName string) ScopedRoleAssignmentId

NewScopedRoleAssignmentID returns a new ScopedRoleAssignmentId struct

func ParseScopedRoleAssignmentID

func ParseScopedRoleAssignmentID(input string) (*ScopedRoleAssignmentId, error)

ParseScopedRoleAssignmentID parses 'input' into a ScopedRoleAssignmentId

func ParseScopedRoleAssignmentIDInsensitively

func ParseScopedRoleAssignmentIDInsensitively(input string) (*ScopedRoleAssignmentId, error)

ParseScopedRoleAssignmentIDInsensitively parses 'input' case-insensitively into a ScopedRoleAssignmentId note: this method should only be used for API response data and not user input

func (ScopedRoleAssignmentId) ID

ID returns the formatted Scoped Role Assignment ID

func (ScopedRoleAssignmentId) Segments

func (id ScopedRoleAssignmentId) Segments() []resourceids.Segment

Segments returns a slice of Resource ID Segments which comprise this Scoped Role Assignment ID

func (ScopedRoleAssignmentId) String

func (id ScopedRoleAssignmentId) String() string

String returns a human-readable description of this Scoped Role Assignment ID

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL