/
sharedflow.go
357 lines (303 loc) · 13.2 KB
/
sharedflow.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
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package apigee
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// You can combine policies and resources into a shared flow that you can consume from multiple API proxies, and even from other shared flows. Although it's like a proxy, a shared flow has no endpoint. It can be used only from an API proxy or shared flow that's in the same organization as the shared flow itself.
//
// To get more information about SharedFlow, see:
//
// * [API documentation](https://cloud.google.com/apigee/docs/reference/apis/apigee/rest/v1/organizations.sharedflows)
// * How-to Guides
// - [Sharedflows](https://cloud.google.com/apigee/docs/resources)
//
// ## Import
//
// SharedFlow can be imported using any of these accepted formats:
//
// * `{{org_id}}/sharedflows/{{name}}`
//
// * `{{org_id}}/{{name}}`
//
// When using the `pulumi import` command, SharedFlow can be imported using one of the formats above. For example:
//
// ```sh
// $ pulumi import gcp:apigee/sharedflow:Sharedflow default {{org_id}}/sharedflows/{{name}}
// ```
//
// ```sh
// $ pulumi import gcp:apigee/sharedflow:Sharedflow default {{org_id}}/{{name}}
// ```
type Sharedflow struct {
pulumi.CustomResourceState
// Path to the config zip bundle.
//
// ***
ConfigBundle pulumi.StringOutput `pulumi:"configBundle"`
// A hash of local config bundle in string, user needs to use a Terraform Hash function of their choice. A change in hash
// will trigger an update.
DetectMd5hash pulumi.StringPtrOutput `pulumi:"detectMd5hash"`
// The id of the most recently created revision for this shared flow.
LatestRevisionId pulumi.StringOutput `pulumi:"latestRevisionId"`
// (Computed) Base 64 MD5 hash of the uploaded data. It is speculative as remote does not return hash of the bundle. Remote changes are detected using returned lastModified timestamp.
Md5hash pulumi.StringOutput `pulumi:"md5hash"`
// Metadata describing the shared flow.
// Structure is documented below.
MetaDatas SharedflowMetaDataArrayOutput `pulumi:"metaDatas"`
// The ID of the shared flow.
Name pulumi.StringOutput `pulumi:"name"`
// The Apigee Organization name associated with the Apigee instance.
OrgId pulumi.StringOutput `pulumi:"orgId"`
// A list of revisions of this shared flow.
Revisions pulumi.StringArrayOutput `pulumi:"revisions"`
}
// NewSharedflow registers a new resource with the given unique name, arguments, and options.
func NewSharedflow(ctx *pulumi.Context,
name string, args *SharedflowArgs, opts ...pulumi.ResourceOption) (*Sharedflow, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ConfigBundle == nil {
return nil, errors.New("invalid value for required argument 'ConfigBundle'")
}
if args.OrgId == nil {
return nil, errors.New("invalid value for required argument 'OrgId'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource Sharedflow
err := ctx.RegisterResource("gcp:apigee/sharedflow:Sharedflow", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetSharedflow gets an existing Sharedflow 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 GetSharedflow(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *SharedflowState, opts ...pulumi.ResourceOption) (*Sharedflow, error) {
var resource Sharedflow
err := ctx.ReadResource("gcp:apigee/sharedflow:Sharedflow", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Sharedflow resources.
type sharedflowState struct {
// Path to the config zip bundle.
//
// ***
ConfigBundle *string `pulumi:"configBundle"`
// A hash of local config bundle in string, user needs to use a Terraform Hash function of their choice. A change in hash
// will trigger an update.
DetectMd5hash *string `pulumi:"detectMd5hash"`
// The id of the most recently created revision for this shared flow.
LatestRevisionId *string `pulumi:"latestRevisionId"`
// (Computed) Base 64 MD5 hash of the uploaded data. It is speculative as remote does not return hash of the bundle. Remote changes are detected using returned lastModified timestamp.
Md5hash *string `pulumi:"md5hash"`
// Metadata describing the shared flow.
// Structure is documented below.
MetaDatas []SharedflowMetaData `pulumi:"metaDatas"`
// The ID of the shared flow.
Name *string `pulumi:"name"`
// The Apigee Organization name associated with the Apigee instance.
OrgId *string `pulumi:"orgId"`
// A list of revisions of this shared flow.
Revisions []string `pulumi:"revisions"`
}
type SharedflowState struct {
// Path to the config zip bundle.
//
// ***
ConfigBundle pulumi.StringPtrInput
// A hash of local config bundle in string, user needs to use a Terraform Hash function of their choice. A change in hash
// will trigger an update.
DetectMd5hash pulumi.StringPtrInput
// The id of the most recently created revision for this shared flow.
LatestRevisionId pulumi.StringPtrInput
// (Computed) Base 64 MD5 hash of the uploaded data. It is speculative as remote does not return hash of the bundle. Remote changes are detected using returned lastModified timestamp.
Md5hash pulumi.StringPtrInput
// Metadata describing the shared flow.
// Structure is documented below.
MetaDatas SharedflowMetaDataArrayInput
// The ID of the shared flow.
Name pulumi.StringPtrInput
// The Apigee Organization name associated with the Apigee instance.
OrgId pulumi.StringPtrInput
// A list of revisions of this shared flow.
Revisions pulumi.StringArrayInput
}
func (SharedflowState) ElementType() reflect.Type {
return reflect.TypeOf((*sharedflowState)(nil)).Elem()
}
type sharedflowArgs struct {
// Path to the config zip bundle.
//
// ***
ConfigBundle string `pulumi:"configBundle"`
// A hash of local config bundle in string, user needs to use a Terraform Hash function of their choice. A change in hash
// will trigger an update.
DetectMd5hash *string `pulumi:"detectMd5hash"`
// The ID of the shared flow.
Name *string `pulumi:"name"`
// The Apigee Organization name associated with the Apigee instance.
OrgId string `pulumi:"orgId"`
}
// The set of arguments for constructing a Sharedflow resource.
type SharedflowArgs struct {
// Path to the config zip bundle.
//
// ***
ConfigBundle pulumi.StringInput
// A hash of local config bundle in string, user needs to use a Terraform Hash function of their choice. A change in hash
// will trigger an update.
DetectMd5hash pulumi.StringPtrInput
// The ID of the shared flow.
Name pulumi.StringPtrInput
// The Apigee Organization name associated with the Apigee instance.
OrgId pulumi.StringInput
}
func (SharedflowArgs) ElementType() reflect.Type {
return reflect.TypeOf((*sharedflowArgs)(nil)).Elem()
}
type SharedflowInput interface {
pulumi.Input
ToSharedflowOutput() SharedflowOutput
ToSharedflowOutputWithContext(ctx context.Context) SharedflowOutput
}
func (*Sharedflow) ElementType() reflect.Type {
return reflect.TypeOf((**Sharedflow)(nil)).Elem()
}
func (i *Sharedflow) ToSharedflowOutput() SharedflowOutput {
return i.ToSharedflowOutputWithContext(context.Background())
}
func (i *Sharedflow) ToSharedflowOutputWithContext(ctx context.Context) SharedflowOutput {
return pulumi.ToOutputWithContext(ctx, i).(SharedflowOutput)
}
// SharedflowArrayInput is an input type that accepts SharedflowArray and SharedflowArrayOutput values.
// You can construct a concrete instance of `SharedflowArrayInput` via:
//
// SharedflowArray{ SharedflowArgs{...} }
type SharedflowArrayInput interface {
pulumi.Input
ToSharedflowArrayOutput() SharedflowArrayOutput
ToSharedflowArrayOutputWithContext(context.Context) SharedflowArrayOutput
}
type SharedflowArray []SharedflowInput
func (SharedflowArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Sharedflow)(nil)).Elem()
}
func (i SharedflowArray) ToSharedflowArrayOutput() SharedflowArrayOutput {
return i.ToSharedflowArrayOutputWithContext(context.Background())
}
func (i SharedflowArray) ToSharedflowArrayOutputWithContext(ctx context.Context) SharedflowArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(SharedflowArrayOutput)
}
// SharedflowMapInput is an input type that accepts SharedflowMap and SharedflowMapOutput values.
// You can construct a concrete instance of `SharedflowMapInput` via:
//
// SharedflowMap{ "key": SharedflowArgs{...} }
type SharedflowMapInput interface {
pulumi.Input
ToSharedflowMapOutput() SharedflowMapOutput
ToSharedflowMapOutputWithContext(context.Context) SharedflowMapOutput
}
type SharedflowMap map[string]SharedflowInput
func (SharedflowMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Sharedflow)(nil)).Elem()
}
func (i SharedflowMap) ToSharedflowMapOutput() SharedflowMapOutput {
return i.ToSharedflowMapOutputWithContext(context.Background())
}
func (i SharedflowMap) ToSharedflowMapOutputWithContext(ctx context.Context) SharedflowMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(SharedflowMapOutput)
}
type SharedflowOutput struct{ *pulumi.OutputState }
func (SharedflowOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Sharedflow)(nil)).Elem()
}
func (o SharedflowOutput) ToSharedflowOutput() SharedflowOutput {
return o
}
func (o SharedflowOutput) ToSharedflowOutputWithContext(ctx context.Context) SharedflowOutput {
return o
}
// Path to the config zip bundle.
//
// ***
func (o SharedflowOutput) ConfigBundle() pulumi.StringOutput {
return o.ApplyT(func(v *Sharedflow) pulumi.StringOutput { return v.ConfigBundle }).(pulumi.StringOutput)
}
// A hash of local config bundle in string, user needs to use a Terraform Hash function of their choice. A change in hash
// will trigger an update.
func (o SharedflowOutput) DetectMd5hash() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Sharedflow) pulumi.StringPtrOutput { return v.DetectMd5hash }).(pulumi.StringPtrOutput)
}
// The id of the most recently created revision for this shared flow.
func (o SharedflowOutput) LatestRevisionId() pulumi.StringOutput {
return o.ApplyT(func(v *Sharedflow) pulumi.StringOutput { return v.LatestRevisionId }).(pulumi.StringOutput)
}
// (Computed) Base 64 MD5 hash of the uploaded data. It is speculative as remote does not return hash of the bundle. Remote changes are detected using returned lastModified timestamp.
func (o SharedflowOutput) Md5hash() pulumi.StringOutput {
return o.ApplyT(func(v *Sharedflow) pulumi.StringOutput { return v.Md5hash }).(pulumi.StringOutput)
}
// Metadata describing the shared flow.
// Structure is documented below.
func (o SharedflowOutput) MetaDatas() SharedflowMetaDataArrayOutput {
return o.ApplyT(func(v *Sharedflow) SharedflowMetaDataArrayOutput { return v.MetaDatas }).(SharedflowMetaDataArrayOutput)
}
// The ID of the shared flow.
func (o SharedflowOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *Sharedflow) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// The Apigee Organization name associated with the Apigee instance.
func (o SharedflowOutput) OrgId() pulumi.StringOutput {
return o.ApplyT(func(v *Sharedflow) pulumi.StringOutput { return v.OrgId }).(pulumi.StringOutput)
}
// A list of revisions of this shared flow.
func (o SharedflowOutput) Revisions() pulumi.StringArrayOutput {
return o.ApplyT(func(v *Sharedflow) pulumi.StringArrayOutput { return v.Revisions }).(pulumi.StringArrayOutput)
}
type SharedflowArrayOutput struct{ *pulumi.OutputState }
func (SharedflowArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Sharedflow)(nil)).Elem()
}
func (o SharedflowArrayOutput) ToSharedflowArrayOutput() SharedflowArrayOutput {
return o
}
func (o SharedflowArrayOutput) ToSharedflowArrayOutputWithContext(ctx context.Context) SharedflowArrayOutput {
return o
}
func (o SharedflowArrayOutput) Index(i pulumi.IntInput) SharedflowOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Sharedflow {
return vs[0].([]*Sharedflow)[vs[1].(int)]
}).(SharedflowOutput)
}
type SharedflowMapOutput struct{ *pulumi.OutputState }
func (SharedflowMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Sharedflow)(nil)).Elem()
}
func (o SharedflowMapOutput) ToSharedflowMapOutput() SharedflowMapOutput {
return o
}
func (o SharedflowMapOutput) ToSharedflowMapOutputWithContext(ctx context.Context) SharedflowMapOutput {
return o
}
func (o SharedflowMapOutput) MapIndex(k pulumi.StringInput) SharedflowOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Sharedflow {
return vs[0].(map[string]*Sharedflow)[vs[1].(string)]
}).(SharedflowOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*SharedflowInput)(nil)).Elem(), &Sharedflow{})
pulumi.RegisterInputType(reflect.TypeOf((*SharedflowArrayInput)(nil)).Elem(), SharedflowArray{})
pulumi.RegisterInputType(reflect.TypeOf((*SharedflowMapInput)(nil)).Elem(), SharedflowMap{})
pulumi.RegisterOutputType(SharedflowOutput{})
pulumi.RegisterOutputType(SharedflowArrayOutput{})
pulumi.RegisterOutputType(SharedflowMapOutput{})
}