/
app.go
374 lines (319 loc) · 14.3 KB
/
app.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
// 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 pinpoint
import (
"context"
"reflect"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides a Pinpoint App resource.
//
// ## Example Usage
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/pinpoint"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := pinpoint.NewApp(ctx, "example", &pinpoint.AppArgs{
// Name: pulumi.String("test-app"),
// Limits: &pinpoint.AppLimitsArgs{
// MaximumDuration: pulumi.Int(600),
// },
// QuietTime: &pinpoint.AppQuietTimeArgs{
// Start: pulumi.String("00:00"),
// End: pulumi.String("06:00"),
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
//
// ## Import
//
// Using `pulumi import`, import Pinpoint App using the `application-id`. For example:
//
// ```sh
// $ pulumi import aws:pinpoint/app:App name application-id
// ```
type App struct {
pulumi.CustomResourceState
// The Application ID of the Pinpoint App.
ApplicationId pulumi.StringOutput `pulumi:"applicationId"`
// Amazon Resource Name (ARN) of the PinPoint Application
Arn pulumi.StringOutput `pulumi:"arn"`
// Specifies settings for invoking an AWS Lambda function that customizes a segment for a campaign
CampaignHook AppCampaignHookPtrOutput `pulumi:"campaignHook"`
// The default campaign limits for the app. These limits apply to each campaign for the app, unless the campaign overrides the default with limits of its own
Limits AppLimitsPtrOutput `pulumi:"limits"`
// The application name. By default generated by Pulumi
Name pulumi.StringOutput `pulumi:"name"`
// The name of the Pinpoint application. Conflicts with `name`
NamePrefix pulumi.StringOutput `pulumi:"namePrefix"`
// The default quiet time for the app. Each campaign for this app sends no messages during this time unless the campaign overrides the default with a quiet time of its own
QuietTime AppQuietTimePtrOutput `pulumi:"quietTime"`
// Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags pulumi.StringMapOutput `pulumi:"tags"`
// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
//
// Deprecated: Please use `tags` instead.
TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
}
// NewApp registers a new resource with the given unique name, arguments, and options.
func NewApp(ctx *pulumi.Context,
name string, args *AppArgs, opts ...pulumi.ResourceOption) (*App, error) {
if args == nil {
args = &AppArgs{}
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource App
err := ctx.RegisterResource("aws:pinpoint/app:App", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetApp gets an existing App 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 GetApp(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *AppState, opts ...pulumi.ResourceOption) (*App, error) {
var resource App
err := ctx.ReadResource("aws:pinpoint/app:App", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering App resources.
type appState struct {
// The Application ID of the Pinpoint App.
ApplicationId *string `pulumi:"applicationId"`
// Amazon Resource Name (ARN) of the PinPoint Application
Arn *string `pulumi:"arn"`
// Specifies settings for invoking an AWS Lambda function that customizes a segment for a campaign
CampaignHook *AppCampaignHook `pulumi:"campaignHook"`
// The default campaign limits for the app. These limits apply to each campaign for the app, unless the campaign overrides the default with limits of its own
Limits *AppLimits `pulumi:"limits"`
// The application name. By default generated by Pulumi
Name *string `pulumi:"name"`
// The name of the Pinpoint application. Conflicts with `name`
NamePrefix *string `pulumi:"namePrefix"`
// The default quiet time for the app. Each campaign for this app sends no messages during this time unless the campaign overrides the default with a quiet time of its own
QuietTime *AppQuietTime `pulumi:"quietTime"`
// Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags map[string]string `pulumi:"tags"`
// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
//
// Deprecated: Please use `tags` instead.
TagsAll map[string]string `pulumi:"tagsAll"`
}
type AppState struct {
// The Application ID of the Pinpoint App.
ApplicationId pulumi.StringPtrInput
// Amazon Resource Name (ARN) of the PinPoint Application
Arn pulumi.StringPtrInput
// Specifies settings for invoking an AWS Lambda function that customizes a segment for a campaign
CampaignHook AppCampaignHookPtrInput
// The default campaign limits for the app. These limits apply to each campaign for the app, unless the campaign overrides the default with limits of its own
Limits AppLimitsPtrInput
// The application name. By default generated by Pulumi
Name pulumi.StringPtrInput
// The name of the Pinpoint application. Conflicts with `name`
NamePrefix pulumi.StringPtrInput
// The default quiet time for the app. Each campaign for this app sends no messages during this time unless the campaign overrides the default with a quiet time of its own
QuietTime AppQuietTimePtrInput
// Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags pulumi.StringMapInput
// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
//
// Deprecated: Please use `tags` instead.
TagsAll pulumi.StringMapInput
}
func (AppState) ElementType() reflect.Type {
return reflect.TypeOf((*appState)(nil)).Elem()
}
type appArgs struct {
// Specifies settings for invoking an AWS Lambda function that customizes a segment for a campaign
CampaignHook *AppCampaignHook `pulumi:"campaignHook"`
// The default campaign limits for the app. These limits apply to each campaign for the app, unless the campaign overrides the default with limits of its own
Limits *AppLimits `pulumi:"limits"`
// The application name. By default generated by Pulumi
Name *string `pulumi:"name"`
// The name of the Pinpoint application. Conflicts with `name`
NamePrefix *string `pulumi:"namePrefix"`
// The default quiet time for the app. Each campaign for this app sends no messages during this time unless the campaign overrides the default with a quiet time of its own
QuietTime *AppQuietTime `pulumi:"quietTime"`
// Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags map[string]string `pulumi:"tags"`
}
// The set of arguments for constructing a App resource.
type AppArgs struct {
// Specifies settings for invoking an AWS Lambda function that customizes a segment for a campaign
CampaignHook AppCampaignHookPtrInput
// The default campaign limits for the app. These limits apply to each campaign for the app, unless the campaign overrides the default with limits of its own
Limits AppLimitsPtrInput
// The application name. By default generated by Pulumi
Name pulumi.StringPtrInput
// The name of the Pinpoint application. Conflicts with `name`
NamePrefix pulumi.StringPtrInput
// The default quiet time for the app. Each campaign for this app sends no messages during this time unless the campaign overrides the default with a quiet time of its own
QuietTime AppQuietTimePtrInput
// Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags pulumi.StringMapInput
}
func (AppArgs) ElementType() reflect.Type {
return reflect.TypeOf((*appArgs)(nil)).Elem()
}
type AppInput interface {
pulumi.Input
ToAppOutput() AppOutput
ToAppOutputWithContext(ctx context.Context) AppOutput
}
func (*App) ElementType() reflect.Type {
return reflect.TypeOf((**App)(nil)).Elem()
}
func (i *App) ToAppOutput() AppOutput {
return i.ToAppOutputWithContext(context.Background())
}
func (i *App) ToAppOutputWithContext(ctx context.Context) AppOutput {
return pulumi.ToOutputWithContext(ctx, i).(AppOutput)
}
// AppArrayInput is an input type that accepts AppArray and AppArrayOutput values.
// You can construct a concrete instance of `AppArrayInput` via:
//
// AppArray{ AppArgs{...} }
type AppArrayInput interface {
pulumi.Input
ToAppArrayOutput() AppArrayOutput
ToAppArrayOutputWithContext(context.Context) AppArrayOutput
}
type AppArray []AppInput
func (AppArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*App)(nil)).Elem()
}
func (i AppArray) ToAppArrayOutput() AppArrayOutput {
return i.ToAppArrayOutputWithContext(context.Background())
}
func (i AppArray) ToAppArrayOutputWithContext(ctx context.Context) AppArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(AppArrayOutput)
}
// AppMapInput is an input type that accepts AppMap and AppMapOutput values.
// You can construct a concrete instance of `AppMapInput` via:
//
// AppMap{ "key": AppArgs{...} }
type AppMapInput interface {
pulumi.Input
ToAppMapOutput() AppMapOutput
ToAppMapOutputWithContext(context.Context) AppMapOutput
}
type AppMap map[string]AppInput
func (AppMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*App)(nil)).Elem()
}
func (i AppMap) ToAppMapOutput() AppMapOutput {
return i.ToAppMapOutputWithContext(context.Background())
}
func (i AppMap) ToAppMapOutputWithContext(ctx context.Context) AppMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(AppMapOutput)
}
type AppOutput struct{ *pulumi.OutputState }
func (AppOutput) ElementType() reflect.Type {
return reflect.TypeOf((**App)(nil)).Elem()
}
func (o AppOutput) ToAppOutput() AppOutput {
return o
}
func (o AppOutput) ToAppOutputWithContext(ctx context.Context) AppOutput {
return o
}
// The Application ID of the Pinpoint App.
func (o AppOutput) ApplicationId() pulumi.StringOutput {
return o.ApplyT(func(v *App) pulumi.StringOutput { return v.ApplicationId }).(pulumi.StringOutput)
}
// Amazon Resource Name (ARN) of the PinPoint Application
func (o AppOutput) Arn() pulumi.StringOutput {
return o.ApplyT(func(v *App) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
}
// Specifies settings for invoking an AWS Lambda function that customizes a segment for a campaign
func (o AppOutput) CampaignHook() AppCampaignHookPtrOutput {
return o.ApplyT(func(v *App) AppCampaignHookPtrOutput { return v.CampaignHook }).(AppCampaignHookPtrOutput)
}
// The default campaign limits for the app. These limits apply to each campaign for the app, unless the campaign overrides the default with limits of its own
func (o AppOutput) Limits() AppLimitsPtrOutput {
return o.ApplyT(func(v *App) AppLimitsPtrOutput { return v.Limits }).(AppLimitsPtrOutput)
}
// The application name. By default generated by Pulumi
func (o AppOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *App) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// The name of the Pinpoint application. Conflicts with `name`
func (o AppOutput) NamePrefix() pulumi.StringOutput {
return o.ApplyT(func(v *App) pulumi.StringOutput { return v.NamePrefix }).(pulumi.StringOutput)
}
// The default quiet time for the app. Each campaign for this app sends no messages during this time unless the campaign overrides the default with a quiet time of its own
func (o AppOutput) QuietTime() AppQuietTimePtrOutput {
return o.ApplyT(func(v *App) AppQuietTimePtrOutput { return v.QuietTime }).(AppQuietTimePtrOutput)
}
// Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
func (o AppOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v *App) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
}
// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
//
// Deprecated: Please use `tags` instead.
func (o AppOutput) TagsAll() pulumi.StringMapOutput {
return o.ApplyT(func(v *App) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
}
type AppArrayOutput struct{ *pulumi.OutputState }
func (AppArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*App)(nil)).Elem()
}
func (o AppArrayOutput) ToAppArrayOutput() AppArrayOutput {
return o
}
func (o AppArrayOutput) ToAppArrayOutputWithContext(ctx context.Context) AppArrayOutput {
return o
}
func (o AppArrayOutput) Index(i pulumi.IntInput) AppOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *App {
return vs[0].([]*App)[vs[1].(int)]
}).(AppOutput)
}
type AppMapOutput struct{ *pulumi.OutputState }
func (AppMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*App)(nil)).Elem()
}
func (o AppMapOutput) ToAppMapOutput() AppMapOutput {
return o
}
func (o AppMapOutput) ToAppMapOutputWithContext(ctx context.Context) AppMapOutput {
return o
}
func (o AppMapOutput) MapIndex(k pulumi.StringInput) AppOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *App {
return vs[0].(map[string]*App)[vs[1].(string)]
}).(AppOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*AppInput)(nil)).Elem(), &App{})
pulumi.RegisterInputType(reflect.TypeOf((*AppArrayInput)(nil)).Elem(), AppArray{})
pulumi.RegisterInputType(reflect.TypeOf((*AppMapInput)(nil)).Elem(), AppMap{})
pulumi.RegisterOutputType(AppOutput{})
pulumi.RegisterOutputType(AppArrayOutput{})
pulumi.RegisterOutputType(AppMapOutput{})
}