roleassignments

package
v0.20240315.1103122 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: MPL-2.0 Imports: 10 Imported by: 0

README

github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2018-01-01-preview/roleassignments Documentation

The roleassignments SDK allows for interaction with the Azure Resource Manager Service authorization (API Version 2018-01-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/2018-01-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)
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)
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)
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)
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
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 DeleteByIdOperationResponse

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

type DeleteOperationResponse

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

type GetByIdOperationResponse

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

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
}

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
}

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
}

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
}

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 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"`
	PrincipalId      string `json:"principalId"`
	RoleDefinitionId string `json:"roleDefinitionId"`
}

type RoleAssignmentPropertiesWithScope

type RoleAssignmentPropertiesWithScope struct {
	CanDelegate      *bool   `json:"canDelegate,omitempty"`
	PrincipalId      *string `json:"principalId,omitempty"`
	RoleDefinitionId *string `json:"roleDefinitionId,omitempty"`
	Scope            *string `json:"scope,omitempty"`
}

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

func (c RoleAssignmentsClient) DeleteById(ctx context.Context, id RoleIdId) (result DeleteByIdOperationResponse, err error)

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