/
businessService.go
340 lines (280 loc) · 11.5 KB
/
businessService.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
// *** 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 pagerduty
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// A [business service](https://v2.developer.pagerduty.com/v2/page/api-reference#!/Business_Services/get_business_services) allows you to model capabilities that span multiple technical services and that may be owned by several different teams.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-pagerduty/sdk/go/pagerduty"
// "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := pagerduty.NewBusinessService(ctx, "example", &pagerduty.BusinessServiceArgs{
// Description: pulumi.String("A very descriptive description of this business service"),
// PointOfContact: pulumi.String("PagerDuty Admin"),
// Team: pulumi.String("P37RSRS"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
//
// ## Import
//
// Services can be imported using the `id`, e.g.
//
// ```sh
// $ pulumi import pagerduty:index/businessService:BusinessService main PLBP09X
// ```
type BusinessService struct {
pulumi.CustomResourceState
Description pulumi.StringPtrOutput `pulumi:"description"`
HtmlUrl pulumi.StringOutput `pulumi:"htmlUrl"`
// The name of the business service.
Name pulumi.StringOutput `pulumi:"name"`
// The owner of the business service.
PointOfContact pulumi.StringPtrOutput `pulumi:"pointOfContact"`
Self pulumi.StringOutput `pulumi:"self"`
Summary pulumi.StringOutput `pulumi:"summary"`
// ID of the team that owns the business service.
Team pulumi.StringPtrOutput `pulumi:"team"`
// Default value is `businessService`. Can also be set as `businessServiceReference`.
Type pulumi.StringPtrOutput `pulumi:"type"`
}
// NewBusinessService registers a new resource with the given unique name, arguments, and options.
func NewBusinessService(ctx *pulumi.Context,
name string, args *BusinessServiceArgs, opts ...pulumi.ResourceOption) (*BusinessService, error) {
if args == nil {
args = &BusinessServiceArgs{}
}
var resource BusinessService
err := ctx.RegisterResource("pagerduty:index/businessService:BusinessService", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetBusinessService gets an existing BusinessService 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 GetBusinessService(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *BusinessServiceState, opts ...pulumi.ResourceOption) (*BusinessService, error) {
var resource BusinessService
err := ctx.ReadResource("pagerduty:index/businessService:BusinessService", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering BusinessService resources.
type businessServiceState struct {
Description *string `pulumi:"description"`
HtmlUrl *string `pulumi:"htmlUrl"`
// The name of the business service.
Name *string `pulumi:"name"`
// The owner of the business service.
PointOfContact *string `pulumi:"pointOfContact"`
Self *string `pulumi:"self"`
Summary *string `pulumi:"summary"`
// ID of the team that owns the business service.
Team *string `pulumi:"team"`
// Default value is `businessService`. Can also be set as `businessServiceReference`.
Type *string `pulumi:"type"`
}
type BusinessServiceState struct {
Description pulumi.StringPtrInput
HtmlUrl pulumi.StringPtrInput
// The name of the business service.
Name pulumi.StringPtrInput
// The owner of the business service.
PointOfContact pulumi.StringPtrInput
Self pulumi.StringPtrInput
Summary pulumi.StringPtrInput
// ID of the team that owns the business service.
Team pulumi.StringPtrInput
// Default value is `businessService`. Can also be set as `businessServiceReference`.
Type pulumi.StringPtrInput
}
func (BusinessServiceState) ElementType() reflect.Type {
return reflect.TypeOf((*businessServiceState)(nil)).Elem()
}
type businessServiceArgs struct {
Description *string `pulumi:"description"`
// The name of the business service.
Name *string `pulumi:"name"`
// The owner of the business service.
PointOfContact *string `pulumi:"pointOfContact"`
// ID of the team that owns the business service.
Team *string `pulumi:"team"`
// Default value is `businessService`. Can also be set as `businessServiceReference`.
Type *string `pulumi:"type"`
}
// The set of arguments for constructing a BusinessService resource.
type BusinessServiceArgs struct {
Description pulumi.StringPtrInput
// The name of the business service.
Name pulumi.StringPtrInput
// The owner of the business service.
PointOfContact pulumi.StringPtrInput
// ID of the team that owns the business service.
Team pulumi.StringPtrInput
// Default value is `businessService`. Can also be set as `businessServiceReference`.
Type pulumi.StringPtrInput
}
func (BusinessServiceArgs) ElementType() reflect.Type {
return reflect.TypeOf((*businessServiceArgs)(nil)).Elem()
}
type BusinessServiceInput interface {
pulumi.Input
ToBusinessServiceOutput() BusinessServiceOutput
ToBusinessServiceOutputWithContext(ctx context.Context) BusinessServiceOutput
}
func (*BusinessService) ElementType() reflect.Type {
return reflect.TypeOf((*BusinessService)(nil))
}
func (i *BusinessService) ToBusinessServiceOutput() BusinessServiceOutput {
return i.ToBusinessServiceOutputWithContext(context.Background())
}
func (i *BusinessService) ToBusinessServiceOutputWithContext(ctx context.Context) BusinessServiceOutput {
return pulumi.ToOutputWithContext(ctx, i).(BusinessServiceOutput)
}
func (i *BusinessService) ToBusinessServicePtrOutput() BusinessServicePtrOutput {
return i.ToBusinessServicePtrOutputWithContext(context.Background())
}
func (i *BusinessService) ToBusinessServicePtrOutputWithContext(ctx context.Context) BusinessServicePtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(BusinessServicePtrOutput)
}
type BusinessServicePtrInput interface {
pulumi.Input
ToBusinessServicePtrOutput() BusinessServicePtrOutput
ToBusinessServicePtrOutputWithContext(ctx context.Context) BusinessServicePtrOutput
}
type businessServicePtrType BusinessServiceArgs
func (*businessServicePtrType) ElementType() reflect.Type {
return reflect.TypeOf((**BusinessService)(nil))
}
func (i *businessServicePtrType) ToBusinessServicePtrOutput() BusinessServicePtrOutput {
return i.ToBusinessServicePtrOutputWithContext(context.Background())
}
func (i *businessServicePtrType) ToBusinessServicePtrOutputWithContext(ctx context.Context) BusinessServicePtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(BusinessServicePtrOutput)
}
// BusinessServiceArrayInput is an input type that accepts BusinessServiceArray and BusinessServiceArrayOutput values.
// You can construct a concrete instance of `BusinessServiceArrayInput` via:
//
// BusinessServiceArray{ BusinessServiceArgs{...} }
type BusinessServiceArrayInput interface {
pulumi.Input
ToBusinessServiceArrayOutput() BusinessServiceArrayOutput
ToBusinessServiceArrayOutputWithContext(context.Context) BusinessServiceArrayOutput
}
type BusinessServiceArray []BusinessServiceInput
func (BusinessServiceArray) ElementType() reflect.Type {
return reflect.TypeOf(([]*BusinessService)(nil))
}
func (i BusinessServiceArray) ToBusinessServiceArrayOutput() BusinessServiceArrayOutput {
return i.ToBusinessServiceArrayOutputWithContext(context.Background())
}
func (i BusinessServiceArray) ToBusinessServiceArrayOutputWithContext(ctx context.Context) BusinessServiceArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(BusinessServiceArrayOutput)
}
// BusinessServiceMapInput is an input type that accepts BusinessServiceMap and BusinessServiceMapOutput values.
// You can construct a concrete instance of `BusinessServiceMapInput` via:
//
// BusinessServiceMap{ "key": BusinessServiceArgs{...} }
type BusinessServiceMapInput interface {
pulumi.Input
ToBusinessServiceMapOutput() BusinessServiceMapOutput
ToBusinessServiceMapOutputWithContext(context.Context) BusinessServiceMapOutput
}
type BusinessServiceMap map[string]BusinessServiceInput
func (BusinessServiceMap) ElementType() reflect.Type {
return reflect.TypeOf((map[string]*BusinessService)(nil))
}
func (i BusinessServiceMap) ToBusinessServiceMapOutput() BusinessServiceMapOutput {
return i.ToBusinessServiceMapOutputWithContext(context.Background())
}
func (i BusinessServiceMap) ToBusinessServiceMapOutputWithContext(ctx context.Context) BusinessServiceMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(BusinessServiceMapOutput)
}
type BusinessServiceOutput struct {
*pulumi.OutputState
}
func (BusinessServiceOutput) ElementType() reflect.Type {
return reflect.TypeOf((*BusinessService)(nil))
}
func (o BusinessServiceOutput) ToBusinessServiceOutput() BusinessServiceOutput {
return o
}
func (o BusinessServiceOutput) ToBusinessServiceOutputWithContext(ctx context.Context) BusinessServiceOutput {
return o
}
func (o BusinessServiceOutput) ToBusinessServicePtrOutput() BusinessServicePtrOutput {
return o.ToBusinessServicePtrOutputWithContext(context.Background())
}
func (o BusinessServiceOutput) ToBusinessServicePtrOutputWithContext(ctx context.Context) BusinessServicePtrOutput {
return o.ApplyT(func(v BusinessService) *BusinessService {
return &v
}).(BusinessServicePtrOutput)
}
type BusinessServicePtrOutput struct {
*pulumi.OutputState
}
func (BusinessServicePtrOutput) ElementType() reflect.Type {
return reflect.TypeOf((**BusinessService)(nil))
}
func (o BusinessServicePtrOutput) ToBusinessServicePtrOutput() BusinessServicePtrOutput {
return o
}
func (o BusinessServicePtrOutput) ToBusinessServicePtrOutputWithContext(ctx context.Context) BusinessServicePtrOutput {
return o
}
type BusinessServiceArrayOutput struct{ *pulumi.OutputState }
func (BusinessServiceArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]BusinessService)(nil))
}
func (o BusinessServiceArrayOutput) ToBusinessServiceArrayOutput() BusinessServiceArrayOutput {
return o
}
func (o BusinessServiceArrayOutput) ToBusinessServiceArrayOutputWithContext(ctx context.Context) BusinessServiceArrayOutput {
return o
}
func (o BusinessServiceArrayOutput) Index(i pulumi.IntInput) BusinessServiceOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) BusinessService {
return vs[0].([]BusinessService)[vs[1].(int)]
}).(BusinessServiceOutput)
}
type BusinessServiceMapOutput struct{ *pulumi.OutputState }
func (BusinessServiceMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]BusinessService)(nil))
}
func (o BusinessServiceMapOutput) ToBusinessServiceMapOutput() BusinessServiceMapOutput {
return o
}
func (o BusinessServiceMapOutput) ToBusinessServiceMapOutputWithContext(ctx context.Context) BusinessServiceMapOutput {
return o
}
func (o BusinessServiceMapOutput) MapIndex(k pulumi.StringInput) BusinessServiceOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) BusinessService {
return vs[0].(map[string]BusinessService)[vs[1].(string)]
}).(BusinessServiceOutput)
}
func init() {
pulumi.RegisterOutputType(BusinessServiceOutput{})
pulumi.RegisterOutputType(BusinessServicePtrOutput{})
pulumi.RegisterOutputType(BusinessServiceArrayOutput{})
pulumi.RegisterOutputType(BusinessServiceMapOutput{})
}