commitmentplans

package
v0.20230615.1121338 Latest Latest
Warning

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

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

README

github.com/hashicorp/go-azure-sdk/resource-manager/cognitive/2022-10-01/commitmentplans Documentation

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

Client Initialization

client := commitmentplans.NewCommitmentPlansClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: CommitmentPlansClient.CreateOrUpdate

ctx := context.TODO()
id := commitmentplans.NewCommitmentPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "commitmentPlanValue")

payload := commitmentplans.CommitmentPlan{
	// ...
}


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

ctx := context.TODO()
id := commitmentplans.NewCommitmentPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "commitmentPlanValue")

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

Example Usage: CommitmentPlansClient.Get

ctx := context.TODO()
id := commitmentplans.NewCommitmentPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "commitmentPlanValue")

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

ctx := context.TODO()
id := commitmentplans.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 PossibleValuesForHostingModel

func PossibleValuesForHostingModel() []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 ValidateCommitmentPlanID

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

ValidateCommitmentPlanID checks that 'input' can be parsed as a Commitment Plan 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) 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 CommitmentPeriod

type CommitmentPeriod struct {
	Count     *int64           `json:"count,omitempty"`
	EndDate   *string          `json:"endDate,omitempty"`
	Quota     *CommitmentQuota `json:"quota,omitempty"`
	StartDate *string          `json:"startDate,omitempty"`
	Tier      *string          `json:"tier,omitempty"`
}

type CommitmentPlan

type CommitmentPlan struct {
	Etag       *string                   `json:"etag,omitempty"`
	Id         *string                   `json:"id,omitempty"`
	Name       *string                   `json:"name,omitempty"`
	Properties *CommitmentPlanProperties `json:"properties,omitempty"`
	SystemData *systemdata.SystemData    `json:"systemData,omitempty"`
	Type       *string                   `json:"type,omitempty"`
}

type CommitmentPlanId

type CommitmentPlanId struct {
	SubscriptionId     string
	ResourceGroupName  string
	AccountName        string
	CommitmentPlanName string
}

CommitmentPlanId is a struct representing the Resource ID for a Commitment Plan

func NewCommitmentPlanID

func NewCommitmentPlanID(subscriptionId string, resourceGroupName string, accountName string, commitmentPlanName string) CommitmentPlanId

NewCommitmentPlanID returns a new CommitmentPlanId struct

func ParseCommitmentPlanID

func ParseCommitmentPlanID(input string) (*CommitmentPlanId, error)

ParseCommitmentPlanID parses 'input' into a CommitmentPlanId

func ParseCommitmentPlanIDInsensitively

func ParseCommitmentPlanIDInsensitively(input string) (*CommitmentPlanId, error)

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

func (CommitmentPlanId) ID

func (id CommitmentPlanId) ID() string

ID returns the formatted Commitment Plan ID

func (CommitmentPlanId) Segments

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

Segments returns a slice of Resource ID Segments which comprise this Commitment Plan ID

func (CommitmentPlanId) String

func (id CommitmentPlanId) String() string

String returns a human-readable description of this Commitment Plan ID

type CommitmentPlanOperationPredicate

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

func (CommitmentPlanOperationPredicate) Matches

type CommitmentPlanProperties

type CommitmentPlanProperties struct {
	AutoRenew    *bool             `json:"autoRenew,omitempty"`
	Current      *CommitmentPeriod `json:"current,omitempty"`
	HostingModel *HostingModel     `json:"hostingModel,omitempty"`
	Last         *CommitmentPeriod `json:"last,omitempty"`
	Next         *CommitmentPeriod `json:"next,omitempty"`
	PlanType     *string           `json:"planType,omitempty"`
}

type CommitmentPlansClient

type CommitmentPlansClient struct {
	Client *resourcemanager.Client
}

func NewCommitmentPlansClientWithBaseURI

func NewCommitmentPlansClientWithBaseURI(api environments.Api) (*CommitmentPlansClient, error)

func (CommitmentPlansClient) CreateOrUpdate

CreateOrUpdate ...

func (CommitmentPlansClient) Delete

Delete ...

func (CommitmentPlansClient) DeleteThenPoll

func (c CommitmentPlansClient) DeleteThenPoll(ctx context.Context, id CommitmentPlanId) error

DeleteThenPoll performs Delete then polls until it's completed

func (CommitmentPlansClient) Get

Get ...

func (CommitmentPlansClient) List

List ...

func (CommitmentPlansClient) ListComplete

ListComplete retrieves all the results into a single object

func (CommitmentPlansClient) ListCompleteMatchingPredicate

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

ListCompleteMatchingPredicate retrieves all the results and then applies the predicate

type CommitmentQuota

type CommitmentQuota struct {
	Quantity *int64  `json:"quantity,omitempty"`
	Unit     *string `json:"unit,omitempty"`
}

type CreateOrUpdateOperationResponse

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

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        *CommitmentPlan
}

type HostingModel

type HostingModel string
const (
	HostingModelConnectedContainer    HostingModel = "ConnectedContainer"
	HostingModelDisconnectedContainer HostingModel = "DisconnectedContainer"
	HostingModelWeb                   HostingModel = "Web"
)

func (*HostingModel) UnmarshalJSON added in v0.20230503.1093249

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

type ListCompleteResult

type ListCompleteResult struct {
	Items []CommitmentPlan
}

type ListOperationResponse

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

Jump to

Keyboard shortcuts

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