roleassignments

package
v0.20240122.1044832 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: MPL-2.0 Imports: 13 Imported by: 0

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-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 := roleassignments.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 := 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
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PossibleValuesForPrincipalType

func PossibleValuesForPrincipalType() []string

func ValidateRoleIdID

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

ValidateRoleIdID checks that 'input' can be parsed as a Role Id ID

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 ListCompleteResult

type ListCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []RoleAssignment
}

type ListForResourceCompleteResult

type ListForResourceCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []RoleAssignment
}

type ListForResourceGroupCompleteResult

type ListForResourceGroupCompleteResult struct {
	LatestHttpResponse *http.Response
	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 {
	LatestHttpResponse *http.Response
	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 ListOperationOptions

type ListOperationOptions struct {
	Filter   *string
	TenantId *string
}

func DefaultListOperationOptions

func DefaultListOperationOptions() ListOperationOptions

func (ListOperationOptions) ToHeaders

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

func (ListOperationOptions) ToOData

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

func (ListOperationOptions) ToQuery

type ListOperationResponse

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

type PrincipalType

type PrincipalType string
const (
	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 *RoleAssignmentPropertiesWithScope `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 {
	CanDelegate                        *bool          `json:"canDelegate,omitempty"`
	Condition                          *string        `json:"condition,omitempty"`
	ConditionVersion                   *string        `json:"conditionVersion,omitempty"`
	DelegatedManagedIdentityResourceId *string        `json:"delegatedManagedIdentityResourceId,omitempty"`
	Description                        *string        `json:"description,omitempty"`
	PrincipalId                        string         `json:"principalId"`
	PrincipalType                      *PrincipalType `json:"principalType,omitempty"`
	RoleDefinitionId                   string         `json:"roleDefinitionId"`
}

type RoleAssignmentPropertiesWithScope

type RoleAssignmentPropertiesWithScope struct {
	CanDelegate                        *bool          `json:"canDelegate,omitempty"`
	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,omitempty"`
	PrincipalType                      *PrincipalType `json:"principalType,omitempty"`
	RoleDefinitionId                   *string        `json:"roleDefinitionId,omitempty"`
	Scope                              *string        `json:"scope,omitempty"`
	UpdatedBy                          *string        `json:"updatedBy,omitempty"`
	UpdatedOn                          *string        `json:"updatedOn,omitempty"`
}

func (*RoleAssignmentPropertiesWithScope) GetCreatedOnAsTime

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

func (*RoleAssignmentPropertiesWithScope) GetUpdatedOnAsTime

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

func (*RoleAssignmentPropertiesWithScope) SetCreatedOnAsTime

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

func (*RoleAssignmentPropertiesWithScope) SetUpdatedOnAsTime

func (o *RoleAssignmentPropertiesWithScope) 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) List

List ...

func (RoleAssignmentsClient) ListComplete

ListComplete retrieves all the results into a single object

func (RoleAssignmentsClient) ListCompleteMatchingPredicate

func (c RoleAssignmentsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, options ListOperationOptions, predicate RoleAssignmentOperationPredicate) (result ListCompleteResult, err error)

ListCompleteMatchingPredicate retrieves all the results and then applies the predicate

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

type RoleIdId

type RoleIdId struct {
	RoleId string
}

RoleIdId is a struct representing the Resource ID for a Role Id

func NewRoleIdID

func NewRoleIdID(roleId string) RoleIdId

NewRoleIdID returns a new RoleIdId struct

func ParseRoleIdID

func ParseRoleIdID(input string) (*RoleIdId, error)

ParseRoleIdID parses 'input' into a RoleIdId

func ParseRoleIdIDInsensitively

func ParseRoleIdIDInsensitively(input string) (*RoleIdId, error)

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

func (*RoleIdId) FromParseResult

func (id *RoleIdId) FromParseResult(input resourceids.ParseResult) error

func (RoleIdId) ID

func (id RoleIdId) ID() string

ID returns the formatted Role Id ID

func (RoleIdId) Segments

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

Segments returns a slice of Resource ID Segments which comprise this Role Id ID

func (RoleIdId) String

func (id RoleIdId) String() string

String returns a human-readable description of this Role Id ID

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) FromParseResult

func (id *ScopedRoleAssignmentId) FromParseResult(input resourceids.ParseResult) error

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