raipolicies

package
v0.20241017.1093842 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2024 License: MPL-2.0 Imports: 13 Imported by: 1

README

github.com/hashicorp/go-azure-sdk/resource-manager/cognitive/2024-10-01/raipolicies Documentation

The raipolicies SDK allows for interaction with Azure Resource Manager cognitive (API Version 2024-10-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/cognitive/2024-10-01/raipolicies"

Client Initialization

client := raipolicies.NewRaiPoliciesClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: RaiPoliciesClient.CreateOrUpdate

ctx := context.TODO()
id := raipolicies.NewRaiPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "raiPolicyName")

payload := raipolicies.RaiPolicy{
	// ...
}


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

ctx := context.TODO()
id := raipolicies.NewRaiPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "raiPolicyName")

if err := client.DeleteThenPoll(ctx, id); err != nil {
	// handle the error
}

Example Usage: RaiPoliciesClient.Get

ctx := context.TODO()
id := raipolicies.NewRaiPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "raiPolicyName")

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

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

// alternatively `client.List(ctx, id)` can be used to do batched pagination
items, err := client.ListComplete(ctx, id)
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 PossibleValuesForContentLevel

func PossibleValuesForContentLevel() []string

func PossibleValuesForRaiPolicyContentSource

func PossibleValuesForRaiPolicyContentSource() []string

func PossibleValuesForRaiPolicyMode

func PossibleValuesForRaiPolicyMode() []string

func PossibleValuesForRaiPolicyType

func PossibleValuesForRaiPolicyType() []string

func ValidateAccountID

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

ValidateAccountID checks that 'input' can be parsed as a Account ID

func ValidateRaiPolicyID

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

ValidateRaiPolicyID checks that 'input' can be parsed as a Rai Policy ID

Types

type AccountId

type AccountId struct {
	SubscriptionId    string
	ResourceGroupName string
	AccountName       string
}

AccountId is a struct representing the Resource ID for a Account

func NewAccountID

func NewAccountID(subscriptionId string, resourceGroupName string, accountName string) AccountId

NewAccountID returns a new AccountId struct

func ParseAccountID

func ParseAccountID(input string) (*AccountId, error)

ParseAccountID parses 'input' into a AccountId

func ParseAccountIDInsensitively

func ParseAccountIDInsensitively(input string) (*AccountId, error)

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

func (*AccountId) FromParseResult

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

func (AccountId) ID

func (id AccountId) ID() string

ID returns the formatted Account ID

func (AccountId) Segments

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

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

func (AccountId) String

func (id AccountId) String() string

String returns a human-readable description of this Account ID

type ContentLevel

type ContentLevel string
const (
	ContentLevelHigh   ContentLevel = "High"
	ContentLevelLow    ContentLevel = "Low"
	ContentLevelMedium ContentLevel = "Medium"
)

func (*ContentLevel) UnmarshalJSON

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

type CreateOrUpdateOperationResponse

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

type CustomBlocklistConfig

type CustomBlocklistConfig struct {
	Blocking      *bool                   `json:"blocking,omitempty"`
	BlocklistName *string                 `json:"blocklistName,omitempty"`
	Source        *RaiPolicyContentSource `json:"source,omitempty"`
}

type DeleteOperationResponse

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

type GetOperationResponse

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

type ListCompleteResult

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

type ListCustomPager

type ListCustomPager struct {
	NextLink *odata.Link `json:"nextLink"`
}
func (p *ListCustomPager) NextPageLink() *odata.Link

type ListOperationResponse

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

type RaiPoliciesClient

type RaiPoliciesClient struct {
	Client *resourcemanager.Client
}

func NewRaiPoliciesClientWithBaseURI

func NewRaiPoliciesClientWithBaseURI(sdkApi sdkEnv.Api) (*RaiPoliciesClient, error)

func (RaiPoliciesClient) CreateOrUpdate

func (c RaiPoliciesClient) CreateOrUpdate(ctx context.Context, id RaiPolicyId, input RaiPolicy) (result CreateOrUpdateOperationResponse, err error)

CreateOrUpdate ...

func (RaiPoliciesClient) Delete

Delete ...

func (RaiPoliciesClient) DeleteThenPoll

func (c RaiPoliciesClient) DeleteThenPoll(ctx context.Context, id RaiPolicyId) error

DeleteThenPoll performs Delete then polls until it's completed

func (RaiPoliciesClient) Get

Get ...

func (RaiPoliciesClient) List

func (c RaiPoliciesClient) List(ctx context.Context, id AccountId) (result ListOperationResponse, err error)

List ...

func (RaiPoliciesClient) ListComplete

ListComplete retrieves all the results into a single object

func (RaiPoliciesClient) ListCompleteMatchingPredicate

func (c RaiPoliciesClient) ListCompleteMatchingPredicate(ctx context.Context, id AccountId, predicate RaiPolicyOperationPredicate) (result ListCompleteResult, err error)

ListCompleteMatchingPredicate retrieves all the results and then applies the predicate

type RaiPolicy

type RaiPolicy struct {
	Etag       *string                `json:"etag,omitempty"`
	Id         *string                `json:"id,omitempty"`
	Name       *string                `json:"name,omitempty"`
	Properties *RaiPolicyProperties   `json:"properties,omitempty"`
	SystemData *systemdata.SystemData `json:"systemData,omitempty"`
	Tags       *map[string]string     `json:"tags,omitempty"`
	Type       *string                `json:"type,omitempty"`
}

type RaiPolicyContentFilter

type RaiPolicyContentFilter struct {
	Blocking          *bool                   `json:"blocking,omitempty"`
	Enabled           *bool                   `json:"enabled,omitempty"`
	Name              *string                 `json:"name,omitempty"`
	SeverityThreshold *ContentLevel           `json:"severityThreshold,omitempty"`
	Source            *RaiPolicyContentSource `json:"source,omitempty"`
}

type RaiPolicyContentSource

type RaiPolicyContentSource string
const (
	RaiPolicyContentSourceCompletion RaiPolicyContentSource = "Completion"
	RaiPolicyContentSourcePrompt     RaiPolicyContentSource = "Prompt"
)

func (*RaiPolicyContentSource) UnmarshalJSON

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

type RaiPolicyId

type RaiPolicyId struct {
	SubscriptionId    string
	ResourceGroupName string
	AccountName       string
	RaiPolicyName     string
}

RaiPolicyId is a struct representing the Resource ID for a Rai Policy

func NewRaiPolicyID

func NewRaiPolicyID(subscriptionId string, resourceGroupName string, accountName string, raiPolicyName string) RaiPolicyId

NewRaiPolicyID returns a new RaiPolicyId struct

func ParseRaiPolicyID

func ParseRaiPolicyID(input string) (*RaiPolicyId, error)

ParseRaiPolicyID parses 'input' into a RaiPolicyId

func ParseRaiPolicyIDInsensitively

func ParseRaiPolicyIDInsensitively(input string) (*RaiPolicyId, error)

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

func (*RaiPolicyId) FromParseResult

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

func (RaiPolicyId) ID

func (id RaiPolicyId) ID() string

ID returns the formatted Rai Policy ID

func (RaiPolicyId) Segments

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

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

func (RaiPolicyId) String

func (id RaiPolicyId) String() string

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

type RaiPolicyMode

type RaiPolicyMode string
const (
	RaiPolicyModeAsynchronousFilter RaiPolicyMode = "Asynchronous_filter"
	RaiPolicyModeBlocking           RaiPolicyMode = "Blocking"
	RaiPolicyModeDefault            RaiPolicyMode = "Default"
	RaiPolicyModeDeferred           RaiPolicyMode = "Deferred"
)

func (*RaiPolicyMode) UnmarshalJSON

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

type RaiPolicyOperationPredicate

type RaiPolicyOperationPredicate struct {
	Etag *string
	Id   *string
	Name *string
	Type *string
}

func (RaiPolicyOperationPredicate) Matches

func (p RaiPolicyOperationPredicate) Matches(input RaiPolicy) bool

type RaiPolicyProperties

type RaiPolicyProperties struct {
	BasePolicyName   *string                   `json:"basePolicyName,omitempty"`
	ContentFilters   *[]RaiPolicyContentFilter `json:"contentFilters,omitempty"`
	CustomBlocklists *[]CustomBlocklistConfig  `json:"customBlocklists,omitempty"`
	Mode             *RaiPolicyMode            `json:"mode,omitempty"`
	Type             *RaiPolicyType            `json:"type,omitempty"`
}

type RaiPolicyType

type RaiPolicyType string
const (
	RaiPolicyTypeSystemManaged RaiPolicyType = "SystemManaged"
	RaiPolicyTypeUserManaged   RaiPolicyType = "UserManaged"
)

func (*RaiPolicyType) UnmarshalJSON

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

Jump to

Keyboard shortcuts

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