rolemanagementpolicies

package
v0.20241009.1142232 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: MPL-2.0 Imports: 14 Imported by: 1

README

github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2020-10-01/rolemanagementpolicies Documentation

The rolemanagementpolicies SDK allows for interaction with Azure Resource Manager authorization (API Version 2020-10-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-helpers/resourcemanager/commonids"
import "github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2020-10-01/rolemanagementpolicies"

Client Initialization

client := rolemanagementpolicies.NewRoleManagementPoliciesClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: RoleManagementPoliciesClient.Delete

ctx := context.TODO()
id := rolemanagementpolicies.NewScopedRoleManagementPolicyID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "roleManagementPolicyName")

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

ctx := context.TODO()
id := rolemanagementpolicies.NewScopedRoleManagementPolicyID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "roleManagementPolicyName")

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: RoleManagementPoliciesClient.ListForScope

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

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

Example Usage: RoleManagementPoliciesClient.Update

ctx := context.TODO()
id := rolemanagementpolicies.NewScopedRoleManagementPolicyID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "roleManagementPolicyName")

payload := rolemanagementpolicies.RoleManagementPolicy{
	// ...
}


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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PossibleValuesForApprovalMode added in v0.20241009.1142232

func PossibleValuesForApprovalMode() []string

func PossibleValuesForEnablementRules added in v0.20241009.1142232

func PossibleValuesForEnablementRules() []string

func PossibleValuesForNotificationDeliveryMechanism added in v0.20241009.1142232

func PossibleValuesForNotificationDeliveryMechanism() []string

func PossibleValuesForNotificationLevel added in v0.20241009.1142232

func PossibleValuesForNotificationLevel() []string

func PossibleValuesForRecipientType added in v0.20241009.1142232

func PossibleValuesForRecipientType() []string

func PossibleValuesForRoleManagementPolicyRuleType

func PossibleValuesForRoleManagementPolicyRuleType() []string

func PossibleValuesForUserType added in v0.20241009.1142232

func PossibleValuesForUserType() []string

func ValidateScopedRoleManagementPolicyID

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

ValidateScopedRoleManagementPolicyID checks that 'input' can be parsed as a Scoped Role Management Policy ID

Types

type ApprovalMode added in v0.20241009.1142232

type ApprovalMode string
const (
	ApprovalModeNoApproval  ApprovalMode = "NoApproval"
	ApprovalModeParallel    ApprovalMode = "Parallel"
	ApprovalModeSerial      ApprovalMode = "Serial"
	ApprovalModeSingleStage ApprovalMode = "SingleStage"
)

func (*ApprovalMode) UnmarshalJSON added in v0.20241009.1142232

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

type ApprovalSettings added in v0.20241009.1142232

type ApprovalSettings struct {
	ApprovalMode                     *ApprovalMode    `json:"approvalMode,omitempty"`
	ApprovalStages                   *[]ApprovalStage `json:"approvalStages,omitempty"`
	IsApprovalRequired               *bool            `json:"isApprovalRequired,omitempty"`
	IsApprovalRequiredForExtension   *bool            `json:"isApprovalRequiredForExtension,omitempty"`
	IsRequestorJustificationRequired *bool            `json:"isRequestorJustificationRequired,omitempty"`
}

type ApprovalStage added in v0.20241009.1142232

type ApprovalStage struct {
	ApprovalStageTimeOutInDays      *int64     `json:"approvalStageTimeOutInDays,omitempty"`
	EscalationApprovers             *[]UserSet `json:"escalationApprovers,omitempty"`
	EscalationTimeInMinutes         *int64     `json:"escalationTimeInMinutes,omitempty"`
	IsApproverJustificationRequired *bool      `json:"isApproverJustificationRequired,omitempty"`
	IsEscalationEnabled             *bool      `json:"isEscalationEnabled,omitempty"`
	PrimaryApprovers                *[]UserSet `json:"primaryApprovers,omitempty"`
}

type BaseRoleManagementPolicyRuleImpl added in v0.20240920.1135249

type BaseRoleManagementPolicyRuleImpl struct {
	Id       *string                         `json:"id,omitempty"`
	RuleType RoleManagementPolicyRuleType    `json:"ruleType"`
	Target   *RoleManagementPolicyRuleTarget `json:"target,omitempty"`
}

func (BaseRoleManagementPolicyRuleImpl) RoleManagementPolicyRule added in v0.20240920.1135249

type DeleteOperationResponse

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

type EnablementRules added in v0.20241009.1142232

type EnablementRules string
const (
	EnablementRulesJustification             EnablementRules = "Justification"
	EnablementRulesMultiFactorAuthentication EnablementRules = "MultiFactorAuthentication"
	EnablementRulesTicketing                 EnablementRules = "Ticketing"
)

func (*EnablementRules) UnmarshalJSON added in v0.20241009.1142232

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

type GetOperationResponse

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

type ListForScopeCompleteResult

type ListForScopeCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []RoleManagementPolicy
}

type ListForScopeCustomPager added in v0.20240628.1153531

type ListForScopeCustomPager struct {
	NextLink *odata.Link `json:"nextLink"`
}
func (p *ListForScopeCustomPager) NextPageLink() *odata.Link

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

type NotificationDeliveryMechanism added in v0.20241009.1142232

type NotificationDeliveryMechanism string
const (
	NotificationDeliveryMechanismEmail NotificationDeliveryMechanism = "Email"
)

func (*NotificationDeliveryMechanism) UnmarshalJSON added in v0.20241009.1142232

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

type NotificationLevel added in v0.20241009.1142232

type NotificationLevel string
const (
	NotificationLevelAll      NotificationLevel = "All"
	NotificationLevelCritical NotificationLevel = "Critical"
	NotificationLevelNone     NotificationLevel = "None"
)

func (*NotificationLevel) UnmarshalJSON added in v0.20241009.1142232

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

type PolicyProperties

type PolicyProperties struct {
	Scope *PolicyPropertiesScope `json:"scope,omitempty"`
}

type PolicyPropertiesScope

type PolicyPropertiesScope struct {
	DisplayName *string `json:"displayName,omitempty"`
	Id          *string `json:"id,omitempty"`
	Type        *string `json:"type,omitempty"`
}

type Principal

type Principal struct {
	DisplayName *string `json:"displayName,omitempty"`
	Email       *string `json:"email,omitempty"`
	Id          *string `json:"id,omitempty"`
	Type        *string `json:"type,omitempty"`
}

type RawRoleManagementPolicyRuleImpl

type RawRoleManagementPolicyRuleImpl struct {
	Type   string
	Values map[string]interface{}
	// contains filtered or unexported fields
}

RawRoleManagementPolicyRuleImpl is returned when the Discriminated Value doesn't match any of the defined types NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) and is used only for Deserialization (e.g. this cannot be used as a Request Payload).

func (RawRoleManagementPolicyRuleImpl) RoleManagementPolicyRule added in v0.20240920.1135249

type RecipientType added in v0.20241009.1142232

type RecipientType string
const (
	RecipientTypeAdmin     RecipientType = "Admin"
	RecipientTypeApprover  RecipientType = "Approver"
	RecipientTypeRequestor RecipientType = "Requestor"
)

func (*RecipientType) UnmarshalJSON added in v0.20241009.1142232

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

type RoleManagementPoliciesClient

type RoleManagementPoliciesClient struct {
	Client *resourcemanager.Client
}

func NewRoleManagementPoliciesClientWithBaseURI

func NewRoleManagementPoliciesClientWithBaseURI(sdkApi sdkEnv.Api) (*RoleManagementPoliciesClient, error)

func (RoleManagementPoliciesClient) Delete

Delete ...

func (RoleManagementPoliciesClient) Get

Get ...

func (RoleManagementPoliciesClient) ListForScope

ListForScope ...

func (RoleManagementPoliciesClient) ListForScopeComplete

ListForScopeComplete retrieves all the results into a single object

func (RoleManagementPoliciesClient) ListForScopeCompleteMatchingPredicate

ListForScopeCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (RoleManagementPoliciesClient) Update

Update ...

type RoleManagementPolicy

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

type RoleManagementPolicyApprovalRule added in v0.20241009.1142232

type RoleManagementPolicyApprovalRule struct {
	Setting *ApprovalSettings `json:"setting,omitempty"`

	Id       *string                         `json:"id,omitempty"`
	RuleType RoleManagementPolicyRuleType    `json:"ruleType"`
	Target   *RoleManagementPolicyRuleTarget `json:"target,omitempty"`
}

func (RoleManagementPolicyApprovalRule) MarshalJSON added in v0.20241009.1142232

func (s RoleManagementPolicyApprovalRule) MarshalJSON() ([]byte, error)

func (RoleManagementPolicyApprovalRule) RoleManagementPolicyRule added in v0.20241009.1142232

type RoleManagementPolicyAuthenticationContextRule added in v0.20241009.1142232

type RoleManagementPolicyAuthenticationContextRule struct {
	ClaimValue *string `json:"claimValue,omitempty"`
	IsEnabled  *bool   `json:"isEnabled,omitempty"`

	Id       *string                         `json:"id,omitempty"`
	RuleType RoleManagementPolicyRuleType    `json:"ruleType"`
	Target   *RoleManagementPolicyRuleTarget `json:"target,omitempty"`
}

func (RoleManagementPolicyAuthenticationContextRule) MarshalJSON added in v0.20241009.1142232

func (RoleManagementPolicyAuthenticationContextRule) RoleManagementPolicyRule added in v0.20241009.1142232

type RoleManagementPolicyEnablementRule added in v0.20241009.1142232

type RoleManagementPolicyEnablementRule struct {
	EnabledRules *[]EnablementRules `json:"enabledRules,omitempty"`

	Id       *string                         `json:"id,omitempty"`
	RuleType RoleManagementPolicyRuleType    `json:"ruleType"`
	Target   *RoleManagementPolicyRuleTarget `json:"target,omitempty"`
}

func (RoleManagementPolicyEnablementRule) MarshalJSON added in v0.20241009.1142232

func (s RoleManagementPolicyEnablementRule) MarshalJSON() ([]byte, error)

func (RoleManagementPolicyEnablementRule) RoleManagementPolicyRule added in v0.20241009.1142232

type RoleManagementPolicyExpirationRule added in v0.20241009.1142232

type RoleManagementPolicyExpirationRule struct {
	IsExpirationRequired *bool   `json:"isExpirationRequired,omitempty"`
	MaximumDuration      *string `json:"maximumDuration,omitempty"`

	Id       *string                         `json:"id,omitempty"`
	RuleType RoleManagementPolicyRuleType    `json:"ruleType"`
	Target   *RoleManagementPolicyRuleTarget `json:"target,omitempty"`
}

func (RoleManagementPolicyExpirationRule) MarshalJSON added in v0.20241009.1142232

func (s RoleManagementPolicyExpirationRule) MarshalJSON() ([]byte, error)

func (RoleManagementPolicyExpirationRule) RoleManagementPolicyRule added in v0.20241009.1142232

type RoleManagementPolicyNotificationRule added in v0.20241009.1142232

type RoleManagementPolicyNotificationRule struct {
	IsDefaultRecipientsEnabled *bool                          `json:"isDefaultRecipientsEnabled,omitempty"`
	NotificationLevel          *NotificationLevel             `json:"notificationLevel,omitempty"`
	NotificationRecipients     *[]string                      `json:"notificationRecipients,omitempty"`
	NotificationType           *NotificationDeliveryMechanism `json:"notificationType,omitempty"`
	RecipientType              *RecipientType                 `json:"recipientType,omitempty"`

	Id       *string                         `json:"id,omitempty"`
	RuleType RoleManagementPolicyRuleType    `json:"ruleType"`
	Target   *RoleManagementPolicyRuleTarget `json:"target,omitempty"`
}

func (RoleManagementPolicyNotificationRule) MarshalJSON added in v0.20241009.1142232

func (s RoleManagementPolicyNotificationRule) MarshalJSON() ([]byte, error)

func (RoleManagementPolicyNotificationRule) RoleManagementPolicyRule added in v0.20241009.1142232

type RoleManagementPolicyOperationPredicate

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

func (RoleManagementPolicyOperationPredicate) Matches

type RoleManagementPolicyProperties

type RoleManagementPolicyProperties struct {
	Description           *string                     `json:"description,omitempty"`
	DisplayName           *string                     `json:"displayName,omitempty"`
	EffectiveRules        *[]RoleManagementPolicyRule `json:"effectiveRules,omitempty"`
	IsOrganizationDefault *bool                       `json:"isOrganizationDefault,omitempty"`
	LastModifiedBy        *Principal                  `json:"lastModifiedBy,omitempty"`
	LastModifiedDateTime  *string                     `json:"lastModifiedDateTime,omitempty"`
	PolicyProperties      *PolicyProperties           `json:"policyProperties,omitempty"`
	Rules                 *[]RoleManagementPolicyRule `json:"rules,omitempty"`
	Scope                 *string                     `json:"scope,omitempty"`
}

func (*RoleManagementPolicyProperties) GetLastModifiedDateTimeAsTime

func (o *RoleManagementPolicyProperties) GetLastModifiedDateTimeAsTime() (*time.Time, error)

func (*RoleManagementPolicyProperties) SetLastModifiedDateTimeAsTime

func (o *RoleManagementPolicyProperties) SetLastModifiedDateTimeAsTime(input time.Time)

func (*RoleManagementPolicyProperties) UnmarshalJSON

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

type RoleManagementPolicyRule

type RoleManagementPolicyRule interface {
	RoleManagementPolicyRule() BaseRoleManagementPolicyRuleImpl
}

func UnmarshalRoleManagementPolicyRuleImplementation added in v0.20240920.1135249

func UnmarshalRoleManagementPolicyRuleImplementation(input []byte) (RoleManagementPolicyRule, error)

type RoleManagementPolicyRuleTarget

type RoleManagementPolicyRuleTarget struct {
	Caller              *string   `json:"caller,omitempty"`
	EnforcedSettings    *[]string `json:"enforcedSettings,omitempty"`
	InheritableSettings *[]string `json:"inheritableSettings,omitempty"`
	Level               *string   `json:"level,omitempty"`
	Operations          *[]string `json:"operations,omitempty"`
	TargetObjects       *[]string `json:"targetObjects,omitempty"`
}

type RoleManagementPolicyRuleType

type RoleManagementPolicyRuleType string
const (
	RoleManagementPolicyRuleTypeRoleManagementPolicyApprovalRule              RoleManagementPolicyRuleType = "RoleManagementPolicyApprovalRule"
	RoleManagementPolicyRuleTypeRoleManagementPolicyAuthenticationContextRule RoleManagementPolicyRuleType = "RoleManagementPolicyAuthenticationContextRule"
	RoleManagementPolicyRuleTypeRoleManagementPolicyEnablementRule            RoleManagementPolicyRuleType = "RoleManagementPolicyEnablementRule"
	RoleManagementPolicyRuleTypeRoleManagementPolicyExpirationRule            RoleManagementPolicyRuleType = "RoleManagementPolicyExpirationRule"
	RoleManagementPolicyRuleTypeRoleManagementPolicyNotificationRule          RoleManagementPolicyRuleType = "RoleManagementPolicyNotificationRule"
)

func (*RoleManagementPolicyRuleType) UnmarshalJSON

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

type ScopedRoleManagementPolicyId

type ScopedRoleManagementPolicyId struct {
	Scope                    string
	RoleManagementPolicyName string
}

ScopedRoleManagementPolicyId is a struct representing the Resource ID for a Scoped Role Management Policy

func NewScopedRoleManagementPolicyID

func NewScopedRoleManagementPolicyID(scope string, roleManagementPolicyName string) ScopedRoleManagementPolicyId

NewScopedRoleManagementPolicyID returns a new ScopedRoleManagementPolicyId struct

func ParseScopedRoleManagementPolicyID

func ParseScopedRoleManagementPolicyID(input string) (*ScopedRoleManagementPolicyId, error)

ParseScopedRoleManagementPolicyID parses 'input' into a ScopedRoleManagementPolicyId

func ParseScopedRoleManagementPolicyIDInsensitively

func ParseScopedRoleManagementPolicyIDInsensitively(input string) (*ScopedRoleManagementPolicyId, error)

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

func (*ScopedRoleManagementPolicyId) FromParseResult

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

func (ScopedRoleManagementPolicyId) ID

ID returns the formatted Scoped Role Management Policy ID

func (ScopedRoleManagementPolicyId) Segments

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

func (ScopedRoleManagementPolicyId) String

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

type UpdateOperationResponse

type UpdateOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *RoleManagementPolicy
}

type UserSet added in v0.20241009.1142232

type UserSet struct {
	Description *string   `json:"description,omitempty"`
	Id          *string   `json:"id,omitempty"`
	IsBackup    *bool     `json:"isBackup,omitempty"`
	UserType    *UserType `json:"userType,omitempty"`
}

type UserType added in v0.20241009.1142232

type UserType string
const (
	UserTypeGroup UserType = "Group"
	UserTypeUser  UserType = "User"
)

func (*UserType) UnmarshalJSON added in v0.20241009.1142232

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

Jump to

Keyboard shortcuts

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