policydefinitions

package
v0.20230524.1111852 Latest Latest
Warning

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

Go to latest
Published: May 24, 2023 License: MPL-2.0 Imports: 10 Imported by: 0

README

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

The policydefinitions 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/policydefinitions"

Client Initialization

client := policydefinitions.NewPolicyDefinitionsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: PolicyDefinitionsClient.CreateOrUpdate

ctx := context.TODO()
id := policydefinitions.NewProviderPolicyDefinitionID("12345678-1234-9876-4563-123456789012", "policyDefinitionValue")

payload := policydefinitions.PolicyDefinition{
	// ...
}


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: PolicyDefinitionsClient.CreateOrUpdateAtManagementGroup

ctx := context.TODO()
id := policydefinitions.NewProviders2PolicyDefinitionID("managementGroupIdValue", "policyDefinitionValue")

payload := policydefinitions.PolicyDefinition{
	// ...
}


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

Example Usage: PolicyDefinitionsClient.Delete

ctx := context.TODO()
id := policydefinitions.NewProviderPolicyDefinitionID("12345678-1234-9876-4563-123456789012", "policyDefinitionValue")

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: PolicyDefinitionsClient.DeleteAtManagementGroup

ctx := context.TODO()
id := policydefinitions.NewProviders2PolicyDefinitionID("managementGroupIdValue", "policyDefinitionValue")

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

Example Usage: PolicyDefinitionsClient.Get

ctx := context.TODO()
id := policydefinitions.NewProviderPolicyDefinitionID("12345678-1234-9876-4563-123456789012", "policyDefinitionValue")

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: PolicyDefinitionsClient.GetAtManagementGroup

ctx := context.TODO()
id := policydefinitions.NewProviders2PolicyDefinitionID("managementGroupIdValue", "policyDefinitionValue")

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

Example Usage: PolicyDefinitionsClient.GetBuiltIn

ctx := context.TODO()
id := policydefinitions.NewPolicyDefinitionID("policyDefinitionValue")

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

Example Usage: PolicyDefinitionsClient.List

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

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

Example Usage: PolicyDefinitionsClient.ListBuiltIn

ctx := context.TODO()


// alternatively `client.ListBuiltIn(ctx, policydefinitions.DefaultListBuiltInOperationOptions())` can be used to do batched pagination
items, err := client.ListBuiltInComplete(ctx, policydefinitions.DefaultListBuiltInOperationOptions())
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Example Usage: PolicyDefinitionsClient.ListByManagementGroup

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

// alternatively `client.ListByManagementGroup(ctx, id, policydefinitions.DefaultListByManagementGroupOperationOptions())` can be used to do batched pagination
items, err := client.ListByManagementGroupComplete(ctx, id, policydefinitions.DefaultListByManagementGroupOperationOptions())
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 PossibleValuesForParameterType

func PossibleValuesForParameterType() []string

func PossibleValuesForPolicyType

func PossibleValuesForPolicyType() []string

func ValidatePolicyDefinitionID

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

ValidatePolicyDefinitionID checks that 'input' can be parsed as a Policy Definition ID

func ValidateProviderPolicyDefinitionID

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

ValidateProviderPolicyDefinitionID checks that 'input' can be parsed as a Provider Policy Definition ID

func ValidateProviders2PolicyDefinitionID

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

ValidateProviders2PolicyDefinitionID checks that 'input' can be parsed as a Providers 2 Policy Definition ID

Types

type CreateOrUpdateAtManagementGroupOperationResponse

type CreateOrUpdateAtManagementGroupOperationResponse struct {
	HttpResponse *http.Response
	Model        *PolicyDefinition
}

type CreateOrUpdateOperationResponse

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

type DeleteAtManagementGroupOperationResponse

type DeleteAtManagementGroupOperationResponse struct {
	HttpResponse *http.Response
}

type DeleteOperationResponse

type DeleteOperationResponse struct {
	HttpResponse *http.Response
}

type GetAtManagementGroupOperationResponse

type GetAtManagementGroupOperationResponse struct {
	HttpResponse *http.Response
	Model        *PolicyDefinition
}

type GetBuiltInOperationResponse

type GetBuiltInOperationResponse struct {
	HttpResponse *http.Response
	Model        *PolicyDefinition
}

type GetOperationResponse

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

type ListBuiltInCompleteResult

type ListBuiltInCompleteResult struct {
	Items []PolicyDefinition
}

type ListBuiltInOperationOptions

type ListBuiltInOperationOptions struct {
	Filter *string
	Top    *int64
}

func DefaultListBuiltInOperationOptions

func DefaultListBuiltInOperationOptions() ListBuiltInOperationOptions

type ListBuiltInOperationResponse

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

func (ListBuiltInOperationResponse) HasMore

func (r ListBuiltInOperationResponse) HasMore() bool

func (ListBuiltInOperationResponse) LoadMore

type ListByManagementGroupCompleteResult

type ListByManagementGroupCompleteResult struct {
	Items []PolicyDefinition
}

type ListByManagementGroupOperationOptions

type ListByManagementGroupOperationOptions struct {
	Filter *string
	Top    *int64
}

func DefaultListByManagementGroupOperationOptions

func DefaultListByManagementGroupOperationOptions() ListByManagementGroupOperationOptions

type ListByManagementGroupOperationResponse

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

func (ListByManagementGroupOperationResponse) HasMore

func (ListByManagementGroupOperationResponse) LoadMore

type ListCompleteResult

type ListCompleteResult struct {
	Items []PolicyDefinition
}

type ListOperationOptions

type ListOperationOptions struct {
	Filter *string
	Top    *int64
}

func DefaultListOperationOptions

func DefaultListOperationOptions() ListOperationOptions

type ListOperationResponse

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

type ParameterDefinitionsValue struct {
	AllowedValues *[]interface{}                     `json:"allowedValues,omitempty"`
	DefaultValue  *interface{}                       `json:"defaultValue,omitempty"`
	Metadata      *ParameterDefinitionsValueMetadata `json:"metadata,omitempty"`
	Type          *ParameterType                     `json:"type,omitempty"`
}

type ParameterDefinitionsValueMetadata

type ParameterDefinitionsValueMetadata struct {
	AssignPermissions *bool   `json:"assignPermissions,omitempty"`
	Description       *string `json:"description,omitempty"`
	DisplayName       *string `json:"displayName,omitempty"`
	StrongType        *string `json:"strongType,omitempty"`
}

type ParameterType

type ParameterType string
const (
	ParameterTypeArray    ParameterType = "Array"
	ParameterTypeBoolean  ParameterType = "Boolean"
	ParameterTypeDateTime ParameterType = "DateTime"
	ParameterTypeFloat    ParameterType = "Float"
	ParameterTypeInteger  ParameterType = "Integer"
	ParameterTypeObject   ParameterType = "Object"
	ParameterTypeString   ParameterType = "String"
)

type PolicyDefinition

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

type PolicyDefinitionId

type PolicyDefinitionId struct {
	PolicyDefinitionName string
}

PolicyDefinitionId is a struct representing the Resource ID for a Policy Definition

func NewPolicyDefinitionID

func NewPolicyDefinitionID(policyDefinitionName string) PolicyDefinitionId

NewPolicyDefinitionID returns a new PolicyDefinitionId struct

func ParsePolicyDefinitionID

func ParsePolicyDefinitionID(input string) (*PolicyDefinitionId, error)

ParsePolicyDefinitionID parses 'input' into a PolicyDefinitionId

func ParsePolicyDefinitionIDInsensitively

func ParsePolicyDefinitionIDInsensitively(input string) (*PolicyDefinitionId, error)

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

func (PolicyDefinitionId) ID

func (id PolicyDefinitionId) ID() string

ID returns the formatted Policy Definition ID

func (PolicyDefinitionId) Segments

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

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

func (PolicyDefinitionId) String

func (id PolicyDefinitionId) String() string

String returns a human-readable description of this Policy Definition ID

type PolicyDefinitionOperationPredicate

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

func (PolicyDefinitionOperationPredicate) Matches

type PolicyDefinitionProperties

type PolicyDefinitionProperties struct {
	Description *string                               `json:"description,omitempty"`
	DisplayName *string                               `json:"displayName,omitempty"`
	Metadata    *interface{}                          `json:"metadata,omitempty"`
	Mode        *string                               `json:"mode,omitempty"`
	Parameters  *map[string]ParameterDefinitionsValue `json:"parameters,omitempty"`
	PolicyRule  *interface{}                          `json:"policyRule,omitempty"`
	PolicyType  *PolicyType                           `json:"policyType,omitempty"`
}

type PolicyDefinitionsClient

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

func NewPolicyDefinitionsClientWithBaseURI

func NewPolicyDefinitionsClientWithBaseURI(endpoint string) PolicyDefinitionsClient

func (PolicyDefinitionsClient) CreateOrUpdate

CreateOrUpdate ...

func (PolicyDefinitionsClient) CreateOrUpdateAtManagementGroup

CreateOrUpdateAtManagementGroup ...

func (PolicyDefinitionsClient) Delete

Delete ...

func (PolicyDefinitionsClient) DeleteAtManagementGroup

DeleteAtManagementGroup ...

func (PolicyDefinitionsClient) Get

Get ...

func (PolicyDefinitionsClient) GetAtManagementGroup

GetAtManagementGroup ...

func (PolicyDefinitionsClient) GetBuiltIn

GetBuiltIn ...

func (PolicyDefinitionsClient) List

List ...

func (PolicyDefinitionsClient) ListBuiltIn

ListBuiltIn ...

func (PolicyDefinitionsClient) ListBuiltInComplete

ListBuiltInComplete retrieves all of the results into a single object

func (PolicyDefinitionsClient) ListBuiltInCompleteMatchingPredicate

func (c PolicyDefinitionsClient) ListBuiltInCompleteMatchingPredicate(ctx context.Context, options ListBuiltInOperationOptions, predicate PolicyDefinitionOperationPredicate) (resp ListBuiltInCompleteResult, err error)

ListBuiltInCompleteMatchingPredicate retrieves all of the results and then applied the predicate

func (PolicyDefinitionsClient) ListByManagementGroup

ListByManagementGroup ...

func (PolicyDefinitionsClient) ListByManagementGroupComplete

ListByManagementGroupComplete retrieves all of the results into a single object

func (PolicyDefinitionsClient) ListByManagementGroupCompleteMatchingPredicate

ListByManagementGroupCompleteMatchingPredicate retrieves all of the results and then applied the predicate

func (PolicyDefinitionsClient) ListComplete

ListComplete retrieves all of the results into a single object

func (PolicyDefinitionsClient) ListCompleteMatchingPredicate

ListCompleteMatchingPredicate retrieves all of the results and then applied the predicate

type PolicyType

type PolicyType string
const (
	PolicyTypeBuiltIn      PolicyType = "BuiltIn"
	PolicyTypeCustom       PolicyType = "Custom"
	PolicyTypeNotSpecified PolicyType = "NotSpecified"
	PolicyTypeStatic       PolicyType = "Static"
)

type ProviderPolicyDefinitionId

type ProviderPolicyDefinitionId struct {
	SubscriptionId       string
	PolicyDefinitionName string
}

ProviderPolicyDefinitionId is a struct representing the Resource ID for a Provider Policy Definition

func NewProviderPolicyDefinitionID

func NewProviderPolicyDefinitionID(subscriptionId string, policyDefinitionName string) ProviderPolicyDefinitionId

NewProviderPolicyDefinitionID returns a new ProviderPolicyDefinitionId struct

func ParseProviderPolicyDefinitionID

func ParseProviderPolicyDefinitionID(input string) (*ProviderPolicyDefinitionId, error)

ParseProviderPolicyDefinitionID parses 'input' into a ProviderPolicyDefinitionId

func ParseProviderPolicyDefinitionIDInsensitively

func ParseProviderPolicyDefinitionIDInsensitively(input string) (*ProviderPolicyDefinitionId, error)

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

func (ProviderPolicyDefinitionId) ID

ID returns the formatted Provider Policy Definition ID

func (ProviderPolicyDefinitionId) Segments

Segments returns a slice of Resource ID Segments which comprise this Provider Policy Definition ID

func (ProviderPolicyDefinitionId) String

func (id ProviderPolicyDefinitionId) String() string

String returns a human-readable description of this Provider Policy Definition ID

type Providers2PolicyDefinitionId

type Providers2PolicyDefinitionId struct {
	ManagementGroupId    string
	PolicyDefinitionName string
}

Providers2PolicyDefinitionId is a struct representing the Resource ID for a Providers 2 Policy Definition

func NewProviders2PolicyDefinitionID

func NewProviders2PolicyDefinitionID(managementGroupId string, policyDefinitionName string) Providers2PolicyDefinitionId

NewProviders2PolicyDefinitionID returns a new Providers2PolicyDefinitionId struct

func ParseProviders2PolicyDefinitionID

func ParseProviders2PolicyDefinitionID(input string) (*Providers2PolicyDefinitionId, error)

ParseProviders2PolicyDefinitionID parses 'input' into a Providers2PolicyDefinitionId

func ParseProviders2PolicyDefinitionIDInsensitively

func ParseProviders2PolicyDefinitionIDInsensitively(input string) (*Providers2PolicyDefinitionId, error)

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

func (Providers2PolicyDefinitionId) ID

ID returns the formatted Providers 2 Policy Definition ID

func (Providers2PolicyDefinitionId) Segments

Segments returns a slice of Resource ID Segments which comprise this Providers 2 Policy Definition ID

func (Providers2PolicyDefinitionId) String

String returns a human-readable description of this Providers 2 Policy Definition ID

Jump to

Keyboard shortcuts

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