This repository has been archived by the owner on Mar 11, 2021. It is now read-only.
/
project.go
246 lines (222 loc) · 7.63 KB
/
project.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
// *** 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 latest
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// A project resource
// Latest API Version: 2018-04-19.
type Project struct {
pulumi.CustomResourceState
// UTC Date and time when project was created
CreationTime pulumi.StringOutput `pulumi:"creationTime"`
// List of DatabaseInfo
DatabasesInfo DatabaseInfoResponseArrayOutput `pulumi:"databasesInfo"`
// Resource location.
Location pulumi.StringOutput `pulumi:"location"`
// Resource name.
Name pulumi.StringOutput `pulumi:"name"`
// The project's provisioning state
ProvisioningState pulumi.StringOutput `pulumi:"provisioningState"`
// Information for connecting to source
SourceConnectionInfo pulumi.AnyOutput `pulumi:"sourceConnectionInfo"`
// Source platform for the project
SourcePlatform pulumi.StringOutput `pulumi:"sourcePlatform"`
// Resource tags.
Tags pulumi.StringMapOutput `pulumi:"tags"`
// Information for connecting to target
TargetConnectionInfo pulumi.AnyOutput `pulumi:"targetConnectionInfo"`
// Target platform for the project
TargetPlatform pulumi.StringOutput `pulumi:"targetPlatform"`
// Resource type.
Type pulumi.StringOutput `pulumi:"type"`
}
// NewProject registers a new resource with the given unique name, arguments, and options.
func NewProject(ctx *pulumi.Context,
name string, args *ProjectArgs, opts ...pulumi.ResourceOption) (*Project, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.GroupName == nil {
return nil, errors.New("invalid value for required argument 'GroupName'")
}
if args.ProjectName == nil {
return nil, errors.New("invalid value for required argument 'ProjectName'")
}
if args.ServiceName == nil {
return nil, errors.New("invalid value for required argument 'ServiceName'")
}
if args.SourcePlatform == nil {
return nil, errors.New("invalid value for required argument 'SourcePlatform'")
}
if args.TargetPlatform == nil {
return nil, errors.New("invalid value for required argument 'TargetPlatform'")
}
aliases := pulumi.Aliases([]pulumi.Alias{
{
Type: pulumi.String("azure-nextgen:datamigration/v20171115preview:Project"),
},
{
Type: pulumi.String("azure-nextgen:datamigration/v20180315preview:Project"),
},
{
Type: pulumi.String("azure-nextgen:datamigration/v20180331preview:Project"),
},
{
Type: pulumi.String("azure-nextgen:datamigration/v20180419:Project"),
},
{
Type: pulumi.String("azure-nextgen:datamigration/v20180715preview:Project"),
},
})
opts = append(opts, aliases)
var resource Project
err := ctx.RegisterResource("azure-nextgen:datamigration/latest:Project", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetProject gets an existing Project 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 GetProject(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ProjectState, opts ...pulumi.ResourceOption) (*Project, error) {
var resource Project
err := ctx.ReadResource("azure-nextgen:datamigration/latest:Project", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Project resources.
type projectState struct {
// UTC Date and time when project was created
CreationTime *string `pulumi:"creationTime"`
// List of DatabaseInfo
DatabasesInfo []DatabaseInfoResponse `pulumi:"databasesInfo"`
// Resource location.
Location *string `pulumi:"location"`
// Resource name.
Name *string `pulumi:"name"`
// The project's provisioning state
ProvisioningState *string `pulumi:"provisioningState"`
// Information for connecting to source
SourceConnectionInfo interface{} `pulumi:"sourceConnectionInfo"`
// Source platform for the project
SourcePlatform *string `pulumi:"sourcePlatform"`
// Resource tags.
Tags map[string]string `pulumi:"tags"`
// Information for connecting to target
TargetConnectionInfo interface{} `pulumi:"targetConnectionInfo"`
// Target platform for the project
TargetPlatform *string `pulumi:"targetPlatform"`
// Resource type.
Type *string `pulumi:"type"`
}
type ProjectState struct {
// UTC Date and time when project was created
CreationTime pulumi.StringPtrInput
// List of DatabaseInfo
DatabasesInfo DatabaseInfoResponseArrayInput
// Resource location.
Location pulumi.StringPtrInput
// Resource name.
Name pulumi.StringPtrInput
// The project's provisioning state
ProvisioningState pulumi.StringPtrInput
// Information for connecting to source
SourceConnectionInfo pulumi.Input
// Source platform for the project
SourcePlatform pulumi.StringPtrInput
// Resource tags.
Tags pulumi.StringMapInput
// Information for connecting to target
TargetConnectionInfo pulumi.Input
// Target platform for the project
TargetPlatform pulumi.StringPtrInput
// Resource type.
Type pulumi.StringPtrInput
}
func (ProjectState) ElementType() reflect.Type {
return reflect.TypeOf((*projectState)(nil)).Elem()
}
type projectArgs struct {
// List of DatabaseInfo
DatabasesInfo []DatabaseInfo `pulumi:"databasesInfo"`
// Name of the resource group
GroupName string `pulumi:"groupName"`
// Resource location.
Location *string `pulumi:"location"`
// Name of the project
ProjectName string `pulumi:"projectName"`
// Name of the service
ServiceName string `pulumi:"serviceName"`
// Information for connecting to source
SourceConnectionInfo interface{} `pulumi:"sourceConnectionInfo"`
// Source platform for the project
SourcePlatform string `pulumi:"sourcePlatform"`
// Resource tags.
Tags map[string]string `pulumi:"tags"`
// Information for connecting to target
TargetConnectionInfo interface{} `pulumi:"targetConnectionInfo"`
// Target platform for the project
TargetPlatform string `pulumi:"targetPlatform"`
}
// The set of arguments for constructing a Project resource.
type ProjectArgs struct {
// List of DatabaseInfo
DatabasesInfo DatabaseInfoArrayInput
// Name of the resource group
GroupName pulumi.StringInput
// Resource location.
Location pulumi.StringPtrInput
// Name of the project
ProjectName pulumi.StringInput
// Name of the service
ServiceName pulumi.StringInput
// Information for connecting to source
SourceConnectionInfo pulumi.Input
// Source platform for the project
SourcePlatform pulumi.StringInput
// Resource tags.
Tags pulumi.StringMapInput
// Information for connecting to target
TargetConnectionInfo pulumi.Input
// Target platform for the project
TargetPlatform pulumi.StringInput
}
func (ProjectArgs) ElementType() reflect.Type {
return reflect.TypeOf((*projectArgs)(nil)).Elem()
}
type ProjectInput interface {
pulumi.Input
ToProjectOutput() ProjectOutput
ToProjectOutputWithContext(ctx context.Context) ProjectOutput
}
func (*Project) ElementType() reflect.Type {
return reflect.TypeOf((*Project)(nil))
}
func (i *Project) ToProjectOutput() ProjectOutput {
return i.ToProjectOutputWithContext(context.Background())
}
func (i *Project) ToProjectOutputWithContext(ctx context.Context) ProjectOutput {
return pulumi.ToOutputWithContext(ctx, i).(ProjectOutput)
}
type ProjectOutput struct {
*pulumi.OutputState
}
func (ProjectOutput) ElementType() reflect.Type {
return reflect.TypeOf((*Project)(nil))
}
func (o ProjectOutput) ToProjectOutput() ProjectOutput {
return o
}
func (o ProjectOutput) ToProjectOutputWithContext(ctx context.Context) ProjectOutput {
return o
}
func init() {
pulumi.RegisterOutputType(ProjectOutput{})
}