/
gatewaySmbUser.go
274 lines (225 loc) · 9.49 KB
/
gatewaySmbUser.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
// 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 cloudstoragegateway
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides a Cloud Storage Gateway Gateway SMB User resource.
//
// For information about Cloud Storage Gateway Gateway SMB User and how to use it, see [What is Gateway SMB User](https://www.alibabacloud.com/help/en/cloud-storage-gateway/latest/creategatewaysmbuser).
//
// > **NOTE:** Available since v1.142.0.
//
// ## Import
//
// Cloud Storage Gateway Gateway SMB User can be imported using the id, e.g.
//
// ```sh
// $ pulumi import alicloud:cloudstoragegateway/gatewaySmbUser:GatewaySmbUser example <gateway_id>:<username>
// ```
type GatewaySmbUser struct {
pulumi.CustomResourceState
// The Gateway ID of the Gateway SMB User.
GatewayId pulumi.StringOutput `pulumi:"gatewayId"`
// The password of the Gateway SMB User.
Password pulumi.StringOutput `pulumi:"password"`
// The username of the Gateway SMB User.
Username pulumi.StringOutput `pulumi:"username"`
}
// NewGatewaySmbUser registers a new resource with the given unique name, arguments, and options.
func NewGatewaySmbUser(ctx *pulumi.Context,
name string, args *GatewaySmbUserArgs, opts ...pulumi.ResourceOption) (*GatewaySmbUser, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.GatewayId == nil {
return nil, errors.New("invalid value for required argument 'GatewayId'")
}
if args.Password == nil {
return nil, errors.New("invalid value for required argument 'Password'")
}
if args.Username == nil {
return nil, errors.New("invalid value for required argument 'Username'")
}
if args.Password != nil {
args.Password = pulumi.ToSecret(args.Password).(pulumi.StringInput)
}
secrets := pulumi.AdditionalSecretOutputs([]string{
"password",
})
opts = append(opts, secrets)
opts = internal.PkgResourceDefaultOpts(opts)
var resource GatewaySmbUser
err := ctx.RegisterResource("alicloud:cloudstoragegateway/gatewaySmbUser:GatewaySmbUser", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetGatewaySmbUser gets an existing GatewaySmbUser 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 GetGatewaySmbUser(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *GatewaySmbUserState, opts ...pulumi.ResourceOption) (*GatewaySmbUser, error) {
var resource GatewaySmbUser
err := ctx.ReadResource("alicloud:cloudstoragegateway/gatewaySmbUser:GatewaySmbUser", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering GatewaySmbUser resources.
type gatewaySmbUserState struct {
// The Gateway ID of the Gateway SMB User.
GatewayId *string `pulumi:"gatewayId"`
// The password of the Gateway SMB User.
Password *string `pulumi:"password"`
// The username of the Gateway SMB User.
Username *string `pulumi:"username"`
}
type GatewaySmbUserState struct {
// The Gateway ID of the Gateway SMB User.
GatewayId pulumi.StringPtrInput
// The password of the Gateway SMB User.
Password pulumi.StringPtrInput
// The username of the Gateway SMB User.
Username pulumi.StringPtrInput
}
func (GatewaySmbUserState) ElementType() reflect.Type {
return reflect.TypeOf((*gatewaySmbUserState)(nil)).Elem()
}
type gatewaySmbUserArgs struct {
// The Gateway ID of the Gateway SMB User.
GatewayId string `pulumi:"gatewayId"`
// The password of the Gateway SMB User.
Password string `pulumi:"password"`
// The username of the Gateway SMB User.
Username string `pulumi:"username"`
}
// The set of arguments for constructing a GatewaySmbUser resource.
type GatewaySmbUserArgs struct {
// The Gateway ID of the Gateway SMB User.
GatewayId pulumi.StringInput
// The password of the Gateway SMB User.
Password pulumi.StringInput
// The username of the Gateway SMB User.
Username pulumi.StringInput
}
func (GatewaySmbUserArgs) ElementType() reflect.Type {
return reflect.TypeOf((*gatewaySmbUserArgs)(nil)).Elem()
}
type GatewaySmbUserInput interface {
pulumi.Input
ToGatewaySmbUserOutput() GatewaySmbUserOutput
ToGatewaySmbUserOutputWithContext(ctx context.Context) GatewaySmbUserOutput
}
func (*GatewaySmbUser) ElementType() reflect.Type {
return reflect.TypeOf((**GatewaySmbUser)(nil)).Elem()
}
func (i *GatewaySmbUser) ToGatewaySmbUserOutput() GatewaySmbUserOutput {
return i.ToGatewaySmbUserOutputWithContext(context.Background())
}
func (i *GatewaySmbUser) ToGatewaySmbUserOutputWithContext(ctx context.Context) GatewaySmbUserOutput {
return pulumi.ToOutputWithContext(ctx, i).(GatewaySmbUserOutput)
}
// GatewaySmbUserArrayInput is an input type that accepts GatewaySmbUserArray and GatewaySmbUserArrayOutput values.
// You can construct a concrete instance of `GatewaySmbUserArrayInput` via:
//
// GatewaySmbUserArray{ GatewaySmbUserArgs{...} }
type GatewaySmbUserArrayInput interface {
pulumi.Input
ToGatewaySmbUserArrayOutput() GatewaySmbUserArrayOutput
ToGatewaySmbUserArrayOutputWithContext(context.Context) GatewaySmbUserArrayOutput
}
type GatewaySmbUserArray []GatewaySmbUserInput
func (GatewaySmbUserArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*GatewaySmbUser)(nil)).Elem()
}
func (i GatewaySmbUserArray) ToGatewaySmbUserArrayOutput() GatewaySmbUserArrayOutput {
return i.ToGatewaySmbUserArrayOutputWithContext(context.Background())
}
func (i GatewaySmbUserArray) ToGatewaySmbUserArrayOutputWithContext(ctx context.Context) GatewaySmbUserArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(GatewaySmbUserArrayOutput)
}
// GatewaySmbUserMapInput is an input type that accepts GatewaySmbUserMap and GatewaySmbUserMapOutput values.
// You can construct a concrete instance of `GatewaySmbUserMapInput` via:
//
// GatewaySmbUserMap{ "key": GatewaySmbUserArgs{...} }
type GatewaySmbUserMapInput interface {
pulumi.Input
ToGatewaySmbUserMapOutput() GatewaySmbUserMapOutput
ToGatewaySmbUserMapOutputWithContext(context.Context) GatewaySmbUserMapOutput
}
type GatewaySmbUserMap map[string]GatewaySmbUserInput
func (GatewaySmbUserMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*GatewaySmbUser)(nil)).Elem()
}
func (i GatewaySmbUserMap) ToGatewaySmbUserMapOutput() GatewaySmbUserMapOutput {
return i.ToGatewaySmbUserMapOutputWithContext(context.Background())
}
func (i GatewaySmbUserMap) ToGatewaySmbUserMapOutputWithContext(ctx context.Context) GatewaySmbUserMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(GatewaySmbUserMapOutput)
}
type GatewaySmbUserOutput struct{ *pulumi.OutputState }
func (GatewaySmbUserOutput) ElementType() reflect.Type {
return reflect.TypeOf((**GatewaySmbUser)(nil)).Elem()
}
func (o GatewaySmbUserOutput) ToGatewaySmbUserOutput() GatewaySmbUserOutput {
return o
}
func (o GatewaySmbUserOutput) ToGatewaySmbUserOutputWithContext(ctx context.Context) GatewaySmbUserOutput {
return o
}
// The Gateway ID of the Gateway SMB User.
func (o GatewaySmbUserOutput) GatewayId() pulumi.StringOutput {
return o.ApplyT(func(v *GatewaySmbUser) pulumi.StringOutput { return v.GatewayId }).(pulumi.StringOutput)
}
// The password of the Gateway SMB User.
func (o GatewaySmbUserOutput) Password() pulumi.StringOutput {
return o.ApplyT(func(v *GatewaySmbUser) pulumi.StringOutput { return v.Password }).(pulumi.StringOutput)
}
// The username of the Gateway SMB User.
func (o GatewaySmbUserOutput) Username() pulumi.StringOutput {
return o.ApplyT(func(v *GatewaySmbUser) pulumi.StringOutput { return v.Username }).(pulumi.StringOutput)
}
type GatewaySmbUserArrayOutput struct{ *pulumi.OutputState }
func (GatewaySmbUserArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*GatewaySmbUser)(nil)).Elem()
}
func (o GatewaySmbUserArrayOutput) ToGatewaySmbUserArrayOutput() GatewaySmbUserArrayOutput {
return o
}
func (o GatewaySmbUserArrayOutput) ToGatewaySmbUserArrayOutputWithContext(ctx context.Context) GatewaySmbUserArrayOutput {
return o
}
func (o GatewaySmbUserArrayOutput) Index(i pulumi.IntInput) GatewaySmbUserOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *GatewaySmbUser {
return vs[0].([]*GatewaySmbUser)[vs[1].(int)]
}).(GatewaySmbUserOutput)
}
type GatewaySmbUserMapOutput struct{ *pulumi.OutputState }
func (GatewaySmbUserMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*GatewaySmbUser)(nil)).Elem()
}
func (o GatewaySmbUserMapOutput) ToGatewaySmbUserMapOutput() GatewaySmbUserMapOutput {
return o
}
func (o GatewaySmbUserMapOutput) ToGatewaySmbUserMapOutputWithContext(ctx context.Context) GatewaySmbUserMapOutput {
return o
}
func (o GatewaySmbUserMapOutput) MapIndex(k pulumi.StringInput) GatewaySmbUserOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *GatewaySmbUser {
return vs[0].(map[string]*GatewaySmbUser)[vs[1].(string)]
}).(GatewaySmbUserOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*GatewaySmbUserInput)(nil)).Elem(), &GatewaySmbUser{})
pulumi.RegisterInputType(reflect.TypeOf((*GatewaySmbUserArrayInput)(nil)).Elem(), GatewaySmbUserArray{})
pulumi.RegisterInputType(reflect.TypeOf((*GatewaySmbUserMapInput)(nil)).Elem(), GatewaySmbUserMap{})
pulumi.RegisterOutputType(GatewaySmbUserOutput{})
pulumi.RegisterOutputType(GatewaySmbUserArrayOutput{})
pulumi.RegisterOutputType(GatewaySmbUserMapOutput{})
}