/
location.go
306 lines (245 loc) · 8.87 KB
/
location.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
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package notebooks
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Represents a Location resource.
//
// ## Import
//
// Location can be imported using any of these accepted formats
//
// ```sh
// $ pulumi import gcp:notebooks/location:Location default projects/{{project}}/locations/{{name}}
// ```
//
// ```sh
// $ pulumi import gcp:notebooks/location:Location default {{project}}/{{name}}
// ```
//
// ```sh
// $ pulumi import gcp:notebooks/location:Location default {{name}}
// ```
type Location struct {
pulumi.CustomResourceState
// Name of the Location resource.
Name pulumi.StringOutput `pulumi:"name"`
// The ID of the project in which the resource belongs.
// If it is not provided, the provider project is used.
Project pulumi.StringOutput `pulumi:"project"`
// The URI of the created resource.
SelfLink pulumi.StringOutput `pulumi:"selfLink"`
}
// NewLocation registers a new resource with the given unique name, arguments, and options.
func NewLocation(ctx *pulumi.Context,
name string, args *LocationArgs, opts ...pulumi.ResourceOption) (*Location, error) {
if args == nil {
args = &LocationArgs{}
}
var resource Location
err := ctx.RegisterResource("gcp:notebooks/location:Location", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetLocation gets an existing Location 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 GetLocation(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *LocationState, opts ...pulumi.ResourceOption) (*Location, error) {
var resource Location
err := ctx.ReadResource("gcp:notebooks/location:Location", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Location resources.
type locationState struct {
// Name of the Location resource.
Name *string `pulumi:"name"`
// The ID of the project in which the resource belongs.
// If it is not provided, the provider project is used.
Project *string `pulumi:"project"`
// The URI of the created resource.
SelfLink *string `pulumi:"selfLink"`
}
type LocationState struct {
// Name of the Location resource.
Name pulumi.StringPtrInput
// The ID of the project in which the resource belongs.
// If it is not provided, the provider project is used.
Project pulumi.StringPtrInput
// The URI of the created resource.
SelfLink pulumi.StringPtrInput
}
func (LocationState) ElementType() reflect.Type {
return reflect.TypeOf((*locationState)(nil)).Elem()
}
type locationArgs struct {
// Name of the Location resource.
Name *string `pulumi:"name"`
// The ID of the project in which the resource belongs.
// If it is not provided, the provider project is used.
Project *string `pulumi:"project"`
}
// The set of arguments for constructing a Location resource.
type LocationArgs struct {
// Name of the Location resource.
Name pulumi.StringPtrInput
// The ID of the project in which the resource belongs.
// If it is not provided, the provider project is used.
Project pulumi.StringPtrInput
}
func (LocationArgs) ElementType() reflect.Type {
return reflect.TypeOf((*locationArgs)(nil)).Elem()
}
type LocationInput interface {
pulumi.Input
ToLocationOutput() LocationOutput
ToLocationOutputWithContext(ctx context.Context) LocationOutput
}
func (*Location) ElementType() reflect.Type {
return reflect.TypeOf((*Location)(nil))
}
func (i *Location) ToLocationOutput() LocationOutput {
return i.ToLocationOutputWithContext(context.Background())
}
func (i *Location) ToLocationOutputWithContext(ctx context.Context) LocationOutput {
return pulumi.ToOutputWithContext(ctx, i).(LocationOutput)
}
func (i *Location) ToLocationPtrOutput() LocationPtrOutput {
return i.ToLocationPtrOutputWithContext(context.Background())
}
func (i *Location) ToLocationPtrOutputWithContext(ctx context.Context) LocationPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(LocationPtrOutput)
}
type LocationPtrInput interface {
pulumi.Input
ToLocationPtrOutput() LocationPtrOutput
ToLocationPtrOutputWithContext(ctx context.Context) LocationPtrOutput
}
type locationPtrType LocationArgs
func (*locationPtrType) ElementType() reflect.Type {
return reflect.TypeOf((**Location)(nil))
}
func (i *locationPtrType) ToLocationPtrOutput() LocationPtrOutput {
return i.ToLocationPtrOutputWithContext(context.Background())
}
func (i *locationPtrType) ToLocationPtrOutputWithContext(ctx context.Context) LocationPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(LocationPtrOutput)
}
// LocationArrayInput is an input type that accepts LocationArray and LocationArrayOutput values.
// You can construct a concrete instance of `LocationArrayInput` via:
//
// LocationArray{ LocationArgs{...} }
type LocationArrayInput interface {
pulumi.Input
ToLocationArrayOutput() LocationArrayOutput
ToLocationArrayOutputWithContext(context.Context) LocationArrayOutput
}
type LocationArray []LocationInput
func (LocationArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Location)(nil)).Elem()
}
func (i LocationArray) ToLocationArrayOutput() LocationArrayOutput {
return i.ToLocationArrayOutputWithContext(context.Background())
}
func (i LocationArray) ToLocationArrayOutputWithContext(ctx context.Context) LocationArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(LocationArrayOutput)
}
// LocationMapInput is an input type that accepts LocationMap and LocationMapOutput values.
// You can construct a concrete instance of `LocationMapInput` via:
//
// LocationMap{ "key": LocationArgs{...} }
type LocationMapInput interface {
pulumi.Input
ToLocationMapOutput() LocationMapOutput
ToLocationMapOutputWithContext(context.Context) LocationMapOutput
}
type LocationMap map[string]LocationInput
func (LocationMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Location)(nil)).Elem()
}
func (i LocationMap) ToLocationMapOutput() LocationMapOutput {
return i.ToLocationMapOutputWithContext(context.Background())
}
func (i LocationMap) ToLocationMapOutputWithContext(ctx context.Context) LocationMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(LocationMapOutput)
}
type LocationOutput struct{ *pulumi.OutputState }
func (LocationOutput) ElementType() reflect.Type {
return reflect.TypeOf((*Location)(nil))
}
func (o LocationOutput) ToLocationOutput() LocationOutput {
return o
}
func (o LocationOutput) ToLocationOutputWithContext(ctx context.Context) LocationOutput {
return o
}
func (o LocationOutput) ToLocationPtrOutput() LocationPtrOutput {
return o.ToLocationPtrOutputWithContext(context.Background())
}
func (o LocationOutput) ToLocationPtrOutputWithContext(ctx context.Context) LocationPtrOutput {
return o.ApplyTWithContext(ctx, func(_ context.Context, v Location) *Location {
return &v
}).(LocationPtrOutput)
}
type LocationPtrOutput struct{ *pulumi.OutputState }
func (LocationPtrOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Location)(nil))
}
func (o LocationPtrOutput) ToLocationPtrOutput() LocationPtrOutput {
return o
}
func (o LocationPtrOutput) ToLocationPtrOutputWithContext(ctx context.Context) LocationPtrOutput {
return o
}
func (o LocationPtrOutput) Elem() LocationOutput {
return o.ApplyT(func(v *Location) Location {
if v != nil {
return *v
}
var ret Location
return ret
}).(LocationOutput)
}
type LocationArrayOutput struct{ *pulumi.OutputState }
func (LocationArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]Location)(nil))
}
func (o LocationArrayOutput) ToLocationArrayOutput() LocationArrayOutput {
return o
}
func (o LocationArrayOutput) ToLocationArrayOutputWithContext(ctx context.Context) LocationArrayOutput {
return o
}
func (o LocationArrayOutput) Index(i pulumi.IntInput) LocationOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) Location {
return vs[0].([]Location)[vs[1].(int)]
}).(LocationOutput)
}
type LocationMapOutput struct{ *pulumi.OutputState }
func (LocationMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]Location)(nil))
}
func (o LocationMapOutput) ToLocationMapOutput() LocationMapOutput {
return o
}
func (o LocationMapOutput) ToLocationMapOutputWithContext(ctx context.Context) LocationMapOutput {
return o
}
func (o LocationMapOutput) MapIndex(k pulumi.StringInput) LocationOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) Location {
return vs[0].(map[string]Location)[vs[1].(string)]
}).(LocationOutput)
}
func init() {
pulumi.RegisterOutputType(LocationOutput{})
pulumi.RegisterOutputType(LocationPtrOutput{})
pulumi.RegisterOutputType(LocationArrayOutput{})
pulumi.RegisterOutputType(LocationMapOutput{})
}