/
binding.go
144 lines (131 loc) · 4.86 KB
/
binding.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
// *** 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 rabbitmq
import (
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// The ``.Binding`` resource creates and manages a binding relationship
// between a queue an exchange.
type Binding struct {
pulumi.CustomResourceState
// Additional key/value arguments for the binding.
Arguments pulumi.MapOutput `pulumi:"arguments"`
// The destination queue or exchange.
Destination pulumi.StringOutput `pulumi:"destination"`
// The type of destination (queue or exchange).
DestinationType pulumi.StringOutput `pulumi:"destinationType"`
// A unique key to refer to the binding.
PropertiesKey pulumi.StringOutput `pulumi:"propertiesKey"`
// A routing key for the binding.
RoutingKey pulumi.StringPtrOutput `pulumi:"routingKey"`
// The source exchange.
Source pulumi.StringOutput `pulumi:"source"`
// The vhost to create the resource in.
Vhost pulumi.StringOutput `pulumi:"vhost"`
}
// NewBinding registers a new resource with the given unique name, arguments, and options.
func NewBinding(ctx *pulumi.Context,
name string, args *BindingArgs, opts ...pulumi.ResourceOption) (*Binding, error) {
if args == nil || args.Destination == nil {
return nil, errors.New("missing required argument 'Destination'")
}
if args == nil || args.DestinationType == nil {
return nil, errors.New("missing required argument 'DestinationType'")
}
if args == nil || args.Source == nil {
return nil, errors.New("missing required argument 'Source'")
}
if args == nil || args.Vhost == nil {
return nil, errors.New("missing required argument 'Vhost'")
}
if args == nil {
args = &BindingArgs{}
}
var resource Binding
err := ctx.RegisterResource("rabbitmq:index/binding:Binding", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetBinding gets an existing Binding 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 GetBinding(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *BindingState, opts ...pulumi.ResourceOption) (*Binding, error) {
var resource Binding
err := ctx.ReadResource("rabbitmq:index/binding:Binding", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Binding resources.
type bindingState struct {
// Additional key/value arguments for the binding.
Arguments map[string]interface{} `pulumi:"arguments"`
// The destination queue or exchange.
Destination *string `pulumi:"destination"`
// The type of destination (queue or exchange).
DestinationType *string `pulumi:"destinationType"`
// A unique key to refer to the binding.
PropertiesKey *string `pulumi:"propertiesKey"`
// A routing key for the binding.
RoutingKey *string `pulumi:"routingKey"`
// The source exchange.
Source *string `pulumi:"source"`
// The vhost to create the resource in.
Vhost *string `pulumi:"vhost"`
}
type BindingState struct {
// Additional key/value arguments for the binding.
Arguments pulumi.MapInput
// The destination queue or exchange.
Destination pulumi.StringPtrInput
// The type of destination (queue or exchange).
DestinationType pulumi.StringPtrInput
// A unique key to refer to the binding.
PropertiesKey pulumi.StringPtrInput
// A routing key for the binding.
RoutingKey pulumi.StringPtrInput
// The source exchange.
Source pulumi.StringPtrInput
// The vhost to create the resource in.
Vhost pulumi.StringPtrInput
}
func (BindingState) ElementType() reflect.Type {
return reflect.TypeOf((*bindingState)(nil)).Elem()
}
type bindingArgs struct {
// Additional key/value arguments for the binding.
Arguments map[string]interface{} `pulumi:"arguments"`
// The destination queue or exchange.
Destination string `pulumi:"destination"`
// The type of destination (queue or exchange).
DestinationType string `pulumi:"destinationType"`
// A routing key for the binding.
RoutingKey *string `pulumi:"routingKey"`
// The source exchange.
Source string `pulumi:"source"`
// The vhost to create the resource in.
Vhost string `pulumi:"vhost"`
}
// The set of arguments for constructing a Binding resource.
type BindingArgs struct {
// Additional key/value arguments for the binding.
Arguments pulumi.MapInput
// The destination queue or exchange.
Destination pulumi.StringInput
// The type of destination (queue or exchange).
DestinationType pulumi.StringInput
// A routing key for the binding.
RoutingKey pulumi.StringPtrInput
// The source exchange.
Source pulumi.StringInput
// The vhost to create the resource in.
Vhost pulumi.StringInput
}
func (BindingArgs) ElementType() reflect.Type {
return reflect.TypeOf((*bindingArgs)(nil)).Elem()
}