policyassignments

package
v0.20230728.1102029 Latest Latest
Warning

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

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

README

github.com/hashicorp/go-azure-sdk/resource-manager/resources/2021-06-01/policyassignments Documentation

The policyassignments SDK allows for interaction with the Azure Resource Manager Service resources (API Version 2021-06-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/resources/2021-06-01/policyassignments"

Client Initialization

client := policyassignments.NewPolicyAssignmentsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: PolicyAssignmentsClient.Create

ctx := context.TODO()
id := policyassignments.NewScopedPolicyAssignmentID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "policyAssignmentValue")

payload := policyassignments.PolicyAssignment{
	// ...
}


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: PolicyAssignmentsClient.CreateById

ctx := context.TODO()
id := policyassignments.NewPolicyAssignmentIdID("policyAssignmentIdValue")

payload := policyassignments.PolicyAssignment{
	// ...
}


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: PolicyAssignmentsClient.Delete

ctx := context.TODO()
id := policyassignments.NewScopedPolicyAssignmentID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "policyAssignmentValue")

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: PolicyAssignmentsClient.DeleteById

ctx := context.TODO()
id := policyassignments.NewPolicyAssignmentIdID("policyAssignmentIdValue")

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

ctx := context.TODO()
id := policyassignments.NewScopedPolicyAssignmentID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "policyAssignmentValue")

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: PolicyAssignmentsClient.GetById

ctx := context.TODO()
id := policyassignments.NewPolicyAssignmentIdID("policyAssignmentIdValue")

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

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

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

Example Usage: PolicyAssignmentsClient.ListForManagementGroup

ctx := context.TODO()
id := policyassignments.NewManagementGroupID("groupIdValue")

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

Example Usage: PolicyAssignmentsClient.ListForResource

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

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

Example Usage: PolicyAssignmentsClient.ListForResourceGroup

ctx := context.TODO()
id := policyassignments.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group")

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

Example Usage: PolicyAssignmentsClient.Update

ctx := context.TODO()
id := policyassignments.NewScopedPolicyAssignmentID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "policyAssignmentValue")

payload := policyassignments.PolicyAssignmentUpdate{
	// ...
}


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
}

Example Usage: PolicyAssignmentsClient.UpdateById

ctx := context.TODO()
id := policyassignments.NewPolicyAssignmentIdID("policyAssignmentIdValue")

payload := policyassignments.PolicyAssignmentUpdate{
	// ...
}


read, err := client.UpdateById(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 PossibleValuesForEnforcementMode

func PossibleValuesForEnforcementMode() []string

func ValidatePolicyAssignmentIdID

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

ValidatePolicyAssignmentIdID checks that 'input' can be parsed as a Policy Assignment Id ID

func ValidateScopedPolicyAssignmentID

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

ValidateScopedPolicyAssignmentID checks that 'input' can be parsed as a Scoped Policy Assignment ID

Types

type CreateByIdOperationResponse

type CreateByIdOperationResponse struct {
	HttpResponse *http.Response
	Model        *PolicyAssignment
}

type CreateOperationResponse

type CreateOperationResponse struct {
	HttpResponse *http.Response
	Model        *PolicyAssignment
}

type DeleteByIdOperationResponse

type DeleteByIdOperationResponse struct {
	HttpResponse *http.Response
	Model        *PolicyAssignment
}

type DeleteOperationResponse

type DeleteOperationResponse struct {
	HttpResponse *http.Response
	Model        *PolicyAssignment
}

type EnforcementMode

type EnforcementMode string
const (
	EnforcementModeDefault      EnforcementMode = "Default"
	EnforcementModeDoNotEnforce EnforcementMode = "DoNotEnforce"
)

type GetByIdOperationResponse

type GetByIdOperationResponse struct {
	HttpResponse *http.Response
	Model        *PolicyAssignment
}

type GetOperationResponse

type GetOperationResponse struct {
	HttpResponse *http.Response
	Model        *PolicyAssignment
}

type ListCompleteResult

type ListCompleteResult struct {
	Items []PolicyAssignment
}

type ListForManagementGroupCompleteResult

type ListForManagementGroupCompleteResult struct {
	Items []PolicyAssignment
}

type ListForManagementGroupOperationOptions

type ListForManagementGroupOperationOptions struct {
	Filter *string
	Top    *int64
}

func DefaultListForManagementGroupOperationOptions

func DefaultListForManagementGroupOperationOptions() ListForManagementGroupOperationOptions

type ListForManagementGroupOperationResponse

type ListForManagementGroupOperationResponse struct {
	HttpResponse *http.Response
	Model        *[]PolicyAssignment
	// contains filtered or unexported fields
}

func (ListForManagementGroupOperationResponse) HasMore

func (ListForManagementGroupOperationResponse) LoadMore

type ListForResourceCompleteResult

type ListForResourceCompleteResult struct {
	Items []PolicyAssignment
}

type ListForResourceGroupCompleteResult

type ListForResourceGroupCompleteResult struct {
	Items []PolicyAssignment
}

type ListForResourceGroupOperationOptions

type ListForResourceGroupOperationOptions struct {
	Filter *string
	Top    *int64
}

func DefaultListForResourceGroupOperationOptions

func DefaultListForResourceGroupOperationOptions() ListForResourceGroupOperationOptions

type ListForResourceGroupOperationResponse

type ListForResourceGroupOperationResponse struct {
	HttpResponse *http.Response
	Model        *[]PolicyAssignment
	// contains filtered or unexported fields
}

func (ListForResourceGroupOperationResponse) HasMore

func (ListForResourceGroupOperationResponse) LoadMore

type ListForResourceOperationOptions

type ListForResourceOperationOptions struct {
	Filter *string
	Top    *int64
}

func DefaultListForResourceOperationOptions

func DefaultListForResourceOperationOptions() ListForResourceOperationOptions

type ListForResourceOperationResponse

type ListForResourceOperationResponse struct {
	HttpResponse *http.Response
	Model        *[]PolicyAssignment
	// contains filtered or unexported fields
}

func (ListForResourceOperationResponse) HasMore

func (ListForResourceOperationResponse) LoadMore

type ListOperationOptions

type ListOperationOptions struct {
	Filter *string
	Top    *int64
}

func DefaultListOperationOptions

func DefaultListOperationOptions() ListOperationOptions

type ListOperationResponse

type ListOperationResponse struct {
	HttpResponse *http.Response
	Model        *[]PolicyAssignment
	// contains filtered or unexported fields
}

func (ListOperationResponse) HasMore

func (r ListOperationResponse) HasMore() bool

func (ListOperationResponse) LoadMore

func (r ListOperationResponse) LoadMore(ctx context.Context) (resp ListOperationResponse, err error)

type NonComplianceMessage

type NonComplianceMessage struct {
	Message                     string  `json:"message"`
	PolicyDefinitionReferenceId *string `json:"policyDefinitionReferenceId,omitempty"`
}

type ParameterValuesValue

type ParameterValuesValue struct {
	Value *interface{} `json:"value,omitempty"`
}

type PolicyAssignment

type PolicyAssignment struct {
	Id         *string                           `json:"id,omitempty"`
	Identity   *identity.SystemOrUserAssignedMap `json:"identity,omitempty"`
	Location   *string                           `json:"location,omitempty"`
	Name       *string                           `json:"name,omitempty"`
	Properties *PolicyAssignmentProperties       `json:"properties,omitempty"`
	SystemData *systemdata.SystemData            `json:"systemData,omitempty"`
	Type       *string                           `json:"type,omitempty"`
}

type PolicyAssignmentIdId

type PolicyAssignmentIdId struct {
	PolicyAssignmentId string
}

PolicyAssignmentIdId is a struct representing the Resource ID for a Policy Assignment Id

func NewPolicyAssignmentIdID

func NewPolicyAssignmentIdID(policyAssignmentId string) PolicyAssignmentIdId

NewPolicyAssignmentIdID returns a new PolicyAssignmentIdId struct

func ParsePolicyAssignmentIdID

func ParsePolicyAssignmentIdID(input string) (*PolicyAssignmentIdId, error)

ParsePolicyAssignmentIdID parses 'input' into a PolicyAssignmentIdId

func ParsePolicyAssignmentIdIDInsensitively

func ParsePolicyAssignmentIdIDInsensitively(input string) (*PolicyAssignmentIdId, error)

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

func (PolicyAssignmentIdId) ID

func (id PolicyAssignmentIdId) ID() string

ID returns the formatted Policy Assignment Id ID

func (PolicyAssignmentIdId) Segments

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

Segments returns a slice of Resource ID Segments which comprise this Policy Assignment Id ID

func (PolicyAssignmentIdId) String

func (id PolicyAssignmentIdId) String() string

String returns a human-readable description of this Policy Assignment Id ID

type PolicyAssignmentOperationPredicate

type PolicyAssignmentOperationPredicate struct {
	Id       *string
	Location *string
	Name     *string
	Type     *string
}

func (PolicyAssignmentOperationPredicate) Matches

type PolicyAssignmentProperties

type PolicyAssignmentProperties struct {
	Description           *string                          `json:"description,omitempty"`
	DisplayName           *string                          `json:"displayName,omitempty"`
	EnforcementMode       *EnforcementMode                 `json:"enforcementMode,omitempty"`
	Metadata              *interface{}                     `json:"metadata,omitempty"`
	NonComplianceMessages *[]NonComplianceMessage          `json:"nonComplianceMessages,omitempty"`
	NotScopes             *[]string                        `json:"notScopes,omitempty"`
	Parameters            *map[string]ParameterValuesValue `json:"parameters,omitempty"`
	PolicyDefinitionId    *string                          `json:"policyDefinitionId,omitempty"`
	Scope                 *string                          `json:"scope,omitempty"`
}

type PolicyAssignmentUpdate

type PolicyAssignmentUpdate struct {
	Identity *identity.SystemOrUserAssignedMap `json:"identity,omitempty"`
	Location *string                           `json:"location,omitempty"`
}

type PolicyAssignmentsClient

type PolicyAssignmentsClient struct {
	Client autorest.Client
	// contains filtered or unexported fields
}

func NewPolicyAssignmentsClientWithBaseURI

func NewPolicyAssignmentsClientWithBaseURI(endpoint string) PolicyAssignmentsClient

func (PolicyAssignmentsClient) Create

Create ...

func (PolicyAssignmentsClient) CreateById

CreateById ...

func (PolicyAssignmentsClient) Delete

Delete ...

func (PolicyAssignmentsClient) DeleteById

DeleteById ...

func (PolicyAssignmentsClient) Get

Get ...

func (PolicyAssignmentsClient) GetById

GetById ...

func (PolicyAssignmentsClient) List

List ...

func (PolicyAssignmentsClient) ListComplete

ListComplete retrieves all of the results into a single object

func (PolicyAssignmentsClient) ListCompleteMatchingPredicate

ListCompleteMatchingPredicate retrieves all of the results and then applied the predicate

func (PolicyAssignmentsClient) ListForManagementGroup

ListForManagementGroup ...

func (PolicyAssignmentsClient) ListForManagementGroupComplete

ListForManagementGroupComplete retrieves all of the results into a single object

func (PolicyAssignmentsClient) ListForManagementGroupCompleteMatchingPredicate

ListForManagementGroupCompleteMatchingPredicate retrieves all of the results and then applied the predicate

func (PolicyAssignmentsClient) ListForResource

ListForResource ...

func (PolicyAssignmentsClient) ListForResourceComplete

ListForResourceComplete retrieves all of the results into a single object

func (PolicyAssignmentsClient) ListForResourceCompleteMatchingPredicate

ListForResourceCompleteMatchingPredicate retrieves all of the results and then applied the predicate

func (PolicyAssignmentsClient) ListForResourceGroup

ListForResourceGroup ...

func (PolicyAssignmentsClient) ListForResourceGroupComplete

ListForResourceGroupComplete retrieves all of the results into a single object

func (PolicyAssignmentsClient) ListForResourceGroupCompleteMatchingPredicate

ListForResourceGroupCompleteMatchingPredicate retrieves all of the results and then applied the predicate

func (PolicyAssignmentsClient) Update

Update ...

func (PolicyAssignmentsClient) UpdateById

UpdateById ...

type ScopedPolicyAssignmentId

type ScopedPolicyAssignmentId struct {
	Scope                string
	PolicyAssignmentName string
}

ScopedPolicyAssignmentId is a struct representing the Resource ID for a Scoped Policy Assignment

func NewScopedPolicyAssignmentID

func NewScopedPolicyAssignmentID(scope string, policyAssignmentName string) ScopedPolicyAssignmentId

NewScopedPolicyAssignmentID returns a new ScopedPolicyAssignmentId struct

func ParseScopedPolicyAssignmentID

func ParseScopedPolicyAssignmentID(input string) (*ScopedPolicyAssignmentId, error)

ParseScopedPolicyAssignmentID parses 'input' into a ScopedPolicyAssignmentId

func ParseScopedPolicyAssignmentIDInsensitively

func ParseScopedPolicyAssignmentIDInsensitively(input string) (*ScopedPolicyAssignmentId, error)

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

func (ScopedPolicyAssignmentId) ID

ID returns the formatted Scoped Policy Assignment ID

func (ScopedPolicyAssignmentId) Segments

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

func (ScopedPolicyAssignmentId) String

func (id ScopedPolicyAssignmentId) String() string

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

type UpdateByIdOperationResponse

type UpdateByIdOperationResponse struct {
	HttpResponse *http.Response
	Model        *PolicyAssignment
}

type UpdateOperationResponse

type UpdateOperationResponse struct {
	HttpResponse *http.Response
	Model        *PolicyAssignment
}

Jump to

Keyboard shortcuts

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