-
Notifications
You must be signed in to change notification settings - Fork 2
/
automationActionsActionTeamAssociation.go
278 lines (230 loc) · 12.5 KB
/
automationActionsActionTeamAssociation.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
// 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"
)
// An Automation Actions [action association with a team](https://developer.pagerduty.com/api-reference/8f722dd91a4ba-associate-an-automation-action-with-a-team) configures the relation of a specific Action with a Team.
//
// ## 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.NewTeam(ctx, "example", &pagerduty.TeamArgs{
// Name: pulumi.String("Engineering"),
// Description: pulumi.String("All engineering"),
// })
// if err != nil {
// return err
// }
// paActionExample, err := pagerduty.NewAutomationActionsAction(ctx, "pa_action_example", &pagerduty.AutomationActionsActionArgs{
// Name: pulumi.String("PA Action created via TF"),
// Description: pulumi.String("Description of the PA Action created via TF"),
// ActionType: pulumi.String("process_automation"),
// ActionDataReference: &pagerduty.AutomationActionsActionActionDataReferenceArgs{
// ProcessAutomationJobId: pulumi.String("P123456"),
// },
// })
// if err != nil {
// return err
// }
// _, err = pagerduty.NewAutomationActionsActionTeamAssociation(ctx, "foo", &pagerduty.AutomationActionsActionTeamAssociationArgs{
// ActionId: paActionExample.ID(),
// TeamId: example.ID(),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// Action team association can be imported using the `action_id` and `team_id` separated by a colon, e.g.
//
// ```sh
// $ pulumi import pagerduty:index/automationActionsActionTeamAssociation:AutomationActionsActionTeamAssociation example 01DER7CUUBF7TH4116K0M4WKPU:PLB09Z
// ```
type AutomationActionsActionTeamAssociation struct {
pulumi.CustomResourceState
ActionId pulumi.StringOutput `pulumi:"actionId"`
TeamId pulumi.StringOutput `pulumi:"teamId"`
}
// NewAutomationActionsActionTeamAssociation registers a new resource with the given unique name, arguments, and options.
func NewAutomationActionsActionTeamAssociation(ctx *pulumi.Context,
name string, args *AutomationActionsActionTeamAssociationArgs, opts ...pulumi.ResourceOption) (*AutomationActionsActionTeamAssociation, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ActionId == nil {
return nil, errors.New("invalid value for required argument 'ActionId'")
}
if args.TeamId == nil {
return nil, errors.New("invalid value for required argument 'TeamId'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource AutomationActionsActionTeamAssociation
err := ctx.RegisterResource("pagerduty:index/automationActionsActionTeamAssociation:AutomationActionsActionTeamAssociation", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetAutomationActionsActionTeamAssociation gets an existing AutomationActionsActionTeamAssociation 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 GetAutomationActionsActionTeamAssociation(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *AutomationActionsActionTeamAssociationState, opts ...pulumi.ResourceOption) (*AutomationActionsActionTeamAssociation, error) {
var resource AutomationActionsActionTeamAssociation
err := ctx.ReadResource("pagerduty:index/automationActionsActionTeamAssociation:AutomationActionsActionTeamAssociation", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering AutomationActionsActionTeamAssociation resources.
type automationActionsActionTeamAssociationState struct {
ActionId *string `pulumi:"actionId"`
TeamId *string `pulumi:"teamId"`
}
type AutomationActionsActionTeamAssociationState struct {
ActionId pulumi.StringPtrInput
TeamId pulumi.StringPtrInput
}
func (AutomationActionsActionTeamAssociationState) ElementType() reflect.Type {
return reflect.TypeOf((*automationActionsActionTeamAssociationState)(nil)).Elem()
}
type automationActionsActionTeamAssociationArgs struct {
ActionId string `pulumi:"actionId"`
TeamId string `pulumi:"teamId"`
}
// The set of arguments for constructing a AutomationActionsActionTeamAssociation resource.
type AutomationActionsActionTeamAssociationArgs struct {
ActionId pulumi.StringInput
TeamId pulumi.StringInput
}
func (AutomationActionsActionTeamAssociationArgs) ElementType() reflect.Type {
return reflect.TypeOf((*automationActionsActionTeamAssociationArgs)(nil)).Elem()
}
type AutomationActionsActionTeamAssociationInput interface {
pulumi.Input
ToAutomationActionsActionTeamAssociationOutput() AutomationActionsActionTeamAssociationOutput
ToAutomationActionsActionTeamAssociationOutputWithContext(ctx context.Context) AutomationActionsActionTeamAssociationOutput
}
func (*AutomationActionsActionTeamAssociation) ElementType() reflect.Type {
return reflect.TypeOf((**AutomationActionsActionTeamAssociation)(nil)).Elem()
}
func (i *AutomationActionsActionTeamAssociation) ToAutomationActionsActionTeamAssociationOutput() AutomationActionsActionTeamAssociationOutput {
return i.ToAutomationActionsActionTeamAssociationOutputWithContext(context.Background())
}
func (i *AutomationActionsActionTeamAssociation) ToAutomationActionsActionTeamAssociationOutputWithContext(ctx context.Context) AutomationActionsActionTeamAssociationOutput {
return pulumi.ToOutputWithContext(ctx, i).(AutomationActionsActionTeamAssociationOutput)
}
// AutomationActionsActionTeamAssociationArrayInput is an input type that accepts AutomationActionsActionTeamAssociationArray and AutomationActionsActionTeamAssociationArrayOutput values.
// You can construct a concrete instance of `AutomationActionsActionTeamAssociationArrayInput` via:
//
// AutomationActionsActionTeamAssociationArray{ AutomationActionsActionTeamAssociationArgs{...} }
type AutomationActionsActionTeamAssociationArrayInput interface {
pulumi.Input
ToAutomationActionsActionTeamAssociationArrayOutput() AutomationActionsActionTeamAssociationArrayOutput
ToAutomationActionsActionTeamAssociationArrayOutputWithContext(context.Context) AutomationActionsActionTeamAssociationArrayOutput
}
type AutomationActionsActionTeamAssociationArray []AutomationActionsActionTeamAssociationInput
func (AutomationActionsActionTeamAssociationArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*AutomationActionsActionTeamAssociation)(nil)).Elem()
}
func (i AutomationActionsActionTeamAssociationArray) ToAutomationActionsActionTeamAssociationArrayOutput() AutomationActionsActionTeamAssociationArrayOutput {
return i.ToAutomationActionsActionTeamAssociationArrayOutputWithContext(context.Background())
}
func (i AutomationActionsActionTeamAssociationArray) ToAutomationActionsActionTeamAssociationArrayOutputWithContext(ctx context.Context) AutomationActionsActionTeamAssociationArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(AutomationActionsActionTeamAssociationArrayOutput)
}
// AutomationActionsActionTeamAssociationMapInput is an input type that accepts AutomationActionsActionTeamAssociationMap and AutomationActionsActionTeamAssociationMapOutput values.
// You can construct a concrete instance of `AutomationActionsActionTeamAssociationMapInput` via:
//
// AutomationActionsActionTeamAssociationMap{ "key": AutomationActionsActionTeamAssociationArgs{...} }
type AutomationActionsActionTeamAssociationMapInput interface {
pulumi.Input
ToAutomationActionsActionTeamAssociationMapOutput() AutomationActionsActionTeamAssociationMapOutput
ToAutomationActionsActionTeamAssociationMapOutputWithContext(context.Context) AutomationActionsActionTeamAssociationMapOutput
}
type AutomationActionsActionTeamAssociationMap map[string]AutomationActionsActionTeamAssociationInput
func (AutomationActionsActionTeamAssociationMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*AutomationActionsActionTeamAssociation)(nil)).Elem()
}
func (i AutomationActionsActionTeamAssociationMap) ToAutomationActionsActionTeamAssociationMapOutput() AutomationActionsActionTeamAssociationMapOutput {
return i.ToAutomationActionsActionTeamAssociationMapOutputWithContext(context.Background())
}
func (i AutomationActionsActionTeamAssociationMap) ToAutomationActionsActionTeamAssociationMapOutputWithContext(ctx context.Context) AutomationActionsActionTeamAssociationMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(AutomationActionsActionTeamAssociationMapOutput)
}
type AutomationActionsActionTeamAssociationOutput struct{ *pulumi.OutputState }
func (AutomationActionsActionTeamAssociationOutput) ElementType() reflect.Type {
return reflect.TypeOf((**AutomationActionsActionTeamAssociation)(nil)).Elem()
}
func (o AutomationActionsActionTeamAssociationOutput) ToAutomationActionsActionTeamAssociationOutput() AutomationActionsActionTeamAssociationOutput {
return o
}
func (o AutomationActionsActionTeamAssociationOutput) ToAutomationActionsActionTeamAssociationOutputWithContext(ctx context.Context) AutomationActionsActionTeamAssociationOutput {
return o
}
func (o AutomationActionsActionTeamAssociationOutput) ActionId() pulumi.StringOutput {
return o.ApplyT(func(v *AutomationActionsActionTeamAssociation) pulumi.StringOutput { return v.ActionId }).(pulumi.StringOutput)
}
func (o AutomationActionsActionTeamAssociationOutput) TeamId() pulumi.StringOutput {
return o.ApplyT(func(v *AutomationActionsActionTeamAssociation) pulumi.StringOutput { return v.TeamId }).(pulumi.StringOutput)
}
type AutomationActionsActionTeamAssociationArrayOutput struct{ *pulumi.OutputState }
func (AutomationActionsActionTeamAssociationArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*AutomationActionsActionTeamAssociation)(nil)).Elem()
}
func (o AutomationActionsActionTeamAssociationArrayOutput) ToAutomationActionsActionTeamAssociationArrayOutput() AutomationActionsActionTeamAssociationArrayOutput {
return o
}
func (o AutomationActionsActionTeamAssociationArrayOutput) ToAutomationActionsActionTeamAssociationArrayOutputWithContext(ctx context.Context) AutomationActionsActionTeamAssociationArrayOutput {
return o
}
func (o AutomationActionsActionTeamAssociationArrayOutput) Index(i pulumi.IntInput) AutomationActionsActionTeamAssociationOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *AutomationActionsActionTeamAssociation {
return vs[0].([]*AutomationActionsActionTeamAssociation)[vs[1].(int)]
}).(AutomationActionsActionTeamAssociationOutput)
}
type AutomationActionsActionTeamAssociationMapOutput struct{ *pulumi.OutputState }
func (AutomationActionsActionTeamAssociationMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*AutomationActionsActionTeamAssociation)(nil)).Elem()
}
func (o AutomationActionsActionTeamAssociationMapOutput) ToAutomationActionsActionTeamAssociationMapOutput() AutomationActionsActionTeamAssociationMapOutput {
return o
}
func (o AutomationActionsActionTeamAssociationMapOutput) ToAutomationActionsActionTeamAssociationMapOutputWithContext(ctx context.Context) AutomationActionsActionTeamAssociationMapOutput {
return o
}
func (o AutomationActionsActionTeamAssociationMapOutput) MapIndex(k pulumi.StringInput) AutomationActionsActionTeamAssociationOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *AutomationActionsActionTeamAssociation {
return vs[0].(map[string]*AutomationActionsActionTeamAssociation)[vs[1].(string)]
}).(AutomationActionsActionTeamAssociationOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*AutomationActionsActionTeamAssociationInput)(nil)).Elem(), &AutomationActionsActionTeamAssociation{})
pulumi.RegisterInputType(reflect.TypeOf((*AutomationActionsActionTeamAssociationArrayInput)(nil)).Elem(), AutomationActionsActionTeamAssociationArray{})
pulumi.RegisterInputType(reflect.TypeOf((*AutomationActionsActionTeamAssociationMapInput)(nil)).Elem(), AutomationActionsActionTeamAssociationMap{})
pulumi.RegisterOutputType(AutomationActionsActionTeamAssociationOutput{})
pulumi.RegisterOutputType(AutomationActionsActionTeamAssociationArrayOutput{})
pulumi.RegisterOutputType(AutomationActionsActionTeamAssociationMapOutput{})
}