/
developer.go
272 lines (233 loc) · 11 KB
/
developer.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
// 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 v1
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-google-native/sdk/go/google/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Creates a developer. Once created, the developer can register an app and obtain an API key. At creation time, a developer is set as `active`. To change the developer status, use the SetDeveloperStatus API.
// Auto-naming is currently not supported for this resource.
type Developer struct {
pulumi.CustomResourceState
// Access type.
AccessType pulumi.StringOutput `pulumi:"accessType"`
// Developer app family.
AppFamily pulumi.StringOutput `pulumi:"appFamily"`
// List of apps associated with the developer.
Apps pulumi.StringArrayOutput `pulumi:"apps"`
// Optional. Developer attributes (name/value pairs). The custom attribute limit is 18.
Attributes GoogleCloudApigeeV1AttributeResponseArrayOutput `pulumi:"attributes"`
// List of companies associated with the developer.
Companies pulumi.StringArrayOutput `pulumi:"companies"`
// Time at which the developer was created in milliseconds since epoch.
CreatedAt pulumi.StringOutput `pulumi:"createdAt"`
// ID of the developer. **Note**: IDs are generated internally by Apigee and are not guaranteed to stay the same over time.
DeveloperId pulumi.StringOutput `pulumi:"developerId"`
// Email address of the developer. This value is used to uniquely identify the developer in Apigee hybrid. Note that the email address has to be in lowercase only.
Email pulumi.StringOutput `pulumi:"email"`
// First name of the developer.
FirstName pulumi.StringOutput `pulumi:"firstName"`
// Time at which the developer was last modified in milliseconds since epoch.
LastModifiedAt pulumi.StringOutput `pulumi:"lastModifiedAt"`
// Last name of the developer.
LastName pulumi.StringOutput `pulumi:"lastName"`
OrganizationId pulumi.StringOutput `pulumi:"organizationId"`
// Name of the Apigee organization in which the developer resides.
OrganizationName pulumi.StringOutput `pulumi:"organizationName"`
// Status of the developer. Valid values are `active` and `inactive`.
Status pulumi.StringOutput `pulumi:"status"`
// User name of the developer. Not used by Apigee hybrid.
UserName pulumi.StringOutput `pulumi:"userName"`
}
// NewDeveloper registers a new resource with the given unique name, arguments, and options.
func NewDeveloper(ctx *pulumi.Context,
name string, args *DeveloperArgs, opts ...pulumi.ResourceOption) (*Developer, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.Email == nil {
return nil, errors.New("invalid value for required argument 'Email'")
}
if args.FirstName == nil {
return nil, errors.New("invalid value for required argument 'FirstName'")
}
if args.LastName == nil {
return nil, errors.New("invalid value for required argument 'LastName'")
}
if args.OrganizationId == nil {
return nil, errors.New("invalid value for required argument 'OrganizationId'")
}
if args.UserName == nil {
return nil, errors.New("invalid value for required argument 'UserName'")
}
replaceOnChanges := pulumi.ReplaceOnChanges([]string{
"organizationId",
})
opts = append(opts, replaceOnChanges)
opts = internal.PkgResourceDefaultOpts(opts)
var resource Developer
err := ctx.RegisterResource("google-native:apigee/v1:Developer", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetDeveloper gets an existing Developer 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 GetDeveloper(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *DeveloperState, opts ...pulumi.ResourceOption) (*Developer, error) {
var resource Developer
err := ctx.ReadResource("google-native:apigee/v1:Developer", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Developer resources.
type developerState struct {
}
type DeveloperState struct {
}
func (DeveloperState) ElementType() reflect.Type {
return reflect.TypeOf((*developerState)(nil)).Elem()
}
type developerArgs struct {
// Access type.
AccessType *string `pulumi:"accessType"`
// Developer app family.
AppFamily *string `pulumi:"appFamily"`
// List of apps associated with the developer.
Apps []string `pulumi:"apps"`
// Optional. Developer attributes (name/value pairs). The custom attribute limit is 18.
Attributes []GoogleCloudApigeeV1Attribute `pulumi:"attributes"`
// List of companies associated with the developer.
Companies []string `pulumi:"companies"`
// ID of the developer. **Note**: IDs are generated internally by Apigee and are not guaranteed to stay the same over time.
DeveloperId *string `pulumi:"developerId"`
// Email address of the developer. This value is used to uniquely identify the developer in Apigee hybrid. Note that the email address has to be in lowercase only.
Email string `pulumi:"email"`
// First name of the developer.
FirstName string `pulumi:"firstName"`
// Last name of the developer.
LastName string `pulumi:"lastName"`
OrganizationId string `pulumi:"organizationId"`
// User name of the developer. Not used by Apigee hybrid.
UserName string `pulumi:"userName"`
}
// The set of arguments for constructing a Developer resource.
type DeveloperArgs struct {
// Access type.
AccessType pulumi.StringPtrInput
// Developer app family.
AppFamily pulumi.StringPtrInput
// List of apps associated with the developer.
Apps pulumi.StringArrayInput
// Optional. Developer attributes (name/value pairs). The custom attribute limit is 18.
Attributes GoogleCloudApigeeV1AttributeArrayInput
// List of companies associated with the developer.
Companies pulumi.StringArrayInput
// ID of the developer. **Note**: IDs are generated internally by Apigee and are not guaranteed to stay the same over time.
DeveloperId pulumi.StringPtrInput
// Email address of the developer. This value is used to uniquely identify the developer in Apigee hybrid. Note that the email address has to be in lowercase only.
Email pulumi.StringInput
// First name of the developer.
FirstName pulumi.StringInput
// Last name of the developer.
LastName pulumi.StringInput
OrganizationId pulumi.StringInput
// User name of the developer. Not used by Apigee hybrid.
UserName pulumi.StringInput
}
func (DeveloperArgs) ElementType() reflect.Type {
return reflect.TypeOf((*developerArgs)(nil)).Elem()
}
type DeveloperInput interface {
pulumi.Input
ToDeveloperOutput() DeveloperOutput
ToDeveloperOutputWithContext(ctx context.Context) DeveloperOutput
}
func (*Developer) ElementType() reflect.Type {
return reflect.TypeOf((**Developer)(nil)).Elem()
}
func (i *Developer) ToDeveloperOutput() DeveloperOutput {
return i.ToDeveloperOutputWithContext(context.Background())
}
func (i *Developer) ToDeveloperOutputWithContext(ctx context.Context) DeveloperOutput {
return pulumi.ToOutputWithContext(ctx, i).(DeveloperOutput)
}
type DeveloperOutput struct{ *pulumi.OutputState }
func (DeveloperOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Developer)(nil)).Elem()
}
func (o DeveloperOutput) ToDeveloperOutput() DeveloperOutput {
return o
}
func (o DeveloperOutput) ToDeveloperOutputWithContext(ctx context.Context) DeveloperOutput {
return o
}
// Access type.
func (o DeveloperOutput) AccessType() pulumi.StringOutput {
return o.ApplyT(func(v *Developer) pulumi.StringOutput { return v.AccessType }).(pulumi.StringOutput)
}
// Developer app family.
func (o DeveloperOutput) AppFamily() pulumi.StringOutput {
return o.ApplyT(func(v *Developer) pulumi.StringOutput { return v.AppFamily }).(pulumi.StringOutput)
}
// List of apps associated with the developer.
func (o DeveloperOutput) Apps() pulumi.StringArrayOutput {
return o.ApplyT(func(v *Developer) pulumi.StringArrayOutput { return v.Apps }).(pulumi.StringArrayOutput)
}
// Optional. Developer attributes (name/value pairs). The custom attribute limit is 18.
func (o DeveloperOutput) Attributes() GoogleCloudApigeeV1AttributeResponseArrayOutput {
return o.ApplyT(func(v *Developer) GoogleCloudApigeeV1AttributeResponseArrayOutput { return v.Attributes }).(GoogleCloudApigeeV1AttributeResponseArrayOutput)
}
// List of companies associated with the developer.
func (o DeveloperOutput) Companies() pulumi.StringArrayOutput {
return o.ApplyT(func(v *Developer) pulumi.StringArrayOutput { return v.Companies }).(pulumi.StringArrayOutput)
}
// Time at which the developer was created in milliseconds since epoch.
func (o DeveloperOutput) CreatedAt() pulumi.StringOutput {
return o.ApplyT(func(v *Developer) pulumi.StringOutput { return v.CreatedAt }).(pulumi.StringOutput)
}
// ID of the developer. **Note**: IDs are generated internally by Apigee and are not guaranteed to stay the same over time.
func (o DeveloperOutput) DeveloperId() pulumi.StringOutput {
return o.ApplyT(func(v *Developer) pulumi.StringOutput { return v.DeveloperId }).(pulumi.StringOutput)
}
// Email address of the developer. This value is used to uniquely identify the developer in Apigee hybrid. Note that the email address has to be in lowercase only.
func (o DeveloperOutput) Email() pulumi.StringOutput {
return o.ApplyT(func(v *Developer) pulumi.StringOutput { return v.Email }).(pulumi.StringOutput)
}
// First name of the developer.
func (o DeveloperOutput) FirstName() pulumi.StringOutput {
return o.ApplyT(func(v *Developer) pulumi.StringOutput { return v.FirstName }).(pulumi.StringOutput)
}
// Time at which the developer was last modified in milliseconds since epoch.
func (o DeveloperOutput) LastModifiedAt() pulumi.StringOutput {
return o.ApplyT(func(v *Developer) pulumi.StringOutput { return v.LastModifiedAt }).(pulumi.StringOutput)
}
// Last name of the developer.
func (o DeveloperOutput) LastName() pulumi.StringOutput {
return o.ApplyT(func(v *Developer) pulumi.StringOutput { return v.LastName }).(pulumi.StringOutput)
}
func (o DeveloperOutput) OrganizationId() pulumi.StringOutput {
return o.ApplyT(func(v *Developer) pulumi.StringOutput { return v.OrganizationId }).(pulumi.StringOutput)
}
// Name of the Apigee organization in which the developer resides.
func (o DeveloperOutput) OrganizationName() pulumi.StringOutput {
return o.ApplyT(func(v *Developer) pulumi.StringOutput { return v.OrganizationName }).(pulumi.StringOutput)
}
// Status of the developer. Valid values are `active` and `inactive`.
func (o DeveloperOutput) Status() pulumi.StringOutput {
return o.ApplyT(func(v *Developer) pulumi.StringOutput { return v.Status }).(pulumi.StringOutput)
}
// User name of the developer. Not used by Apigee hybrid.
func (o DeveloperOutput) UserName() pulumi.StringOutput {
return o.ApplyT(func(v *Developer) pulumi.StringOutput { return v.UserName }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*DeveloperInput)(nil)).Elem(), &Developer{})
pulumi.RegisterOutputType(DeveloperOutput{})
}