/
source.go
247 lines (209 loc) · 11.1 KB
/
source.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
// Code generated by the Pulumi SDK Generator DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package v1alpha1
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-google-native/sdk/go/google/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Creates a new Source in a given project and location.
// Auto-naming is currently not supported for this resource.
type Source struct {
pulumi.CustomResourceState
// AWS type source details.
Aws AwsSourceDetailsResponseOutput `pulumi:"aws"`
// Azure type source details.
Azure AzureSourceDetailsResponseOutput `pulumi:"azure"`
// The create time timestamp.
CreateTime pulumi.StringOutput `pulumi:"createTime"`
// User-provided description of the source.
Description pulumi.StringOutput `pulumi:"description"`
// Optional. Immutable. The encryption details of the source data stored by the service.
Encryption EncryptionResponseOutput `pulumi:"encryption"`
// Provides details on the state of the Source in case of an error.
Error StatusResponseOutput `pulumi:"error"`
// The labels of the source.
Labels pulumi.StringMapOutput `pulumi:"labels"`
Location pulumi.StringOutput `pulumi:"location"`
// The Source name.
Name pulumi.StringOutput `pulumi:"name"`
Project pulumi.StringOutput `pulumi:"project"`
// A request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
RequestId pulumi.StringPtrOutput `pulumi:"requestId"`
// Required. The source identifier.
SourceId pulumi.StringOutput `pulumi:"sourceId"`
// The update time timestamp.
UpdateTime pulumi.StringOutput `pulumi:"updateTime"`
// Vmware type source details.
Vmware VmwareSourceDetailsResponseOutput `pulumi:"vmware"`
}
// NewSource registers a new resource with the given unique name, arguments, and options.
func NewSource(ctx *pulumi.Context,
name string, args *SourceArgs, opts ...pulumi.ResourceOption) (*Source, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.SourceId == nil {
return nil, errors.New("invalid value for required argument 'SourceId'")
}
replaceOnChanges := pulumi.ReplaceOnChanges([]string{
"location",
"project",
"sourceId",
})
opts = append(opts, replaceOnChanges)
opts = internal.PkgResourceDefaultOpts(opts)
var resource Source
err := ctx.RegisterResource("google-native:vmmigration/v1alpha1:Source", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetSource gets an existing Source 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 GetSource(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *SourceState, opts ...pulumi.ResourceOption) (*Source, error) {
var resource Source
err := ctx.ReadResource("google-native:vmmigration/v1alpha1:Source", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Source resources.
type sourceState struct {
}
type SourceState struct {
}
func (SourceState) ElementType() reflect.Type {
return reflect.TypeOf((*sourceState)(nil)).Elem()
}
type sourceArgs struct {
// AWS type source details.
Aws *AwsSourceDetails `pulumi:"aws"`
// Azure type source details.
Azure *AzureSourceDetails `pulumi:"azure"`
// User-provided description of the source.
Description *string `pulumi:"description"`
// Optional. Immutable. The encryption details of the source data stored by the service.
Encryption *Encryption `pulumi:"encryption"`
// The labels of the source.
Labels map[string]string `pulumi:"labels"`
Location *string `pulumi:"location"`
Project *string `pulumi:"project"`
// A request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
RequestId *string `pulumi:"requestId"`
// Required. The source identifier.
SourceId string `pulumi:"sourceId"`
// Vmware type source details.
Vmware *VmwareSourceDetails `pulumi:"vmware"`
}
// The set of arguments for constructing a Source resource.
type SourceArgs struct {
// AWS type source details.
Aws AwsSourceDetailsPtrInput
// Azure type source details.
Azure AzureSourceDetailsPtrInput
// User-provided description of the source.
Description pulumi.StringPtrInput
// Optional. Immutable. The encryption details of the source data stored by the service.
Encryption EncryptionPtrInput
// The labels of the source.
Labels pulumi.StringMapInput
Location pulumi.StringPtrInput
Project pulumi.StringPtrInput
// A request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
RequestId pulumi.StringPtrInput
// Required. The source identifier.
SourceId pulumi.StringInput
// Vmware type source details.
Vmware VmwareSourceDetailsPtrInput
}
func (SourceArgs) ElementType() reflect.Type {
return reflect.TypeOf((*sourceArgs)(nil)).Elem()
}
type SourceInput interface {
pulumi.Input
ToSourceOutput() SourceOutput
ToSourceOutputWithContext(ctx context.Context) SourceOutput
}
func (*Source) ElementType() reflect.Type {
return reflect.TypeOf((**Source)(nil)).Elem()
}
func (i *Source) ToSourceOutput() SourceOutput {
return i.ToSourceOutputWithContext(context.Background())
}
func (i *Source) ToSourceOutputWithContext(ctx context.Context) SourceOutput {
return pulumi.ToOutputWithContext(ctx, i).(SourceOutput)
}
type SourceOutput struct{ *pulumi.OutputState }
func (SourceOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Source)(nil)).Elem()
}
func (o SourceOutput) ToSourceOutput() SourceOutput {
return o
}
func (o SourceOutput) ToSourceOutputWithContext(ctx context.Context) SourceOutput {
return o
}
// AWS type source details.
func (o SourceOutput) Aws() AwsSourceDetailsResponseOutput {
return o.ApplyT(func(v *Source) AwsSourceDetailsResponseOutput { return v.Aws }).(AwsSourceDetailsResponseOutput)
}
// Azure type source details.
func (o SourceOutput) Azure() AzureSourceDetailsResponseOutput {
return o.ApplyT(func(v *Source) AzureSourceDetailsResponseOutput { return v.Azure }).(AzureSourceDetailsResponseOutput)
}
// The create time timestamp.
func (o SourceOutput) CreateTime() pulumi.StringOutput {
return o.ApplyT(func(v *Source) pulumi.StringOutput { return v.CreateTime }).(pulumi.StringOutput)
}
// User-provided description of the source.
func (o SourceOutput) Description() pulumi.StringOutput {
return o.ApplyT(func(v *Source) pulumi.StringOutput { return v.Description }).(pulumi.StringOutput)
}
// Optional. Immutable. The encryption details of the source data stored by the service.
func (o SourceOutput) Encryption() EncryptionResponseOutput {
return o.ApplyT(func(v *Source) EncryptionResponseOutput { return v.Encryption }).(EncryptionResponseOutput)
}
// Provides details on the state of the Source in case of an error.
func (o SourceOutput) Error() StatusResponseOutput {
return o.ApplyT(func(v *Source) StatusResponseOutput { return v.Error }).(StatusResponseOutput)
}
// The labels of the source.
func (o SourceOutput) Labels() pulumi.StringMapOutput {
return o.ApplyT(func(v *Source) pulumi.StringMapOutput { return v.Labels }).(pulumi.StringMapOutput)
}
func (o SourceOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v *Source) pulumi.StringOutput { return v.Location }).(pulumi.StringOutput)
}
// The Source name.
func (o SourceOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *Source) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
func (o SourceOutput) Project() pulumi.StringOutput {
return o.ApplyT(func(v *Source) pulumi.StringOutput { return v.Project }).(pulumi.StringOutput)
}
// A request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
func (o SourceOutput) RequestId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Source) pulumi.StringPtrOutput { return v.RequestId }).(pulumi.StringPtrOutput)
}
// Required. The source identifier.
func (o SourceOutput) SourceId() pulumi.StringOutput {
return o.ApplyT(func(v *Source) pulumi.StringOutput { return v.SourceId }).(pulumi.StringOutput)
}
// The update time timestamp.
func (o SourceOutput) UpdateTime() pulumi.StringOutput {
return o.ApplyT(func(v *Source) pulumi.StringOutput { return v.UpdateTime }).(pulumi.StringOutput)
}
// Vmware type source details.
func (o SourceOutput) Vmware() VmwareSourceDetailsResponseOutput {
return o.ApplyT(func(v *Source) VmwareSourceDetailsResponseOutput { return v.Vmware }).(VmwareSourceDetailsResponseOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*SourceInput)(nil)).Elem(), &Source{})
pulumi.RegisterOutputType(SourceOutput{})
}