roledefinitions

package
v0.20230712.1084117 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2023 License: MPL-2.0 Imports: 12 Imported by: 0

README

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

The roledefinitions 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/roledefinitions"

Client Initialization

client := roledefinitions.NewRoleDefinitionsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: RoleDefinitionsClient.CreateOrUpdate

ctx := context.TODO()
id := roledefinitions.NewScopedRoleDefinitionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "roleDefinitionIdValue")

payload := roledefinitions.RoleDefinition{
	// ...
}


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

Example Usage: RoleDefinitionsClient.Delete

ctx := context.TODO()
id := roledefinitions.NewScopedRoleDefinitionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "roleDefinitionIdValue")

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: RoleDefinitionsClient.Get

ctx := context.TODO()
id := roledefinitions.NewScopedRoleDefinitionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "roleDefinitionIdValue")

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: RoleDefinitionsClient.List

ctx := context.TODO()
id := roledefinitions.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group")

// alternatively `client.List(ctx, id, roledefinitions.DefaultListOperationOptions())` can be used to do batched pagination
items, err := client.ListComplete(ctx, id, roledefinitions.DefaultListOperationOptions())
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 ValidateScopedRoleDefinitionID

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

ValidateScopedRoleDefinitionID checks that 'input' can be parsed as a Scoped Role Definition ID

Types

type CreateOrUpdateOperationResponse

type CreateOrUpdateOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *RoleDefinition
}

type DeleteOperationResponse

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

type GetOperationResponse

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

type ListCompleteResult

type ListCompleteResult struct {
	Items []RoleDefinition
}

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        *[]RoleDefinition
}

type Permission

type Permission struct {
	Actions        *[]string `json:"actions,omitempty"`
	DataActions    *[]string `json:"dataActions,omitempty"`
	NotActions     *[]string `json:"notActions,omitempty"`
	NotDataActions *[]string `json:"notDataActions,omitempty"`
}

type RoleDefinition

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

type RoleDefinitionOperationPredicate

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

func (RoleDefinitionOperationPredicate) Matches

type RoleDefinitionProperties

type RoleDefinitionProperties struct {
	AssignableScopes *[]string     `json:"assignableScopes,omitempty"`
	CreatedBy        *string       `json:"createdBy,omitempty"`
	CreatedOn        *string       `json:"createdOn,omitempty"`
	Description      *string       `json:"description,omitempty"`
	Permissions      *[]Permission `json:"permissions,omitempty"`
	RoleName         *string       `json:"roleName,omitempty"`
	Type             *string       `json:"type,omitempty"`
	UpdatedBy        *string       `json:"updatedBy,omitempty"`
	UpdatedOn        *string       `json:"updatedOn,omitempty"`
}

func (*RoleDefinitionProperties) GetCreatedOnAsTime

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

func (*RoleDefinitionProperties) GetUpdatedOnAsTime

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

func (*RoleDefinitionProperties) SetCreatedOnAsTime

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

func (*RoleDefinitionProperties) SetUpdatedOnAsTime

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

type RoleDefinitionsClient

type RoleDefinitionsClient struct {
	Client *resourcemanager.Client
}

func NewRoleDefinitionsClientWithBaseURI

func NewRoleDefinitionsClientWithBaseURI(api environments.Api) (*RoleDefinitionsClient, error)

func (RoleDefinitionsClient) CreateOrUpdate

CreateOrUpdate ...

func (RoleDefinitionsClient) Delete

Delete ...

func (RoleDefinitionsClient) Get

Get ...

func (RoleDefinitionsClient) List

List ...

func (RoleDefinitionsClient) ListComplete

ListComplete retrieves all the results into a single object

func (RoleDefinitionsClient) ListCompleteMatchingPredicate

func (c RoleDefinitionsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ScopeId, options ListOperationOptions, predicate RoleDefinitionOperationPredicate) (result ListCompleteResult, err error)

ListCompleteMatchingPredicate retrieves all the results and then applies the predicate

type ScopedRoleDefinitionId

type ScopedRoleDefinitionId struct {
	Scope            string
	RoleDefinitionId string
}

ScopedRoleDefinitionId is a struct representing the Resource ID for a Scoped Role Definition

func NewScopedRoleDefinitionID

func NewScopedRoleDefinitionID(scope string, roleDefinitionId string) ScopedRoleDefinitionId

NewScopedRoleDefinitionID returns a new ScopedRoleDefinitionId struct

func ParseScopedRoleDefinitionID

func ParseScopedRoleDefinitionID(input string) (*ScopedRoleDefinitionId, error)

ParseScopedRoleDefinitionID parses 'input' into a ScopedRoleDefinitionId

func ParseScopedRoleDefinitionIDInsensitively

func ParseScopedRoleDefinitionIDInsensitively(input string) (*ScopedRoleDefinitionId, error)

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

func (ScopedRoleDefinitionId) ID

ID returns the formatted Scoped Role Definition ID

func (ScopedRoleDefinitionId) Segments

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

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

func (ScopedRoleDefinitionId) String

func (id ScopedRoleDefinitionId) String() string

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

Jump to

Keyboard shortcuts

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