This repository has been archived by the owner on Mar 11, 2021. It is now read-only.
/
trigger.go
171 lines (147 loc) · 4.84 KB
/
trigger.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
// *** WARNING: this file was generated by the Pulumi SDK Generator. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package v20191101
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// A Trigger data transfer object.
type Trigger struct {
pulumi.CustomResourceState
// Kind of synchronization
Kind pulumi.StringOutput `pulumi:"kind"`
// Name of the azure resource
Name pulumi.StringOutput `pulumi:"name"`
// Type of the azure resource
Type pulumi.StringOutput `pulumi:"type"`
}
// NewTrigger registers a new resource with the given unique name, arguments, and options.
func NewTrigger(ctx *pulumi.Context,
name string, args *TriggerArgs, opts ...pulumi.ResourceOption) (*Trigger, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.AccountName == nil {
return nil, errors.New("invalid value for required argument 'AccountName'")
}
if args.Kind == nil {
return nil, errors.New("invalid value for required argument 'Kind'")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
if args.ShareSubscriptionName == nil {
return nil, errors.New("invalid value for required argument 'ShareSubscriptionName'")
}
if args.TriggerName == nil {
return nil, errors.New("invalid value for required argument 'TriggerName'")
}
aliases := pulumi.Aliases([]pulumi.Alias{
{
Type: pulumi.String("azure-nextgen:datashare/latest:Trigger"),
},
{
Type: pulumi.String("azure-nextgen:datashare/v20181101preview:Trigger"),
},
{
Type: pulumi.String("azure-nextgen:datashare/v20200901:Trigger"),
},
})
opts = append(opts, aliases)
var resource Trigger
err := ctx.RegisterResource("azure-nextgen:datashare/v20191101:Trigger", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetTrigger gets an existing Trigger 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 GetTrigger(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *TriggerState, opts ...pulumi.ResourceOption) (*Trigger, error) {
var resource Trigger
err := ctx.ReadResource("azure-nextgen:datashare/v20191101:Trigger", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Trigger resources.
type triggerState struct {
// Kind of synchronization
Kind *string `pulumi:"kind"`
// Name of the azure resource
Name *string `pulumi:"name"`
// Type of the azure resource
Type *string `pulumi:"type"`
}
type TriggerState struct {
// Kind of synchronization
Kind pulumi.StringPtrInput
// Name of the azure resource
Name pulumi.StringPtrInput
// Type of the azure resource
Type pulumi.StringPtrInput
}
func (TriggerState) ElementType() reflect.Type {
return reflect.TypeOf((*triggerState)(nil)).Elem()
}
type triggerArgs struct {
// The name of the share account.
AccountName string `pulumi:"accountName"`
// Kind of synchronization
Kind string `pulumi:"kind"`
// The resource group name.
ResourceGroupName string `pulumi:"resourceGroupName"`
// The name of the share subscription which will hold the data set sink.
ShareSubscriptionName string `pulumi:"shareSubscriptionName"`
// The name of the trigger.
TriggerName string `pulumi:"triggerName"`
}
// The set of arguments for constructing a Trigger resource.
type TriggerArgs struct {
// The name of the share account.
AccountName pulumi.StringInput
// Kind of synchronization
Kind pulumi.StringInput
// The resource group name.
ResourceGroupName pulumi.StringInput
// The name of the share subscription which will hold the data set sink.
ShareSubscriptionName pulumi.StringInput
// The name of the trigger.
TriggerName pulumi.StringInput
}
func (TriggerArgs) ElementType() reflect.Type {
return reflect.TypeOf((*triggerArgs)(nil)).Elem()
}
type TriggerInput interface {
pulumi.Input
ToTriggerOutput() TriggerOutput
ToTriggerOutputWithContext(ctx context.Context) TriggerOutput
}
func (*Trigger) ElementType() reflect.Type {
return reflect.TypeOf((*Trigger)(nil))
}
func (i *Trigger) ToTriggerOutput() TriggerOutput {
return i.ToTriggerOutputWithContext(context.Background())
}
func (i *Trigger) ToTriggerOutputWithContext(ctx context.Context) TriggerOutput {
return pulumi.ToOutputWithContext(ctx, i).(TriggerOutput)
}
type TriggerOutput struct {
*pulumi.OutputState
}
func (TriggerOutput) ElementType() reflect.Type {
return reflect.TypeOf((*Trigger)(nil))
}
func (o TriggerOutput) ToTriggerOutput() TriggerOutput {
return o
}
func (o TriggerOutput) ToTriggerOutputWithContext(ctx context.Context) TriggerOutput {
return o
}
func init() {
pulumi.RegisterOutputType(TriggerOutput{})
}