forked from pulumi/pulumi-azure-native-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
globalSchedule.go
280 lines (241 loc) · 12.3 KB
/
globalSchedule.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
// Code generated by the Pulumi SDK Generator DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package devtestlab
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure-native-sdk/v2/utilities"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// A schedule.
// Azure REST API version: 2018-09-15. Prior API version in Azure Native 1.x: 2018-09-15.
//
// Other available API versions: 2016-05-15.
type GlobalSchedule struct {
pulumi.CustomResourceState
// The creation date of the schedule.
CreatedDate pulumi.StringOutput `pulumi:"createdDate"`
// If the schedule will occur once each day of the week, specify the daily recurrence.
DailyRecurrence DayDetailsResponsePtrOutput `pulumi:"dailyRecurrence"`
// If the schedule will occur multiple times a day, specify the hourly recurrence.
HourlyRecurrence HourDetailsResponsePtrOutput `pulumi:"hourlyRecurrence"`
// The location of the resource.
Location pulumi.StringPtrOutput `pulumi:"location"`
// The name of the resource.
Name pulumi.StringOutput `pulumi:"name"`
// Notification settings.
NotificationSettings NotificationSettingsResponsePtrOutput `pulumi:"notificationSettings"`
// The provisioning status of the resource.
ProvisioningState pulumi.StringOutput `pulumi:"provisioningState"`
// The status of the schedule (i.e. Enabled, Disabled)
Status pulumi.StringPtrOutput `pulumi:"status"`
// The tags of the resource.
Tags pulumi.StringMapOutput `pulumi:"tags"`
// The resource ID to which the schedule belongs
TargetResourceId pulumi.StringPtrOutput `pulumi:"targetResourceId"`
// The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart).
TaskType pulumi.StringPtrOutput `pulumi:"taskType"`
// The time zone ID (e.g. China Standard Time, Greenland Standard Time, Pacific Standard time, etc.). The possible values for this property can be found in `IReadOnlyCollection<string> TimeZoneConverter.TZConvert.KnownWindowsTimeZoneIds` (https://github.com/mattjohnsonpint/TimeZoneConverter/blob/main/README.md)
TimeZoneId pulumi.StringPtrOutput `pulumi:"timeZoneId"`
// The type of the resource.
Type pulumi.StringOutput `pulumi:"type"`
// The unique immutable identifier of a resource (Guid).
UniqueIdentifier pulumi.StringOutput `pulumi:"uniqueIdentifier"`
// If the schedule will occur only some days of the week, specify the weekly recurrence.
WeeklyRecurrence WeekDetailsResponsePtrOutput `pulumi:"weeklyRecurrence"`
}
// NewGlobalSchedule registers a new resource with the given unique name, arguments, and options.
func NewGlobalSchedule(ctx *pulumi.Context,
name string, args *GlobalScheduleArgs, opts ...pulumi.ResourceOption) (*GlobalSchedule, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
if args.NotificationSettings != nil {
args.NotificationSettings = args.NotificationSettings.ToNotificationSettingsPtrOutput().ApplyT(func(v *NotificationSettings) *NotificationSettings { return v.Defaults() }).(NotificationSettingsPtrOutput)
}
if args.Status == nil {
args.Status = pulumi.StringPtr("Disabled")
}
aliases := pulumi.Aliases([]pulumi.Alias{
{
Type: pulumi.String("azure-native:devtestlab/v20160515:GlobalSchedule"),
},
{
Type: pulumi.String("azure-native:devtestlab/v20180915:GlobalSchedule"),
},
})
opts = append(opts, aliases)
opts = utilities.PkgResourceDefaultOpts(opts)
var resource GlobalSchedule
err := ctx.RegisterResource("azure-native:devtestlab:GlobalSchedule", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetGlobalSchedule gets an existing GlobalSchedule resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetGlobalSchedule(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *GlobalScheduleState, opts ...pulumi.ResourceOption) (*GlobalSchedule, error) {
var resource GlobalSchedule
err := ctx.ReadResource("azure-native:devtestlab:GlobalSchedule", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering GlobalSchedule resources.
type globalScheduleState struct {
}
type GlobalScheduleState struct {
}
func (GlobalScheduleState) ElementType() reflect.Type {
return reflect.TypeOf((*globalScheduleState)(nil)).Elem()
}
type globalScheduleArgs struct {
// If the schedule will occur once each day of the week, specify the daily recurrence.
DailyRecurrence *DayDetails `pulumi:"dailyRecurrence"`
// If the schedule will occur multiple times a day, specify the hourly recurrence.
HourlyRecurrence *HourDetails `pulumi:"hourlyRecurrence"`
// The location of the resource.
Location *string `pulumi:"location"`
// The name of the schedule.
Name *string `pulumi:"name"`
// Notification settings.
NotificationSettings *NotificationSettings `pulumi:"notificationSettings"`
// The name of the resource group.
ResourceGroupName string `pulumi:"resourceGroupName"`
// The status of the schedule (i.e. Enabled, Disabled)
Status *string `pulumi:"status"`
// The tags of the resource.
Tags map[string]string `pulumi:"tags"`
// The resource ID to which the schedule belongs
TargetResourceId *string `pulumi:"targetResourceId"`
// The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart).
TaskType *string `pulumi:"taskType"`
// The time zone ID (e.g. China Standard Time, Greenland Standard Time, Pacific Standard time, etc.). The possible values for this property can be found in `IReadOnlyCollection<string> TimeZoneConverter.TZConvert.KnownWindowsTimeZoneIds` (https://github.com/mattjohnsonpint/TimeZoneConverter/blob/main/README.md)
TimeZoneId *string `pulumi:"timeZoneId"`
// If the schedule will occur only some days of the week, specify the weekly recurrence.
WeeklyRecurrence *WeekDetails `pulumi:"weeklyRecurrence"`
}
// The set of arguments for constructing a GlobalSchedule resource.
type GlobalScheduleArgs struct {
// If the schedule will occur once each day of the week, specify the daily recurrence.
DailyRecurrence DayDetailsPtrInput
// If the schedule will occur multiple times a day, specify the hourly recurrence.
HourlyRecurrence HourDetailsPtrInput
// The location of the resource.
Location pulumi.StringPtrInput
// The name of the schedule.
Name pulumi.StringPtrInput
// Notification settings.
NotificationSettings NotificationSettingsPtrInput
// The name of the resource group.
ResourceGroupName pulumi.StringInput
// The status of the schedule (i.e. Enabled, Disabled)
Status pulumi.StringPtrInput
// The tags of the resource.
Tags pulumi.StringMapInput
// The resource ID to which the schedule belongs
TargetResourceId pulumi.StringPtrInput
// The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart).
TaskType pulumi.StringPtrInput
// The time zone ID (e.g. China Standard Time, Greenland Standard Time, Pacific Standard time, etc.). The possible values for this property can be found in `IReadOnlyCollection<string> TimeZoneConverter.TZConvert.KnownWindowsTimeZoneIds` (https://github.com/mattjohnsonpint/TimeZoneConverter/blob/main/README.md)
TimeZoneId pulumi.StringPtrInput
// If the schedule will occur only some days of the week, specify the weekly recurrence.
WeeklyRecurrence WeekDetailsPtrInput
}
func (GlobalScheduleArgs) ElementType() reflect.Type {
return reflect.TypeOf((*globalScheduleArgs)(nil)).Elem()
}
type GlobalScheduleInput interface {
pulumi.Input
ToGlobalScheduleOutput() GlobalScheduleOutput
ToGlobalScheduleOutputWithContext(ctx context.Context) GlobalScheduleOutput
}
func (*GlobalSchedule) ElementType() reflect.Type {
return reflect.TypeOf((**GlobalSchedule)(nil)).Elem()
}
func (i *GlobalSchedule) ToGlobalScheduleOutput() GlobalScheduleOutput {
return i.ToGlobalScheduleOutputWithContext(context.Background())
}
func (i *GlobalSchedule) ToGlobalScheduleOutputWithContext(ctx context.Context) GlobalScheduleOutput {
return pulumi.ToOutputWithContext(ctx, i).(GlobalScheduleOutput)
}
type GlobalScheduleOutput struct{ *pulumi.OutputState }
func (GlobalScheduleOutput) ElementType() reflect.Type {
return reflect.TypeOf((**GlobalSchedule)(nil)).Elem()
}
func (o GlobalScheduleOutput) ToGlobalScheduleOutput() GlobalScheduleOutput {
return o
}
func (o GlobalScheduleOutput) ToGlobalScheduleOutputWithContext(ctx context.Context) GlobalScheduleOutput {
return o
}
// The creation date of the schedule.
func (o GlobalScheduleOutput) CreatedDate() pulumi.StringOutput {
return o.ApplyT(func(v *GlobalSchedule) pulumi.StringOutput { return v.CreatedDate }).(pulumi.StringOutput)
}
// If the schedule will occur once each day of the week, specify the daily recurrence.
func (o GlobalScheduleOutput) DailyRecurrence() DayDetailsResponsePtrOutput {
return o.ApplyT(func(v *GlobalSchedule) DayDetailsResponsePtrOutput { return v.DailyRecurrence }).(DayDetailsResponsePtrOutput)
}
// If the schedule will occur multiple times a day, specify the hourly recurrence.
func (o GlobalScheduleOutput) HourlyRecurrence() HourDetailsResponsePtrOutput {
return o.ApplyT(func(v *GlobalSchedule) HourDetailsResponsePtrOutput { return v.HourlyRecurrence }).(HourDetailsResponsePtrOutput)
}
// The location of the resource.
func (o GlobalScheduleOutput) Location() pulumi.StringPtrOutput {
return o.ApplyT(func(v *GlobalSchedule) pulumi.StringPtrOutput { return v.Location }).(pulumi.StringPtrOutput)
}
// The name of the resource.
func (o GlobalScheduleOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *GlobalSchedule) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// Notification settings.
func (o GlobalScheduleOutput) NotificationSettings() NotificationSettingsResponsePtrOutput {
return o.ApplyT(func(v *GlobalSchedule) NotificationSettingsResponsePtrOutput { return v.NotificationSettings }).(NotificationSettingsResponsePtrOutput)
}
// The provisioning status of the resource.
func (o GlobalScheduleOutput) ProvisioningState() pulumi.StringOutput {
return o.ApplyT(func(v *GlobalSchedule) pulumi.StringOutput { return v.ProvisioningState }).(pulumi.StringOutput)
}
// The status of the schedule (i.e. Enabled, Disabled)
func (o GlobalScheduleOutput) Status() pulumi.StringPtrOutput {
return o.ApplyT(func(v *GlobalSchedule) pulumi.StringPtrOutput { return v.Status }).(pulumi.StringPtrOutput)
}
// The tags of the resource.
func (o GlobalScheduleOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v *GlobalSchedule) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
}
// The resource ID to which the schedule belongs
func (o GlobalScheduleOutput) TargetResourceId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *GlobalSchedule) pulumi.StringPtrOutput { return v.TargetResourceId }).(pulumi.StringPtrOutput)
}
// The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart).
func (o GlobalScheduleOutput) TaskType() pulumi.StringPtrOutput {
return o.ApplyT(func(v *GlobalSchedule) pulumi.StringPtrOutput { return v.TaskType }).(pulumi.StringPtrOutput)
}
// The time zone ID (e.g. China Standard Time, Greenland Standard Time, Pacific Standard time, etc.). The possible values for this property can be found in `IReadOnlyCollection<string> TimeZoneConverter.TZConvert.KnownWindowsTimeZoneIds` (https://github.com/mattjohnsonpint/TimeZoneConverter/blob/main/README.md)
func (o GlobalScheduleOutput) TimeZoneId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *GlobalSchedule) pulumi.StringPtrOutput { return v.TimeZoneId }).(pulumi.StringPtrOutput)
}
// The type of the resource.
func (o GlobalScheduleOutput) Type() pulumi.StringOutput {
return o.ApplyT(func(v *GlobalSchedule) pulumi.StringOutput { return v.Type }).(pulumi.StringOutput)
}
// The unique immutable identifier of a resource (Guid).
func (o GlobalScheduleOutput) UniqueIdentifier() pulumi.StringOutput {
return o.ApplyT(func(v *GlobalSchedule) pulumi.StringOutput { return v.UniqueIdentifier }).(pulumi.StringOutput)
}
// If the schedule will occur only some days of the week, specify the weekly recurrence.
func (o GlobalScheduleOutput) WeeklyRecurrence() WeekDetailsResponsePtrOutput {
return o.ApplyT(func(v *GlobalSchedule) WeekDetailsResponsePtrOutput { return v.WeeklyRecurrence }).(WeekDetailsResponsePtrOutput)
}
func init() {
pulumi.RegisterOutputType(GlobalScheduleOutput{})
}