-
Notifications
You must be signed in to change notification settings - Fork 50
/
outputEventHub.go
179 lines (162 loc) · 7.51 KB
/
outputEventHub.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
// *** 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 streamanalytics
import (
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/go/pulumi"
)
// Manages a Stream Analytics Output to an EventHub.
//
// > This content is derived from https://github.com/terraform-providers/terraform-provider-azurerm/blob/master/website/docs/r/stream_analytics_output_eventhub.html.markdown.
type OutputEventHub struct {
s *pulumi.ResourceState
}
// NewOutputEventHub registers a new resource with the given unique name, arguments, and options.
func NewOutputEventHub(ctx *pulumi.Context,
name string, args *OutputEventHubArgs, opts ...pulumi.ResourceOpt) (*OutputEventHub, error) {
if args == nil || args.EventhubName == nil {
return nil, errors.New("missing required argument 'EventhubName'")
}
if args == nil || args.ResourceGroupName == nil {
return nil, errors.New("missing required argument 'ResourceGroupName'")
}
if args == nil || args.Serialization == nil {
return nil, errors.New("missing required argument 'Serialization'")
}
if args == nil || args.ServicebusNamespace == nil {
return nil, errors.New("missing required argument 'ServicebusNamespace'")
}
if args == nil || args.SharedAccessPolicyKey == nil {
return nil, errors.New("missing required argument 'SharedAccessPolicyKey'")
}
if args == nil || args.SharedAccessPolicyName == nil {
return nil, errors.New("missing required argument 'SharedAccessPolicyName'")
}
if args == nil || args.StreamAnalyticsJobName == nil {
return nil, errors.New("missing required argument 'StreamAnalyticsJobName'")
}
inputs := make(map[string]interface{})
if args == nil {
inputs["eventhubName"] = nil
inputs["name"] = nil
inputs["resourceGroupName"] = nil
inputs["serialization"] = nil
inputs["servicebusNamespace"] = nil
inputs["sharedAccessPolicyKey"] = nil
inputs["sharedAccessPolicyName"] = nil
inputs["streamAnalyticsJobName"] = nil
} else {
inputs["eventhubName"] = args.EventhubName
inputs["name"] = args.Name
inputs["resourceGroupName"] = args.ResourceGroupName
inputs["serialization"] = args.Serialization
inputs["servicebusNamespace"] = args.ServicebusNamespace
inputs["sharedAccessPolicyKey"] = args.SharedAccessPolicyKey
inputs["sharedAccessPolicyName"] = args.SharedAccessPolicyName
inputs["streamAnalyticsJobName"] = args.StreamAnalyticsJobName
}
s, err := ctx.RegisterResource("azure:streamanalytics/outputEventHub:OutputEventHub", name, true, inputs, opts...)
if err != nil {
return nil, err
}
return &OutputEventHub{s: s}, nil
}
// GetOutputEventHub gets an existing OutputEventHub 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 GetOutputEventHub(ctx *pulumi.Context,
name string, id pulumi.ID, state *OutputEventHubState, opts ...pulumi.ResourceOpt) (*OutputEventHub, error) {
inputs := make(map[string]interface{})
if state != nil {
inputs["eventhubName"] = state.EventhubName
inputs["name"] = state.Name
inputs["resourceGroupName"] = state.ResourceGroupName
inputs["serialization"] = state.Serialization
inputs["servicebusNamespace"] = state.ServicebusNamespace
inputs["sharedAccessPolicyKey"] = state.SharedAccessPolicyKey
inputs["sharedAccessPolicyName"] = state.SharedAccessPolicyName
inputs["streamAnalyticsJobName"] = state.StreamAnalyticsJobName
}
s, err := ctx.ReadResource("azure:streamanalytics/outputEventHub:OutputEventHub", name, id, inputs, opts...)
if err != nil {
return nil, err
}
return &OutputEventHub{s: s}, nil
}
// URN is this resource's unique name assigned by Pulumi.
func (r *OutputEventHub) URN() *pulumi.URNOutput {
return r.s.URN()
}
// ID is this resource's unique identifier assigned by its provider.
func (r *OutputEventHub) ID() *pulumi.IDOutput {
return r.s.ID()
}
// The name of the Event Hub.
func (r *OutputEventHub) EventhubName() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["eventhubName"])
}
// The name of the Stream Output. Changing this forces a new resource to be created.
func (r *OutputEventHub) Name() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["name"])
}
// The name of the Resource Group where the Stream Analytics Job exists. Changing this forces a new resource to be created.
func (r *OutputEventHub) ResourceGroupName() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["resourceGroupName"])
}
// A `serialization` block as defined below.
func (r *OutputEventHub) Serialization() *pulumi.Output {
return r.s.State["serialization"]
}
// The namespace that is associated with the desired Event Hub, Service Bus Queue, Service Bus Topic, etc.
func (r *OutputEventHub) ServicebusNamespace() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["servicebusNamespace"])
}
// The shared access policy key for the specified shared access policy.
func (r *OutputEventHub) SharedAccessPolicyKey() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["sharedAccessPolicyKey"])
}
// The shared access policy name for the Event Hub, Service Bus Queue, Service Bus Topic, etc.
func (r *OutputEventHub) SharedAccessPolicyName() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["sharedAccessPolicyName"])
}
// The name of the Stream Analytics Job. Changing this forces a new resource to be created.
func (r *OutputEventHub) StreamAnalyticsJobName() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["streamAnalyticsJobName"])
}
// Input properties used for looking up and filtering OutputEventHub resources.
type OutputEventHubState struct {
// The name of the Event Hub.
EventhubName interface{}
// The name of the Stream Output. Changing this forces a new resource to be created.
Name interface{}
// The name of the Resource Group where the Stream Analytics Job exists. Changing this forces a new resource to be created.
ResourceGroupName interface{}
// A `serialization` block as defined below.
Serialization interface{}
// The namespace that is associated with the desired Event Hub, Service Bus Queue, Service Bus Topic, etc.
ServicebusNamespace interface{}
// The shared access policy key for the specified shared access policy.
SharedAccessPolicyKey interface{}
// The shared access policy name for the Event Hub, Service Bus Queue, Service Bus Topic, etc.
SharedAccessPolicyName interface{}
// The name of the Stream Analytics Job. Changing this forces a new resource to be created.
StreamAnalyticsJobName interface{}
}
// The set of arguments for constructing a OutputEventHub resource.
type OutputEventHubArgs struct {
// The name of the Event Hub.
EventhubName interface{}
// The name of the Stream Output. Changing this forces a new resource to be created.
Name interface{}
// The name of the Resource Group where the Stream Analytics Job exists. Changing this forces a new resource to be created.
ResourceGroupName interface{}
// A `serialization` block as defined below.
Serialization interface{}
// The namespace that is associated with the desired Event Hub, Service Bus Queue, Service Bus Topic, etc.
ServicebusNamespace interface{}
// The shared access policy key for the specified shared access policy.
SharedAccessPolicyKey interface{}
// The shared access policy name for the Event Hub, Service Bus Queue, Service Bus Topic, etc.
SharedAccessPolicyName interface{}
// The name of the Stream Analytics Job. Changing this forces a new resource to be created.
StreamAnalyticsJobName interface{}
}