This repository has been archived by the owner on Aug 15, 2022. It is now read-only.
generated from pulumi/pulumi-tf-provider-boilerplate
/
snapshotPolicyAttachment.go
234 lines (186 loc) · 9.14 KB
/
snapshotPolicyAttachment.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
// 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 cbs
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
type SnapshotPolicyAttachment struct {
pulumi.CustomResourceState
// ID of CBS snapshot policy.
SnapshotPolicyId pulumi.StringOutput `pulumi:"snapshotPolicyId"`
// ID of CBS.
StorageId pulumi.StringOutput `pulumi:"storageId"`
}
// NewSnapshotPolicyAttachment registers a new resource with the given unique name, arguments, and options.
func NewSnapshotPolicyAttachment(ctx *pulumi.Context,
name string, args *SnapshotPolicyAttachmentArgs, opts ...pulumi.ResourceOption) (*SnapshotPolicyAttachment, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.SnapshotPolicyId == nil {
return nil, errors.New("invalid value for required argument 'SnapshotPolicyId'")
}
if args.StorageId == nil {
return nil, errors.New("invalid value for required argument 'StorageId'")
}
var resource SnapshotPolicyAttachment
err := ctx.RegisterResource("tctest:Cbs/snapshotPolicyAttachment:SnapshotPolicyAttachment", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetSnapshotPolicyAttachment gets an existing SnapshotPolicyAttachment 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 GetSnapshotPolicyAttachment(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *SnapshotPolicyAttachmentState, opts ...pulumi.ResourceOption) (*SnapshotPolicyAttachment, error) {
var resource SnapshotPolicyAttachment
err := ctx.ReadResource("tctest:Cbs/snapshotPolicyAttachment:SnapshotPolicyAttachment", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering SnapshotPolicyAttachment resources.
type snapshotPolicyAttachmentState struct {
// ID of CBS snapshot policy.
SnapshotPolicyId *string `pulumi:"snapshotPolicyId"`
// ID of CBS.
StorageId *string `pulumi:"storageId"`
}
type SnapshotPolicyAttachmentState struct {
// ID of CBS snapshot policy.
SnapshotPolicyId pulumi.StringPtrInput
// ID of CBS.
StorageId pulumi.StringPtrInput
}
func (SnapshotPolicyAttachmentState) ElementType() reflect.Type {
return reflect.TypeOf((*snapshotPolicyAttachmentState)(nil)).Elem()
}
type snapshotPolicyAttachmentArgs struct {
// ID of CBS snapshot policy.
SnapshotPolicyId string `pulumi:"snapshotPolicyId"`
// ID of CBS.
StorageId string `pulumi:"storageId"`
}
// The set of arguments for constructing a SnapshotPolicyAttachment resource.
type SnapshotPolicyAttachmentArgs struct {
// ID of CBS snapshot policy.
SnapshotPolicyId pulumi.StringInput
// ID of CBS.
StorageId pulumi.StringInput
}
func (SnapshotPolicyAttachmentArgs) ElementType() reflect.Type {
return reflect.TypeOf((*snapshotPolicyAttachmentArgs)(nil)).Elem()
}
type SnapshotPolicyAttachmentInput interface {
pulumi.Input
ToSnapshotPolicyAttachmentOutput() SnapshotPolicyAttachmentOutput
ToSnapshotPolicyAttachmentOutputWithContext(ctx context.Context) SnapshotPolicyAttachmentOutput
}
func (*SnapshotPolicyAttachment) ElementType() reflect.Type {
return reflect.TypeOf((**SnapshotPolicyAttachment)(nil)).Elem()
}
func (i *SnapshotPolicyAttachment) ToSnapshotPolicyAttachmentOutput() SnapshotPolicyAttachmentOutput {
return i.ToSnapshotPolicyAttachmentOutputWithContext(context.Background())
}
func (i *SnapshotPolicyAttachment) ToSnapshotPolicyAttachmentOutputWithContext(ctx context.Context) SnapshotPolicyAttachmentOutput {
return pulumi.ToOutputWithContext(ctx, i).(SnapshotPolicyAttachmentOutput)
}
// SnapshotPolicyAttachmentArrayInput is an input type that accepts SnapshotPolicyAttachmentArray and SnapshotPolicyAttachmentArrayOutput values.
// You can construct a concrete instance of `SnapshotPolicyAttachmentArrayInput` via:
//
// SnapshotPolicyAttachmentArray{ SnapshotPolicyAttachmentArgs{...} }
type SnapshotPolicyAttachmentArrayInput interface {
pulumi.Input
ToSnapshotPolicyAttachmentArrayOutput() SnapshotPolicyAttachmentArrayOutput
ToSnapshotPolicyAttachmentArrayOutputWithContext(context.Context) SnapshotPolicyAttachmentArrayOutput
}
type SnapshotPolicyAttachmentArray []SnapshotPolicyAttachmentInput
func (SnapshotPolicyAttachmentArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*SnapshotPolicyAttachment)(nil)).Elem()
}
func (i SnapshotPolicyAttachmentArray) ToSnapshotPolicyAttachmentArrayOutput() SnapshotPolicyAttachmentArrayOutput {
return i.ToSnapshotPolicyAttachmentArrayOutputWithContext(context.Background())
}
func (i SnapshotPolicyAttachmentArray) ToSnapshotPolicyAttachmentArrayOutputWithContext(ctx context.Context) SnapshotPolicyAttachmentArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(SnapshotPolicyAttachmentArrayOutput)
}
// SnapshotPolicyAttachmentMapInput is an input type that accepts SnapshotPolicyAttachmentMap and SnapshotPolicyAttachmentMapOutput values.
// You can construct a concrete instance of `SnapshotPolicyAttachmentMapInput` via:
//
// SnapshotPolicyAttachmentMap{ "key": SnapshotPolicyAttachmentArgs{...} }
type SnapshotPolicyAttachmentMapInput interface {
pulumi.Input
ToSnapshotPolicyAttachmentMapOutput() SnapshotPolicyAttachmentMapOutput
ToSnapshotPolicyAttachmentMapOutputWithContext(context.Context) SnapshotPolicyAttachmentMapOutput
}
type SnapshotPolicyAttachmentMap map[string]SnapshotPolicyAttachmentInput
func (SnapshotPolicyAttachmentMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*SnapshotPolicyAttachment)(nil)).Elem()
}
func (i SnapshotPolicyAttachmentMap) ToSnapshotPolicyAttachmentMapOutput() SnapshotPolicyAttachmentMapOutput {
return i.ToSnapshotPolicyAttachmentMapOutputWithContext(context.Background())
}
func (i SnapshotPolicyAttachmentMap) ToSnapshotPolicyAttachmentMapOutputWithContext(ctx context.Context) SnapshotPolicyAttachmentMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(SnapshotPolicyAttachmentMapOutput)
}
type SnapshotPolicyAttachmentOutput struct{ *pulumi.OutputState }
func (SnapshotPolicyAttachmentOutput) ElementType() reflect.Type {
return reflect.TypeOf((**SnapshotPolicyAttachment)(nil)).Elem()
}
func (o SnapshotPolicyAttachmentOutput) ToSnapshotPolicyAttachmentOutput() SnapshotPolicyAttachmentOutput {
return o
}
func (o SnapshotPolicyAttachmentOutput) ToSnapshotPolicyAttachmentOutputWithContext(ctx context.Context) SnapshotPolicyAttachmentOutput {
return o
}
// ID of CBS snapshot policy.
func (o SnapshotPolicyAttachmentOutput) SnapshotPolicyId() pulumi.StringOutput {
return o.ApplyT(func(v *SnapshotPolicyAttachment) pulumi.StringOutput { return v.SnapshotPolicyId }).(pulumi.StringOutput)
}
// ID of CBS.
func (o SnapshotPolicyAttachmentOutput) StorageId() pulumi.StringOutput {
return o.ApplyT(func(v *SnapshotPolicyAttachment) pulumi.StringOutput { return v.StorageId }).(pulumi.StringOutput)
}
type SnapshotPolicyAttachmentArrayOutput struct{ *pulumi.OutputState }
func (SnapshotPolicyAttachmentArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*SnapshotPolicyAttachment)(nil)).Elem()
}
func (o SnapshotPolicyAttachmentArrayOutput) ToSnapshotPolicyAttachmentArrayOutput() SnapshotPolicyAttachmentArrayOutput {
return o
}
func (o SnapshotPolicyAttachmentArrayOutput) ToSnapshotPolicyAttachmentArrayOutputWithContext(ctx context.Context) SnapshotPolicyAttachmentArrayOutput {
return o
}
func (o SnapshotPolicyAttachmentArrayOutput) Index(i pulumi.IntInput) SnapshotPolicyAttachmentOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *SnapshotPolicyAttachment {
return vs[0].([]*SnapshotPolicyAttachment)[vs[1].(int)]
}).(SnapshotPolicyAttachmentOutput)
}
type SnapshotPolicyAttachmentMapOutput struct{ *pulumi.OutputState }
func (SnapshotPolicyAttachmentMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*SnapshotPolicyAttachment)(nil)).Elem()
}
func (o SnapshotPolicyAttachmentMapOutput) ToSnapshotPolicyAttachmentMapOutput() SnapshotPolicyAttachmentMapOutput {
return o
}
func (o SnapshotPolicyAttachmentMapOutput) ToSnapshotPolicyAttachmentMapOutputWithContext(ctx context.Context) SnapshotPolicyAttachmentMapOutput {
return o
}
func (o SnapshotPolicyAttachmentMapOutput) MapIndex(k pulumi.StringInput) SnapshotPolicyAttachmentOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *SnapshotPolicyAttachment {
return vs[0].(map[string]*SnapshotPolicyAttachment)[vs[1].(string)]
}).(SnapshotPolicyAttachmentOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*SnapshotPolicyAttachmentInput)(nil)).Elem(), &SnapshotPolicyAttachment{})
pulumi.RegisterInputType(reflect.TypeOf((*SnapshotPolicyAttachmentArrayInput)(nil)).Elem(), SnapshotPolicyAttachmentArray{})
pulumi.RegisterInputType(reflect.TypeOf((*SnapshotPolicyAttachmentMapInput)(nil)).Elem(), SnapshotPolicyAttachmentMap{})
pulumi.RegisterOutputType(SnapshotPolicyAttachmentOutput{})
pulumi.RegisterOutputType(SnapshotPolicyAttachmentArrayOutput{})
pulumi.RegisterOutputType(SnapshotPolicyAttachmentMapOutput{})
}