-
Notifications
You must be signed in to change notification settings - Fork 2
/
responsePlay.go
401 lines (343 loc) · 15.5 KB
/
responsePlay.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
// 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 pagerduty
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-pagerduty/sdk/v4/go/pagerduty/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-pagerduty/sdk/v4/go/pagerduty"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := pagerduty.NewUser(ctx, "example", &pagerduty.UserArgs{
// Name: pulumi.String("Earline Greenholt"),
// Email: pulumi.String("125.greenholt.earline@graham.name"),
// Teams: pulumi.StringArray{
// examplePagerdutyTeam.Id,
// },
// })
// if err != nil {
// return err
// }
// exampleEscalationPolicy, err := pagerduty.NewEscalationPolicy(ctx, "example", &pagerduty.EscalationPolicyArgs{
// Name: pulumi.String("Engineering Escalation Policy"),
// NumLoops: pulumi.Int(2),
// Rules: pagerduty.EscalationPolicyRuleArray{
// &pagerduty.EscalationPolicyRuleArgs{
// EscalationDelayInMinutes: pulumi.Int(10),
// Targets: pagerduty.EscalationPolicyRuleTargetArray{
// &pagerduty.EscalationPolicyRuleTargetArgs{
// Type: pulumi.String("user"),
// Id: example.ID(),
// },
// },
// },
// },
// })
// if err != nil {
// return err
// }
// _, err = pagerduty.NewResponsePlay(ctx, "example", &pagerduty.ResponsePlayArgs{
// Name: pulumi.String("My Response Play"),
// From: example.Email,
// Responders: pagerduty.ResponsePlayResponderArray{
// &pagerduty.ResponsePlayResponderArgs{
// Type: pulumi.String("escalation_policy_reference"),
// Id: exampleEscalationPolicy.ID(),
// },
// },
// Subscribers: pagerduty.ResponsePlaySubscriberArray{
// &pagerduty.ResponsePlaySubscriberArgs{
// Type: pulumi.String("user_reference"),
// Id: example.ID(),
// },
// },
// Runnability: pulumi.String("services"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// Response Plays can be imported using the `id.from(email)`, e.g.
//
// ```sh
// $ pulumi import pagerduty:index/responsePlay:ResponsePlay main 16208303-022b-f745-f2f5-560e537a2a74.user@email.com
// ```
type ResponsePlay struct {
pulumi.CustomResourceState
// The telephone number that will be set as the conference number for any incident on which this response play is run.
ConferenceNumber pulumi.StringPtrOutput `pulumi:"conferenceNumber"`
// The URL that will be set as the conference URL for any incident on which this response play is run.
ConferenceUrl pulumi.StringPtrOutput `pulumi:"conferenceUrl"`
Description pulumi.StringOutput `pulumi:"description"`
From pulumi.StringOutput `pulumi:"from"`
Name pulumi.StringOutput `pulumi:"name"`
Responders ResponsePlayResponderArrayOutput `pulumi:"responders"`
RespondersMessage pulumi.StringPtrOutput `pulumi:"respondersMessage"`
Runnability pulumi.StringPtrOutput `pulumi:"runnability"`
Subscribers ResponsePlaySubscriberArrayOutput `pulumi:"subscribers"`
SubscribersMessage pulumi.StringPtrOutput `pulumi:"subscribersMessage"`
Team pulumi.StringPtrOutput `pulumi:"team"`
Type pulumi.StringPtrOutput `pulumi:"type"`
}
// NewResponsePlay registers a new resource with the given unique name, arguments, and options.
func NewResponsePlay(ctx *pulumi.Context,
name string, args *ResponsePlayArgs, opts ...pulumi.ResourceOption) (*ResponsePlay, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.From == nil {
return nil, errors.New("invalid value for required argument 'From'")
}
if args.Description == nil {
args.Description = pulumi.StringPtr("Managed by Pulumi")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource ResponsePlay
err := ctx.RegisterResource("pagerduty:index/responsePlay:ResponsePlay", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetResponsePlay gets an existing ResponsePlay 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 GetResponsePlay(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ResponsePlayState, opts ...pulumi.ResourceOption) (*ResponsePlay, error) {
var resource ResponsePlay
err := ctx.ReadResource("pagerduty:index/responsePlay:ResponsePlay", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering ResponsePlay resources.
type responsePlayState struct {
// The telephone number that will be set as the conference number for any incident on which this response play is run.
ConferenceNumber *string `pulumi:"conferenceNumber"`
// The URL that will be set as the conference URL for any incident on which this response play is run.
ConferenceUrl *string `pulumi:"conferenceUrl"`
Description *string `pulumi:"description"`
From *string `pulumi:"from"`
Name *string `pulumi:"name"`
Responders []ResponsePlayResponder `pulumi:"responders"`
RespondersMessage *string `pulumi:"respondersMessage"`
Runnability *string `pulumi:"runnability"`
Subscribers []ResponsePlaySubscriber `pulumi:"subscribers"`
SubscribersMessage *string `pulumi:"subscribersMessage"`
Team *string `pulumi:"team"`
Type *string `pulumi:"type"`
}
type ResponsePlayState struct {
// The telephone number that will be set as the conference number for any incident on which this response play is run.
ConferenceNumber pulumi.StringPtrInput
// The URL that will be set as the conference URL for any incident on which this response play is run.
ConferenceUrl pulumi.StringPtrInput
Description pulumi.StringPtrInput
From pulumi.StringPtrInput
Name pulumi.StringPtrInput
Responders ResponsePlayResponderArrayInput
RespondersMessage pulumi.StringPtrInput
Runnability pulumi.StringPtrInput
Subscribers ResponsePlaySubscriberArrayInput
SubscribersMessage pulumi.StringPtrInput
Team pulumi.StringPtrInput
Type pulumi.StringPtrInput
}
func (ResponsePlayState) ElementType() reflect.Type {
return reflect.TypeOf((*responsePlayState)(nil)).Elem()
}
type responsePlayArgs struct {
// The telephone number that will be set as the conference number for any incident on which this response play is run.
ConferenceNumber *string `pulumi:"conferenceNumber"`
// The URL that will be set as the conference URL for any incident on which this response play is run.
ConferenceUrl *string `pulumi:"conferenceUrl"`
Description *string `pulumi:"description"`
From string `pulumi:"from"`
Name *string `pulumi:"name"`
Responders []ResponsePlayResponder `pulumi:"responders"`
RespondersMessage *string `pulumi:"respondersMessage"`
Runnability *string `pulumi:"runnability"`
Subscribers []ResponsePlaySubscriber `pulumi:"subscribers"`
SubscribersMessage *string `pulumi:"subscribersMessage"`
Team *string `pulumi:"team"`
Type *string `pulumi:"type"`
}
// The set of arguments for constructing a ResponsePlay resource.
type ResponsePlayArgs struct {
// The telephone number that will be set as the conference number for any incident on which this response play is run.
ConferenceNumber pulumi.StringPtrInput
// The URL that will be set as the conference URL for any incident on which this response play is run.
ConferenceUrl pulumi.StringPtrInput
Description pulumi.StringPtrInput
From pulumi.StringInput
Name pulumi.StringPtrInput
Responders ResponsePlayResponderArrayInput
RespondersMessage pulumi.StringPtrInput
Runnability pulumi.StringPtrInput
Subscribers ResponsePlaySubscriberArrayInput
SubscribersMessage pulumi.StringPtrInput
Team pulumi.StringPtrInput
Type pulumi.StringPtrInput
}
func (ResponsePlayArgs) ElementType() reflect.Type {
return reflect.TypeOf((*responsePlayArgs)(nil)).Elem()
}
type ResponsePlayInput interface {
pulumi.Input
ToResponsePlayOutput() ResponsePlayOutput
ToResponsePlayOutputWithContext(ctx context.Context) ResponsePlayOutput
}
func (*ResponsePlay) ElementType() reflect.Type {
return reflect.TypeOf((**ResponsePlay)(nil)).Elem()
}
func (i *ResponsePlay) ToResponsePlayOutput() ResponsePlayOutput {
return i.ToResponsePlayOutputWithContext(context.Background())
}
func (i *ResponsePlay) ToResponsePlayOutputWithContext(ctx context.Context) ResponsePlayOutput {
return pulumi.ToOutputWithContext(ctx, i).(ResponsePlayOutput)
}
// ResponsePlayArrayInput is an input type that accepts ResponsePlayArray and ResponsePlayArrayOutput values.
// You can construct a concrete instance of `ResponsePlayArrayInput` via:
//
// ResponsePlayArray{ ResponsePlayArgs{...} }
type ResponsePlayArrayInput interface {
pulumi.Input
ToResponsePlayArrayOutput() ResponsePlayArrayOutput
ToResponsePlayArrayOutputWithContext(context.Context) ResponsePlayArrayOutput
}
type ResponsePlayArray []ResponsePlayInput
func (ResponsePlayArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*ResponsePlay)(nil)).Elem()
}
func (i ResponsePlayArray) ToResponsePlayArrayOutput() ResponsePlayArrayOutput {
return i.ToResponsePlayArrayOutputWithContext(context.Background())
}
func (i ResponsePlayArray) ToResponsePlayArrayOutputWithContext(ctx context.Context) ResponsePlayArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(ResponsePlayArrayOutput)
}
// ResponsePlayMapInput is an input type that accepts ResponsePlayMap and ResponsePlayMapOutput values.
// You can construct a concrete instance of `ResponsePlayMapInput` via:
//
// ResponsePlayMap{ "key": ResponsePlayArgs{...} }
type ResponsePlayMapInput interface {
pulumi.Input
ToResponsePlayMapOutput() ResponsePlayMapOutput
ToResponsePlayMapOutputWithContext(context.Context) ResponsePlayMapOutput
}
type ResponsePlayMap map[string]ResponsePlayInput
func (ResponsePlayMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*ResponsePlay)(nil)).Elem()
}
func (i ResponsePlayMap) ToResponsePlayMapOutput() ResponsePlayMapOutput {
return i.ToResponsePlayMapOutputWithContext(context.Background())
}
func (i ResponsePlayMap) ToResponsePlayMapOutputWithContext(ctx context.Context) ResponsePlayMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(ResponsePlayMapOutput)
}
type ResponsePlayOutput struct{ *pulumi.OutputState }
func (ResponsePlayOutput) ElementType() reflect.Type {
return reflect.TypeOf((**ResponsePlay)(nil)).Elem()
}
func (o ResponsePlayOutput) ToResponsePlayOutput() ResponsePlayOutput {
return o
}
func (o ResponsePlayOutput) ToResponsePlayOutputWithContext(ctx context.Context) ResponsePlayOutput {
return o
}
// The telephone number that will be set as the conference number for any incident on which this response play is run.
func (o ResponsePlayOutput) ConferenceNumber() pulumi.StringPtrOutput {
return o.ApplyT(func(v *ResponsePlay) pulumi.StringPtrOutput { return v.ConferenceNumber }).(pulumi.StringPtrOutput)
}
// The URL that will be set as the conference URL for any incident on which this response play is run.
func (o ResponsePlayOutput) ConferenceUrl() pulumi.StringPtrOutput {
return o.ApplyT(func(v *ResponsePlay) pulumi.StringPtrOutput { return v.ConferenceUrl }).(pulumi.StringPtrOutput)
}
func (o ResponsePlayOutput) Description() pulumi.StringOutput {
return o.ApplyT(func(v *ResponsePlay) pulumi.StringOutput { return v.Description }).(pulumi.StringOutput)
}
func (o ResponsePlayOutput) From() pulumi.StringOutput {
return o.ApplyT(func(v *ResponsePlay) pulumi.StringOutput { return v.From }).(pulumi.StringOutput)
}
func (o ResponsePlayOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *ResponsePlay) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
func (o ResponsePlayOutput) Responders() ResponsePlayResponderArrayOutput {
return o.ApplyT(func(v *ResponsePlay) ResponsePlayResponderArrayOutput { return v.Responders }).(ResponsePlayResponderArrayOutput)
}
func (o ResponsePlayOutput) RespondersMessage() pulumi.StringPtrOutput {
return o.ApplyT(func(v *ResponsePlay) pulumi.StringPtrOutput { return v.RespondersMessage }).(pulumi.StringPtrOutput)
}
func (o ResponsePlayOutput) Runnability() pulumi.StringPtrOutput {
return o.ApplyT(func(v *ResponsePlay) pulumi.StringPtrOutput { return v.Runnability }).(pulumi.StringPtrOutput)
}
func (o ResponsePlayOutput) Subscribers() ResponsePlaySubscriberArrayOutput {
return o.ApplyT(func(v *ResponsePlay) ResponsePlaySubscriberArrayOutput { return v.Subscribers }).(ResponsePlaySubscriberArrayOutput)
}
func (o ResponsePlayOutput) SubscribersMessage() pulumi.StringPtrOutput {
return o.ApplyT(func(v *ResponsePlay) pulumi.StringPtrOutput { return v.SubscribersMessage }).(pulumi.StringPtrOutput)
}
func (o ResponsePlayOutput) Team() pulumi.StringPtrOutput {
return o.ApplyT(func(v *ResponsePlay) pulumi.StringPtrOutput { return v.Team }).(pulumi.StringPtrOutput)
}
func (o ResponsePlayOutput) Type() pulumi.StringPtrOutput {
return o.ApplyT(func(v *ResponsePlay) pulumi.StringPtrOutput { return v.Type }).(pulumi.StringPtrOutput)
}
type ResponsePlayArrayOutput struct{ *pulumi.OutputState }
func (ResponsePlayArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*ResponsePlay)(nil)).Elem()
}
func (o ResponsePlayArrayOutput) ToResponsePlayArrayOutput() ResponsePlayArrayOutput {
return o
}
func (o ResponsePlayArrayOutput) ToResponsePlayArrayOutputWithContext(ctx context.Context) ResponsePlayArrayOutput {
return o
}
func (o ResponsePlayArrayOutput) Index(i pulumi.IntInput) ResponsePlayOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ResponsePlay {
return vs[0].([]*ResponsePlay)[vs[1].(int)]
}).(ResponsePlayOutput)
}
type ResponsePlayMapOutput struct{ *pulumi.OutputState }
func (ResponsePlayMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*ResponsePlay)(nil)).Elem()
}
func (o ResponsePlayMapOutput) ToResponsePlayMapOutput() ResponsePlayMapOutput {
return o
}
func (o ResponsePlayMapOutput) ToResponsePlayMapOutputWithContext(ctx context.Context) ResponsePlayMapOutput {
return o
}
func (o ResponsePlayMapOutput) MapIndex(k pulumi.StringInput) ResponsePlayOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ResponsePlay {
return vs[0].(map[string]*ResponsePlay)[vs[1].(string)]
}).(ResponsePlayOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*ResponsePlayInput)(nil)).Elem(), &ResponsePlay{})
pulumi.RegisterInputType(reflect.TypeOf((*ResponsePlayArrayInput)(nil)).Elem(), ResponsePlayArray{})
pulumi.RegisterInputType(reflect.TypeOf((*ResponsePlayMapInput)(nil)).Elem(), ResponsePlayMap{})
pulumi.RegisterOutputType(ResponsePlayOutput{})
pulumi.RegisterOutputType(ResponsePlayArrayOutput{})
pulumi.RegisterOutputType(ResponsePlayMapOutput{})
}