/
notificationRecipientEmail.go
310 lines (261 loc) · 15.6 KB
/
notificationRecipientEmail.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
// 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 apimanagement
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a API Management Notification Recipient Email.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement"
// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
// Name: pulumi.String("example-resources"),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// exampleService, err := apimanagement.NewService(ctx, "example", &apimanagement.ServiceArgs{
// Name: pulumi.String("example-apim"),
// Location: example.Location,
// ResourceGroupName: example.Name,
// PublisherName: pulumi.String("My Company"),
// PublisherEmail: pulumi.String("company@terraform.io"),
// SkuName: pulumi.String("Developer_1"),
// })
// if err != nil {
// return err
// }
// _, err = apimanagement.NewNotificationRecipientEmail(ctx, "example", &apimanagement.NotificationRecipientEmailArgs{
// ApiManagementId: exampleService.ID(),
// NotificationType: pulumi.String("AccountClosedPublisher"),
// Email: pulumi.String("foo@bar.com"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// API Management Notification Recipient Emails can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:apimanagement/notificationRecipientEmail:NotificationRecipientEmail example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.ApiManagement/service/service1/notifications/notificationName1/recipientEmails/email1
// ```
type NotificationRecipientEmail struct {
pulumi.CustomResourceState
// The ID of the API Management Service from which to create this Notification Recipient Email. Changing this forces a new API Management Notification Recipient Email to be created.
ApiManagementId pulumi.StringOutput `pulumi:"apiManagementId"`
// The recipient email address. Changing this forces a new API Management Notification Recipient Email to be created.
Email pulumi.StringOutput `pulumi:"email"`
// The Notification Name to be received. Changing this forces a new API Management Notification Recipient Email to be created. Possible values are `AccountClosedPublisher`, `BCC`, `NewApplicationNotificationMessage`, `NewIssuePublisherNotificationMessage`, `PurchasePublisherNotificationMessage`, `QuotaLimitApproachingPublisherNotificationMessage`, and `RequestPublisherNotificationMessage`.
NotificationType pulumi.StringOutput `pulumi:"notificationType"`
}
// NewNotificationRecipientEmail registers a new resource with the given unique name, arguments, and options.
func NewNotificationRecipientEmail(ctx *pulumi.Context,
name string, args *NotificationRecipientEmailArgs, opts ...pulumi.ResourceOption) (*NotificationRecipientEmail, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ApiManagementId == nil {
return nil, errors.New("invalid value for required argument 'ApiManagementId'")
}
if args.Email == nil {
return nil, errors.New("invalid value for required argument 'Email'")
}
if args.NotificationType == nil {
return nil, errors.New("invalid value for required argument 'NotificationType'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource NotificationRecipientEmail
err := ctx.RegisterResource("azure:apimanagement/notificationRecipientEmail:NotificationRecipientEmail", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetNotificationRecipientEmail gets an existing NotificationRecipientEmail 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 GetNotificationRecipientEmail(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *NotificationRecipientEmailState, opts ...pulumi.ResourceOption) (*NotificationRecipientEmail, error) {
var resource NotificationRecipientEmail
err := ctx.ReadResource("azure:apimanagement/notificationRecipientEmail:NotificationRecipientEmail", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering NotificationRecipientEmail resources.
type notificationRecipientEmailState struct {
// The ID of the API Management Service from which to create this Notification Recipient Email. Changing this forces a new API Management Notification Recipient Email to be created.
ApiManagementId *string `pulumi:"apiManagementId"`
// The recipient email address. Changing this forces a new API Management Notification Recipient Email to be created.
Email *string `pulumi:"email"`
// The Notification Name to be received. Changing this forces a new API Management Notification Recipient Email to be created. Possible values are `AccountClosedPublisher`, `BCC`, `NewApplicationNotificationMessage`, `NewIssuePublisherNotificationMessage`, `PurchasePublisherNotificationMessage`, `QuotaLimitApproachingPublisherNotificationMessage`, and `RequestPublisherNotificationMessage`.
NotificationType *string `pulumi:"notificationType"`
}
type NotificationRecipientEmailState struct {
// The ID of the API Management Service from which to create this Notification Recipient Email. Changing this forces a new API Management Notification Recipient Email to be created.
ApiManagementId pulumi.StringPtrInput
// The recipient email address. Changing this forces a new API Management Notification Recipient Email to be created.
Email pulumi.StringPtrInput
// The Notification Name to be received. Changing this forces a new API Management Notification Recipient Email to be created. Possible values are `AccountClosedPublisher`, `BCC`, `NewApplicationNotificationMessage`, `NewIssuePublisherNotificationMessage`, `PurchasePublisherNotificationMessage`, `QuotaLimitApproachingPublisherNotificationMessage`, and `RequestPublisherNotificationMessage`.
NotificationType pulumi.StringPtrInput
}
func (NotificationRecipientEmailState) ElementType() reflect.Type {
return reflect.TypeOf((*notificationRecipientEmailState)(nil)).Elem()
}
type notificationRecipientEmailArgs struct {
// The ID of the API Management Service from which to create this Notification Recipient Email. Changing this forces a new API Management Notification Recipient Email to be created.
ApiManagementId string `pulumi:"apiManagementId"`
// The recipient email address. Changing this forces a new API Management Notification Recipient Email to be created.
Email string `pulumi:"email"`
// The Notification Name to be received. Changing this forces a new API Management Notification Recipient Email to be created. Possible values are `AccountClosedPublisher`, `BCC`, `NewApplicationNotificationMessage`, `NewIssuePublisherNotificationMessage`, `PurchasePublisherNotificationMessage`, `QuotaLimitApproachingPublisherNotificationMessage`, and `RequestPublisherNotificationMessage`.
NotificationType string `pulumi:"notificationType"`
}
// The set of arguments for constructing a NotificationRecipientEmail resource.
type NotificationRecipientEmailArgs struct {
// The ID of the API Management Service from which to create this Notification Recipient Email. Changing this forces a new API Management Notification Recipient Email to be created.
ApiManagementId pulumi.StringInput
// The recipient email address. Changing this forces a new API Management Notification Recipient Email to be created.
Email pulumi.StringInput
// The Notification Name to be received. Changing this forces a new API Management Notification Recipient Email to be created. Possible values are `AccountClosedPublisher`, `BCC`, `NewApplicationNotificationMessage`, `NewIssuePublisherNotificationMessage`, `PurchasePublisherNotificationMessage`, `QuotaLimitApproachingPublisherNotificationMessage`, and `RequestPublisherNotificationMessage`.
NotificationType pulumi.StringInput
}
func (NotificationRecipientEmailArgs) ElementType() reflect.Type {
return reflect.TypeOf((*notificationRecipientEmailArgs)(nil)).Elem()
}
type NotificationRecipientEmailInput interface {
pulumi.Input
ToNotificationRecipientEmailOutput() NotificationRecipientEmailOutput
ToNotificationRecipientEmailOutputWithContext(ctx context.Context) NotificationRecipientEmailOutput
}
func (*NotificationRecipientEmail) ElementType() reflect.Type {
return reflect.TypeOf((**NotificationRecipientEmail)(nil)).Elem()
}
func (i *NotificationRecipientEmail) ToNotificationRecipientEmailOutput() NotificationRecipientEmailOutput {
return i.ToNotificationRecipientEmailOutputWithContext(context.Background())
}
func (i *NotificationRecipientEmail) ToNotificationRecipientEmailOutputWithContext(ctx context.Context) NotificationRecipientEmailOutput {
return pulumi.ToOutputWithContext(ctx, i).(NotificationRecipientEmailOutput)
}
// NotificationRecipientEmailArrayInput is an input type that accepts NotificationRecipientEmailArray and NotificationRecipientEmailArrayOutput values.
// You can construct a concrete instance of `NotificationRecipientEmailArrayInput` via:
//
// NotificationRecipientEmailArray{ NotificationRecipientEmailArgs{...} }
type NotificationRecipientEmailArrayInput interface {
pulumi.Input
ToNotificationRecipientEmailArrayOutput() NotificationRecipientEmailArrayOutput
ToNotificationRecipientEmailArrayOutputWithContext(context.Context) NotificationRecipientEmailArrayOutput
}
type NotificationRecipientEmailArray []NotificationRecipientEmailInput
func (NotificationRecipientEmailArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*NotificationRecipientEmail)(nil)).Elem()
}
func (i NotificationRecipientEmailArray) ToNotificationRecipientEmailArrayOutput() NotificationRecipientEmailArrayOutput {
return i.ToNotificationRecipientEmailArrayOutputWithContext(context.Background())
}
func (i NotificationRecipientEmailArray) ToNotificationRecipientEmailArrayOutputWithContext(ctx context.Context) NotificationRecipientEmailArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(NotificationRecipientEmailArrayOutput)
}
// NotificationRecipientEmailMapInput is an input type that accepts NotificationRecipientEmailMap and NotificationRecipientEmailMapOutput values.
// You can construct a concrete instance of `NotificationRecipientEmailMapInput` via:
//
// NotificationRecipientEmailMap{ "key": NotificationRecipientEmailArgs{...} }
type NotificationRecipientEmailMapInput interface {
pulumi.Input
ToNotificationRecipientEmailMapOutput() NotificationRecipientEmailMapOutput
ToNotificationRecipientEmailMapOutputWithContext(context.Context) NotificationRecipientEmailMapOutput
}
type NotificationRecipientEmailMap map[string]NotificationRecipientEmailInput
func (NotificationRecipientEmailMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*NotificationRecipientEmail)(nil)).Elem()
}
func (i NotificationRecipientEmailMap) ToNotificationRecipientEmailMapOutput() NotificationRecipientEmailMapOutput {
return i.ToNotificationRecipientEmailMapOutputWithContext(context.Background())
}
func (i NotificationRecipientEmailMap) ToNotificationRecipientEmailMapOutputWithContext(ctx context.Context) NotificationRecipientEmailMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(NotificationRecipientEmailMapOutput)
}
type NotificationRecipientEmailOutput struct{ *pulumi.OutputState }
func (NotificationRecipientEmailOutput) ElementType() reflect.Type {
return reflect.TypeOf((**NotificationRecipientEmail)(nil)).Elem()
}
func (o NotificationRecipientEmailOutput) ToNotificationRecipientEmailOutput() NotificationRecipientEmailOutput {
return o
}
func (o NotificationRecipientEmailOutput) ToNotificationRecipientEmailOutputWithContext(ctx context.Context) NotificationRecipientEmailOutput {
return o
}
// The ID of the API Management Service from which to create this Notification Recipient Email. Changing this forces a new API Management Notification Recipient Email to be created.
func (o NotificationRecipientEmailOutput) ApiManagementId() pulumi.StringOutput {
return o.ApplyT(func(v *NotificationRecipientEmail) pulumi.StringOutput { return v.ApiManagementId }).(pulumi.StringOutput)
}
// The recipient email address. Changing this forces a new API Management Notification Recipient Email to be created.
func (o NotificationRecipientEmailOutput) Email() pulumi.StringOutput {
return o.ApplyT(func(v *NotificationRecipientEmail) pulumi.StringOutput { return v.Email }).(pulumi.StringOutput)
}
// The Notification Name to be received. Changing this forces a new API Management Notification Recipient Email to be created. Possible values are `AccountClosedPublisher`, `BCC`, `NewApplicationNotificationMessage`, `NewIssuePublisherNotificationMessage`, `PurchasePublisherNotificationMessage`, `QuotaLimitApproachingPublisherNotificationMessage`, and `RequestPublisherNotificationMessage`.
func (o NotificationRecipientEmailOutput) NotificationType() pulumi.StringOutput {
return o.ApplyT(func(v *NotificationRecipientEmail) pulumi.StringOutput { return v.NotificationType }).(pulumi.StringOutput)
}
type NotificationRecipientEmailArrayOutput struct{ *pulumi.OutputState }
func (NotificationRecipientEmailArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*NotificationRecipientEmail)(nil)).Elem()
}
func (o NotificationRecipientEmailArrayOutput) ToNotificationRecipientEmailArrayOutput() NotificationRecipientEmailArrayOutput {
return o
}
func (o NotificationRecipientEmailArrayOutput) ToNotificationRecipientEmailArrayOutputWithContext(ctx context.Context) NotificationRecipientEmailArrayOutput {
return o
}
func (o NotificationRecipientEmailArrayOutput) Index(i pulumi.IntInput) NotificationRecipientEmailOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *NotificationRecipientEmail {
return vs[0].([]*NotificationRecipientEmail)[vs[1].(int)]
}).(NotificationRecipientEmailOutput)
}
type NotificationRecipientEmailMapOutput struct{ *pulumi.OutputState }
func (NotificationRecipientEmailMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*NotificationRecipientEmail)(nil)).Elem()
}
func (o NotificationRecipientEmailMapOutput) ToNotificationRecipientEmailMapOutput() NotificationRecipientEmailMapOutput {
return o
}
func (o NotificationRecipientEmailMapOutput) ToNotificationRecipientEmailMapOutputWithContext(ctx context.Context) NotificationRecipientEmailMapOutput {
return o
}
func (o NotificationRecipientEmailMapOutput) MapIndex(k pulumi.StringInput) NotificationRecipientEmailOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *NotificationRecipientEmail {
return vs[0].(map[string]*NotificationRecipientEmail)[vs[1].(string)]
}).(NotificationRecipientEmailOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*NotificationRecipientEmailInput)(nil)).Elem(), &NotificationRecipientEmail{})
pulumi.RegisterInputType(reflect.TypeOf((*NotificationRecipientEmailArrayInput)(nil)).Elem(), NotificationRecipientEmailArray{})
pulumi.RegisterInputType(reflect.TypeOf((*NotificationRecipientEmailMapInput)(nil)).Elem(), NotificationRecipientEmailMap{})
pulumi.RegisterOutputType(NotificationRecipientEmailOutput{})
pulumi.RegisterOutputType(NotificationRecipientEmailArrayOutput{})
pulumi.RegisterOutputType(NotificationRecipientEmailMapOutput{})
}