scheduledactions

package
v0.20230807.1063129 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2023 License: MPL-2.0 Imports: 14 Imported by: 1

README

github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2022-06-01-preview/scheduledactions Documentation

The scheduledactions SDK allows for interaction with the Azure Resource Manager Service costmanagement (API Version 2022-06-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/costmanagement/2022-06-01-preview/scheduledactions"

Client Initialization

client := scheduledactions.NewScheduledActionsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: ScheduledActionsClient.CheckNameAvailability

ctx := context.TODO()

payload := scheduledactions.CheckNameAvailabilityRequest{
	// ...
}


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

Example Usage: ScheduledActionsClient.CheckNameAvailabilityByScope

ctx := context.TODO()
id := scheduledactions.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group")

payload := scheduledactions.CheckNameAvailabilityRequest{
	// ...
}


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

Example Usage: ScheduledActionsClient.CreateOrUpdate

ctx := context.TODO()
id := scheduledactions.NewScheduledActionID("scheduledActionValue")

payload := scheduledactions.ScheduledAction{
	// ...
}


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: ScheduledActionsClient.CreateOrUpdateByScope

ctx := context.TODO()
id := scheduledactions.NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "scheduledActionValue")

payload := scheduledactions.ScheduledAction{
	// ...
}


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

Example Usage: ScheduledActionsClient.Delete

ctx := context.TODO()
id := scheduledactions.NewScheduledActionID("scheduledActionValue")

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: ScheduledActionsClient.DeleteByScope

ctx := context.TODO()
id := scheduledactions.NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "scheduledActionValue")

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

Example Usage: ScheduledActionsClient.Execute

ctx := context.TODO()
id := scheduledactions.NewScheduledActionID("scheduledActionValue")

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

Example Usage: ScheduledActionsClient.ExecuteByScope

ctx := context.TODO()
id := scheduledactions.NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "scheduledActionValue")

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

Example Usage: ScheduledActionsClient.Get

ctx := context.TODO()
id := scheduledactions.NewScheduledActionID("scheduledActionValue")

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: ScheduledActionsClient.GetByScope

ctx := context.TODO()
id := scheduledactions.NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "scheduledActionValue")

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

Example Usage: ScheduledActionsClient.List

ctx := context.TODO()


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

Example Usage: ScheduledActionsClient.ListByScope

ctx := context.TODO()
id := scheduledactions.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group")

// alternatively `client.ListByScope(ctx, id, scheduledactions.DefaultListByScopeOperationOptions())` can be used to do batched pagination
items, err := client.ListByScopeComplete(ctx, id, scheduledactions.DefaultListByScopeOperationOptions())
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 PossibleValuesForCheckNameAvailabilityReason

func PossibleValuesForCheckNameAvailabilityReason() []string

func PossibleValuesForDaysOfWeek

func PossibleValuesForDaysOfWeek() []string

func PossibleValuesForFileFormat

func PossibleValuesForFileFormat() []string

func PossibleValuesForScheduleFrequency

func PossibleValuesForScheduleFrequency() []string

func PossibleValuesForScheduledActionKind

func PossibleValuesForScheduledActionKind() []string

func PossibleValuesForScheduledActionStatus

func PossibleValuesForScheduledActionStatus() []string

func PossibleValuesForWeeksOfMonth

func PossibleValuesForWeeksOfMonth() []string

func ValidateScheduledActionID

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

ValidateScheduledActionID checks that 'input' can be parsed as a Scheduled Action ID

func ValidateScopedScheduledActionID

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

ValidateScopedScheduledActionID checks that 'input' can be parsed as a Scoped Scheduled Action ID

Types

type CheckNameAvailabilityByScopeOperationResponse

type CheckNameAvailabilityByScopeOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *CheckNameAvailabilityResponse
}

type CheckNameAvailabilityOperationResponse

type CheckNameAvailabilityOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *CheckNameAvailabilityResponse
}

type CheckNameAvailabilityReason

type CheckNameAvailabilityReason string
const (
	CheckNameAvailabilityReasonAlreadyExists CheckNameAvailabilityReason = "AlreadyExists"
	CheckNameAvailabilityReasonInvalid       CheckNameAvailabilityReason = "Invalid"
)

func (*CheckNameAvailabilityReason) UnmarshalJSON added in v0.20230411.1183115

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

type CheckNameAvailabilityRequest

type CheckNameAvailabilityRequest struct {
	Name *string `json:"name,omitempty"`
	Type *string `json:"type,omitempty"`
}

type CheckNameAvailabilityResponse

type CheckNameAvailabilityResponse struct {
	Message       *string                      `json:"message,omitempty"`
	NameAvailable *bool                        `json:"nameAvailable,omitempty"`
	Reason        *CheckNameAvailabilityReason `json:"reason,omitempty"`
}

type CreateOrUpdateByScopeOperationResponse

type CreateOrUpdateByScopeOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *ScheduledAction
}

type CreateOrUpdateOperationResponse

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

type DaysOfWeek

type DaysOfWeek string
const (
	DaysOfWeekFriday    DaysOfWeek = "Friday"
	DaysOfWeekMonday    DaysOfWeek = "Monday"
	DaysOfWeekSaturday  DaysOfWeek = "Saturday"
	DaysOfWeekSunday    DaysOfWeek = "Sunday"
	DaysOfWeekThursday  DaysOfWeek = "Thursday"
	DaysOfWeekTuesday   DaysOfWeek = "Tuesday"
	DaysOfWeekWednesday DaysOfWeek = "Wednesday"
)

func (*DaysOfWeek) UnmarshalJSON added in v0.20230411.1183115

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

type DeleteByScopeOperationResponse

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

type DeleteOperationResponse

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

type ExecuteByScopeOperationResponse

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

type ExecuteOperationResponse

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

type FileDestination

type FileDestination struct {
	FileFormats *[]FileFormat `json:"fileFormats,omitempty"`
}

type FileFormat

type FileFormat string
const (
	FileFormatCsv FileFormat = "Csv"
)

func (*FileFormat) UnmarshalJSON added in v0.20230411.1183115

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

type GetByScopeOperationResponse

type GetByScopeOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *ScheduledAction
}

type GetOperationResponse

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

type ListByScopeCompleteResult

type ListByScopeCompleteResult struct {
	Items []ScheduledAction
}

type ListByScopeOperationOptions

type ListByScopeOperationOptions struct {
	Filter *string
}

func DefaultListByScopeOperationOptions

func DefaultListByScopeOperationOptions() ListByScopeOperationOptions

func (ListByScopeOperationOptions) ToHeaders added in v0.20230411.1183115

func (ListByScopeOperationOptions) ToOData added in v0.20230411.1183115

func (ListByScopeOperationOptions) ToQuery added in v0.20230411.1183115

type ListByScopeOperationResponse

type ListByScopeOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]ScheduledAction
}

type ListCompleteResult

type ListCompleteResult struct {
	Items []ScheduledAction
}

type ListOperationOptions

type ListOperationOptions struct {
	Filter *string
}

func DefaultListOperationOptions

func DefaultListOperationOptions() ListOperationOptions

func (ListOperationOptions) ToHeaders added in v0.20230411.1183115

func (o ListOperationOptions) ToHeaders() *client.Headers

func (ListOperationOptions) ToOData added in v0.20230411.1183115

func (o ListOperationOptions) ToOData() *odata.Query

func (ListOperationOptions) ToQuery added in v0.20230411.1183115

type ListOperationResponse

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

type NotificationProperties

type NotificationProperties struct {
	Message *string  `json:"message,omitempty"`
	Subject string   `json:"subject"`
	To      []string `json:"to"`
}

type ScheduleFrequency

type ScheduleFrequency string
const (
	ScheduleFrequencyDaily   ScheduleFrequency = "Daily"
	ScheduleFrequencyMonthly ScheduleFrequency = "Monthly"
	ScheduleFrequencyWeekly  ScheduleFrequency = "Weekly"
)

func (*ScheduleFrequency) UnmarshalJSON added in v0.20230411.1183115

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

type ScheduleProperties

type ScheduleProperties struct {
	DayOfMonth   *int64            `json:"dayOfMonth,omitempty"`
	DaysOfWeek   *[]DaysOfWeek     `json:"daysOfWeek,omitempty"`
	EndDate      string            `json:"endDate"`
	Frequency    ScheduleFrequency `json:"frequency"`
	HourOfDay    *int64            `json:"hourOfDay,omitempty"`
	StartDate    string            `json:"startDate"`
	WeeksOfMonth *[]WeeksOfMonth   `json:"weeksOfMonth,omitempty"`
}

func (*ScheduleProperties) GetEndDateAsTime

func (o *ScheduleProperties) GetEndDateAsTime() (*time.Time, error)

func (*ScheduleProperties) GetStartDateAsTime

func (o *ScheduleProperties) GetStartDateAsTime() (*time.Time, error)

func (*ScheduleProperties) SetEndDateAsTime

func (o *ScheduleProperties) SetEndDateAsTime(input time.Time)

func (*ScheduleProperties) SetStartDateAsTime

func (o *ScheduleProperties) SetStartDateAsTime(input time.Time)

type ScheduledAction

type ScheduledAction struct {
	ETag       *string                    `json:"eTag,omitempty"`
	Id         *string                    `json:"id,omitempty"`
	Kind       *ScheduledActionKind       `json:"kind,omitempty"`
	Name       *string                    `json:"name,omitempty"`
	Properties *ScheduledActionProperties `json:"properties,omitempty"`
	SystemData *systemdata.SystemData     `json:"systemData,omitempty"`
	Type       *string                    `json:"type,omitempty"`
}

type ScheduledActionId

type ScheduledActionId struct {
	ScheduledActionName string
}

ScheduledActionId is a struct representing the Resource ID for a Scheduled Action

func NewScheduledActionID

func NewScheduledActionID(scheduledActionName string) ScheduledActionId

NewScheduledActionID returns a new ScheduledActionId struct

func ParseScheduledActionID

func ParseScheduledActionID(input string) (*ScheduledActionId, error)

ParseScheduledActionID parses 'input' into a ScheduledActionId

func ParseScheduledActionIDInsensitively

func ParseScheduledActionIDInsensitively(input string) (*ScheduledActionId, error)

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

func (ScheduledActionId) ID

func (id ScheduledActionId) ID() string

ID returns the formatted Scheduled Action ID

func (ScheduledActionId) Segments

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

Segments returns a slice of Resource ID Segments which comprise this Scheduled Action ID

func (ScheduledActionId) String

func (id ScheduledActionId) String() string

String returns a human-readable description of this Scheduled Action ID

type ScheduledActionKind

type ScheduledActionKind string
const (
	ScheduledActionKindEmail        ScheduledActionKind = "Email"
	ScheduledActionKindInsightAlert ScheduledActionKind = "InsightAlert"
)

func (*ScheduledActionKind) UnmarshalJSON added in v0.20230411.1183115

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

type ScheduledActionOperationPredicate

type ScheduledActionOperationPredicate struct {
	ETag *string
	Id   *string
	Name *string
	Type *string
}

func (ScheduledActionOperationPredicate) Matches

type ScheduledActionProperties

type ScheduledActionProperties struct {
	DisplayName     string                 `json:"displayName"`
	FileDestination *FileDestination       `json:"fileDestination,omitempty"`
	Notification    NotificationProperties `json:"notification"`
	Schedule        ScheduleProperties     `json:"schedule"`
	Scope           *string                `json:"scope,omitempty"`
	Status          ScheduledActionStatus  `json:"status"`
	ViewId          string                 `json:"viewId"`
}

type ScheduledActionStatus

type ScheduledActionStatus string
const (
	ScheduledActionStatusDisabled ScheduledActionStatus = "Disabled"
	ScheduledActionStatusEnabled  ScheduledActionStatus = "Enabled"
)

func (*ScheduledActionStatus) UnmarshalJSON added in v0.20230411.1183115

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

type ScheduledActionsClient

type ScheduledActionsClient struct {
	Client *resourcemanager.Client
}

func NewScheduledActionsClientWithBaseURI

func NewScheduledActionsClientWithBaseURI(sdkApi sdkEnv.Api) (*ScheduledActionsClient, error)

func (ScheduledActionsClient) CheckNameAvailability

CheckNameAvailability ...

func (ScheduledActionsClient) CheckNameAvailabilityByScope

CheckNameAvailabilityByScope ...

func (ScheduledActionsClient) CreateOrUpdate

CreateOrUpdate ...

func (ScheduledActionsClient) CreateOrUpdateByScope

CreateOrUpdateByScope ...

func (ScheduledActionsClient) Delete

Delete ...

func (ScheduledActionsClient) DeleteByScope

DeleteByScope ...

func (ScheduledActionsClient) Execute

Execute ...

func (ScheduledActionsClient) ExecuteByScope

ExecuteByScope ...

func (ScheduledActionsClient) Get

Get ...

func (ScheduledActionsClient) GetByScope

GetByScope ...

func (ScheduledActionsClient) List

List ...

func (ScheduledActionsClient) ListByScope

ListByScope ...

func (ScheduledActionsClient) ListByScopeComplete

ListByScopeComplete retrieves all the results into a single object

func (ScheduledActionsClient) ListByScopeCompleteMatchingPredicate

func (c ScheduledActionsClient) ListByScopeCompleteMatchingPredicate(ctx context.Context, id commonids.ScopeId, options ListByScopeOperationOptions, predicate ScheduledActionOperationPredicate) (result ListByScopeCompleteResult, err error)

ListByScopeCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (ScheduledActionsClient) ListComplete

ListComplete retrieves all the results into a single object

func (ScheduledActionsClient) ListCompleteMatchingPredicate

func (c ScheduledActionsClient) ListCompleteMatchingPredicate(ctx context.Context, options ListOperationOptions, predicate ScheduledActionOperationPredicate) (result ListCompleteResult, err error)

ListCompleteMatchingPredicate retrieves all the results and then applies the predicate

type ScopedScheduledActionId

type ScopedScheduledActionId struct {
	Scope               string
	ScheduledActionName string
}

ScopedScheduledActionId is a struct representing the Resource ID for a Scoped Scheduled Action

func NewScopedScheduledActionID

func NewScopedScheduledActionID(scope string, scheduledActionName string) ScopedScheduledActionId

NewScopedScheduledActionID returns a new ScopedScheduledActionId struct

func ParseScopedScheduledActionID

func ParseScopedScheduledActionID(input string) (*ScopedScheduledActionId, error)

ParseScopedScheduledActionID parses 'input' into a ScopedScheduledActionId

func ParseScopedScheduledActionIDInsensitively

func ParseScopedScheduledActionIDInsensitively(input string) (*ScopedScheduledActionId, error)

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

func (ScopedScheduledActionId) ID

ID returns the formatted Scoped Scheduled Action ID

func (ScopedScheduledActionId) Segments

Segments returns a slice of Resource ID Segments which comprise this Scoped Scheduled Action ID

func (ScopedScheduledActionId) String

func (id ScopedScheduledActionId) String() string

String returns a human-readable description of this Scoped Scheduled Action ID

type WeeksOfMonth

type WeeksOfMonth string
const (
	WeeksOfMonthFirst  WeeksOfMonth = "First"
	WeeksOfMonthFourth WeeksOfMonth = "Fourth"
	WeeksOfMonthLast   WeeksOfMonth = "Last"
	WeeksOfMonthSecond WeeksOfMonth = "Second"
	WeeksOfMonthThird  WeeksOfMonth = "Third"
)

func (*WeeksOfMonth) UnmarshalJSON added in v0.20230411.1183115

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

Jump to

Keyboard shortcuts

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