generated from pulumi/pulumi-tf-provider-boilerplate
/
machineLearningHoliday.go
314 lines (257 loc) · 12.9 KB
/
machineLearningHoliday.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
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package grafana
import (
"context"
"reflect"
"github.com/lbrlabs/pulumi-grafana/sdk/go/grafana/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumix"
)
// A holiday describes time periods where a time series is expected to behave differently to normal.
//
// To use a holiday in a job, use its id in the `holidays` attribute of a `MachineLearningJob`:
type MachineLearningHoliday struct {
pulumi.CustomResourceState
// A list of custom periods for the holiday.
CustomPeriods MachineLearningHolidayCustomPeriodArrayOutput `pulumi:"customPeriods"`
// A description of the holiday.
Description pulumi.StringPtrOutput `pulumi:"description"`
// The timezone to use for events in the iCal file pointed to by ical_url.
IcalTimezone pulumi.StringPtrOutput `pulumi:"icalTimezone"`
// A URL to an iCal file containing all occurrences of the holiday.
IcalUrl pulumi.StringPtrOutput `pulumi:"icalUrl"`
// The name of the custom period.
Name pulumi.StringOutput `pulumi:"name"`
}
// NewMachineLearningHoliday registers a new resource with the given unique name, arguments, and options.
func NewMachineLearningHoliday(ctx *pulumi.Context,
name string, args *MachineLearningHolidayArgs, opts ...pulumi.ResourceOption) (*MachineLearningHoliday, error) {
if args == nil {
args = &MachineLearningHolidayArgs{}
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource MachineLearningHoliday
err := ctx.RegisterResource("grafana:index/machineLearningHoliday:MachineLearningHoliday", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetMachineLearningHoliday gets an existing MachineLearningHoliday 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 GetMachineLearningHoliday(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *MachineLearningHolidayState, opts ...pulumi.ResourceOption) (*MachineLearningHoliday, error) {
var resource MachineLearningHoliday
err := ctx.ReadResource("grafana:index/machineLearningHoliday:MachineLearningHoliday", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering MachineLearningHoliday resources.
type machineLearningHolidayState struct {
// A list of custom periods for the holiday.
CustomPeriods []MachineLearningHolidayCustomPeriod `pulumi:"customPeriods"`
// A description of the holiday.
Description *string `pulumi:"description"`
// The timezone to use for events in the iCal file pointed to by ical_url.
IcalTimezone *string `pulumi:"icalTimezone"`
// A URL to an iCal file containing all occurrences of the holiday.
IcalUrl *string `pulumi:"icalUrl"`
// The name of the custom period.
Name *string `pulumi:"name"`
}
type MachineLearningHolidayState struct {
// A list of custom periods for the holiday.
CustomPeriods MachineLearningHolidayCustomPeriodArrayInput
// A description of the holiday.
Description pulumi.StringPtrInput
// The timezone to use for events in the iCal file pointed to by ical_url.
IcalTimezone pulumi.StringPtrInput
// A URL to an iCal file containing all occurrences of the holiday.
IcalUrl pulumi.StringPtrInput
// The name of the custom period.
Name pulumi.StringPtrInput
}
func (MachineLearningHolidayState) ElementType() reflect.Type {
return reflect.TypeOf((*machineLearningHolidayState)(nil)).Elem()
}
type machineLearningHolidayArgs struct {
// A list of custom periods for the holiday.
CustomPeriods []MachineLearningHolidayCustomPeriod `pulumi:"customPeriods"`
// A description of the holiday.
Description *string `pulumi:"description"`
// The timezone to use for events in the iCal file pointed to by ical_url.
IcalTimezone *string `pulumi:"icalTimezone"`
// A URL to an iCal file containing all occurrences of the holiday.
IcalUrl *string `pulumi:"icalUrl"`
// The name of the custom period.
Name *string `pulumi:"name"`
}
// The set of arguments for constructing a MachineLearningHoliday resource.
type MachineLearningHolidayArgs struct {
// A list of custom periods for the holiday.
CustomPeriods MachineLearningHolidayCustomPeriodArrayInput
// A description of the holiday.
Description pulumi.StringPtrInput
// The timezone to use for events in the iCal file pointed to by ical_url.
IcalTimezone pulumi.StringPtrInput
// A URL to an iCal file containing all occurrences of the holiday.
IcalUrl pulumi.StringPtrInput
// The name of the custom period.
Name pulumi.StringPtrInput
}
func (MachineLearningHolidayArgs) ElementType() reflect.Type {
return reflect.TypeOf((*machineLearningHolidayArgs)(nil)).Elem()
}
type MachineLearningHolidayInput interface {
pulumi.Input
ToMachineLearningHolidayOutput() MachineLearningHolidayOutput
ToMachineLearningHolidayOutputWithContext(ctx context.Context) MachineLearningHolidayOutput
}
func (*MachineLearningHoliday) ElementType() reflect.Type {
return reflect.TypeOf((**MachineLearningHoliday)(nil)).Elem()
}
func (i *MachineLearningHoliday) ToMachineLearningHolidayOutput() MachineLearningHolidayOutput {
return i.ToMachineLearningHolidayOutputWithContext(context.Background())
}
func (i *MachineLearningHoliday) ToMachineLearningHolidayOutputWithContext(ctx context.Context) MachineLearningHolidayOutput {
return pulumi.ToOutputWithContext(ctx, i).(MachineLearningHolidayOutput)
}
func (i *MachineLearningHoliday) ToOutput(ctx context.Context) pulumix.Output[*MachineLearningHoliday] {
return pulumix.Output[*MachineLearningHoliday]{
OutputState: i.ToMachineLearningHolidayOutputWithContext(ctx).OutputState,
}
}
// MachineLearningHolidayArrayInput is an input type that accepts MachineLearningHolidayArray and MachineLearningHolidayArrayOutput values.
// You can construct a concrete instance of `MachineLearningHolidayArrayInput` via:
//
// MachineLearningHolidayArray{ MachineLearningHolidayArgs{...} }
type MachineLearningHolidayArrayInput interface {
pulumi.Input
ToMachineLearningHolidayArrayOutput() MachineLearningHolidayArrayOutput
ToMachineLearningHolidayArrayOutputWithContext(context.Context) MachineLearningHolidayArrayOutput
}
type MachineLearningHolidayArray []MachineLearningHolidayInput
func (MachineLearningHolidayArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*MachineLearningHoliday)(nil)).Elem()
}
func (i MachineLearningHolidayArray) ToMachineLearningHolidayArrayOutput() MachineLearningHolidayArrayOutput {
return i.ToMachineLearningHolidayArrayOutputWithContext(context.Background())
}
func (i MachineLearningHolidayArray) ToMachineLearningHolidayArrayOutputWithContext(ctx context.Context) MachineLearningHolidayArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(MachineLearningHolidayArrayOutput)
}
func (i MachineLearningHolidayArray) ToOutput(ctx context.Context) pulumix.Output[[]*MachineLearningHoliday] {
return pulumix.Output[[]*MachineLearningHoliday]{
OutputState: i.ToMachineLearningHolidayArrayOutputWithContext(ctx).OutputState,
}
}
// MachineLearningHolidayMapInput is an input type that accepts MachineLearningHolidayMap and MachineLearningHolidayMapOutput values.
// You can construct a concrete instance of `MachineLearningHolidayMapInput` via:
//
// MachineLearningHolidayMap{ "key": MachineLearningHolidayArgs{...} }
type MachineLearningHolidayMapInput interface {
pulumi.Input
ToMachineLearningHolidayMapOutput() MachineLearningHolidayMapOutput
ToMachineLearningHolidayMapOutputWithContext(context.Context) MachineLearningHolidayMapOutput
}
type MachineLearningHolidayMap map[string]MachineLearningHolidayInput
func (MachineLearningHolidayMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*MachineLearningHoliday)(nil)).Elem()
}
func (i MachineLearningHolidayMap) ToMachineLearningHolidayMapOutput() MachineLearningHolidayMapOutput {
return i.ToMachineLearningHolidayMapOutputWithContext(context.Background())
}
func (i MachineLearningHolidayMap) ToMachineLearningHolidayMapOutputWithContext(ctx context.Context) MachineLearningHolidayMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(MachineLearningHolidayMapOutput)
}
func (i MachineLearningHolidayMap) ToOutput(ctx context.Context) pulumix.Output[map[string]*MachineLearningHoliday] {
return pulumix.Output[map[string]*MachineLearningHoliday]{
OutputState: i.ToMachineLearningHolidayMapOutputWithContext(ctx).OutputState,
}
}
type MachineLearningHolidayOutput struct{ *pulumi.OutputState }
func (MachineLearningHolidayOutput) ElementType() reflect.Type {
return reflect.TypeOf((**MachineLearningHoliday)(nil)).Elem()
}
func (o MachineLearningHolidayOutput) ToMachineLearningHolidayOutput() MachineLearningHolidayOutput {
return o
}
func (o MachineLearningHolidayOutput) ToMachineLearningHolidayOutputWithContext(ctx context.Context) MachineLearningHolidayOutput {
return o
}
func (o MachineLearningHolidayOutput) ToOutput(ctx context.Context) pulumix.Output[*MachineLearningHoliday] {
return pulumix.Output[*MachineLearningHoliday]{
OutputState: o.OutputState,
}
}
// A list of custom periods for the holiday.
func (o MachineLearningHolidayOutput) CustomPeriods() MachineLearningHolidayCustomPeriodArrayOutput {
return o.ApplyT(func(v *MachineLearningHoliday) MachineLearningHolidayCustomPeriodArrayOutput { return v.CustomPeriods }).(MachineLearningHolidayCustomPeriodArrayOutput)
}
// A description of the holiday.
func (o MachineLearningHolidayOutput) Description() pulumi.StringPtrOutput {
return o.ApplyT(func(v *MachineLearningHoliday) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
}
// The timezone to use for events in the iCal file pointed to by ical_url.
func (o MachineLearningHolidayOutput) IcalTimezone() pulumi.StringPtrOutput {
return o.ApplyT(func(v *MachineLearningHoliday) pulumi.StringPtrOutput { return v.IcalTimezone }).(pulumi.StringPtrOutput)
}
// A URL to an iCal file containing all occurrences of the holiday.
func (o MachineLearningHolidayOutput) IcalUrl() pulumi.StringPtrOutput {
return o.ApplyT(func(v *MachineLearningHoliday) pulumi.StringPtrOutput { return v.IcalUrl }).(pulumi.StringPtrOutput)
}
// The name of the custom period.
func (o MachineLearningHolidayOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *MachineLearningHoliday) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
type MachineLearningHolidayArrayOutput struct{ *pulumi.OutputState }
func (MachineLearningHolidayArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*MachineLearningHoliday)(nil)).Elem()
}
func (o MachineLearningHolidayArrayOutput) ToMachineLearningHolidayArrayOutput() MachineLearningHolidayArrayOutput {
return o
}
func (o MachineLearningHolidayArrayOutput) ToMachineLearningHolidayArrayOutputWithContext(ctx context.Context) MachineLearningHolidayArrayOutput {
return o
}
func (o MachineLearningHolidayArrayOutput) ToOutput(ctx context.Context) pulumix.Output[[]*MachineLearningHoliday] {
return pulumix.Output[[]*MachineLearningHoliday]{
OutputState: o.OutputState,
}
}
func (o MachineLearningHolidayArrayOutput) Index(i pulumi.IntInput) MachineLearningHolidayOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *MachineLearningHoliday {
return vs[0].([]*MachineLearningHoliday)[vs[1].(int)]
}).(MachineLearningHolidayOutput)
}
type MachineLearningHolidayMapOutput struct{ *pulumi.OutputState }
func (MachineLearningHolidayMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*MachineLearningHoliday)(nil)).Elem()
}
func (o MachineLearningHolidayMapOutput) ToMachineLearningHolidayMapOutput() MachineLearningHolidayMapOutput {
return o
}
func (o MachineLearningHolidayMapOutput) ToMachineLearningHolidayMapOutputWithContext(ctx context.Context) MachineLearningHolidayMapOutput {
return o
}
func (o MachineLearningHolidayMapOutput) ToOutput(ctx context.Context) pulumix.Output[map[string]*MachineLearningHoliday] {
return pulumix.Output[map[string]*MachineLearningHoliday]{
OutputState: o.OutputState,
}
}
func (o MachineLearningHolidayMapOutput) MapIndex(k pulumi.StringInput) MachineLearningHolidayOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *MachineLearningHoliday {
return vs[0].(map[string]*MachineLearningHoliday)[vs[1].(string)]
}).(MachineLearningHolidayOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*MachineLearningHolidayInput)(nil)).Elem(), &MachineLearningHoliday{})
pulumi.RegisterInputType(reflect.TypeOf((*MachineLearningHolidayArrayInput)(nil)).Elem(), MachineLearningHolidayArray{})
pulumi.RegisterInputType(reflect.TypeOf((*MachineLearningHolidayMapInput)(nil)).Elem(), MachineLearningHolidayMap{})
pulumi.RegisterOutputType(MachineLearningHolidayOutput{})
pulumi.RegisterOutputType(MachineLearningHolidayArrayOutput{})
pulumi.RegisterOutputType(MachineLearningHolidayMapOutput{})
}