This repository has been archived by the owner on Mar 11, 2021. It is now read-only.
/
bandwidthSchedule.go
212 lines (188 loc) · 6.78 KB
/
bandwidthSchedule.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
// *** WARNING: this file was generated by the Pulumi SDK Generator. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package v20190701
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// The bandwidth schedule details.
type BandwidthSchedule struct {
pulumi.CustomResourceState
// The days of the week when this schedule is applicable.
Days pulumi.StringArrayOutput `pulumi:"days"`
// The object name.
Name pulumi.StringOutput `pulumi:"name"`
// The bandwidth rate in Mbps.
RateInMbps pulumi.IntOutput `pulumi:"rateInMbps"`
// The start time of the schedule in UTC.
Start pulumi.StringOutput `pulumi:"start"`
// The stop time of the schedule in UTC.
Stop pulumi.StringOutput `pulumi:"stop"`
// The hierarchical type of the object.
Type pulumi.StringOutput `pulumi:"type"`
}
// NewBandwidthSchedule registers a new resource with the given unique name, arguments, and options.
func NewBandwidthSchedule(ctx *pulumi.Context,
name string, args *BandwidthScheduleArgs, opts ...pulumi.ResourceOption) (*BandwidthSchedule, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.Days == nil {
return nil, errors.New("invalid value for required argument 'Days'")
}
if args.DeviceName == nil {
return nil, errors.New("invalid value for required argument 'DeviceName'")
}
if args.Name == nil {
return nil, errors.New("invalid value for required argument 'Name'")
}
if args.RateInMbps == nil {
return nil, errors.New("invalid value for required argument 'RateInMbps'")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
if args.Start == nil {
return nil, errors.New("invalid value for required argument 'Start'")
}
if args.Stop == nil {
return nil, errors.New("invalid value for required argument 'Stop'")
}
aliases := pulumi.Aliases([]pulumi.Alias{
{
Type: pulumi.String("azure-nextgen:databoxedge/latest:BandwidthSchedule"),
},
{
Type: pulumi.String("azure-nextgen:databoxedge/v20190301:BandwidthSchedule"),
},
{
Type: pulumi.String("azure-nextgen:databoxedge/v20190801:BandwidthSchedule"),
},
{
Type: pulumi.String("azure-nextgen:databoxedge/v20200501preview:BandwidthSchedule"),
},
{
Type: pulumi.String("azure-nextgen:databoxedge/v20200901:BandwidthSchedule"),
},
{
Type: pulumi.String("azure-nextgen:databoxedge/v20200901preview:BandwidthSchedule"),
},
})
opts = append(opts, aliases)
var resource BandwidthSchedule
err := ctx.RegisterResource("azure-nextgen:databoxedge/v20190701:BandwidthSchedule", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetBandwidthSchedule gets an existing BandwidthSchedule 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 GetBandwidthSchedule(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *BandwidthScheduleState, opts ...pulumi.ResourceOption) (*BandwidthSchedule, error) {
var resource BandwidthSchedule
err := ctx.ReadResource("azure-nextgen:databoxedge/v20190701:BandwidthSchedule", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering BandwidthSchedule resources.
type bandwidthScheduleState struct {
// The days of the week when this schedule is applicable.
Days []string `pulumi:"days"`
// The object name.
Name *string `pulumi:"name"`
// The bandwidth rate in Mbps.
RateInMbps *int `pulumi:"rateInMbps"`
// The start time of the schedule in UTC.
Start *string `pulumi:"start"`
// The stop time of the schedule in UTC.
Stop *string `pulumi:"stop"`
// The hierarchical type of the object.
Type *string `pulumi:"type"`
}
type BandwidthScheduleState struct {
// The days of the week when this schedule is applicable.
Days pulumi.StringArrayInput
// The object name.
Name pulumi.StringPtrInput
// The bandwidth rate in Mbps.
RateInMbps pulumi.IntPtrInput
// The start time of the schedule in UTC.
Start pulumi.StringPtrInput
// The stop time of the schedule in UTC.
Stop pulumi.StringPtrInput
// The hierarchical type of the object.
Type pulumi.StringPtrInput
}
func (BandwidthScheduleState) ElementType() reflect.Type {
return reflect.TypeOf((*bandwidthScheduleState)(nil)).Elem()
}
type bandwidthScheduleArgs struct {
// The days of the week when this schedule is applicable.
Days []string `pulumi:"days"`
// The device name.
DeviceName string `pulumi:"deviceName"`
// The bandwidth schedule name which needs to be added/updated.
Name string `pulumi:"name"`
// The bandwidth rate in Mbps.
RateInMbps int `pulumi:"rateInMbps"`
// The resource group name.
ResourceGroupName string `pulumi:"resourceGroupName"`
// The start time of the schedule in UTC.
Start string `pulumi:"start"`
// The stop time of the schedule in UTC.
Stop string `pulumi:"stop"`
}
// The set of arguments for constructing a BandwidthSchedule resource.
type BandwidthScheduleArgs struct {
// The days of the week when this schedule is applicable.
Days pulumi.StringArrayInput
// The device name.
DeviceName pulumi.StringInput
// The bandwidth schedule name which needs to be added/updated.
Name pulumi.StringInput
// The bandwidth rate in Mbps.
RateInMbps pulumi.IntInput
// The resource group name.
ResourceGroupName pulumi.StringInput
// The start time of the schedule in UTC.
Start pulumi.StringInput
// The stop time of the schedule in UTC.
Stop pulumi.StringInput
}
func (BandwidthScheduleArgs) ElementType() reflect.Type {
return reflect.TypeOf((*bandwidthScheduleArgs)(nil)).Elem()
}
type BandwidthScheduleInput interface {
pulumi.Input
ToBandwidthScheduleOutput() BandwidthScheduleOutput
ToBandwidthScheduleOutputWithContext(ctx context.Context) BandwidthScheduleOutput
}
func (*BandwidthSchedule) ElementType() reflect.Type {
return reflect.TypeOf((*BandwidthSchedule)(nil))
}
func (i *BandwidthSchedule) ToBandwidthScheduleOutput() BandwidthScheduleOutput {
return i.ToBandwidthScheduleOutputWithContext(context.Background())
}
func (i *BandwidthSchedule) ToBandwidthScheduleOutputWithContext(ctx context.Context) BandwidthScheduleOutput {
return pulumi.ToOutputWithContext(ctx, i).(BandwidthScheduleOutput)
}
type BandwidthScheduleOutput struct {
*pulumi.OutputState
}
func (BandwidthScheduleOutput) ElementType() reflect.Type {
return reflect.TypeOf((*BandwidthSchedule)(nil))
}
func (o BandwidthScheduleOutput) ToBandwidthScheduleOutput() BandwidthScheduleOutput {
return o
}
func (o BandwidthScheduleOutput) ToBandwidthScheduleOutputWithContext(ctx context.Context) BandwidthScheduleOutput {
return o
}
func init() {
pulumi.RegisterOutputType(BandwidthScheduleOutput{})
}