policydefinitions

package
v0.20231023.1152718 Latest Latest
Warning

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

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

README

github.com/hashicorp/go-azure-sdk/resource-manager/resources/2023-04-01/policydefinitions Documentation

The policydefinitions SDK allows for interaction with the Azure Resource Manager Service resources (API Version 2023-04-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/2023-04-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("managementGroupValue", "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("managementGroupValue", "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("managementGroupValue", "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
	OData        *odata.OData
	Model        *PolicyDefinition
}

type CreateOrUpdateOperationResponse

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

type DeleteAtManagementGroupOperationResponse

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

type DeleteOperationResponse

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

type GetAtManagementGroupOperationResponse

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

type GetBuiltInOperationResponse

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

type GetOperationResponse

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

type ListBuiltInCompleteResult

type ListBuiltInCompleteResult struct {
	Items []PolicyDefinition
}

type ListBuiltInOperationOptions

type ListBuiltInOperationOptions struct {
	Filter *string
	Top    *int64
}

func DefaultListBuiltInOperationOptions

func DefaultListBuiltInOperationOptions() ListBuiltInOperationOptions

func (ListBuiltInOperationOptions) ToHeaders

func (ListBuiltInOperationOptions) ToOData

func (ListBuiltInOperationOptions) ToQuery

type ListBuiltInOperationResponse

type ListBuiltInOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]PolicyDefinition
}

type ListByManagementGroupCompleteResult

type ListByManagementGroupCompleteResult struct {
	Items []PolicyDefinition
}

type ListByManagementGroupOperationOptions

type ListByManagementGroupOperationOptions struct {
	Filter *string
	Top    *int64
}

func DefaultListByManagementGroupOperationOptions

func DefaultListByManagementGroupOperationOptions() ListByManagementGroupOperationOptions

func (ListByManagementGroupOperationOptions) ToHeaders

func (ListByManagementGroupOperationOptions) ToOData

func (ListByManagementGroupOperationOptions) ToQuery

type ListByManagementGroupOperationResponse

type ListByManagementGroupOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]PolicyDefinition
}

type ListCompleteResult

type ListCompleteResult struct {
	Items []PolicyDefinition
}

type ListOperationOptions

type ListOperationOptions struct {
	Filter *string
	Top    *int64
}

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

type ParameterDefinitionsValue

type ParameterDefinitionsValue struct {
	AllowedValues *[]interface{}                     `json:"allowedValues,omitempty"`
	DefaultValue  *interface{}                       `json:"defaultValue,omitempty"`
	Metadata      *ParameterDefinitionsValueMetadata `json:"metadata,omitempty"`
	Schema        *interface{}                       `json:"schema,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"
)

func (*ParameterType) UnmarshalJSON

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

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"`
	Version     *string                               `json:"version,omitempty"`
	Versions    *[]string                             `json:"versions,omitempty"`
}

type PolicyDefinitionsClient

type PolicyDefinitionsClient struct {
	Client *resourcemanager.Client
}

func NewPolicyDefinitionsClientWithBaseURI

func NewPolicyDefinitionsClientWithBaseURI(sdkApi sdkEnv.Api) (*PolicyDefinitionsClient, error)

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

func (PolicyDefinitionsClient) ListBuiltInCompleteMatchingPredicate

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

ListBuiltInCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (PolicyDefinitionsClient) ListByManagementGroup

ListByManagementGroup ...

func (PolicyDefinitionsClient) ListByManagementGroupComplete

ListByManagementGroupComplete retrieves all the results into a single object

func (PolicyDefinitionsClient) ListByManagementGroupCompleteMatchingPredicate

ListByManagementGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (PolicyDefinitionsClient) ListComplete

ListComplete retrieves all the results into a single object

func (PolicyDefinitionsClient) ListCompleteMatchingPredicate

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

ListCompleteMatchingPredicate retrieves all the results and then applies the predicate

type PolicyType

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

func (*PolicyType) UnmarshalJSON

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

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 {
	ManagementGroupName  string
	PolicyDefinitionName string
}

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

func NewProviders2PolicyDefinitionID

func NewProviders2PolicyDefinitionID(managementGroupName 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