generated from pulumi/pulumi-tf-provider-boilerplate
/
channel.go
381 lines (323 loc) · 16.3 KB
/
channel.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
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
// 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 mysql
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-oci/sdk/go/oci/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// This resource provides the Channel resource in Oracle Cloud Infrastructure MySQL Database service.
//
// Creates a Channel to establish replication from a source to a target.
//
// ## Import
//
// Channels can be imported using the `id`, e.g.
//
// ```sh
// $ pulumi import oci:Mysql/channel:Channel test_channel "id"
// ```
type Channel struct {
pulumi.CustomResourceState
// The OCID of the compartment.
CompartmentId pulumi.StringOutput `pulumi:"compartmentId"`
// (Updatable) Usage of predefined tag keys. These predefined keys are scoped to namespaces. Example: `{"foo-namespace.bar-key": "value"}`
DefinedTags pulumi.MapOutput `pulumi:"definedTags"`
// (Updatable) User provided information about the Channel.
Description pulumi.StringOutput `pulumi:"description"`
// (Updatable) The user-friendly name for the Channel. It does not have to be unique.
DisplayName pulumi.StringOutput `pulumi:"displayName"`
// (Updatable) Simple key-value pair applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `{"bar-key": "value"}`
FreeformTags pulumi.MapOutput `pulumi:"freeformTags"`
// (Updatable) Whether the Channel should be enabled upon creation. If set to true, the Channel will be asynchronously started as a result of the create Channel operation.
IsEnabled pulumi.BoolOutput `pulumi:"isEnabled"`
// A message describing the state of the Channel.
LifecycleDetails pulumi.StringOutput `pulumi:"lifecycleDetails"`
// (Updatable) Parameters detailing how to provision the source for the given Channel.
Source ChannelSourceOutput `pulumi:"source"`
// The state of the Channel.
State pulumi.StringOutput `pulumi:"state"`
// (Updatable) Parameters detailing how to provision the target for the given Channel.
Target ChannelTargetOutput `pulumi:"target"`
// The date and time the Channel was created, as described by [RFC 3339](https://tools.ietf.org/rfc/rfc3339).
TimeCreated pulumi.StringOutput `pulumi:"timeCreated"`
// The time the Channel was last updated, as described by [RFC 3339](https://tools.ietf.org/rfc/rfc3339).
TimeUpdated pulumi.StringOutput `pulumi:"timeUpdated"`
}
// NewChannel registers a new resource with the given unique name, arguments, and options.
func NewChannel(ctx *pulumi.Context,
name string, args *ChannelArgs, opts ...pulumi.ResourceOption) (*Channel, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.Source == nil {
return nil, errors.New("invalid value for required argument 'Source'")
}
if args.Target == nil {
return nil, errors.New("invalid value for required argument 'Target'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource Channel
err := ctx.RegisterResource("oci:Mysql/channel:Channel", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetChannel gets an existing Channel 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 GetChannel(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ChannelState, opts ...pulumi.ResourceOption) (*Channel, error) {
var resource Channel
err := ctx.ReadResource("oci:Mysql/channel:Channel", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Channel resources.
type channelState struct {
// The OCID of the compartment.
CompartmentId *string `pulumi:"compartmentId"`
// (Updatable) Usage of predefined tag keys. These predefined keys are scoped to namespaces. Example: `{"foo-namespace.bar-key": "value"}`
DefinedTags map[string]interface{} `pulumi:"definedTags"`
// (Updatable) User provided information about the Channel.
Description *string `pulumi:"description"`
// (Updatable) The user-friendly name for the Channel. It does not have to be unique.
DisplayName *string `pulumi:"displayName"`
// (Updatable) Simple key-value pair applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `{"bar-key": "value"}`
FreeformTags map[string]interface{} `pulumi:"freeformTags"`
// (Updatable) Whether the Channel should be enabled upon creation. If set to true, the Channel will be asynchronously started as a result of the create Channel operation.
IsEnabled *bool `pulumi:"isEnabled"`
// A message describing the state of the Channel.
LifecycleDetails *string `pulumi:"lifecycleDetails"`
// (Updatable) Parameters detailing how to provision the source for the given Channel.
Source *ChannelSource `pulumi:"source"`
// The state of the Channel.
State *string `pulumi:"state"`
// (Updatable) Parameters detailing how to provision the target for the given Channel.
Target *ChannelTarget `pulumi:"target"`
// The date and time the Channel was created, as described by [RFC 3339](https://tools.ietf.org/rfc/rfc3339).
TimeCreated *string `pulumi:"timeCreated"`
// The time the Channel was last updated, as described by [RFC 3339](https://tools.ietf.org/rfc/rfc3339).
TimeUpdated *string `pulumi:"timeUpdated"`
}
type ChannelState struct {
// The OCID of the compartment.
CompartmentId pulumi.StringPtrInput
// (Updatable) Usage of predefined tag keys. These predefined keys are scoped to namespaces. Example: `{"foo-namespace.bar-key": "value"}`
DefinedTags pulumi.MapInput
// (Updatable) User provided information about the Channel.
Description pulumi.StringPtrInput
// (Updatable) The user-friendly name for the Channel. It does not have to be unique.
DisplayName pulumi.StringPtrInput
// (Updatable) Simple key-value pair applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `{"bar-key": "value"}`
FreeformTags pulumi.MapInput
// (Updatable) Whether the Channel should be enabled upon creation. If set to true, the Channel will be asynchronously started as a result of the create Channel operation.
IsEnabled pulumi.BoolPtrInput
// A message describing the state of the Channel.
LifecycleDetails pulumi.StringPtrInput
// (Updatable) Parameters detailing how to provision the source for the given Channel.
Source ChannelSourcePtrInput
// The state of the Channel.
State pulumi.StringPtrInput
// (Updatable) Parameters detailing how to provision the target for the given Channel.
Target ChannelTargetPtrInput
// The date and time the Channel was created, as described by [RFC 3339](https://tools.ietf.org/rfc/rfc3339).
TimeCreated pulumi.StringPtrInput
// The time the Channel was last updated, as described by [RFC 3339](https://tools.ietf.org/rfc/rfc3339).
TimeUpdated pulumi.StringPtrInput
}
func (ChannelState) ElementType() reflect.Type {
return reflect.TypeOf((*channelState)(nil)).Elem()
}
type channelArgs struct {
// The OCID of the compartment.
CompartmentId *string `pulumi:"compartmentId"`
// (Updatable) Usage of predefined tag keys. These predefined keys are scoped to namespaces. Example: `{"foo-namespace.bar-key": "value"}`
DefinedTags map[string]interface{} `pulumi:"definedTags"`
// (Updatable) User provided information about the Channel.
Description *string `pulumi:"description"`
// (Updatable) The user-friendly name for the Channel. It does not have to be unique.
DisplayName *string `pulumi:"displayName"`
// (Updatable) Simple key-value pair applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `{"bar-key": "value"}`
FreeformTags map[string]interface{} `pulumi:"freeformTags"`
// (Updatable) Whether the Channel should be enabled upon creation. If set to true, the Channel will be asynchronously started as a result of the create Channel operation.
IsEnabled *bool `pulumi:"isEnabled"`
// (Updatable) Parameters detailing how to provision the source for the given Channel.
Source ChannelSource `pulumi:"source"`
// (Updatable) Parameters detailing how to provision the target for the given Channel.
Target ChannelTarget `pulumi:"target"`
}
// The set of arguments for constructing a Channel resource.
type ChannelArgs struct {
// The OCID of the compartment.
CompartmentId pulumi.StringPtrInput
// (Updatable) Usage of predefined tag keys. These predefined keys are scoped to namespaces. Example: `{"foo-namespace.bar-key": "value"}`
DefinedTags pulumi.MapInput
// (Updatable) User provided information about the Channel.
Description pulumi.StringPtrInput
// (Updatable) The user-friendly name for the Channel. It does not have to be unique.
DisplayName pulumi.StringPtrInput
// (Updatable) Simple key-value pair applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `{"bar-key": "value"}`
FreeformTags pulumi.MapInput
// (Updatable) Whether the Channel should be enabled upon creation. If set to true, the Channel will be asynchronously started as a result of the create Channel operation.
IsEnabled pulumi.BoolPtrInput
// (Updatable) Parameters detailing how to provision the source for the given Channel.
Source ChannelSourceInput
// (Updatable) Parameters detailing how to provision the target for the given Channel.
Target ChannelTargetInput
}
func (ChannelArgs) ElementType() reflect.Type {
return reflect.TypeOf((*channelArgs)(nil)).Elem()
}
type ChannelInput interface {
pulumi.Input
ToChannelOutput() ChannelOutput
ToChannelOutputWithContext(ctx context.Context) ChannelOutput
}
func (*Channel) ElementType() reflect.Type {
return reflect.TypeOf((**Channel)(nil)).Elem()
}
func (i *Channel) ToChannelOutput() ChannelOutput {
return i.ToChannelOutputWithContext(context.Background())
}
func (i *Channel) ToChannelOutputWithContext(ctx context.Context) ChannelOutput {
return pulumi.ToOutputWithContext(ctx, i).(ChannelOutput)
}
// ChannelArrayInput is an input type that accepts ChannelArray and ChannelArrayOutput values.
// You can construct a concrete instance of `ChannelArrayInput` via:
//
// ChannelArray{ ChannelArgs{...} }
type ChannelArrayInput interface {
pulumi.Input
ToChannelArrayOutput() ChannelArrayOutput
ToChannelArrayOutputWithContext(context.Context) ChannelArrayOutput
}
type ChannelArray []ChannelInput
func (ChannelArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Channel)(nil)).Elem()
}
func (i ChannelArray) ToChannelArrayOutput() ChannelArrayOutput {
return i.ToChannelArrayOutputWithContext(context.Background())
}
func (i ChannelArray) ToChannelArrayOutputWithContext(ctx context.Context) ChannelArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(ChannelArrayOutput)
}
// ChannelMapInput is an input type that accepts ChannelMap and ChannelMapOutput values.
// You can construct a concrete instance of `ChannelMapInput` via:
//
// ChannelMap{ "key": ChannelArgs{...} }
type ChannelMapInput interface {
pulumi.Input
ToChannelMapOutput() ChannelMapOutput
ToChannelMapOutputWithContext(context.Context) ChannelMapOutput
}
type ChannelMap map[string]ChannelInput
func (ChannelMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Channel)(nil)).Elem()
}
func (i ChannelMap) ToChannelMapOutput() ChannelMapOutput {
return i.ToChannelMapOutputWithContext(context.Background())
}
func (i ChannelMap) ToChannelMapOutputWithContext(ctx context.Context) ChannelMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(ChannelMapOutput)
}
type ChannelOutput struct{ *pulumi.OutputState }
func (ChannelOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Channel)(nil)).Elem()
}
func (o ChannelOutput) ToChannelOutput() ChannelOutput {
return o
}
func (o ChannelOutput) ToChannelOutputWithContext(ctx context.Context) ChannelOutput {
return o
}
// The OCID of the compartment.
func (o ChannelOutput) CompartmentId() pulumi.StringOutput {
return o.ApplyT(func(v *Channel) pulumi.StringOutput { return v.CompartmentId }).(pulumi.StringOutput)
}
// (Updatable) Usage of predefined tag keys. These predefined keys are scoped to namespaces. Example: `{"foo-namespace.bar-key": "value"}`
func (o ChannelOutput) DefinedTags() pulumi.MapOutput {
return o.ApplyT(func(v *Channel) pulumi.MapOutput { return v.DefinedTags }).(pulumi.MapOutput)
}
// (Updatable) User provided information about the Channel.
func (o ChannelOutput) Description() pulumi.StringOutput {
return o.ApplyT(func(v *Channel) pulumi.StringOutput { return v.Description }).(pulumi.StringOutput)
}
// (Updatable) The user-friendly name for the Channel. It does not have to be unique.
func (o ChannelOutput) DisplayName() pulumi.StringOutput {
return o.ApplyT(func(v *Channel) pulumi.StringOutput { return v.DisplayName }).(pulumi.StringOutput)
}
// (Updatable) Simple key-value pair applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `{"bar-key": "value"}`
func (o ChannelOutput) FreeformTags() pulumi.MapOutput {
return o.ApplyT(func(v *Channel) pulumi.MapOutput { return v.FreeformTags }).(pulumi.MapOutput)
}
// (Updatable) Whether the Channel should be enabled upon creation. If set to true, the Channel will be asynchronously started as a result of the create Channel operation.
func (o ChannelOutput) IsEnabled() pulumi.BoolOutput {
return o.ApplyT(func(v *Channel) pulumi.BoolOutput { return v.IsEnabled }).(pulumi.BoolOutput)
}
// A message describing the state of the Channel.
func (o ChannelOutput) LifecycleDetails() pulumi.StringOutput {
return o.ApplyT(func(v *Channel) pulumi.StringOutput { return v.LifecycleDetails }).(pulumi.StringOutput)
}
// (Updatable) Parameters detailing how to provision the source for the given Channel.
func (o ChannelOutput) Source() ChannelSourceOutput {
return o.ApplyT(func(v *Channel) ChannelSourceOutput { return v.Source }).(ChannelSourceOutput)
}
// The state of the Channel.
func (o ChannelOutput) State() pulumi.StringOutput {
return o.ApplyT(func(v *Channel) pulumi.StringOutput { return v.State }).(pulumi.StringOutput)
}
// (Updatable) Parameters detailing how to provision the target for the given Channel.
func (o ChannelOutput) Target() ChannelTargetOutput {
return o.ApplyT(func(v *Channel) ChannelTargetOutput { return v.Target }).(ChannelTargetOutput)
}
// The date and time the Channel was created, as described by [RFC 3339](https://tools.ietf.org/rfc/rfc3339).
func (o ChannelOutput) TimeCreated() pulumi.StringOutput {
return o.ApplyT(func(v *Channel) pulumi.StringOutput { return v.TimeCreated }).(pulumi.StringOutput)
}
// The time the Channel was last updated, as described by [RFC 3339](https://tools.ietf.org/rfc/rfc3339).
func (o ChannelOutput) TimeUpdated() pulumi.StringOutput {
return o.ApplyT(func(v *Channel) pulumi.StringOutput { return v.TimeUpdated }).(pulumi.StringOutput)
}
type ChannelArrayOutput struct{ *pulumi.OutputState }
func (ChannelArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Channel)(nil)).Elem()
}
func (o ChannelArrayOutput) ToChannelArrayOutput() ChannelArrayOutput {
return o
}
func (o ChannelArrayOutput) ToChannelArrayOutputWithContext(ctx context.Context) ChannelArrayOutput {
return o
}
func (o ChannelArrayOutput) Index(i pulumi.IntInput) ChannelOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Channel {
return vs[0].([]*Channel)[vs[1].(int)]
}).(ChannelOutput)
}
type ChannelMapOutput struct{ *pulumi.OutputState }
func (ChannelMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Channel)(nil)).Elem()
}
func (o ChannelMapOutput) ToChannelMapOutput() ChannelMapOutput {
return o
}
func (o ChannelMapOutput) ToChannelMapOutputWithContext(ctx context.Context) ChannelMapOutput {
return o
}
func (o ChannelMapOutput) MapIndex(k pulumi.StringInput) ChannelOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Channel {
return vs[0].(map[string]*Channel)[vs[1].(string)]
}).(ChannelOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*ChannelInput)(nil)).Elem(), &Channel{})
pulumi.RegisterInputType(reflect.TypeOf((*ChannelArrayInput)(nil)).Elem(), ChannelArray{})
pulumi.RegisterInputType(reflect.TypeOf((*ChannelMapInput)(nil)).Elem(), ChannelMap{})
pulumi.RegisterOutputType(ChannelOutput{})
pulumi.RegisterOutputType(ChannelArrayOutput{})
pulumi.RegisterOutputType(ChannelMapOutput{})
}