/
eventSubscription.go
239 lines (202 loc) · 10.2 KB
/
eventSubscription.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
// Code generated by the Pulumi SDK Generator DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package v1
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-google-native/sdk/go/google/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Creates a new EventSubscription in a given project,location and connection.
type EventSubscription struct {
pulumi.CustomResourceState
ConnectionId pulumi.StringOutput `pulumi:"connectionId"`
// Created time.
CreateTime pulumi.StringOutput `pulumi:"createTime"`
// Optional. The destination to hit when we receive an event
Destinations EventSubscriptionDestinationResponseOutput `pulumi:"destinations"`
// Required. Identifier to assign to the Event Subscription. Must be unique within scope of the parent resource.
EventSubscriptionId pulumi.StringOutput `pulumi:"eventSubscriptionId"`
// Optional. Event type id of the event of current EventSubscription.
EventTypeId pulumi.StringOutput `pulumi:"eventTypeId"`
// Optional. JMS is the source for the event listener.
Jms JMSResponseOutput `pulumi:"jms"`
Location pulumi.StringOutput `pulumi:"location"`
// Resource name of the EventSubscription. Format: projects/{project}/locations/{location}/connections/{connection}/eventSubscriptions/{event_subscription}
Name pulumi.StringOutput `pulumi:"name"`
Project pulumi.StringOutput `pulumi:"project"`
// Optional. Status indicates the status of the event subscription resource
Status EventSubscriptionStatusResponseOutput `pulumi:"status"`
// Optional. name of the Subscriber for the current EventSubscription.
Subscriber pulumi.StringOutput `pulumi:"subscriber"`
// Optional. Link for Subscriber of the current EventSubscription.
SubscriberLink pulumi.StringOutput `pulumi:"subscriberLink"`
// Updated time.
UpdateTime pulumi.StringOutput `pulumi:"updateTime"`
}
// NewEventSubscription registers a new resource with the given unique name, arguments, and options.
func NewEventSubscription(ctx *pulumi.Context,
name string, args *EventSubscriptionArgs, opts ...pulumi.ResourceOption) (*EventSubscription, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ConnectionId == nil {
return nil, errors.New("invalid value for required argument 'ConnectionId'")
}
if args.EventSubscriptionId == nil {
return nil, errors.New("invalid value for required argument 'EventSubscriptionId'")
}
replaceOnChanges := pulumi.ReplaceOnChanges([]string{
"connectionId",
"eventSubscriptionId",
"location",
"project",
})
opts = append(opts, replaceOnChanges)
opts = internal.PkgResourceDefaultOpts(opts)
var resource EventSubscription
err := ctx.RegisterResource("google-native:connectors/v1:EventSubscription", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetEventSubscription gets an existing EventSubscription 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 GetEventSubscription(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *EventSubscriptionState, opts ...pulumi.ResourceOption) (*EventSubscription, error) {
var resource EventSubscription
err := ctx.ReadResource("google-native:connectors/v1:EventSubscription", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering EventSubscription resources.
type eventSubscriptionState struct {
}
type EventSubscriptionState struct {
}
func (EventSubscriptionState) ElementType() reflect.Type {
return reflect.TypeOf((*eventSubscriptionState)(nil)).Elem()
}
type eventSubscriptionArgs struct {
ConnectionId string `pulumi:"connectionId"`
// Optional. The destination to hit when we receive an event
Destinations *EventSubscriptionDestination `pulumi:"destinations"`
// Required. Identifier to assign to the Event Subscription. Must be unique within scope of the parent resource.
EventSubscriptionId string `pulumi:"eventSubscriptionId"`
// Optional. Event type id of the event of current EventSubscription.
EventTypeId *string `pulumi:"eventTypeId"`
// Optional. JMS is the source for the event listener.
Jms *JMS `pulumi:"jms"`
Location *string `pulumi:"location"`
// Resource name of the EventSubscription. Format: projects/{project}/locations/{location}/connections/{connection}/eventSubscriptions/{event_subscription}
Name *string `pulumi:"name"`
Project *string `pulumi:"project"`
// Optional. name of the Subscriber for the current EventSubscription.
Subscriber *string `pulumi:"subscriber"`
// Optional. Link for Subscriber of the current EventSubscription.
SubscriberLink *string `pulumi:"subscriberLink"`
}
// The set of arguments for constructing a EventSubscription resource.
type EventSubscriptionArgs struct {
ConnectionId pulumi.StringInput
// Optional. The destination to hit when we receive an event
Destinations EventSubscriptionDestinationPtrInput
// Required. Identifier to assign to the Event Subscription. Must be unique within scope of the parent resource.
EventSubscriptionId pulumi.StringInput
// Optional. Event type id of the event of current EventSubscription.
EventTypeId pulumi.StringPtrInput
// Optional. JMS is the source for the event listener.
Jms JMSPtrInput
Location pulumi.StringPtrInput
// Resource name of the EventSubscription. Format: projects/{project}/locations/{location}/connections/{connection}/eventSubscriptions/{event_subscription}
Name pulumi.StringPtrInput
Project pulumi.StringPtrInput
// Optional. name of the Subscriber for the current EventSubscription.
Subscriber pulumi.StringPtrInput
// Optional. Link for Subscriber of the current EventSubscription.
SubscriberLink pulumi.StringPtrInput
}
func (EventSubscriptionArgs) ElementType() reflect.Type {
return reflect.TypeOf((*eventSubscriptionArgs)(nil)).Elem()
}
type EventSubscriptionInput interface {
pulumi.Input
ToEventSubscriptionOutput() EventSubscriptionOutput
ToEventSubscriptionOutputWithContext(ctx context.Context) EventSubscriptionOutput
}
func (*EventSubscription) ElementType() reflect.Type {
return reflect.TypeOf((**EventSubscription)(nil)).Elem()
}
func (i *EventSubscription) ToEventSubscriptionOutput() EventSubscriptionOutput {
return i.ToEventSubscriptionOutputWithContext(context.Background())
}
func (i *EventSubscription) ToEventSubscriptionOutputWithContext(ctx context.Context) EventSubscriptionOutput {
return pulumi.ToOutputWithContext(ctx, i).(EventSubscriptionOutput)
}
type EventSubscriptionOutput struct{ *pulumi.OutputState }
func (EventSubscriptionOutput) ElementType() reflect.Type {
return reflect.TypeOf((**EventSubscription)(nil)).Elem()
}
func (o EventSubscriptionOutput) ToEventSubscriptionOutput() EventSubscriptionOutput {
return o
}
func (o EventSubscriptionOutput) ToEventSubscriptionOutputWithContext(ctx context.Context) EventSubscriptionOutput {
return o
}
func (o EventSubscriptionOutput) ConnectionId() pulumi.StringOutput {
return o.ApplyT(func(v *EventSubscription) pulumi.StringOutput { return v.ConnectionId }).(pulumi.StringOutput)
}
// Created time.
func (o EventSubscriptionOutput) CreateTime() pulumi.StringOutput {
return o.ApplyT(func(v *EventSubscription) pulumi.StringOutput { return v.CreateTime }).(pulumi.StringOutput)
}
// Optional. The destination to hit when we receive an event
func (o EventSubscriptionOutput) Destinations() EventSubscriptionDestinationResponseOutput {
return o.ApplyT(func(v *EventSubscription) EventSubscriptionDestinationResponseOutput { return v.Destinations }).(EventSubscriptionDestinationResponseOutput)
}
// Required. Identifier to assign to the Event Subscription. Must be unique within scope of the parent resource.
func (o EventSubscriptionOutput) EventSubscriptionId() pulumi.StringOutput {
return o.ApplyT(func(v *EventSubscription) pulumi.StringOutput { return v.EventSubscriptionId }).(pulumi.StringOutput)
}
// Optional. Event type id of the event of current EventSubscription.
func (o EventSubscriptionOutput) EventTypeId() pulumi.StringOutput {
return o.ApplyT(func(v *EventSubscription) pulumi.StringOutput { return v.EventTypeId }).(pulumi.StringOutput)
}
// Optional. JMS is the source for the event listener.
func (o EventSubscriptionOutput) Jms() JMSResponseOutput {
return o.ApplyT(func(v *EventSubscription) JMSResponseOutput { return v.Jms }).(JMSResponseOutput)
}
func (o EventSubscriptionOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v *EventSubscription) pulumi.StringOutput { return v.Location }).(pulumi.StringOutput)
}
// Resource name of the EventSubscription. Format: projects/{project}/locations/{location}/connections/{connection}/eventSubscriptions/{event_subscription}
func (o EventSubscriptionOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *EventSubscription) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
func (o EventSubscriptionOutput) Project() pulumi.StringOutput {
return o.ApplyT(func(v *EventSubscription) pulumi.StringOutput { return v.Project }).(pulumi.StringOutput)
}
// Optional. Status indicates the status of the event subscription resource
func (o EventSubscriptionOutput) Status() EventSubscriptionStatusResponseOutput {
return o.ApplyT(func(v *EventSubscription) EventSubscriptionStatusResponseOutput { return v.Status }).(EventSubscriptionStatusResponseOutput)
}
// Optional. name of the Subscriber for the current EventSubscription.
func (o EventSubscriptionOutput) Subscriber() pulumi.StringOutput {
return o.ApplyT(func(v *EventSubscription) pulumi.StringOutput { return v.Subscriber }).(pulumi.StringOutput)
}
// Optional. Link for Subscriber of the current EventSubscription.
func (o EventSubscriptionOutput) SubscriberLink() pulumi.StringOutput {
return o.ApplyT(func(v *EventSubscription) pulumi.StringOutput { return v.SubscriberLink }).(pulumi.StringOutput)
}
// Updated time.
func (o EventSubscriptionOutput) UpdateTime() pulumi.StringOutput {
return o.ApplyT(func(v *EventSubscription) pulumi.StringOutput { return v.UpdateTime }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*EventSubscriptionInput)(nil)).Elem(), &EventSubscription{})
pulumi.RegisterOutputType(EventSubscriptionOutput{})
}