schedule

package
v0.20240419.1132837 Latest Latest
Warning

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

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

README

github.com/hashicorp/go-azure-sdk/resource-manager/labservices/2021-10-01-preview/schedule Documentation

The schedule SDK allows for interaction with the Azure Resource Manager Service labservices (API Version 2021-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/labservices/2021-10-01-preview/schedule"

Client Initialization

client := schedule.NewScheduleClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: ScheduleClient.CreateOrUpdate

ctx := context.TODO()
id := schedule.NewScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue", "scheduleValue")

payload := schedule.Schedule{
	// ...
}


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

ctx := context.TODO()
id := schedule.NewScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue", "scheduleValue")

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

Example Usage: ScheduleClient.Get

ctx := context.TODO()
id := schedule.NewScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue", "scheduleValue")

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: ScheduleClient.ListByLab

ctx := context.TODO()
id := schedule.NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue")

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

Example Usage: ScheduleClient.Update

ctx := context.TODO()
id := schedule.NewScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue", "scheduleValue")

payload := schedule.ScheduleUpdate{
	// ...
}


read, err := client.Update(ctx, id, payload)
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 PossibleValuesForProvisioningState

func PossibleValuesForProvisioningState() []string

func PossibleValuesForRecurrenceFrequency

func PossibleValuesForRecurrenceFrequency() []string

func PossibleValuesForWeekDay

func PossibleValuesForWeekDay() []string

func ValidateLabID

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

ValidateLabID checks that 'input' can be parsed as a Lab ID

func ValidateScheduleID

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

ValidateScheduleID checks that 'input' can be parsed as a Schedule ID

Types

type CreateOrUpdateOperationResponse

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

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

type LabId

type LabId struct {
	SubscriptionId    string
	ResourceGroupName string
	LabName           string
}

LabId is a struct representing the Resource ID for a Lab

func NewLabID

func NewLabID(subscriptionId string, resourceGroupName string, labName string) LabId

NewLabID returns a new LabId struct

func ParseLabID

func ParseLabID(input string) (*LabId, error)

ParseLabID parses 'input' into a LabId

func ParseLabIDInsensitively

func ParseLabIDInsensitively(input string) (*LabId, error)

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

func (*LabId) FromParseResult

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

func (LabId) ID

func (id LabId) ID() string

ID returns the formatted Lab ID

func (LabId) Segments

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

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

func (LabId) String

func (id LabId) String() string

String returns a human-readable description of this Lab ID

type ListByLabCompleteResult

type ListByLabCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []Schedule
}

type ListByLabOperationResponse

type ListByLabOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]Schedule
}

type ProvisioningState

type ProvisioningState string
const (
	ProvisioningStateCreating  ProvisioningState = "Creating"
	ProvisioningStateDeleting  ProvisioningState = "Deleting"
	ProvisioningStateFailed    ProvisioningState = "Failed"
	ProvisioningStateLocked    ProvisioningState = "Locked"
	ProvisioningStateSucceeded ProvisioningState = "Succeeded"
	ProvisioningStateUpdating  ProvisioningState = "Updating"
)

func (*ProvisioningState) UnmarshalJSON

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

type RecurrenceFrequency

type RecurrenceFrequency string
const (
	RecurrenceFrequencyDaily  RecurrenceFrequency = "Daily"
	RecurrenceFrequencyWeekly RecurrenceFrequency = "Weekly"
)

func (*RecurrenceFrequency) UnmarshalJSON

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

type RecurrencePattern

type RecurrencePattern struct {
	ExpirationDate string              `json:"expirationDate"`
	Frequency      RecurrenceFrequency `json:"frequency"`
	Interval       *int64              `json:"interval,omitempty"`
	WeekDays       *[]WeekDay          `json:"weekDays,omitempty"`
}

type Schedule

type Schedule struct {
	Id         *string                `json:"id,omitempty"`
	Name       *string                `json:"name,omitempty"`
	Properties ScheduleProperties     `json:"properties"`
	SystemData *systemdata.SystemData `json:"systemData,omitempty"`
	Type       *string                `json:"type,omitempty"`
}

type ScheduleClient

type ScheduleClient struct {
	Client *resourcemanager.Client
}

func NewScheduleClientWithBaseURI

func NewScheduleClientWithBaseURI(sdkApi sdkEnv.Api) (*ScheduleClient, error)

func (ScheduleClient) CreateOrUpdate

func (c ScheduleClient) CreateOrUpdate(ctx context.Context, id ScheduleId, input Schedule) (result CreateOrUpdateOperationResponse, err error)

CreateOrUpdate ...

func (ScheduleClient) Delete

func (c ScheduleClient) Delete(ctx context.Context, id ScheduleId) (result DeleteOperationResponse, err error)

Delete ...

func (ScheduleClient) DeleteThenPoll

func (c ScheduleClient) DeleteThenPoll(ctx context.Context, id ScheduleId) error

DeleteThenPoll performs Delete then polls until it's completed

func (ScheduleClient) Get

func (c ScheduleClient) Get(ctx context.Context, id ScheduleId) (result GetOperationResponse, err error)

Get ...

func (ScheduleClient) ListByLab

func (c ScheduleClient) ListByLab(ctx context.Context, id LabId) (result ListByLabOperationResponse, err error)

ListByLab ...

func (ScheduleClient) ListByLabComplete

func (c ScheduleClient) ListByLabComplete(ctx context.Context, id LabId) (ListByLabCompleteResult, error)

ListByLabComplete retrieves all the results into a single object

func (ScheduleClient) ListByLabCompleteMatchingPredicate

func (c ScheduleClient) ListByLabCompleteMatchingPredicate(ctx context.Context, id LabId, predicate ScheduleOperationPredicate) (result ListByLabCompleteResult, err error)

ListByLabCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (ScheduleClient) Update

func (c ScheduleClient) Update(ctx context.Context, id ScheduleId, input ScheduleUpdate) (result UpdateOperationResponse, err error)

Update ...

type ScheduleId

type ScheduleId struct {
	SubscriptionId    string
	ResourceGroupName string
	LabName           string
	ScheduleName      string
}

ScheduleId is a struct representing the Resource ID for a Schedule

func NewScheduleID

func NewScheduleID(subscriptionId string, resourceGroupName string, labName string, scheduleName string) ScheduleId

NewScheduleID returns a new ScheduleId struct

func ParseScheduleID

func ParseScheduleID(input string) (*ScheduleId, error)

ParseScheduleID parses 'input' into a ScheduleId

func ParseScheduleIDInsensitively

func ParseScheduleIDInsensitively(input string) (*ScheduleId, error)

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

func (*ScheduleId) FromParseResult

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

func (ScheduleId) ID

func (id ScheduleId) ID() string

ID returns the formatted Schedule ID

func (ScheduleId) Segments

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

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

func (ScheduleId) String

func (id ScheduleId) String() string

String returns a human-readable description of this Schedule ID

type ScheduleOperationPredicate

type ScheduleOperationPredicate struct {
	Id   *string
	Name *string
	Type *string
}

func (ScheduleOperationPredicate) Matches

func (p ScheduleOperationPredicate) Matches(input Schedule) bool

type ScheduleProperties

type ScheduleProperties struct {
	Notes             *string            `json:"notes,omitempty"`
	ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"`
	RecurrencePattern *RecurrencePattern `json:"recurrencePattern,omitempty"`
	StartAt           *string            `json:"startAt,omitempty"`
	StopAt            *string            `json:"stopAt,omitempty"`
	TimeZoneId        *string            `json:"timeZoneId,omitempty"`
}

func (*ScheduleProperties) GetStartAtAsTime

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

func (*ScheduleProperties) GetStopAtAsTime

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

func (*ScheduleProperties) SetStartAtAsTime

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

func (*ScheduleProperties) SetStopAtAsTime

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

type ScheduleUpdate

type ScheduleUpdate struct {
	Properties *ScheduleUpdateProperties `json:"properties,omitempty"`
}

type ScheduleUpdateProperties

type ScheduleUpdateProperties struct {
	Notes             *string            `json:"notes,omitempty"`
	RecurrencePattern *RecurrencePattern `json:"recurrencePattern,omitempty"`
	StartAt           *string            `json:"startAt,omitempty"`
	StopAt            *string            `json:"stopAt,omitempty"`
	TimeZoneId        *string            `json:"timeZoneId,omitempty"`
}

func (*ScheduleUpdateProperties) GetStartAtAsTime

func (o *ScheduleUpdateProperties) GetStartAtAsTime() (*time.Time, error)

func (*ScheduleUpdateProperties) GetStopAtAsTime

func (o *ScheduleUpdateProperties) GetStopAtAsTime() (*time.Time, error)

func (*ScheduleUpdateProperties) SetStartAtAsTime

func (o *ScheduleUpdateProperties) SetStartAtAsTime(input time.Time)

func (*ScheduleUpdateProperties) SetStopAtAsTime

func (o *ScheduleUpdateProperties) SetStopAtAsTime(input time.Time)

type UpdateOperationResponse

type UpdateOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *Schedule
}

type WeekDay

type WeekDay string
const (
	WeekDayFriday    WeekDay = "Friday"
	WeekDayMonday    WeekDay = "Monday"
	WeekDaySaturday  WeekDay = "Saturday"
	WeekDaySunday    WeekDay = "Sunday"
	WeekDayThursday  WeekDay = "Thursday"
	WeekDayTuesday   WeekDay = "Tuesday"
	WeekDayWednesday WeekDay = "Wednesday"
)

func (*WeekDay) UnmarshalJSON

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

Jump to

Keyboard shortcuts

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