policyexemptions

package
v0.0.0-...-a81a29a Latest Latest
Warning

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

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

README

github.com/hashicorp/go-azure-sdk/resource-manager/resources/2022-07-01-preview/policyexemptions Documentation

The policyexemptions SDK allows for interaction with the Azure Resource Manager Service resources (API Version 2022-07-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-sdk/resource-manager/resources/2022-07-01-preview/policyexemptions"

Client Initialization

client := policyexemptions.NewPolicyExemptionsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: PolicyExemptionsClient.CreateOrUpdate

ctx := context.TODO()
id := policyexemptions.NewScopedPolicyExemptionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "policyExemptionValue")

payload := policyexemptions.PolicyExemption{
	// ...
}


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

ctx := context.TODO()
id := policyexemptions.NewScopedPolicyExemptionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "policyExemptionValue")

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

ctx := context.TODO()
id := policyexemptions.NewScopedPolicyExemptionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "policyExemptionValue")

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

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

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

Example Usage: PolicyExemptionsClient.ListForManagementGroup

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

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

Example Usage: PolicyExemptionsClient.ListForResource

ctx := context.TODO()
id := policyexemptions.NewResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "providerValue", "parentResourcePathValue", "resourceTypeValue", "resourceValue")

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

Example Usage: PolicyExemptionsClient.ListForResourceGroup

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

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

Example Usage: PolicyExemptionsClient.Update

ctx := context.TODO()
id := policyexemptions.NewScopedPolicyExemptionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "policyExemptionValue")

payload := policyexemptions.PolicyExemptionUpdate{
	// ...
}


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 PossibleValuesForAssignmentScopeValidation

func PossibleValuesForAssignmentScopeValidation() []string

func PossibleValuesForExemptionCategory

func PossibleValuesForExemptionCategory() []string

func PossibleValuesForSelectorKind

func PossibleValuesForSelectorKind() []string

func ValidateResourceID

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

ValidateResourceID checks that 'input' can be parsed as a Resource ID

func ValidateScopedPolicyExemptionID

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

ValidateScopedPolicyExemptionID checks that 'input' can be parsed as a Scoped Policy Exemption ID

Types

type AssignmentScopeValidation

type AssignmentScopeValidation string
const (
	AssignmentScopeValidationDefault       AssignmentScopeValidation = "Default"
	AssignmentScopeValidationDoNotValidate AssignmentScopeValidation = "DoNotValidate"
)

type CreateOrUpdateOperationResponse

type CreateOrUpdateOperationResponse struct {
	HttpResponse *http.Response
	Model        *PolicyExemption
}

type DeleteOperationResponse

type DeleteOperationResponse struct {
	HttpResponse *http.Response
}

type ExemptionCategory

type ExemptionCategory string
const (
	ExemptionCategoryMitigated ExemptionCategory = "Mitigated"
	ExemptionCategoryWaiver    ExemptionCategory = "Waiver"
)

type GetOperationResponse

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

type ListCompleteResult

type ListCompleteResult struct {
	Items []PolicyExemption
}

type ListForManagementGroupCompleteResult

type ListForManagementGroupCompleteResult struct {
	Items []PolicyExemption
}

type ListForManagementGroupOperationOptions

type ListForManagementGroupOperationOptions struct {
	Filter *string
}

func DefaultListForManagementGroupOperationOptions

func DefaultListForManagementGroupOperationOptions() ListForManagementGroupOperationOptions

type ListForManagementGroupOperationResponse

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

func (ListForManagementGroupOperationResponse) HasMore

func (ListForManagementGroupOperationResponse) LoadMore

type ListForResourceCompleteResult

type ListForResourceCompleteResult struct {
	Items []PolicyExemption
}

type ListForResourceGroupCompleteResult

type ListForResourceGroupCompleteResult struct {
	Items []PolicyExemption
}

type ListForResourceGroupOperationOptions

type ListForResourceGroupOperationOptions struct {
	Filter *string
}

func DefaultListForResourceGroupOperationOptions

func DefaultListForResourceGroupOperationOptions() ListForResourceGroupOperationOptions

type ListForResourceGroupOperationResponse

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

func (ListForResourceGroupOperationResponse) HasMore

func (ListForResourceGroupOperationResponse) LoadMore

type ListForResourceOperationOptions

type ListForResourceOperationOptions struct {
	Filter *string
}

func DefaultListForResourceOperationOptions

func DefaultListForResourceOperationOptions() ListForResourceOperationOptions

type ListForResourceOperationResponse

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

func (ListForResourceOperationResponse) HasMore

func (ListForResourceOperationResponse) LoadMore

type ListOperationOptions

type ListOperationOptions struct {
	Filter *string
}

func DefaultListOperationOptions

func DefaultListOperationOptions() ListOperationOptions

type ListOperationResponse

type ListOperationResponse struct {
	HttpResponse *http.Response
	Model        *[]PolicyExemption
	// 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 PolicyExemption

type PolicyExemption struct {
	Id         *string                   `json:"id,omitempty"`
	Name       *string                   `json:"name,omitempty"`
	Properties PolicyExemptionProperties `json:"properties"`
	SystemData *systemdata.SystemData    `json:"systemData,omitempty"`
	Type       *string                   `json:"type,omitempty"`
}

type PolicyExemptionOperationPredicate

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

func (PolicyExemptionOperationPredicate) Matches

type PolicyExemptionProperties

type PolicyExemptionProperties struct {
	AssignmentScopeValidation    *AssignmentScopeValidation `json:"assignmentScopeValidation,omitempty"`
	Description                  *string                    `json:"description,omitempty"`
	DisplayName                  *string                    `json:"displayName,omitempty"`
	ExemptionCategory            ExemptionCategory          `json:"exemptionCategory"`
	ExpiresOn                    *string                    `json:"expiresOn,omitempty"`
	Metadata                     *interface{}               `json:"metadata,omitempty"`
	PolicyAssignmentId           string                     `json:"policyAssignmentId"`
	PolicyDefinitionReferenceIds *[]string                  `json:"policyDefinitionReferenceIds,omitempty"`
	ResourceSelectors            *[]ResourceSelector        `json:"resourceSelectors,omitempty"`
}

func (*PolicyExemptionProperties) GetExpiresOnAsTime

func (o *PolicyExemptionProperties) GetExpiresOnAsTime() (*time.Time, error)

func (*PolicyExemptionProperties) SetExpiresOnAsTime

func (o *PolicyExemptionProperties) SetExpiresOnAsTime(input time.Time)

type PolicyExemptionUpdate

type PolicyExemptionUpdate struct {
	Properties *PolicyExemptionUpdateProperties `json:"properties,omitempty"`
}

type PolicyExemptionUpdateProperties

type PolicyExemptionUpdateProperties struct {
	AssignmentScopeValidation *AssignmentScopeValidation `json:"assignmentScopeValidation,omitempty"`
	ResourceSelectors         *[]ResourceSelector        `json:"resourceSelectors,omitempty"`
}

type PolicyExemptionsClient

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

func NewPolicyExemptionsClientWithBaseURI

func NewPolicyExemptionsClientWithBaseURI(endpoint string) PolicyExemptionsClient

func (PolicyExemptionsClient) CreateOrUpdate

CreateOrUpdate ...

func (PolicyExemptionsClient) Delete

Delete ...

func (PolicyExemptionsClient) Get

Get ...

func (PolicyExemptionsClient) List

List ...

func (PolicyExemptionsClient) ListComplete

ListComplete retrieves all of the results into a single object

func (PolicyExemptionsClient) ListCompleteMatchingPredicate

func (c PolicyExemptionsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, options ListOperationOptions, predicate PolicyExemptionOperationPredicate) (resp ListCompleteResult, err error)

ListCompleteMatchingPredicate retrieves all of the results and then applied the predicate

func (PolicyExemptionsClient) ListForManagementGroup

ListForManagementGroup ...

func (PolicyExemptionsClient) ListForManagementGroupComplete

ListForManagementGroupComplete retrieves all of the results into a single object

func (PolicyExemptionsClient) ListForManagementGroupCompleteMatchingPredicate

ListForManagementGroupCompleteMatchingPredicate retrieves all of the results and then applied the predicate

func (PolicyExemptionsClient) ListForResource

ListForResource ...

func (PolicyExemptionsClient) ListForResourceComplete

ListForResourceComplete retrieves all of the results into a single object

func (PolicyExemptionsClient) ListForResourceCompleteMatchingPredicate

func (c PolicyExemptionsClient) ListForResourceCompleteMatchingPredicate(ctx context.Context, id ResourceId, options ListForResourceOperationOptions, predicate PolicyExemptionOperationPredicate) (resp ListForResourceCompleteResult, err error)

ListForResourceCompleteMatchingPredicate retrieves all of the results and then applied the predicate

func (PolicyExemptionsClient) ListForResourceGroup

ListForResourceGroup ...

func (PolicyExemptionsClient) ListForResourceGroupComplete

ListForResourceGroupComplete retrieves all of the results into a single object

func (PolicyExemptionsClient) ListForResourceGroupCompleteMatchingPredicate

ListForResourceGroupCompleteMatchingPredicate retrieves all of the results and then applied the predicate

func (PolicyExemptionsClient) Update

Update ...

type ResourceId

type ResourceId struct {
	SubscriptionId     string
	ResourceGroupName  string
	ProviderName       string
	ParentResourcePath string
	ResourceType       string
	ResourceName       string
}

ResourceId is a struct representing the Resource ID for a Resource

func NewResourceID

func NewResourceID(subscriptionId string, resourceGroupName string, providerName string, parentResourcePath string, resourceType string, resourceName string) ResourceId

NewResourceID returns a new ResourceId struct

func ParseResourceID

func ParseResourceID(input string) (*ResourceId, error)

ParseResourceID parses 'input' into a ResourceId

func ParseResourceIDInsensitively

func ParseResourceIDInsensitively(input string) (*ResourceId, error)

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

func (ResourceId) ID

func (id ResourceId) ID() string

ID returns the formatted Resource ID

func (ResourceId) Segments

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

Segments returns a slice of Resource ID Segments which comprise this Resource ID

func (ResourceId) String

func (id ResourceId) String() string

String returns a human-readable description of this Resource ID

type ResourceSelector

type ResourceSelector struct {
	Name      *string     `json:"name,omitempty"`
	Selectors *[]Selector `json:"selectors,omitempty"`
}

type ScopedPolicyExemptionId

type ScopedPolicyExemptionId struct {
	Scope               string
	PolicyExemptionName string
}

ScopedPolicyExemptionId is a struct representing the Resource ID for a Scoped Policy Exemption

func NewScopedPolicyExemptionID

func NewScopedPolicyExemptionID(scope string, policyExemptionName string) ScopedPolicyExemptionId

NewScopedPolicyExemptionID returns a new ScopedPolicyExemptionId struct

func ParseScopedPolicyExemptionID

func ParseScopedPolicyExemptionID(input string) (*ScopedPolicyExemptionId, error)

ParseScopedPolicyExemptionID parses 'input' into a ScopedPolicyExemptionId

func ParseScopedPolicyExemptionIDInsensitively

func ParseScopedPolicyExemptionIDInsensitively(input string) (*ScopedPolicyExemptionId, error)

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

func (ScopedPolicyExemptionId) ID

ID returns the formatted Scoped Policy Exemption ID

func (ScopedPolicyExemptionId) Segments

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

func (ScopedPolicyExemptionId) String

func (id ScopedPolicyExemptionId) String() string

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

type Selector

type Selector struct {
	In    *[]string     `json:"in,omitempty"`
	Kind  *SelectorKind `json:"kind,omitempty"`
	NotIn *[]string     `json:"notIn,omitempty"`
}

type SelectorKind

type SelectorKind string
const (
	SelectorKindPolicyDefinitionReferenceId SelectorKind = "policyDefinitionReferenceId"
	SelectorKindResourceLocation            SelectorKind = "resourceLocation"
	SelectorKindResourceType                SelectorKind = "resourceType"
	SelectorKindResourceWithoutLocation     SelectorKind = "resourceWithoutLocation"
)

type UpdateOperationResponse

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

Jump to

Keyboard shortcuts

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