raipolicies

package
v0.20240903.1131440 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2024 License: MPL-2.0 Imports: 13 Imported by: 0

README

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

The raipolicies SDK allows for interaction with the Azure Resource Manager Service cognitive (API Version 2023-10-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/cognitive/2023-10-01-preview/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", "accountValue", "raiPolicyValue")

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", "accountValue", "raiPolicyValue")

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", "accountValue", "raiPolicyValue")

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

// 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 PossibleValuesForAllowedContentLevel

func PossibleValuesForAllowedContentLevel() []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 AllowedContentLevel

type AllowedContentLevel string
const (
	AllowedContentLevelHigh   AllowedContentLevel = "High"
	AllowedContentLevelLow    AllowedContentLevel = "Low"
	AllowedContentLevelMedium AllowedContentLevel = "Medium"
)

func (*AllowedContentLevel) UnmarshalJSON

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

type CreateOrUpdateOperationResponse

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

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 added in v0.20240628.1153531

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 RaiBlocklistConfig

type RaiBlocklistConfig struct {
	Blocking      *bool   `json:"blocking,omitempty"`
	BlocklistName *string `json:"blocklistName,omitempty"`
}

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 {
	AllowedContentLevel *AllowedContentLevel    `json:"allowedContentLevel,omitempty"`
	Blocking            *bool                   `json:"blocking,omitempty"`
	Enabled             *bool                   `json:"enabled,omitempty"`
	Name                *string                 `json:"name,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 (
	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"`
	CompletionBlocklists *[]RaiBlocklistConfig     `json:"completionBlocklists,omitempty"`
	ContentFilters       *[]RaiPolicyContentFilter `json:"contentFilters,omitempty"`
	Mode                 *RaiPolicyMode            `json:"mode,omitempty"`
	PolicyType           *RaiPolicyType            `json:"policyType,omitempty"`
	PromptBlocklists     *[]RaiBlocklistConfig     `json:"promptBlocklists,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