generated from pulumi/pulumi-tf-provider-boilerplate
/
file.go
324 lines (269 loc) · 9.33 KB
/
file.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
315
316
317
318
319
320
321
322
323
324
// 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 storage
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
type File struct {
pulumi.CustomResourceState
// The content type
ContentType pulumi.StringPtrOutput `pulumi:"contentType"`
// The datastore id
DatastoreId pulumi.StringOutput `pulumi:"datastoreId"`
// The file modification date
FileModificationDate pulumi.StringOutput `pulumi:"fileModificationDate"`
// The file name
FileName pulumi.StringOutput `pulumi:"fileName"`
// The file size in bytes
FileSize pulumi.IntOutput `pulumi:"fileSize"`
// The file tag
FileTag pulumi.StringOutput `pulumi:"fileTag"`
// The node name
NodeName pulumi.StringOutput `pulumi:"nodeName"`
// The source file
SourceFile FileSourceFilePtrOutput `pulumi:"sourceFile"`
// The raw source
SourceRaw FileSourceRawPtrOutput `pulumi:"sourceRaw"`
}
// NewFile registers a new resource with the given unique name, arguments, and options.
func NewFile(ctx *pulumi.Context,
name string, args *FileArgs, opts ...pulumi.ResourceOption) (*File, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.DatastoreId == nil {
return nil, errors.New("invalid value for required argument 'DatastoreId'")
}
if args.NodeName == nil {
return nil, errors.New("invalid value for required argument 'NodeName'")
}
opts = pkgResourceDefaultOpts(opts)
var resource File
err := ctx.RegisterResource("proxmoxve:Storage/file:File", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetFile gets an existing File 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 GetFile(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *FileState, opts ...pulumi.ResourceOption) (*File, error) {
var resource File
err := ctx.ReadResource("proxmoxve:Storage/file:File", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering File resources.
type fileState struct {
// The content type
ContentType *string `pulumi:"contentType"`
// The datastore id
DatastoreId *string `pulumi:"datastoreId"`
// The file modification date
FileModificationDate *string `pulumi:"fileModificationDate"`
// The file name
FileName *string `pulumi:"fileName"`
// The file size in bytes
FileSize *int `pulumi:"fileSize"`
// The file tag
FileTag *string `pulumi:"fileTag"`
// The node name
NodeName *string `pulumi:"nodeName"`
// The source file
SourceFile *FileSourceFile `pulumi:"sourceFile"`
// The raw source
SourceRaw *FileSourceRaw `pulumi:"sourceRaw"`
}
type FileState struct {
// The content type
ContentType pulumi.StringPtrInput
// The datastore id
DatastoreId pulumi.StringPtrInput
// The file modification date
FileModificationDate pulumi.StringPtrInput
// The file name
FileName pulumi.StringPtrInput
// The file size in bytes
FileSize pulumi.IntPtrInput
// The file tag
FileTag pulumi.StringPtrInput
// The node name
NodeName pulumi.StringPtrInput
// The source file
SourceFile FileSourceFilePtrInput
// The raw source
SourceRaw FileSourceRawPtrInput
}
func (FileState) ElementType() reflect.Type {
return reflect.TypeOf((*fileState)(nil)).Elem()
}
type fileArgs struct {
// The content type
ContentType *string `pulumi:"contentType"`
// The datastore id
DatastoreId string `pulumi:"datastoreId"`
// The node name
NodeName string `pulumi:"nodeName"`
// The source file
SourceFile *FileSourceFile `pulumi:"sourceFile"`
// The raw source
SourceRaw *FileSourceRaw `pulumi:"sourceRaw"`
}
// The set of arguments for constructing a File resource.
type FileArgs struct {
// The content type
ContentType pulumi.StringPtrInput
// The datastore id
DatastoreId pulumi.StringInput
// The node name
NodeName pulumi.StringInput
// The source file
SourceFile FileSourceFilePtrInput
// The raw source
SourceRaw FileSourceRawPtrInput
}
func (FileArgs) ElementType() reflect.Type {
return reflect.TypeOf((*fileArgs)(nil)).Elem()
}
type FileInput interface {
pulumi.Input
ToFileOutput() FileOutput
ToFileOutputWithContext(ctx context.Context) FileOutput
}
func (*File) ElementType() reflect.Type {
return reflect.TypeOf((**File)(nil)).Elem()
}
func (i *File) ToFileOutput() FileOutput {
return i.ToFileOutputWithContext(context.Background())
}
func (i *File) ToFileOutputWithContext(ctx context.Context) FileOutput {
return pulumi.ToOutputWithContext(ctx, i).(FileOutput)
}
// FileArrayInput is an input type that accepts FileArray and FileArrayOutput values.
// You can construct a concrete instance of `FileArrayInput` via:
//
// FileArray{ FileArgs{...} }
type FileArrayInput interface {
pulumi.Input
ToFileArrayOutput() FileArrayOutput
ToFileArrayOutputWithContext(context.Context) FileArrayOutput
}
type FileArray []FileInput
func (FileArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*File)(nil)).Elem()
}
func (i FileArray) ToFileArrayOutput() FileArrayOutput {
return i.ToFileArrayOutputWithContext(context.Background())
}
func (i FileArray) ToFileArrayOutputWithContext(ctx context.Context) FileArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(FileArrayOutput)
}
// FileMapInput is an input type that accepts FileMap and FileMapOutput values.
// You can construct a concrete instance of `FileMapInput` via:
//
// FileMap{ "key": FileArgs{...} }
type FileMapInput interface {
pulumi.Input
ToFileMapOutput() FileMapOutput
ToFileMapOutputWithContext(context.Context) FileMapOutput
}
type FileMap map[string]FileInput
func (FileMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*File)(nil)).Elem()
}
func (i FileMap) ToFileMapOutput() FileMapOutput {
return i.ToFileMapOutputWithContext(context.Background())
}
func (i FileMap) ToFileMapOutputWithContext(ctx context.Context) FileMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(FileMapOutput)
}
type FileOutput struct{ *pulumi.OutputState }
func (FileOutput) ElementType() reflect.Type {
return reflect.TypeOf((**File)(nil)).Elem()
}
func (o FileOutput) ToFileOutput() FileOutput {
return o
}
func (o FileOutput) ToFileOutputWithContext(ctx context.Context) FileOutput {
return o
}
// The content type
func (o FileOutput) ContentType() pulumi.StringPtrOutput {
return o.ApplyT(func(v *File) pulumi.StringPtrOutput { return v.ContentType }).(pulumi.StringPtrOutput)
}
// The datastore id
func (o FileOutput) DatastoreId() pulumi.StringOutput {
return o.ApplyT(func(v *File) pulumi.StringOutput { return v.DatastoreId }).(pulumi.StringOutput)
}
// The file modification date
func (o FileOutput) FileModificationDate() pulumi.StringOutput {
return o.ApplyT(func(v *File) pulumi.StringOutput { return v.FileModificationDate }).(pulumi.StringOutput)
}
// The file name
func (o FileOutput) FileName() pulumi.StringOutput {
return o.ApplyT(func(v *File) pulumi.StringOutput { return v.FileName }).(pulumi.StringOutput)
}
// The file size in bytes
func (o FileOutput) FileSize() pulumi.IntOutput {
return o.ApplyT(func(v *File) pulumi.IntOutput { return v.FileSize }).(pulumi.IntOutput)
}
// The file tag
func (o FileOutput) FileTag() pulumi.StringOutput {
return o.ApplyT(func(v *File) pulumi.StringOutput { return v.FileTag }).(pulumi.StringOutput)
}
// The node name
func (o FileOutput) NodeName() pulumi.StringOutput {
return o.ApplyT(func(v *File) pulumi.StringOutput { return v.NodeName }).(pulumi.StringOutput)
}
// The source file
func (o FileOutput) SourceFile() FileSourceFilePtrOutput {
return o.ApplyT(func(v *File) FileSourceFilePtrOutput { return v.SourceFile }).(FileSourceFilePtrOutput)
}
// The raw source
func (o FileOutput) SourceRaw() FileSourceRawPtrOutput {
return o.ApplyT(func(v *File) FileSourceRawPtrOutput { return v.SourceRaw }).(FileSourceRawPtrOutput)
}
type FileArrayOutput struct{ *pulumi.OutputState }
func (FileArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*File)(nil)).Elem()
}
func (o FileArrayOutput) ToFileArrayOutput() FileArrayOutput {
return o
}
func (o FileArrayOutput) ToFileArrayOutputWithContext(ctx context.Context) FileArrayOutput {
return o
}
func (o FileArrayOutput) Index(i pulumi.IntInput) FileOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *File {
return vs[0].([]*File)[vs[1].(int)]
}).(FileOutput)
}
type FileMapOutput struct{ *pulumi.OutputState }
func (FileMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*File)(nil)).Elem()
}
func (o FileMapOutput) ToFileMapOutput() FileMapOutput {
return o
}
func (o FileMapOutput) ToFileMapOutputWithContext(ctx context.Context) FileMapOutput {
return o
}
func (o FileMapOutput) MapIndex(k pulumi.StringInput) FileOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *File {
return vs[0].(map[string]*File)[vs[1].(string)]
}).(FileOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*FileInput)(nil)).Elem(), &File{})
pulumi.RegisterInputType(reflect.TypeOf((*FileArrayInput)(nil)).Elem(), FileArray{})
pulumi.RegisterInputType(reflect.TypeOf((*FileMapInput)(nil)).Elem(), FileMap{})
pulumi.RegisterOutputType(FileOutput{})
pulumi.RegisterOutputType(FileArrayOutput{})
pulumi.RegisterOutputType(FileMapOutput{})
}