/
emailForward.go
297 lines (247 loc) · 10.1 KB
/
emailForward.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
// 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 dnsimple
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-dnsimple/sdk/v3/go/dnsimple/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides a DNSimple email forward resource.
//
// ## Example Usage
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-dnsimple/sdk/v3/go/dnsimple"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// // Add an email forwarding rule to the domain
// _, err := dnsimple.NewEmailForward(ctx, "foobar", &dnsimple.EmailForwardArgs{
// AliasName: pulumi.String("sales"),
// DestinationEmail: pulumi.String("jane.doe@example.com"),
// Domain: pulumi.Any(_var.Dnsimple_domain),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
type EmailForward struct {
pulumi.CustomResourceState
// The source email address on the domain
AliasEmail pulumi.StringOutput `pulumi:"aliasEmail"`
// The name part (the part before the @) of the source email address on the domain
AliasName pulumi.StringOutput `pulumi:"aliasName"`
// The destination email address on another domain
DestinationEmail pulumi.StringOutput `pulumi:"destinationEmail"`
// The domain to add the email forwarding rule to
Domain pulumi.StringOutput `pulumi:"domain"`
}
// NewEmailForward registers a new resource with the given unique name, arguments, and options.
func NewEmailForward(ctx *pulumi.Context,
name string, args *EmailForwardArgs, opts ...pulumi.ResourceOption) (*EmailForward, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.AliasName == nil {
return nil, errors.New("invalid value for required argument 'AliasName'")
}
if args.DestinationEmail == nil {
return nil, errors.New("invalid value for required argument 'DestinationEmail'")
}
if args.Domain == nil {
return nil, errors.New("invalid value for required argument 'Domain'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource EmailForward
err := ctx.RegisterResource("dnsimple:index/emailForward:EmailForward", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetEmailForward gets an existing EmailForward 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 GetEmailForward(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *EmailForwardState, opts ...pulumi.ResourceOption) (*EmailForward, error) {
var resource EmailForward
err := ctx.ReadResource("dnsimple:index/emailForward:EmailForward", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering EmailForward resources.
type emailForwardState struct {
// The source email address on the domain
AliasEmail *string `pulumi:"aliasEmail"`
// The name part (the part before the @) of the source email address on the domain
AliasName *string `pulumi:"aliasName"`
// The destination email address on another domain
DestinationEmail *string `pulumi:"destinationEmail"`
// The domain to add the email forwarding rule to
Domain *string `pulumi:"domain"`
}
type EmailForwardState struct {
// The source email address on the domain
AliasEmail pulumi.StringPtrInput
// The name part (the part before the @) of the source email address on the domain
AliasName pulumi.StringPtrInput
// The destination email address on another domain
DestinationEmail pulumi.StringPtrInput
// The domain to add the email forwarding rule to
Domain pulumi.StringPtrInput
}
func (EmailForwardState) ElementType() reflect.Type {
return reflect.TypeOf((*emailForwardState)(nil)).Elem()
}
type emailForwardArgs struct {
// The name part (the part before the @) of the source email address on the domain
AliasName string `pulumi:"aliasName"`
// The destination email address on another domain
DestinationEmail string `pulumi:"destinationEmail"`
// The domain to add the email forwarding rule to
Domain string `pulumi:"domain"`
}
// The set of arguments for constructing a EmailForward resource.
type EmailForwardArgs struct {
// The name part (the part before the @) of the source email address on the domain
AliasName pulumi.StringInput
// The destination email address on another domain
DestinationEmail pulumi.StringInput
// The domain to add the email forwarding rule to
Domain pulumi.StringInput
}
func (EmailForwardArgs) ElementType() reflect.Type {
return reflect.TypeOf((*emailForwardArgs)(nil)).Elem()
}
type EmailForwardInput interface {
pulumi.Input
ToEmailForwardOutput() EmailForwardOutput
ToEmailForwardOutputWithContext(ctx context.Context) EmailForwardOutput
}
func (*EmailForward) ElementType() reflect.Type {
return reflect.TypeOf((**EmailForward)(nil)).Elem()
}
func (i *EmailForward) ToEmailForwardOutput() EmailForwardOutput {
return i.ToEmailForwardOutputWithContext(context.Background())
}
func (i *EmailForward) ToEmailForwardOutputWithContext(ctx context.Context) EmailForwardOutput {
return pulumi.ToOutputWithContext(ctx, i).(EmailForwardOutput)
}
// EmailForwardArrayInput is an input type that accepts EmailForwardArray and EmailForwardArrayOutput values.
// You can construct a concrete instance of `EmailForwardArrayInput` via:
//
// EmailForwardArray{ EmailForwardArgs{...} }
type EmailForwardArrayInput interface {
pulumi.Input
ToEmailForwardArrayOutput() EmailForwardArrayOutput
ToEmailForwardArrayOutputWithContext(context.Context) EmailForwardArrayOutput
}
type EmailForwardArray []EmailForwardInput
func (EmailForwardArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*EmailForward)(nil)).Elem()
}
func (i EmailForwardArray) ToEmailForwardArrayOutput() EmailForwardArrayOutput {
return i.ToEmailForwardArrayOutputWithContext(context.Background())
}
func (i EmailForwardArray) ToEmailForwardArrayOutputWithContext(ctx context.Context) EmailForwardArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(EmailForwardArrayOutput)
}
// EmailForwardMapInput is an input type that accepts EmailForwardMap and EmailForwardMapOutput values.
// You can construct a concrete instance of `EmailForwardMapInput` via:
//
// EmailForwardMap{ "key": EmailForwardArgs{...} }
type EmailForwardMapInput interface {
pulumi.Input
ToEmailForwardMapOutput() EmailForwardMapOutput
ToEmailForwardMapOutputWithContext(context.Context) EmailForwardMapOutput
}
type EmailForwardMap map[string]EmailForwardInput
func (EmailForwardMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*EmailForward)(nil)).Elem()
}
func (i EmailForwardMap) ToEmailForwardMapOutput() EmailForwardMapOutput {
return i.ToEmailForwardMapOutputWithContext(context.Background())
}
func (i EmailForwardMap) ToEmailForwardMapOutputWithContext(ctx context.Context) EmailForwardMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(EmailForwardMapOutput)
}
type EmailForwardOutput struct{ *pulumi.OutputState }
func (EmailForwardOutput) ElementType() reflect.Type {
return reflect.TypeOf((**EmailForward)(nil)).Elem()
}
func (o EmailForwardOutput) ToEmailForwardOutput() EmailForwardOutput {
return o
}
func (o EmailForwardOutput) ToEmailForwardOutputWithContext(ctx context.Context) EmailForwardOutput {
return o
}
// The source email address on the domain
func (o EmailForwardOutput) AliasEmail() pulumi.StringOutput {
return o.ApplyT(func(v *EmailForward) pulumi.StringOutput { return v.AliasEmail }).(pulumi.StringOutput)
}
// The name part (the part before the @) of the source email address on the domain
func (o EmailForwardOutput) AliasName() pulumi.StringOutput {
return o.ApplyT(func(v *EmailForward) pulumi.StringOutput { return v.AliasName }).(pulumi.StringOutput)
}
// The destination email address on another domain
func (o EmailForwardOutput) DestinationEmail() pulumi.StringOutput {
return o.ApplyT(func(v *EmailForward) pulumi.StringOutput { return v.DestinationEmail }).(pulumi.StringOutput)
}
// The domain to add the email forwarding rule to
func (o EmailForwardOutput) Domain() pulumi.StringOutput {
return o.ApplyT(func(v *EmailForward) pulumi.StringOutput { return v.Domain }).(pulumi.StringOutput)
}
type EmailForwardArrayOutput struct{ *pulumi.OutputState }
func (EmailForwardArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*EmailForward)(nil)).Elem()
}
func (o EmailForwardArrayOutput) ToEmailForwardArrayOutput() EmailForwardArrayOutput {
return o
}
func (o EmailForwardArrayOutput) ToEmailForwardArrayOutputWithContext(ctx context.Context) EmailForwardArrayOutput {
return o
}
func (o EmailForwardArrayOutput) Index(i pulumi.IntInput) EmailForwardOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *EmailForward {
return vs[0].([]*EmailForward)[vs[1].(int)]
}).(EmailForwardOutput)
}
type EmailForwardMapOutput struct{ *pulumi.OutputState }
func (EmailForwardMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*EmailForward)(nil)).Elem()
}
func (o EmailForwardMapOutput) ToEmailForwardMapOutput() EmailForwardMapOutput {
return o
}
func (o EmailForwardMapOutput) ToEmailForwardMapOutputWithContext(ctx context.Context) EmailForwardMapOutput {
return o
}
func (o EmailForwardMapOutput) MapIndex(k pulumi.StringInput) EmailForwardOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *EmailForward {
return vs[0].(map[string]*EmailForward)[vs[1].(string)]
}).(EmailForwardOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*EmailForwardInput)(nil)).Elem(), &EmailForward{})
pulumi.RegisterInputType(reflect.TypeOf((*EmailForwardArrayInput)(nil)).Elem(), EmailForwardArray{})
pulumi.RegisterInputType(reflect.TypeOf((*EmailForwardMapInput)(nil)).Elem(), EmailForwardMap{})
pulumi.RegisterOutputType(EmailForwardOutput{})
pulumi.RegisterOutputType(EmailForwardArrayOutput{})
pulumi.RegisterOutputType(EmailForwardMapOutput{})
}