This repository has been archived by the owner on Mar 11, 2021. It is now read-only.
/
user.go
180 lines (156 loc) · 5.45 KB
/
user.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
// *** 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 v20190701
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// Represents a user who has access to one or more shares on the Data Box Edge/Gateway device.
type User struct {
pulumi.CustomResourceState
// The password details.
EncryptedPassword AsymmetricEncryptedSecretResponsePtrOutput `pulumi:"encryptedPassword"`
// The object name.
Name pulumi.StringOutput `pulumi:"name"`
// List of shares that the user has rights on. This field should not be specified during user creation.
ShareAccessRights ShareAccessRightResponseArrayOutput `pulumi:"shareAccessRights"`
// The hierarchical type of the object.
Type pulumi.StringOutput `pulumi:"type"`
}
// NewUser registers a new resource with the given unique name, arguments, and options.
func NewUser(ctx *pulumi.Context,
name string, args *UserArgs, opts ...pulumi.ResourceOption) (*User, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.DeviceName == nil {
return nil, errors.New("invalid value for required argument 'DeviceName'")
}
if args.Name == nil {
return nil, errors.New("invalid value for required argument 'Name'")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
aliases := pulumi.Aliases([]pulumi.Alias{
{
Type: pulumi.String("azure-nextgen:databoxedge/latest:User"),
},
{
Type: pulumi.String("azure-nextgen:databoxedge/v20190301:User"),
},
{
Type: pulumi.String("azure-nextgen:databoxedge/v20190801:User"),
},
{
Type: pulumi.String("azure-nextgen:databoxedge/v20200501preview:User"),
},
{
Type: pulumi.String("azure-nextgen:databoxedge/v20200901:User"),
},
{
Type: pulumi.String("azure-nextgen:databoxedge/v20200901preview:User"),
},
})
opts = append(opts, aliases)
var resource User
err := ctx.RegisterResource("azure-nextgen:databoxedge/v20190701:User", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetUser gets an existing User 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 GetUser(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *UserState, opts ...pulumi.ResourceOption) (*User, error) {
var resource User
err := ctx.ReadResource("azure-nextgen:databoxedge/v20190701:User", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering User resources.
type userState struct {
// The password details.
EncryptedPassword *AsymmetricEncryptedSecretResponse `pulumi:"encryptedPassword"`
// The object name.
Name *string `pulumi:"name"`
// List of shares that the user has rights on. This field should not be specified during user creation.
ShareAccessRights []ShareAccessRightResponse `pulumi:"shareAccessRights"`
// The hierarchical type of the object.
Type *string `pulumi:"type"`
}
type UserState struct {
// The password details.
EncryptedPassword AsymmetricEncryptedSecretResponsePtrInput
// The object name.
Name pulumi.StringPtrInput
// List of shares that the user has rights on. This field should not be specified during user creation.
ShareAccessRights ShareAccessRightResponseArrayInput
// The hierarchical type of the object.
Type pulumi.StringPtrInput
}
func (UserState) ElementType() reflect.Type {
return reflect.TypeOf((*userState)(nil)).Elem()
}
type userArgs struct {
// The device name.
DeviceName string `pulumi:"deviceName"`
// The password details.
EncryptedPassword *AsymmetricEncryptedSecret `pulumi:"encryptedPassword"`
// The user name.
Name string `pulumi:"name"`
// The resource group name.
ResourceGroupName string `pulumi:"resourceGroupName"`
// List of shares that the user has rights on. This field should not be specified during user creation.
ShareAccessRights []ShareAccessRight `pulumi:"shareAccessRights"`
}
// The set of arguments for constructing a User resource.
type UserArgs struct {
// The device name.
DeviceName pulumi.StringInput
// The password details.
EncryptedPassword AsymmetricEncryptedSecretPtrInput
// The user name.
Name pulumi.StringInput
// The resource group name.
ResourceGroupName pulumi.StringInput
// List of shares that the user has rights on. This field should not be specified during user creation.
ShareAccessRights ShareAccessRightArrayInput
}
func (UserArgs) ElementType() reflect.Type {
return reflect.TypeOf((*userArgs)(nil)).Elem()
}
type UserInput interface {
pulumi.Input
ToUserOutput() UserOutput
ToUserOutputWithContext(ctx context.Context) UserOutput
}
func (*User) ElementType() reflect.Type {
return reflect.TypeOf((*User)(nil))
}
func (i *User) ToUserOutput() UserOutput {
return i.ToUserOutputWithContext(context.Background())
}
func (i *User) ToUserOutputWithContext(ctx context.Context) UserOutput {
return pulumi.ToOutputWithContext(ctx, i).(UserOutput)
}
type UserOutput struct {
*pulumi.OutputState
}
func (UserOutput) ElementType() reflect.Type {
return reflect.TypeOf((*User)(nil))
}
func (o UserOutput) ToUserOutput() UserOutput {
return o
}
func (o UserOutput) ToUserOutputWithContext(ctx context.Context) UserOutput {
return o
}
func init() {
pulumi.RegisterOutputType(UserOutput{})
}