This repository has been archived by the owner on Mar 11, 2021. It is now read-only.
/
iotHubResource.go
265 lines (241 loc) · 9.32 KB
/
iotHubResource.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
// *** 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 v20170701
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// The description of the IoT hub.
type IotHubResource struct {
pulumi.CustomResourceState
// The Etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal ETag convention.
Etag pulumi.StringPtrOutput `pulumi:"etag"`
// The resource location.
Location pulumi.StringOutput `pulumi:"location"`
// The resource name.
Name pulumi.StringOutput `pulumi:"name"`
// The properties of an IoT hub.
Properties IotHubPropertiesResponseOutput `pulumi:"properties"`
// The name of the resource group that contains the IoT hub. A resource group name uniquely identifies the resource group within the subscription.
Resourcegroup pulumi.StringOutput `pulumi:"resourcegroup"`
// Information about the SKU of the IoT hub.
Sku IotHubSkuInfoResponseOutput `pulumi:"sku"`
// The subscription identifier.
Subscriptionid pulumi.StringOutput `pulumi:"subscriptionid"`
// The resource tags.
Tags pulumi.StringMapOutput `pulumi:"tags"`
// The resource type.
Type pulumi.StringOutput `pulumi:"type"`
}
// NewIotHubResource registers a new resource with the given unique name, arguments, and options.
func NewIotHubResource(ctx *pulumi.Context,
name string, args *IotHubResourceArgs, opts ...pulumi.ResourceOption) (*IotHubResource, 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.ResourceName == nil {
return nil, errors.New("invalid value for required argument 'ResourceName'")
}
if args.Resourcegroup == nil {
return nil, errors.New("invalid value for required argument 'Resourcegroup'")
}
if args.Sku == nil {
return nil, errors.New("invalid value for required argument 'Sku'")
}
if args.Subscriptionid == nil {
return nil, errors.New("invalid value for required argument 'Subscriptionid'")
}
aliases := pulumi.Aliases([]pulumi.Alias{
{
Type: pulumi.String("azure-nextgen:devices/latest:IotHubResource"),
},
{
Type: pulumi.String("azure-nextgen:devices/v20160203:IotHubResource"),
},
{
Type: pulumi.String("azure-nextgen:devices/v20170119:IotHubResource"),
},
{
Type: pulumi.String("azure-nextgen:devices/v20180122:IotHubResource"),
},
{
Type: pulumi.String("azure-nextgen:devices/v20180401:IotHubResource"),
},
{
Type: pulumi.String("azure-nextgen:devices/v20181201preview:IotHubResource"),
},
{
Type: pulumi.String("azure-nextgen:devices/v20190322:IotHubResource"),
},
{
Type: pulumi.String("azure-nextgen:devices/v20190322preview:IotHubResource"),
},
{
Type: pulumi.String("azure-nextgen:devices/v20190701preview:IotHubResource"),
},
{
Type: pulumi.String("azure-nextgen:devices/v20191104:IotHubResource"),
},
{
Type: pulumi.String("azure-nextgen:devices/v20200301:IotHubResource"),
},
{
Type: pulumi.String("azure-nextgen:devices/v20200401:IotHubResource"),
},
{
Type: pulumi.String("azure-nextgen:devices/v20200615:IotHubResource"),
},
{
Type: pulumi.String("azure-nextgen:devices/v20200710preview:IotHubResource"),
},
{
Type: pulumi.String("azure-nextgen:devices/v20200801:IotHubResource"),
},
{
Type: pulumi.String("azure-nextgen:devices/v20200831:IotHubResource"),
},
{
Type: pulumi.String("azure-nextgen:devices/v20200831preview:IotHubResource"),
},
})
opts = append(opts, aliases)
var resource IotHubResource
err := ctx.RegisterResource("azure-nextgen:devices/v20170701:IotHubResource", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetIotHubResource gets an existing IotHubResource 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 GetIotHubResource(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *IotHubResourceState, opts ...pulumi.ResourceOption) (*IotHubResource, error) {
var resource IotHubResource
err := ctx.ReadResource("azure-nextgen:devices/v20170701:IotHubResource", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering IotHubResource resources.
type iotHubResourceState struct {
// The Etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal ETag convention.
Etag *string `pulumi:"etag"`
// The resource location.
Location *string `pulumi:"location"`
// The resource name.
Name *string `pulumi:"name"`
// The properties of an IoT hub.
Properties *IotHubPropertiesResponse `pulumi:"properties"`
// The name of the resource group that contains the IoT hub. A resource group name uniquely identifies the resource group within the subscription.
Resourcegroup *string `pulumi:"resourcegroup"`
// Information about the SKU of the IoT hub.
Sku *IotHubSkuInfoResponse `pulumi:"sku"`
// The subscription identifier.
Subscriptionid *string `pulumi:"subscriptionid"`
// The resource tags.
Tags map[string]string `pulumi:"tags"`
// The resource type.
Type *string `pulumi:"type"`
}
type IotHubResourceState struct {
// The Etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal ETag convention.
Etag pulumi.StringPtrInput
// The resource location.
Location pulumi.StringPtrInput
// The resource name.
Name pulumi.StringPtrInput
// The properties of an IoT hub.
Properties IotHubPropertiesResponsePtrInput
// The name of the resource group that contains the IoT hub. A resource group name uniquely identifies the resource group within the subscription.
Resourcegroup pulumi.StringPtrInput
// Information about the SKU of the IoT hub.
Sku IotHubSkuInfoResponsePtrInput
// The subscription identifier.
Subscriptionid pulumi.StringPtrInput
// The resource tags.
Tags pulumi.StringMapInput
// The resource type.
Type pulumi.StringPtrInput
}
func (IotHubResourceState) ElementType() reflect.Type {
return reflect.TypeOf((*iotHubResourceState)(nil)).Elem()
}
type iotHubResourceArgs struct {
// The Etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal ETag convention.
Etag *string `pulumi:"etag"`
// The resource location.
Location *string `pulumi:"location"`
// The properties of an IoT hub.
Properties *IotHubProperties `pulumi:"properties"`
// The name of the resource group that contains the IoT hub.
ResourceGroupName string `pulumi:"resourceGroupName"`
// The name of the IoT hub.
ResourceName string `pulumi:"resourceName"`
// The name of the resource group that contains the IoT hub. A resource group name uniquely identifies the resource group within the subscription.
Resourcegroup string `pulumi:"resourcegroup"`
// Information about the SKU of the IoT hub.
Sku IotHubSkuInfo `pulumi:"sku"`
// The subscription identifier.
Subscriptionid string `pulumi:"subscriptionid"`
// The resource tags.
Tags map[string]string `pulumi:"tags"`
}
// The set of arguments for constructing a IotHubResource resource.
type IotHubResourceArgs struct {
// The Etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal ETag convention.
Etag pulumi.StringPtrInput
// The resource location.
Location pulumi.StringPtrInput
// The properties of an IoT hub.
Properties IotHubPropertiesPtrInput
// The name of the resource group that contains the IoT hub.
ResourceGroupName pulumi.StringInput
// The name of the IoT hub.
ResourceName pulumi.StringInput
// The name of the resource group that contains the IoT hub. A resource group name uniquely identifies the resource group within the subscription.
Resourcegroup pulumi.StringInput
// Information about the SKU of the IoT hub.
Sku IotHubSkuInfoInput
// The subscription identifier.
Subscriptionid pulumi.StringInput
// The resource tags.
Tags pulumi.StringMapInput
}
func (IotHubResourceArgs) ElementType() reflect.Type {
return reflect.TypeOf((*iotHubResourceArgs)(nil)).Elem()
}
type IotHubResourceInput interface {
pulumi.Input
ToIotHubResourceOutput() IotHubResourceOutput
ToIotHubResourceOutputWithContext(ctx context.Context) IotHubResourceOutput
}
func (*IotHubResource) ElementType() reflect.Type {
return reflect.TypeOf((*IotHubResource)(nil))
}
func (i *IotHubResource) ToIotHubResourceOutput() IotHubResourceOutput {
return i.ToIotHubResourceOutputWithContext(context.Background())
}
func (i *IotHubResource) ToIotHubResourceOutputWithContext(ctx context.Context) IotHubResourceOutput {
return pulumi.ToOutputWithContext(ctx, i).(IotHubResourceOutput)
}
type IotHubResourceOutput struct {
*pulumi.OutputState
}
func (IotHubResourceOutput) ElementType() reflect.Type {
return reflect.TypeOf((*IotHubResource)(nil))
}
func (o IotHubResourceOutput) ToIotHubResourceOutput() IotHubResourceOutput {
return o
}
func (o IotHubResourceOutput) ToIotHubResourceOutputWithContext(ctx context.Context) IotHubResourceOutput {
return o
}
func init() {
pulumi.RegisterOutputType(IotHubResourceOutput{})
}