-
Notifications
You must be signed in to change notification settings - Fork 2
/
businessService.go
324 lines (270 loc) · 12.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
// 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"
"github.com/pulumi/pulumi-pagerduty/sdk/v4/go/pagerduty/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// A [business service](https://developer.pagerduty.com/api-reference/b3A6Mjc0ODExNg-create-a-business-service) 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/v4/go/pagerduty"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := pagerduty.NewBusinessService(ctx, "example", &pagerduty.BusinessServiceArgs{
// Name: pulumi.String("My Web App"),
// 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.StringOutput `pulumi:"description"`
// A URL at which the entity is uniquely displayed in the Web app.
HtmlUrl pulumi.StringOutput `pulumi:"htmlUrl"`
Name pulumi.StringOutput `pulumi:"name"`
PointOfContact pulumi.StringPtrOutput `pulumi:"pointOfContact"`
// The API show URL at which the object is accessible.
Self pulumi.StringOutput `pulumi:"self"`
// A short-form, server-generated string that provides succinct, important information about an object suitable for primary labeling of an entity in a client. In many cases, this will be identical to `name`, though it is not intended to be an identifier.
Summary pulumi.StringOutput `pulumi:"summary"`
Team pulumi.StringPtrOutput `pulumi:"team"`
// Deprecated: This will become a computed attribute in the next major release.
Type pulumi.StringOutput `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{}
}
if args.Description == nil {
args.Description = pulumi.StringPtr("Managed by Pulumi")
}
opts = internal.PkgResourceDefaultOpts(opts)
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"`
// A URL at which the entity is uniquely displayed in the Web app.
HtmlUrl *string `pulumi:"htmlUrl"`
Name *string `pulumi:"name"`
PointOfContact *string `pulumi:"pointOfContact"`
// The API show URL at which the object is accessible.
Self *string `pulumi:"self"`
// A short-form, server-generated string that provides succinct, important information about an object suitable for primary labeling of an entity in a client. In many cases, this will be identical to `name`, though it is not intended to be an identifier.
Summary *string `pulumi:"summary"`
Team *string `pulumi:"team"`
// Deprecated: This will become a computed attribute in the next major release.
Type *string `pulumi:"type"`
}
type BusinessServiceState struct {
Description pulumi.StringPtrInput
// A URL at which the entity is uniquely displayed in the Web app.
HtmlUrl pulumi.StringPtrInput
Name pulumi.StringPtrInput
PointOfContact pulumi.StringPtrInput
// The API show URL at which the object is accessible.
Self pulumi.StringPtrInput
// A short-form, server-generated string that provides succinct, important information about an object suitable for primary labeling of an entity in a client. In many cases, this will be identical to `name`, though it is not intended to be an identifier.
Summary pulumi.StringPtrInput
Team pulumi.StringPtrInput
// Deprecated: This will become a computed attribute in the next major release.
Type pulumi.StringPtrInput
}
func (BusinessServiceState) ElementType() reflect.Type {
return reflect.TypeOf((*businessServiceState)(nil)).Elem()
}
type businessServiceArgs struct {
Description *string `pulumi:"description"`
Name *string `pulumi:"name"`
PointOfContact *string `pulumi:"pointOfContact"`
Team *string `pulumi:"team"`
// Deprecated: This will become a computed attribute in the next major release.
Type *string `pulumi:"type"`
}
// The set of arguments for constructing a BusinessService resource.
type BusinessServiceArgs struct {
Description pulumi.StringPtrInput
Name pulumi.StringPtrInput
PointOfContact pulumi.StringPtrInput
Team pulumi.StringPtrInput
// Deprecated: This will become a computed attribute in the next major release.
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)).Elem()
}
func (i *BusinessService) ToBusinessServiceOutput() BusinessServiceOutput {
return i.ToBusinessServiceOutputWithContext(context.Background())
}
func (i *BusinessService) ToBusinessServiceOutputWithContext(ctx context.Context) BusinessServiceOutput {
return pulumi.ToOutputWithContext(ctx, i).(BusinessServiceOutput)
}
// 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)).Elem()
}
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)).Elem()
}
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)).Elem()
}
func (o BusinessServiceOutput) ToBusinessServiceOutput() BusinessServiceOutput {
return o
}
func (o BusinessServiceOutput) ToBusinessServiceOutputWithContext(ctx context.Context) BusinessServiceOutput {
return o
}
func (o BusinessServiceOutput) Description() pulumi.StringOutput {
return o.ApplyT(func(v *BusinessService) pulumi.StringOutput { return v.Description }).(pulumi.StringOutput)
}
// A URL at which the entity is uniquely displayed in the Web app.
func (o BusinessServiceOutput) HtmlUrl() pulumi.StringOutput {
return o.ApplyT(func(v *BusinessService) pulumi.StringOutput { return v.HtmlUrl }).(pulumi.StringOutput)
}
func (o BusinessServiceOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *BusinessService) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
func (o BusinessServiceOutput) PointOfContact() pulumi.StringPtrOutput {
return o.ApplyT(func(v *BusinessService) pulumi.StringPtrOutput { return v.PointOfContact }).(pulumi.StringPtrOutput)
}
// The API show URL at which the object is accessible.
func (o BusinessServiceOutput) Self() pulumi.StringOutput {
return o.ApplyT(func(v *BusinessService) pulumi.StringOutput { return v.Self }).(pulumi.StringOutput)
}
// A short-form, server-generated string that provides succinct, important information about an object suitable for primary labeling of an entity in a client. In many cases, this will be identical to `name`, though it is not intended to be an identifier.
func (o BusinessServiceOutput) Summary() pulumi.StringOutput {
return o.ApplyT(func(v *BusinessService) pulumi.StringOutput { return v.Summary }).(pulumi.StringOutput)
}
func (o BusinessServiceOutput) Team() pulumi.StringPtrOutput {
return o.ApplyT(func(v *BusinessService) pulumi.StringPtrOutput { return v.Team }).(pulumi.StringPtrOutput)
}
// Deprecated: This will become a computed attribute in the next major release.
func (o BusinessServiceOutput) Type() pulumi.StringOutput {
return o.ApplyT(func(v *BusinessService) pulumi.StringOutput { return v.Type }).(pulumi.StringOutput)
}
type BusinessServiceArrayOutput struct{ *pulumi.OutputState }
func (BusinessServiceArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*BusinessService)(nil)).Elem()
}
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)).Elem()
}
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.RegisterInputType(reflect.TypeOf((*BusinessServiceInput)(nil)).Elem(), &BusinessService{})
pulumi.RegisterInputType(reflect.TypeOf((*BusinessServiceArrayInput)(nil)).Elem(), BusinessServiceArray{})
pulumi.RegisterInputType(reflect.TypeOf((*BusinessServiceMapInput)(nil)).Elem(), BusinessServiceMap{})
pulumi.RegisterOutputType(BusinessServiceOutput{})
pulumi.RegisterOutputType(BusinessServiceArrayOutput{})
pulumi.RegisterOutputType(BusinessServiceMapOutput{})
}