/
targetProject.go
187 lines (155 loc) · 9.45 KB
/
targetProject.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
// 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 TargetProject in a given project. NOTE: TargetProject is a global resource; hence the only supported value for location is `global`.
// Auto-naming is currently not supported for this resource.
type TargetProject struct {
pulumi.CustomResourceState
// The time this target project resource was created (not related to when the Compute Engine project it points to was created).
CreateTime pulumi.StringOutput `pulumi:"createTime"`
// The target project's description.
Description pulumi.StringOutput `pulumi:"description"`
Location pulumi.StringOutput `pulumi:"location"`
// The name of the target project.
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 target_project identifier.
TargetProjectId pulumi.StringOutput `pulumi:"targetProjectId"`
// The last time the target project resource was updated.
UpdateTime pulumi.StringOutput `pulumi:"updateTime"`
}
// NewTargetProject registers a new resource with the given unique name, arguments, and options.
func NewTargetProject(ctx *pulumi.Context,
name string, args *TargetProjectArgs, opts ...pulumi.ResourceOption) (*TargetProject, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.TargetProjectId == nil {
return nil, errors.New("invalid value for required argument 'TargetProjectId'")
}
replaceOnChanges := pulumi.ReplaceOnChanges([]string{
"location",
"project",
"targetProjectId",
})
opts = append(opts, replaceOnChanges)
opts = internal.PkgResourceDefaultOpts(opts)
var resource TargetProject
err := ctx.RegisterResource("google-native:vmmigration/v1alpha1:TargetProject", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetTargetProject gets an existing TargetProject 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 GetTargetProject(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *TargetProjectState, opts ...pulumi.ResourceOption) (*TargetProject, error) {
var resource TargetProject
err := ctx.ReadResource("google-native:vmmigration/v1alpha1:TargetProject", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering TargetProject resources.
type targetProjectState struct {
}
type TargetProjectState struct {
}
func (TargetProjectState) ElementType() reflect.Type {
return reflect.TypeOf((*targetProjectState)(nil)).Elem()
}
type targetProjectArgs struct {
// The target project's description.
Description *string `pulumi:"description"`
Location *string `pulumi:"location"`
// The target project ID (number) or project name.
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 target_project identifier.
TargetProjectId string `pulumi:"targetProjectId"`
}
// The set of arguments for constructing a TargetProject resource.
type TargetProjectArgs struct {
// The target project's description.
Description pulumi.StringPtrInput
Location pulumi.StringPtrInput
// The target project ID (number) or project name.
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 target_project identifier.
TargetProjectId pulumi.StringInput
}
func (TargetProjectArgs) ElementType() reflect.Type {
return reflect.TypeOf((*targetProjectArgs)(nil)).Elem()
}
type TargetProjectInput interface {
pulumi.Input
ToTargetProjectOutput() TargetProjectOutput
ToTargetProjectOutputWithContext(ctx context.Context) TargetProjectOutput
}
func (*TargetProject) ElementType() reflect.Type {
return reflect.TypeOf((**TargetProject)(nil)).Elem()
}
func (i *TargetProject) ToTargetProjectOutput() TargetProjectOutput {
return i.ToTargetProjectOutputWithContext(context.Background())
}
func (i *TargetProject) ToTargetProjectOutputWithContext(ctx context.Context) TargetProjectOutput {
return pulumi.ToOutputWithContext(ctx, i).(TargetProjectOutput)
}
type TargetProjectOutput struct{ *pulumi.OutputState }
func (TargetProjectOutput) ElementType() reflect.Type {
return reflect.TypeOf((**TargetProject)(nil)).Elem()
}
func (o TargetProjectOutput) ToTargetProjectOutput() TargetProjectOutput {
return o
}
func (o TargetProjectOutput) ToTargetProjectOutputWithContext(ctx context.Context) TargetProjectOutput {
return o
}
// The time this target project resource was created (not related to when the Compute Engine project it points to was created).
func (o TargetProjectOutput) CreateTime() pulumi.StringOutput {
return o.ApplyT(func(v *TargetProject) pulumi.StringOutput { return v.CreateTime }).(pulumi.StringOutput)
}
// The target project's description.
func (o TargetProjectOutput) Description() pulumi.StringOutput {
return o.ApplyT(func(v *TargetProject) pulumi.StringOutput { return v.Description }).(pulumi.StringOutput)
}
func (o TargetProjectOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v *TargetProject) pulumi.StringOutput { return v.Location }).(pulumi.StringOutput)
}
// The name of the target project.
func (o TargetProjectOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *TargetProject) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
func (o TargetProjectOutput) Project() pulumi.StringOutput {
return o.ApplyT(func(v *TargetProject) 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 TargetProjectOutput) RequestId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *TargetProject) pulumi.StringPtrOutput { return v.RequestId }).(pulumi.StringPtrOutput)
}
// Required. The target_project identifier.
func (o TargetProjectOutput) TargetProjectId() pulumi.StringOutput {
return o.ApplyT(func(v *TargetProject) pulumi.StringOutput { return v.TargetProjectId }).(pulumi.StringOutput)
}
// The last time the target project resource was updated.
func (o TargetProjectOutput) UpdateTime() pulumi.StringOutput {
return o.ApplyT(func(v *TargetProject) pulumi.StringOutput { return v.UpdateTime }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*TargetProjectInput)(nil)).Elem(), &TargetProject{})
pulumi.RegisterOutputType(TargetProjectOutput{})
}