-
Notifications
You must be signed in to change notification settings - Fork 2
/
userContactMethod.go
149 lines (136 loc) · 6.63 KB
/
userContactMethod.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
// *** 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 (
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// A [contact method](https://v2.developer.pagerduty.com/v2/page/api-reference#!/Users/get_users_id_contact_methods) is a contact method for a PagerDuty user (email, phone or SMS).
type UserContactMethod struct {
pulumi.CustomResourceState
// The "address" to deliver to: `email`, `phone number`, etc., depending on the type.
Address pulumi.StringOutput `pulumi:"address"`
// If true, this phone has been blacklisted by PagerDuty and no messages will be sent to it.
Blacklisted pulumi.BoolOutput `pulumi:"blacklisted"`
// The 1-to-3 digit country calling code. Required when using `phoneContactMethod` or `smsContactMethod`.
CountryCode pulumi.IntPtrOutput `pulumi:"countryCode"`
// If true, this phone is capable of receiving SMS messages.
Enabled pulumi.BoolOutput `pulumi:"enabled"`
// The label (e.g., "Work", "Mobile", etc.).
Label pulumi.StringOutput `pulumi:"label"`
// Send an abbreviated email message instead of the standard email output.
SendShortEmail pulumi.BoolPtrOutput `pulumi:"sendShortEmail"`
// The contact method type. May be (`emailContactMethod`, `phoneContactMethod`, `smsContactMethod`, `pushNotificationContactMethod`).
Type pulumi.StringOutput `pulumi:"type"`
// The ID of the user.
UserId pulumi.StringOutput `pulumi:"userId"`
}
// NewUserContactMethod registers a new resource with the given unique name, arguments, and options.
func NewUserContactMethod(ctx *pulumi.Context,
name string, args *UserContactMethodArgs, opts ...pulumi.ResourceOption) (*UserContactMethod, error) {
if args == nil || args.Address == nil {
return nil, errors.New("missing required argument 'Address'")
}
if args == nil || args.Label == nil {
return nil, errors.New("missing required argument 'Label'")
}
if args == nil || args.Type == nil {
return nil, errors.New("missing required argument 'Type'")
}
if args == nil || args.UserId == nil {
return nil, errors.New("missing required argument 'UserId'")
}
if args == nil {
args = &UserContactMethodArgs{}
}
var resource UserContactMethod
err := ctx.RegisterResource("pagerduty:index/userContactMethod:UserContactMethod", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetUserContactMethod gets an existing UserContactMethod 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 GetUserContactMethod(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *UserContactMethodState, opts ...pulumi.ResourceOption) (*UserContactMethod, error) {
var resource UserContactMethod
err := ctx.ReadResource("pagerduty:index/userContactMethod:UserContactMethod", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering UserContactMethod resources.
type userContactMethodState struct {
// The "address" to deliver to: `email`, `phone number`, etc., depending on the type.
Address *string `pulumi:"address"`
// If true, this phone has been blacklisted by PagerDuty and no messages will be sent to it.
Blacklisted *bool `pulumi:"blacklisted"`
// The 1-to-3 digit country calling code. Required when using `phoneContactMethod` or `smsContactMethod`.
CountryCode *int `pulumi:"countryCode"`
// If true, this phone is capable of receiving SMS messages.
Enabled *bool `pulumi:"enabled"`
// The label (e.g., "Work", "Mobile", etc.).
Label *string `pulumi:"label"`
// Send an abbreviated email message instead of the standard email output.
SendShortEmail *bool `pulumi:"sendShortEmail"`
// The contact method type. May be (`emailContactMethod`, `phoneContactMethod`, `smsContactMethod`, `pushNotificationContactMethod`).
Type *string `pulumi:"type"`
// The ID of the user.
UserId *string `pulumi:"userId"`
}
type UserContactMethodState struct {
// The "address" to deliver to: `email`, `phone number`, etc., depending on the type.
Address pulumi.StringPtrInput
// If true, this phone has been blacklisted by PagerDuty and no messages will be sent to it.
Blacklisted pulumi.BoolPtrInput
// The 1-to-3 digit country calling code. Required when using `phoneContactMethod` or `smsContactMethod`.
CountryCode pulumi.IntPtrInput
// If true, this phone is capable of receiving SMS messages.
Enabled pulumi.BoolPtrInput
// The label (e.g., "Work", "Mobile", etc.).
Label pulumi.StringPtrInput
// Send an abbreviated email message instead of the standard email output.
SendShortEmail pulumi.BoolPtrInput
// The contact method type. May be (`emailContactMethod`, `phoneContactMethod`, `smsContactMethod`, `pushNotificationContactMethod`).
Type pulumi.StringPtrInput
// The ID of the user.
UserId pulumi.StringPtrInput
}
func (UserContactMethodState) ElementType() reflect.Type {
return reflect.TypeOf((*userContactMethodState)(nil)).Elem()
}
type userContactMethodArgs struct {
// The "address" to deliver to: `email`, `phone number`, etc., depending on the type.
Address string `pulumi:"address"`
// The 1-to-3 digit country calling code. Required when using `phoneContactMethod` or `smsContactMethod`.
CountryCode *int `pulumi:"countryCode"`
// The label (e.g., "Work", "Mobile", etc.).
Label string `pulumi:"label"`
// Send an abbreviated email message instead of the standard email output.
SendShortEmail *bool `pulumi:"sendShortEmail"`
// The contact method type. May be (`emailContactMethod`, `phoneContactMethod`, `smsContactMethod`, `pushNotificationContactMethod`).
Type string `pulumi:"type"`
// The ID of the user.
UserId string `pulumi:"userId"`
}
// The set of arguments for constructing a UserContactMethod resource.
type UserContactMethodArgs struct {
// The "address" to deliver to: `email`, `phone number`, etc., depending on the type.
Address pulumi.StringInput
// The 1-to-3 digit country calling code. Required when using `phoneContactMethod` or `smsContactMethod`.
CountryCode pulumi.IntPtrInput
// The label (e.g., "Work", "Mobile", etc.).
Label pulumi.StringInput
// Send an abbreviated email message instead of the standard email output.
SendShortEmail pulumi.BoolPtrInput
// The contact method type. May be (`emailContactMethod`, `phoneContactMethod`, `smsContactMethod`, `pushNotificationContactMethod`).
Type pulumi.StringInput
// The ID of the user.
UserId pulumi.StringInput
}
func (UserContactMethodArgs) ElementType() reflect.Type {
return reflect.TypeOf((*userContactMethodArgs)(nil)).Elem()
}