policyexemptions

package
v0.20230922.1111207 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2023 License: MPL-2.0 Imports: 14 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.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group")

// 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 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"
)

func (*AssignmentScopeValidation) UnmarshalJSON added in v0.20230509.1154719

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

type CreateOrUpdateOperationResponse

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

type DeleteOperationResponse

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

type ExemptionCategory

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

func (*ExemptionCategory) UnmarshalJSON added in v0.20230509.1154719

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

type GetOperationResponse

type GetOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	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

func (ListForManagementGroupOperationOptions) ToHeaders added in v0.20230509.1154719

func (ListForManagementGroupOperationOptions) ToOData added in v0.20230509.1154719

func (ListForManagementGroupOperationOptions) ToQuery added in v0.20230509.1154719

type ListForManagementGroupOperationResponse

type ListForManagementGroupOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]PolicyExemption
}

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

func (ListForResourceGroupOperationOptions) ToHeaders added in v0.20230509.1154719

func (ListForResourceGroupOperationOptions) ToOData added in v0.20230509.1154719

func (ListForResourceGroupOperationOptions) ToQuery added in v0.20230509.1154719

type ListForResourceGroupOperationResponse

type ListForResourceGroupOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]PolicyExemption
}

type ListForResourceOperationOptions

type ListForResourceOperationOptions struct {
	Filter *string
}

func DefaultListForResourceOperationOptions

func DefaultListForResourceOperationOptions() ListForResourceOperationOptions

func (ListForResourceOperationOptions) ToHeaders added in v0.20230509.1154719

func (ListForResourceOperationOptions) ToOData added in v0.20230509.1154719

func (ListForResourceOperationOptions) ToQuery added in v0.20230509.1154719

type ListForResourceOperationResponse

type ListForResourceOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]PolicyExemption
}

type ListOperationOptions

type ListOperationOptions struct {
	Filter *string
}

func DefaultListOperationOptions

func DefaultListOperationOptions() ListOperationOptions

func (ListOperationOptions) ToHeaders added in v0.20230509.1154719

func (o ListOperationOptions) ToHeaders() *client.Headers

func (ListOperationOptions) ToOData added in v0.20230509.1154719

func (o ListOperationOptions) ToOData() *odata.Query

func (ListOperationOptions) ToQuery added in v0.20230509.1154719

type ListOperationResponse

type ListOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]PolicyExemption
}

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 *resourcemanager.Client
}

func NewPolicyExemptionsClientWithBaseURI

func NewPolicyExemptionsClientWithBaseURI(sdkApi sdkEnv.Api) (*PolicyExemptionsClient, error)

func (PolicyExemptionsClient) CreateOrUpdate

CreateOrUpdate ...

func (PolicyExemptionsClient) Delete

Delete ...

func (PolicyExemptionsClient) Get

Get ...

func (PolicyExemptionsClient) List

List ...

func (PolicyExemptionsClient) ListComplete

ListComplete retrieves all the results into a single object

func (PolicyExemptionsClient) ListCompleteMatchingPredicate

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

ListCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (PolicyExemptionsClient) ListForManagementGroup

ListForManagementGroup ...

func (PolicyExemptionsClient) ListForManagementGroupComplete

ListForManagementGroupComplete retrieves all the results into a single object

func (PolicyExemptionsClient) ListForManagementGroupCompleteMatchingPredicate

ListForManagementGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (PolicyExemptionsClient) ListForResource

ListForResource ...

func (PolicyExemptionsClient) ListForResourceComplete

ListForResourceComplete retrieves all the results into a single object

func (PolicyExemptionsClient) ListForResourceCompleteMatchingPredicate

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

ListForResourceCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (PolicyExemptionsClient) ListForResourceGroup

ListForResourceGroup ...

func (PolicyExemptionsClient) ListForResourceGroupComplete

ListForResourceGroupComplete retrieves all the results into a single object

func (PolicyExemptionsClient) ListForResourceGroupCompleteMatchingPredicate

ListForResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (PolicyExemptionsClient) Update

Update ...

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

func (*SelectorKind) UnmarshalJSON added in v0.20230509.1154719

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

type UpdateOperationResponse

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

Jump to

Keyboard shortcuts

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