/
integrationAccountAgreement.go
418 lines (372 loc) · 19.3 KB
/
integrationAccountAgreement.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
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package logicapps
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a Logic App Integration Account Agreement.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "io/ioutil"
//
// "github.com/pulumi/pulumi-azure/sdk/v4/go/azure/core"
// "github.com/pulumi/pulumi-azure/sdk/v4/go/azure/logicapps"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func readFileOrPanic(path string) pulumi.StringPtrInput {
// data, err := ioutil.ReadFile(path)
// if err != nil {
// panic(err.Error())
// }
// return pulumi.String(string(data))
// }
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// testResourceGroup, err := core.NewResourceGroup(ctx, "testResourceGroup", &core.ResourceGroupArgs{
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// testIntegrationAccount, err := logicapps.NewIntegrationAccount(ctx, "testIntegrationAccount", &logicapps.IntegrationAccountArgs{
// Location: testResourceGroup.Location,
// ResourceGroupName: testResourceGroup.Name,
// SkuName: pulumi.String("Standard"),
// })
// if err != nil {
// return err
// }
// host, err := logicapps.NewIntegrationAccountPartner(ctx, "host", &logicapps.IntegrationAccountPartnerArgs{
// ResourceGroupName: testResourceGroup.Name,
// IntegrationAccountName: testIntegrationAccount.Name,
// BusinessIdentities: logicapps.IntegrationAccountPartnerBusinessIdentityArray{
// &logicapps.IntegrationAccountPartnerBusinessIdentityArgs{
// Qualifier: pulumi.String("AS2Identity"),
// Value: pulumi.String("FabrikamNY"),
// },
// },
// })
// if err != nil {
// return err
// }
// guest, err := logicapps.NewIntegrationAccountPartner(ctx, "guest", &logicapps.IntegrationAccountPartnerArgs{
// ResourceGroupName: testResourceGroup.Name,
// IntegrationAccountName: testIntegrationAccount.Name,
// BusinessIdentities: logicapps.IntegrationAccountPartnerBusinessIdentityArray{
// &logicapps.IntegrationAccountPartnerBusinessIdentityArgs{
// Qualifier: pulumi.String("AS2Identity"),
// Value: pulumi.String("FabrikamDC"),
// },
// },
// })
// if err != nil {
// return err
// }
// _, err = logicapps.NewIntegrationAccountAgreement(ctx, "testIntegrationAccountAgreement", &logicapps.IntegrationAccountAgreementArgs{
// ResourceGroupName: testResourceGroup.Name,
// IntegrationAccountName: testIntegrationAccount.Name,
// AgreementType: pulumi.String("AS2"),
// HostPartnerName: host.Name,
// GuestPartnerName: guest.Name,
// Content: readFileOrPanic("testdata/integration_account_agreement_content_as2.json"),
// HostIdentity: &logicapps.IntegrationAccountAgreementHostIdentityArgs{
// Qualifier: pulumi.String("AS2Identity"),
// Value: pulumi.String("FabrikamNY"),
// },
// GuestIdentity: &logicapps.IntegrationAccountAgreementGuestIdentityArgs{
// Qualifier: pulumi.String("AS2Identity"),
// Value: pulumi.String("FabrikamDC"),
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
//
// ## Import
//
// Logic App Integration Account Agreements can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:logicapps/integrationAccountAgreement:IntegrationAccountAgreement example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Logic/integrationAccounts/account1/agreements/agreement1
// ```
type IntegrationAccountAgreement struct {
pulumi.CustomResourceState
// The type of the Logic App Integration Account Agreement. Possible values are `AS2`, `X12` and `Edifact`.
AgreementType pulumi.StringOutput `pulumi:"agreementType"`
// The content of the Logic App Integration Account Agreement.
Content pulumi.StringOutput `pulumi:"content"`
// A `guestIdentity` block as documented below.
GuestIdentity IntegrationAccountAgreementGuestIdentityOutput `pulumi:"guestIdentity"`
// The name of the guest Logic App Integration Account Partner.
GuestPartnerName pulumi.StringOutput `pulumi:"guestPartnerName"`
// A `hostIdentity` block as documented below.
HostIdentity IntegrationAccountAgreementHostIdentityOutput `pulumi:"hostIdentity"`
// The name of the host Logic App Integration Account Partner.
HostPartnerName pulumi.StringOutput `pulumi:"hostPartnerName"`
// The name of the Logic App Integration Account. Changing this forces a new resource to be created.
IntegrationAccountName pulumi.StringOutput `pulumi:"integrationAccountName"`
// The metadata of the Logic App Integration Account Agreement.
Metadata pulumi.StringMapOutput `pulumi:"metadata"`
// The name which should be used for this Logic App Integration Account Agreement. Changing this forces a new resource to be created.
Name pulumi.StringOutput `pulumi:"name"`
// The name of the Resource Group where the Logic App Integration Account Agreement should exist. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringOutput `pulumi:"resourceGroupName"`
}
// NewIntegrationAccountAgreement registers a new resource with the given unique name, arguments, and options.
func NewIntegrationAccountAgreement(ctx *pulumi.Context,
name string, args *IntegrationAccountAgreementArgs, opts ...pulumi.ResourceOption) (*IntegrationAccountAgreement, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.AgreementType == nil {
return nil, errors.New("invalid value for required argument 'AgreementType'")
}
if args.Content == nil {
return nil, errors.New("invalid value for required argument 'Content'")
}
if args.GuestIdentity == nil {
return nil, errors.New("invalid value for required argument 'GuestIdentity'")
}
if args.GuestPartnerName == nil {
return nil, errors.New("invalid value for required argument 'GuestPartnerName'")
}
if args.HostIdentity == nil {
return nil, errors.New("invalid value for required argument 'HostIdentity'")
}
if args.HostPartnerName == nil {
return nil, errors.New("invalid value for required argument 'HostPartnerName'")
}
if args.IntegrationAccountName == nil {
return nil, errors.New("invalid value for required argument 'IntegrationAccountName'")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
var resource IntegrationAccountAgreement
err := ctx.RegisterResource("azure:logicapps/integrationAccountAgreement:IntegrationAccountAgreement", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetIntegrationAccountAgreement gets an existing IntegrationAccountAgreement 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 GetIntegrationAccountAgreement(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *IntegrationAccountAgreementState, opts ...pulumi.ResourceOption) (*IntegrationAccountAgreement, error) {
var resource IntegrationAccountAgreement
err := ctx.ReadResource("azure:logicapps/integrationAccountAgreement:IntegrationAccountAgreement", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering IntegrationAccountAgreement resources.
type integrationAccountAgreementState struct {
// The type of the Logic App Integration Account Agreement. Possible values are `AS2`, `X12` and `Edifact`.
AgreementType *string `pulumi:"agreementType"`
// The content of the Logic App Integration Account Agreement.
Content *string `pulumi:"content"`
// A `guestIdentity` block as documented below.
GuestIdentity *IntegrationAccountAgreementGuestIdentity `pulumi:"guestIdentity"`
// The name of the guest Logic App Integration Account Partner.
GuestPartnerName *string `pulumi:"guestPartnerName"`
// A `hostIdentity` block as documented below.
HostIdentity *IntegrationAccountAgreementHostIdentity `pulumi:"hostIdentity"`
// The name of the host Logic App Integration Account Partner.
HostPartnerName *string `pulumi:"hostPartnerName"`
// The name of the Logic App Integration Account. Changing this forces a new resource to be created.
IntegrationAccountName *string `pulumi:"integrationAccountName"`
// The metadata of the Logic App Integration Account Agreement.
Metadata map[string]string `pulumi:"metadata"`
// The name which should be used for this Logic App Integration Account Agreement. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// The name of the Resource Group where the Logic App Integration Account Agreement should exist. Changing this forces a new resource to be created.
ResourceGroupName *string `pulumi:"resourceGroupName"`
}
type IntegrationAccountAgreementState struct {
// The type of the Logic App Integration Account Agreement. Possible values are `AS2`, `X12` and `Edifact`.
AgreementType pulumi.StringPtrInput
// The content of the Logic App Integration Account Agreement.
Content pulumi.StringPtrInput
// A `guestIdentity` block as documented below.
GuestIdentity IntegrationAccountAgreementGuestIdentityPtrInput
// The name of the guest Logic App Integration Account Partner.
GuestPartnerName pulumi.StringPtrInput
// A `hostIdentity` block as documented below.
HostIdentity IntegrationAccountAgreementHostIdentityPtrInput
// The name of the host Logic App Integration Account Partner.
HostPartnerName pulumi.StringPtrInput
// The name of the Logic App Integration Account. Changing this forces a new resource to be created.
IntegrationAccountName pulumi.StringPtrInput
// The metadata of the Logic App Integration Account Agreement.
Metadata pulumi.StringMapInput
// The name which should be used for this Logic App Integration Account Agreement. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// The name of the Resource Group where the Logic App Integration Account Agreement should exist. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringPtrInput
}
func (IntegrationAccountAgreementState) ElementType() reflect.Type {
return reflect.TypeOf((*integrationAccountAgreementState)(nil)).Elem()
}
type integrationAccountAgreementArgs struct {
// The type of the Logic App Integration Account Agreement. Possible values are `AS2`, `X12` and `Edifact`.
AgreementType string `pulumi:"agreementType"`
// The content of the Logic App Integration Account Agreement.
Content string `pulumi:"content"`
// A `guestIdentity` block as documented below.
GuestIdentity IntegrationAccountAgreementGuestIdentity `pulumi:"guestIdentity"`
// The name of the guest Logic App Integration Account Partner.
GuestPartnerName string `pulumi:"guestPartnerName"`
// A `hostIdentity` block as documented below.
HostIdentity IntegrationAccountAgreementHostIdentity `pulumi:"hostIdentity"`
// The name of the host Logic App Integration Account Partner.
HostPartnerName string `pulumi:"hostPartnerName"`
// The name of the Logic App Integration Account. Changing this forces a new resource to be created.
IntegrationAccountName string `pulumi:"integrationAccountName"`
// The metadata of the Logic App Integration Account Agreement.
Metadata map[string]string `pulumi:"metadata"`
// The name which should be used for this Logic App Integration Account Agreement. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// The name of the Resource Group where the Logic App Integration Account Agreement should exist. Changing this forces a new resource to be created.
ResourceGroupName string `pulumi:"resourceGroupName"`
}
// The set of arguments for constructing a IntegrationAccountAgreement resource.
type IntegrationAccountAgreementArgs struct {
// The type of the Logic App Integration Account Agreement. Possible values are `AS2`, `X12` and `Edifact`.
AgreementType pulumi.StringInput
// The content of the Logic App Integration Account Agreement.
Content pulumi.StringInput
// A `guestIdentity` block as documented below.
GuestIdentity IntegrationAccountAgreementGuestIdentityInput
// The name of the guest Logic App Integration Account Partner.
GuestPartnerName pulumi.StringInput
// A `hostIdentity` block as documented below.
HostIdentity IntegrationAccountAgreementHostIdentityInput
// The name of the host Logic App Integration Account Partner.
HostPartnerName pulumi.StringInput
// The name of the Logic App Integration Account. Changing this forces a new resource to be created.
IntegrationAccountName pulumi.StringInput
// The metadata of the Logic App Integration Account Agreement.
Metadata pulumi.StringMapInput
// The name which should be used for this Logic App Integration Account Agreement. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// The name of the Resource Group where the Logic App Integration Account Agreement should exist. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringInput
}
func (IntegrationAccountAgreementArgs) ElementType() reflect.Type {
return reflect.TypeOf((*integrationAccountAgreementArgs)(nil)).Elem()
}
type IntegrationAccountAgreementInput interface {
pulumi.Input
ToIntegrationAccountAgreementOutput() IntegrationAccountAgreementOutput
ToIntegrationAccountAgreementOutputWithContext(ctx context.Context) IntegrationAccountAgreementOutput
}
func (*IntegrationAccountAgreement) ElementType() reflect.Type {
return reflect.TypeOf((**IntegrationAccountAgreement)(nil)).Elem()
}
func (i *IntegrationAccountAgreement) ToIntegrationAccountAgreementOutput() IntegrationAccountAgreementOutput {
return i.ToIntegrationAccountAgreementOutputWithContext(context.Background())
}
func (i *IntegrationAccountAgreement) ToIntegrationAccountAgreementOutputWithContext(ctx context.Context) IntegrationAccountAgreementOutput {
return pulumi.ToOutputWithContext(ctx, i).(IntegrationAccountAgreementOutput)
}
// IntegrationAccountAgreementArrayInput is an input type that accepts IntegrationAccountAgreementArray and IntegrationAccountAgreementArrayOutput values.
// You can construct a concrete instance of `IntegrationAccountAgreementArrayInput` via:
//
// IntegrationAccountAgreementArray{ IntegrationAccountAgreementArgs{...} }
type IntegrationAccountAgreementArrayInput interface {
pulumi.Input
ToIntegrationAccountAgreementArrayOutput() IntegrationAccountAgreementArrayOutput
ToIntegrationAccountAgreementArrayOutputWithContext(context.Context) IntegrationAccountAgreementArrayOutput
}
type IntegrationAccountAgreementArray []IntegrationAccountAgreementInput
func (IntegrationAccountAgreementArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*IntegrationAccountAgreement)(nil)).Elem()
}
func (i IntegrationAccountAgreementArray) ToIntegrationAccountAgreementArrayOutput() IntegrationAccountAgreementArrayOutput {
return i.ToIntegrationAccountAgreementArrayOutputWithContext(context.Background())
}
func (i IntegrationAccountAgreementArray) ToIntegrationAccountAgreementArrayOutputWithContext(ctx context.Context) IntegrationAccountAgreementArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(IntegrationAccountAgreementArrayOutput)
}
// IntegrationAccountAgreementMapInput is an input type that accepts IntegrationAccountAgreementMap and IntegrationAccountAgreementMapOutput values.
// You can construct a concrete instance of `IntegrationAccountAgreementMapInput` via:
//
// IntegrationAccountAgreementMap{ "key": IntegrationAccountAgreementArgs{...} }
type IntegrationAccountAgreementMapInput interface {
pulumi.Input
ToIntegrationAccountAgreementMapOutput() IntegrationAccountAgreementMapOutput
ToIntegrationAccountAgreementMapOutputWithContext(context.Context) IntegrationAccountAgreementMapOutput
}
type IntegrationAccountAgreementMap map[string]IntegrationAccountAgreementInput
func (IntegrationAccountAgreementMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*IntegrationAccountAgreement)(nil)).Elem()
}
func (i IntegrationAccountAgreementMap) ToIntegrationAccountAgreementMapOutput() IntegrationAccountAgreementMapOutput {
return i.ToIntegrationAccountAgreementMapOutputWithContext(context.Background())
}
func (i IntegrationAccountAgreementMap) ToIntegrationAccountAgreementMapOutputWithContext(ctx context.Context) IntegrationAccountAgreementMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(IntegrationAccountAgreementMapOutput)
}
type IntegrationAccountAgreementOutput struct{ *pulumi.OutputState }
func (IntegrationAccountAgreementOutput) ElementType() reflect.Type {
return reflect.TypeOf((**IntegrationAccountAgreement)(nil)).Elem()
}
func (o IntegrationAccountAgreementOutput) ToIntegrationAccountAgreementOutput() IntegrationAccountAgreementOutput {
return o
}
func (o IntegrationAccountAgreementOutput) ToIntegrationAccountAgreementOutputWithContext(ctx context.Context) IntegrationAccountAgreementOutput {
return o
}
type IntegrationAccountAgreementArrayOutput struct{ *pulumi.OutputState }
func (IntegrationAccountAgreementArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*IntegrationAccountAgreement)(nil)).Elem()
}
func (o IntegrationAccountAgreementArrayOutput) ToIntegrationAccountAgreementArrayOutput() IntegrationAccountAgreementArrayOutput {
return o
}
func (o IntegrationAccountAgreementArrayOutput) ToIntegrationAccountAgreementArrayOutputWithContext(ctx context.Context) IntegrationAccountAgreementArrayOutput {
return o
}
func (o IntegrationAccountAgreementArrayOutput) Index(i pulumi.IntInput) IntegrationAccountAgreementOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *IntegrationAccountAgreement {
return vs[0].([]*IntegrationAccountAgreement)[vs[1].(int)]
}).(IntegrationAccountAgreementOutput)
}
type IntegrationAccountAgreementMapOutput struct{ *pulumi.OutputState }
func (IntegrationAccountAgreementMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*IntegrationAccountAgreement)(nil)).Elem()
}
func (o IntegrationAccountAgreementMapOutput) ToIntegrationAccountAgreementMapOutput() IntegrationAccountAgreementMapOutput {
return o
}
func (o IntegrationAccountAgreementMapOutput) ToIntegrationAccountAgreementMapOutputWithContext(ctx context.Context) IntegrationAccountAgreementMapOutput {
return o
}
func (o IntegrationAccountAgreementMapOutput) MapIndex(k pulumi.StringInput) IntegrationAccountAgreementOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *IntegrationAccountAgreement {
return vs[0].(map[string]*IntegrationAccountAgreement)[vs[1].(string)]
}).(IntegrationAccountAgreementOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*IntegrationAccountAgreementInput)(nil)).Elem(), &IntegrationAccountAgreement{})
pulumi.RegisterInputType(reflect.TypeOf((*IntegrationAccountAgreementArrayInput)(nil)).Elem(), IntegrationAccountAgreementArray{})
pulumi.RegisterInputType(reflect.TypeOf((*IntegrationAccountAgreementMapInput)(nil)).Elem(), IntegrationAccountAgreementMap{})
pulumi.RegisterOutputType(IntegrationAccountAgreementOutput{})
pulumi.RegisterOutputType(IntegrationAccountAgreementArrayOutput{})
pulumi.RegisterOutputType(IntegrationAccountAgreementMapOutput{})
}