/
developerApp.go
254 lines (216 loc) · 11.5 KB
/
developerApp.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
// 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 an app associated with a developer. This API associates the developer app with the specified API product and auto-generates an API key for the app to use in calls to API proxies inside that API product. The `name` is the unique ID of the app that you can use in API calls. The `DisplayName` (set as an attribute) appears in the UI. If you don't set the `DisplayName` attribute, the `name` appears in the UI.
type DeveloperApp struct {
pulumi.CustomResourceState
// List of API products associated with the developer app.
ApiProducts pulumi.StringArrayOutput `pulumi:"apiProducts"`
// Developer app family.
AppFamily pulumi.StringOutput `pulumi:"appFamily"`
// ID of the developer app.
AppId pulumi.StringOutput `pulumi:"appId"`
// List of attributes for the developer app.
Attributes GoogleCloudApigeeV1AttributeResponseArrayOutput `pulumi:"attributes"`
// Callback URL used by OAuth 2.0 authorization servers to communicate authorization codes back to developer apps.
CallbackUrl pulumi.StringOutput `pulumi:"callbackUrl"`
// Time the developer app was created in milliseconds since epoch.
CreatedAt pulumi.StringOutput `pulumi:"createdAt"`
// Set of credentials for the developer app consisting of the consumer key/secret pairs associated with the API products.
Credentials GoogleCloudApigeeV1CredentialResponseArrayOutput `pulumi:"credentials"`
DeveloperId pulumi.StringOutput `pulumi:"developerId"`
// Expiration time, in milliseconds, for the consumer key that is generated for the developer app. If not set or left to the default value of `-1`, the API key never expires. The expiration time can't be updated after it is set.
KeyExpiresIn pulumi.StringOutput `pulumi:"keyExpiresIn"`
// Time the developer app was modified in milliseconds since epoch.
LastModifiedAt pulumi.StringOutput `pulumi:"lastModifiedAt"`
// Name of the developer app.
Name pulumi.StringOutput `pulumi:"name"`
OrganizationId pulumi.StringOutput `pulumi:"organizationId"`
// Scopes to apply to the developer app. The specified scopes must already exist for the API product that you associate with the developer app.
Scopes pulumi.StringArrayOutput `pulumi:"scopes"`
// Status of the credential. Valid values include `approved` or `revoked`.
Status pulumi.StringOutput `pulumi:"status"`
}
// NewDeveloperApp registers a new resource with the given unique name, arguments, and options.
func NewDeveloperApp(ctx *pulumi.Context,
name string, args *DeveloperAppArgs, opts ...pulumi.ResourceOption) (*DeveloperApp, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.DeveloperId == nil {
return nil, errors.New("invalid value for required argument 'DeveloperId'")
}
if args.OrganizationId == nil {
return nil, errors.New("invalid value for required argument 'OrganizationId'")
}
replaceOnChanges := pulumi.ReplaceOnChanges([]string{
"developerId",
"organizationId",
})
opts = append(opts, replaceOnChanges)
opts = internal.PkgResourceDefaultOpts(opts)
var resource DeveloperApp
err := ctx.RegisterResource("google-native:apigee/v1:DeveloperApp", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetDeveloperApp gets an existing DeveloperApp 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 GetDeveloperApp(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *DeveloperAppState, opts ...pulumi.ResourceOption) (*DeveloperApp, error) {
var resource DeveloperApp
err := ctx.ReadResource("google-native:apigee/v1:DeveloperApp", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering DeveloperApp resources.
type developerAppState struct {
}
type DeveloperAppState struct {
}
func (DeveloperAppState) ElementType() reflect.Type {
return reflect.TypeOf((*developerAppState)(nil)).Elem()
}
type developerAppArgs struct {
// List of API products associated with the developer app.
ApiProducts []string `pulumi:"apiProducts"`
// Developer app family.
AppFamily *string `pulumi:"appFamily"`
// ID of the developer app.
AppId *string `pulumi:"appId"`
// List of attributes for the developer app.
Attributes []GoogleCloudApigeeV1Attribute `pulumi:"attributes"`
// Callback URL used by OAuth 2.0 authorization servers to communicate authorization codes back to developer apps.
CallbackUrl *string `pulumi:"callbackUrl"`
// ID of the developer.
DeveloperId string `pulumi:"developerId"`
// Expiration time, in milliseconds, for the consumer key that is generated for the developer app. If not set or left to the default value of `-1`, the API key never expires. The expiration time can't be updated after it is set.
KeyExpiresIn *string `pulumi:"keyExpiresIn"`
// Name of the developer app.
Name *string `pulumi:"name"`
OrganizationId string `pulumi:"organizationId"`
// Scopes to apply to the developer app. The specified scopes must already exist for the API product that you associate with the developer app.
Scopes []string `pulumi:"scopes"`
// Status of the credential. Valid values include `approved` or `revoked`.
Status *string `pulumi:"status"`
}
// The set of arguments for constructing a DeveloperApp resource.
type DeveloperAppArgs struct {
// List of API products associated with the developer app.
ApiProducts pulumi.StringArrayInput
// Developer app family.
AppFamily pulumi.StringPtrInput
// ID of the developer app.
AppId pulumi.StringPtrInput
// List of attributes for the developer app.
Attributes GoogleCloudApigeeV1AttributeArrayInput
// Callback URL used by OAuth 2.0 authorization servers to communicate authorization codes back to developer apps.
CallbackUrl pulumi.StringPtrInput
// ID of the developer.
DeveloperId pulumi.StringInput
// Expiration time, in milliseconds, for the consumer key that is generated for the developer app. If not set or left to the default value of `-1`, the API key never expires. The expiration time can't be updated after it is set.
KeyExpiresIn pulumi.StringPtrInput
// Name of the developer app.
Name pulumi.StringPtrInput
OrganizationId pulumi.StringInput
// Scopes to apply to the developer app. The specified scopes must already exist for the API product that you associate with the developer app.
Scopes pulumi.StringArrayInput
// Status of the credential. Valid values include `approved` or `revoked`.
Status pulumi.StringPtrInput
}
func (DeveloperAppArgs) ElementType() reflect.Type {
return reflect.TypeOf((*developerAppArgs)(nil)).Elem()
}
type DeveloperAppInput interface {
pulumi.Input
ToDeveloperAppOutput() DeveloperAppOutput
ToDeveloperAppOutputWithContext(ctx context.Context) DeveloperAppOutput
}
func (*DeveloperApp) ElementType() reflect.Type {
return reflect.TypeOf((**DeveloperApp)(nil)).Elem()
}
func (i *DeveloperApp) ToDeveloperAppOutput() DeveloperAppOutput {
return i.ToDeveloperAppOutputWithContext(context.Background())
}
func (i *DeveloperApp) ToDeveloperAppOutputWithContext(ctx context.Context) DeveloperAppOutput {
return pulumi.ToOutputWithContext(ctx, i).(DeveloperAppOutput)
}
type DeveloperAppOutput struct{ *pulumi.OutputState }
func (DeveloperAppOutput) ElementType() reflect.Type {
return reflect.TypeOf((**DeveloperApp)(nil)).Elem()
}
func (o DeveloperAppOutput) ToDeveloperAppOutput() DeveloperAppOutput {
return o
}
func (o DeveloperAppOutput) ToDeveloperAppOutputWithContext(ctx context.Context) DeveloperAppOutput {
return o
}
// List of API products associated with the developer app.
func (o DeveloperAppOutput) ApiProducts() pulumi.StringArrayOutput {
return o.ApplyT(func(v *DeveloperApp) pulumi.StringArrayOutput { return v.ApiProducts }).(pulumi.StringArrayOutput)
}
// Developer app family.
func (o DeveloperAppOutput) AppFamily() pulumi.StringOutput {
return o.ApplyT(func(v *DeveloperApp) pulumi.StringOutput { return v.AppFamily }).(pulumi.StringOutput)
}
// ID of the developer app.
func (o DeveloperAppOutput) AppId() pulumi.StringOutput {
return o.ApplyT(func(v *DeveloperApp) pulumi.StringOutput { return v.AppId }).(pulumi.StringOutput)
}
// List of attributes for the developer app.
func (o DeveloperAppOutput) Attributes() GoogleCloudApigeeV1AttributeResponseArrayOutput {
return o.ApplyT(func(v *DeveloperApp) GoogleCloudApigeeV1AttributeResponseArrayOutput { return v.Attributes }).(GoogleCloudApigeeV1AttributeResponseArrayOutput)
}
// Callback URL used by OAuth 2.0 authorization servers to communicate authorization codes back to developer apps.
func (o DeveloperAppOutput) CallbackUrl() pulumi.StringOutput {
return o.ApplyT(func(v *DeveloperApp) pulumi.StringOutput { return v.CallbackUrl }).(pulumi.StringOutput)
}
// Time the developer app was created in milliseconds since epoch.
func (o DeveloperAppOutput) CreatedAt() pulumi.StringOutput {
return o.ApplyT(func(v *DeveloperApp) pulumi.StringOutput { return v.CreatedAt }).(pulumi.StringOutput)
}
// Set of credentials for the developer app consisting of the consumer key/secret pairs associated with the API products.
func (o DeveloperAppOutput) Credentials() GoogleCloudApigeeV1CredentialResponseArrayOutput {
return o.ApplyT(func(v *DeveloperApp) GoogleCloudApigeeV1CredentialResponseArrayOutput { return v.Credentials }).(GoogleCloudApigeeV1CredentialResponseArrayOutput)
}
func (o DeveloperAppOutput) DeveloperId() pulumi.StringOutput {
return o.ApplyT(func(v *DeveloperApp) pulumi.StringOutput { return v.DeveloperId }).(pulumi.StringOutput)
}
// Expiration time, in milliseconds, for the consumer key that is generated for the developer app. If not set or left to the default value of `-1`, the API key never expires. The expiration time can't be updated after it is set.
func (o DeveloperAppOutput) KeyExpiresIn() pulumi.StringOutput {
return o.ApplyT(func(v *DeveloperApp) pulumi.StringOutput { return v.KeyExpiresIn }).(pulumi.StringOutput)
}
// Time the developer app was modified in milliseconds since epoch.
func (o DeveloperAppOutput) LastModifiedAt() pulumi.StringOutput {
return o.ApplyT(func(v *DeveloperApp) pulumi.StringOutput { return v.LastModifiedAt }).(pulumi.StringOutput)
}
// Name of the developer app.
func (o DeveloperAppOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *DeveloperApp) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
func (o DeveloperAppOutput) OrganizationId() pulumi.StringOutput {
return o.ApplyT(func(v *DeveloperApp) pulumi.StringOutput { return v.OrganizationId }).(pulumi.StringOutput)
}
// Scopes to apply to the developer app. The specified scopes must already exist for the API product that you associate with the developer app.
func (o DeveloperAppOutput) Scopes() pulumi.StringArrayOutput {
return o.ApplyT(func(v *DeveloperApp) pulumi.StringArrayOutput { return v.Scopes }).(pulumi.StringArrayOutput)
}
// Status of the credential. Valid values include `approved` or `revoked`.
func (o DeveloperAppOutput) Status() pulumi.StringOutput {
return o.ApplyT(func(v *DeveloperApp) pulumi.StringOutput { return v.Status }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*DeveloperAppInput)(nil)).Elem(), &DeveloperApp{})
pulumi.RegisterOutputType(DeveloperAppOutput{})
}