policyassignments

package
v0.20240624.1135538 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2024 License: MPL-2.0 Imports: 11 Imported by: 0

README

github.com/hashicorp/go-azure-sdk/resource-manager/resources/2015-11-01/policyassignments Documentation

The policyassignments SDK allows for interaction with the Azure Resource Manager Service resources (API Version 2015-11-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/resources/2015-11-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 := commonids.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.ListForResource

ctx := context.TODO()
id := commonids.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 := commonids.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.ListForScope

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

// alternatively `client.ListForScope(ctx, id, policyassignments.DefaultListForScopeOperationOptions())` can be used to do batched pagination
items, err := client.ListForScopeComplete(ctx, id, policyassignments.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 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
	OData        *odata.OData
	Model        *PolicyAssignment
}

type CreateOperationResponse

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

type DeleteByIdOperationResponse

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

type DeleteOperationResponse

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

type GetByIdOperationResponse

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

type GetOperationResponse

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

type ListCompleteResult

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

type ListForResourceCompleteResult

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

type ListForResourceGroupCompleteResult

type ListForResourceGroupCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []PolicyAssignment
}

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

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

type ListForScopeCompleteResult

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

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

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

type PolicyAssignment

type PolicyAssignment struct {
	Name       *string                     `json:"name,omitempty"`
	Properties *PolicyAssignmentProperties `json:"properties,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) FromParseResult

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

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 {
	Name *string
}

func (PolicyAssignmentOperationPredicate) Matches

type PolicyAssignmentProperties

type PolicyAssignmentProperties struct {
	DisplayName        *string `json:"displayName,omitempty"`
	PolicyDefinitionId *string `json:"policyDefinitionId,omitempty"`
	Scope              *string `json:"scope,omitempty"`
}

type PolicyAssignmentsClient

type PolicyAssignmentsClient struct {
	Client *resourcemanager.Client
}

func NewPolicyAssignmentsClientWithBaseURI

func NewPolicyAssignmentsClientWithBaseURI(sdkApi sdkEnv.Api) (*PolicyAssignmentsClient, error)

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 the results into a single object

func (PolicyAssignmentsClient) ListCompleteMatchingPredicate

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

ListCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (PolicyAssignmentsClient) ListForResource

ListForResource ...

func (PolicyAssignmentsClient) ListForResourceComplete

ListForResourceComplete retrieves all the results into a single object

func (PolicyAssignmentsClient) ListForResourceCompleteMatchingPredicate

func (c PolicyAssignmentsClient) ListForResourceCompleteMatchingPredicate(ctx context.Context, id commonids.ScopeId, options ListForResourceOperationOptions, predicate PolicyAssignmentOperationPredicate) (result ListForResourceCompleteResult, err error)

ListForResourceCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (PolicyAssignmentsClient) ListForResourceGroup

ListForResourceGroup ...

func (PolicyAssignmentsClient) ListForResourceGroupComplete

ListForResourceGroupComplete retrieves all the results into a single object

func (PolicyAssignmentsClient) ListForResourceGroupCompleteMatchingPredicate

ListForResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (PolicyAssignmentsClient) ListForScope

ListForScope ...

func (PolicyAssignmentsClient) ListForScopeComplete

ListForScopeComplete retrieves all the results into a single object

func (PolicyAssignmentsClient) ListForScopeCompleteMatchingPredicate

func (c PolicyAssignmentsClient) ListForScopeCompleteMatchingPredicate(ctx context.Context, id commonids.ScopeId, options ListForScopeOperationOptions, predicate PolicyAssignmentOperationPredicate) (result ListForScopeCompleteResult, err error)

ListForScopeCompleteMatchingPredicate retrieves all the results and then applies the predicate

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

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

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

Jump to

Keyboard shortcuts

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