This repository has been archived by the owner on Mar 11, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
topic.go
232 lines (208 loc) · 7.96 KB
/
topic.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
// *** 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 v20200101preview
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// EventGrid Topic
type Topic struct {
pulumi.CustomResourceState
// Endpoint for the topic.
Endpoint pulumi.StringOutput `pulumi:"endpoint"`
// This determines the format that Event Grid should expect for incoming events published to the topic.
InputSchema pulumi.StringPtrOutput `pulumi:"inputSchema"`
// This enables publishing using custom event schemas. An InputSchemaMapping can be specified to map various properties of a source schema to various required properties of the EventGridEvent schema.
InputSchemaMapping JsonInputSchemaMappingResponsePtrOutput `pulumi:"inputSchemaMapping"`
// Location of the resource
Location pulumi.StringOutput `pulumi:"location"`
// Metric resource id for the topic.
MetricResourceId pulumi.StringOutput `pulumi:"metricResourceId"`
// Name of the resource
Name pulumi.StringOutput `pulumi:"name"`
// Provisioning state of the topic.
ProvisioningState pulumi.StringOutput `pulumi:"provisioningState"`
// Tags of the resource
Tags pulumi.StringMapOutput `pulumi:"tags"`
// Type of the resource
Type pulumi.StringOutput `pulumi:"type"`
}
// NewTopic registers a new resource with the given unique name, arguments, and options.
func NewTopic(ctx *pulumi.Context,
name string, args *TopicArgs, opts ...pulumi.ResourceOption) (*Topic, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
if args.TopicName == nil {
return nil, errors.New("invalid value for required argument 'TopicName'")
}
if args.InputSchema == nil {
args.InputSchema = pulumi.StringPtr("EventGridSchema")
}
aliases := pulumi.Aliases([]pulumi.Alias{
{
Type: pulumi.String("azure-nextgen:eventgrid/latest:Topic"),
},
{
Type: pulumi.String("azure-nextgen:eventgrid/v20170615preview:Topic"),
},
{
Type: pulumi.String("azure-nextgen:eventgrid/v20170915preview:Topic"),
},
{
Type: pulumi.String("azure-nextgen:eventgrid/v20180101:Topic"),
},
{
Type: pulumi.String("azure-nextgen:eventgrid/v20180501preview:Topic"),
},
{
Type: pulumi.String("azure-nextgen:eventgrid/v20180915preview:Topic"),
},
{
Type: pulumi.String("azure-nextgen:eventgrid/v20190101:Topic"),
},
{
Type: pulumi.String("azure-nextgen:eventgrid/v20190201preview:Topic"),
},
{
Type: pulumi.String("azure-nextgen:eventgrid/v20190601:Topic"),
},
{
Type: pulumi.String("azure-nextgen:eventgrid/v20200401preview:Topic"),
},
{
Type: pulumi.String("azure-nextgen:eventgrid/v20200601:Topic"),
},
{
Type: pulumi.String("azure-nextgen:eventgrid/v20201015preview:Topic"),
},
})
opts = append(opts, aliases)
var resource Topic
err := ctx.RegisterResource("azure-nextgen:eventgrid/v20200101preview:Topic", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetTopic gets an existing Topic 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 GetTopic(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *TopicState, opts ...pulumi.ResourceOption) (*Topic, error) {
var resource Topic
err := ctx.ReadResource("azure-nextgen:eventgrid/v20200101preview:Topic", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Topic resources.
type topicState struct {
// Endpoint for the topic.
Endpoint *string `pulumi:"endpoint"`
// This determines the format that Event Grid should expect for incoming events published to the topic.
InputSchema *string `pulumi:"inputSchema"`
// This enables publishing using custom event schemas. An InputSchemaMapping can be specified to map various properties of a source schema to various required properties of the EventGridEvent schema.
InputSchemaMapping *JsonInputSchemaMappingResponse `pulumi:"inputSchemaMapping"`
// Location of the resource
Location *string `pulumi:"location"`
// Metric resource id for the topic.
MetricResourceId *string `pulumi:"metricResourceId"`
// Name of the resource
Name *string `pulumi:"name"`
// Provisioning state of the topic.
ProvisioningState *string `pulumi:"provisioningState"`
// Tags of the resource
Tags map[string]string `pulumi:"tags"`
// Type of the resource
Type *string `pulumi:"type"`
}
type TopicState struct {
// Endpoint for the topic.
Endpoint pulumi.StringPtrInput
// This determines the format that Event Grid should expect for incoming events published to the topic.
InputSchema pulumi.StringPtrInput
// This enables publishing using custom event schemas. An InputSchemaMapping can be specified to map various properties of a source schema to various required properties of the EventGridEvent schema.
InputSchemaMapping JsonInputSchemaMappingResponsePtrInput
// Location of the resource
Location pulumi.StringPtrInput
// Metric resource id for the topic.
MetricResourceId pulumi.StringPtrInput
// Name of the resource
Name pulumi.StringPtrInput
// Provisioning state of the topic.
ProvisioningState pulumi.StringPtrInput
// Tags of the resource
Tags pulumi.StringMapInput
// Type of the resource
Type pulumi.StringPtrInput
}
func (TopicState) ElementType() reflect.Type {
return reflect.TypeOf((*topicState)(nil)).Elem()
}
type topicArgs struct {
// This determines the format that Event Grid should expect for incoming events published to the topic.
InputSchema *string `pulumi:"inputSchema"`
// This enables publishing using custom event schemas. An InputSchemaMapping can be specified to map various properties of a source schema to various required properties of the EventGridEvent schema.
InputSchemaMapping *JsonInputSchemaMapping `pulumi:"inputSchemaMapping"`
// Location of the resource
Location *string `pulumi:"location"`
// The name of the resource group within the user's subscription.
ResourceGroupName string `pulumi:"resourceGroupName"`
// Tags of the resource
Tags map[string]string `pulumi:"tags"`
// Name of the topic
TopicName string `pulumi:"topicName"`
}
// The set of arguments for constructing a Topic resource.
type TopicArgs struct {
// This determines the format that Event Grid should expect for incoming events published to the topic.
InputSchema pulumi.StringPtrInput
// This enables publishing using custom event schemas. An InputSchemaMapping can be specified to map various properties of a source schema to various required properties of the EventGridEvent schema.
InputSchemaMapping JsonInputSchemaMappingPtrInput
// Location of the resource
Location pulumi.StringPtrInput
// The name of the resource group within the user's subscription.
ResourceGroupName pulumi.StringInput
// Tags of the resource
Tags pulumi.StringMapInput
// Name of the topic
TopicName pulumi.StringInput
}
func (TopicArgs) ElementType() reflect.Type {
return reflect.TypeOf((*topicArgs)(nil)).Elem()
}
type TopicInput interface {
pulumi.Input
ToTopicOutput() TopicOutput
ToTopicOutputWithContext(ctx context.Context) TopicOutput
}
func (*Topic) ElementType() reflect.Type {
return reflect.TypeOf((*Topic)(nil))
}
func (i *Topic) ToTopicOutput() TopicOutput {
return i.ToTopicOutputWithContext(context.Background())
}
func (i *Topic) ToTopicOutputWithContext(ctx context.Context) TopicOutput {
return pulumi.ToOutputWithContext(ctx, i).(TopicOutput)
}
type TopicOutput struct {
*pulumi.OutputState
}
func (TopicOutput) ElementType() reflect.Type {
return reflect.TypeOf((*Topic)(nil))
}
func (o TopicOutput) ToTopicOutput() TopicOutput {
return o
}
func (o TopicOutput) ToTopicOutputWithContext(ctx context.Context) TopicOutput {
return o
}
func init() {
pulumi.RegisterOutputType(TopicOutput{})
}