scheduledactions

package
v0.20240920.1135249 Latest Latest
Warning

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

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

README

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

The scheduledactions SDK allows for interaction with Azure Resource Manager costmanagement (API Version 2023-07-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-helpers/resourcemanager/commonids"
import "github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2023-07-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 := commonids.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("name")

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


read, err := client.CreateOrUpdate(ctx, id, payload, scheduledactions.DefaultCreateOrUpdateOperationOptions())
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", "name")

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


read, err := client.CreateOrUpdateByScope(ctx, id, payload, scheduledactions.DefaultCreateOrUpdateByScopeOperationOptions())
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("name")

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

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.Get

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

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

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 := commonids.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
}

Example Usage: ScheduledActionsClient.Run

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

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

Example Usage: ScheduledActionsClient.RunByScope

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

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

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

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 CreateOrUpdateByScopeOperationOptions

type CreateOrUpdateByScopeOperationOptions struct {
	IfMatch *string
}

func DefaultCreateOrUpdateByScopeOperationOptions

func DefaultCreateOrUpdateByScopeOperationOptions() CreateOrUpdateByScopeOperationOptions

func (CreateOrUpdateByScopeOperationOptions) ToHeaders

func (CreateOrUpdateByScopeOperationOptions) ToOData

func (CreateOrUpdateByScopeOperationOptions) ToQuery

type CreateOrUpdateByScopeOperationResponse

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

type CreateOrUpdateOperationOptions

type CreateOrUpdateOperationOptions struct {
	IfMatch *string
}

func DefaultCreateOrUpdateOperationOptions

func DefaultCreateOrUpdateOperationOptions() CreateOrUpdateOperationOptions

func (CreateOrUpdateOperationOptions) ToHeaders

func (CreateOrUpdateOperationOptions) ToOData

func (CreateOrUpdateOperationOptions) ToQuery

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

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 FileDestination

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

type FileFormat

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

func (*FileFormat) UnmarshalJSON

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 {
	LatestHttpResponse *http.Response
	Items              []ScheduledAction
}

type ListByScopeCustomPager added in v0.20240628.1153531

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

type ListByScopeOperationOptions

type ListByScopeOperationOptions struct {
	Filter *string
}

func DefaultListByScopeOperationOptions

func DefaultListByScopeOperationOptions() ListByScopeOperationOptions

func (ListByScopeOperationOptions) ToHeaders

func (ListByScopeOperationOptions) ToOData

func (ListByScopeOperationOptions) ToQuery

type ListByScopeOperationResponse

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

type ListCompleteResult

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

type ListCustomPager added in v0.20240628.1153531

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

type ListOperationOptions

type ListOperationOptions struct {
	Filter *string
}

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

type NotificationProperties

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

type RunByScopeOperationResponse

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

type RunOperationResponse

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

type ScheduleFrequency

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

func (*ScheduleFrequency) UnmarshalJSON

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) FromParseResult

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

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

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"`
	NotificationEmail *string                `json:"notificationEmail,omitempty"`
	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"
	ScheduledActionStatusExpired  ScheduledActionStatus = "Expired"
)

func (*ScheduledActionStatus) UnmarshalJSON

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) 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

func (ScheduledActionsClient) Run

Run ...

func (ScheduledActionsClient) RunByScope

RunByScope ...

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) FromParseResult

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

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

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