-
Notifications
You must be signed in to change notification settings - Fork 5
/
enterpriseUser.go
247 lines (223 loc) · 8.31 KB
/
enterpriseUser.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
// *** 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 dms
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// Provides a DMS Enterprise User resource. For information about Alidms Enterprise User and how to use it, see [What is Resource Alidms Enterprise User](https://www.alibabacloud.com/help/doc-detail/98001.htm).
//
// > **NOTE:** Available in 1.90.0+.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-alicloud/sdk/v2/go/alicloud/dms"
// "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := dms.NewEnterpriseUser(ctx, "example", &dms.EnterpriseUserArgs{
// Mobile: pulumi.String("1591066xxxx"),
// RoleNames: pulumi.StringArray{
// pulumi.String("DBA"),
// },
// Uid: pulumi.String("uid"),
// UserName: pulumi.String("tf-test"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
//
// ## Import
//
// DMS Enterprise User can be imported using the id, e.g.
//
// ```sh
// $ pulumi import alicloud:dms/enterpriseUser:EnterpriseUser example 24356xxx
// ```
type EnterpriseUser struct {
pulumi.CustomResourceState
// Maximum number of inquiries on the day.
MaxExecuteCount pulumi.IntPtrOutput `pulumi:"maxExecuteCount"`
// Query the maximum number of rows on the day.
MaxResultCount pulumi.IntPtrOutput `pulumi:"maxResultCount"`
// The DingTalk number or mobile number of the user.
Mobile pulumi.StringPtrOutput `pulumi:"mobile"`
// It has been deprecated from 1.100.0 and use `userName` instead.
//
// Deprecated: Field 'nick_name' has been deprecated from version 1.100.0. Use 'user_name' instead.
NickName pulumi.StringOutput `pulumi:"nickName"`
// The roles that the user plays.
RoleNames pulumi.StringArrayOutput `pulumi:"roleNames"`
// The state of DMS Enterprise User. Valid values: `NORMAL`, `DISABLE`.
Status pulumi.StringPtrOutput `pulumi:"status"`
// The tenant ID.
Tid pulumi.IntPtrOutput `pulumi:"tid"`
// The Alibaba Cloud unique ID (UID) of the user to add.
Uid pulumi.StringOutput `pulumi:"uid"`
// The nickname of the user.
UserName pulumi.StringOutput `pulumi:"userName"`
}
// NewEnterpriseUser registers a new resource with the given unique name, arguments, and options.
func NewEnterpriseUser(ctx *pulumi.Context,
name string, args *EnterpriseUserArgs, opts ...pulumi.ResourceOption) (*EnterpriseUser, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.Uid == nil {
return nil, errors.New("invalid value for required argument 'Uid'")
}
var resource EnterpriseUser
err := ctx.RegisterResource("alicloud:dms/enterpriseUser:EnterpriseUser", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetEnterpriseUser gets an existing EnterpriseUser 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 GetEnterpriseUser(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *EnterpriseUserState, opts ...pulumi.ResourceOption) (*EnterpriseUser, error) {
var resource EnterpriseUser
err := ctx.ReadResource("alicloud:dms/enterpriseUser:EnterpriseUser", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering EnterpriseUser resources.
type enterpriseUserState struct {
// Maximum number of inquiries on the day.
MaxExecuteCount *int `pulumi:"maxExecuteCount"`
// Query the maximum number of rows on the day.
MaxResultCount *int `pulumi:"maxResultCount"`
// The DingTalk number or mobile number of the user.
Mobile *string `pulumi:"mobile"`
// It has been deprecated from 1.100.0 and use `userName` instead.
//
// Deprecated: Field 'nick_name' has been deprecated from version 1.100.0. Use 'user_name' instead.
NickName *string `pulumi:"nickName"`
// The roles that the user plays.
RoleNames []string `pulumi:"roleNames"`
// The state of DMS Enterprise User. Valid values: `NORMAL`, `DISABLE`.
Status *string `pulumi:"status"`
// The tenant ID.
Tid *int `pulumi:"tid"`
// The Alibaba Cloud unique ID (UID) of the user to add.
Uid *string `pulumi:"uid"`
// The nickname of the user.
UserName *string `pulumi:"userName"`
}
type EnterpriseUserState struct {
// Maximum number of inquiries on the day.
MaxExecuteCount pulumi.IntPtrInput
// Query the maximum number of rows on the day.
MaxResultCount pulumi.IntPtrInput
// The DingTalk number or mobile number of the user.
Mobile pulumi.StringPtrInput
// It has been deprecated from 1.100.0 and use `userName` instead.
//
// Deprecated: Field 'nick_name' has been deprecated from version 1.100.0. Use 'user_name' instead.
NickName pulumi.StringPtrInput
// The roles that the user plays.
RoleNames pulumi.StringArrayInput
// The state of DMS Enterprise User. Valid values: `NORMAL`, `DISABLE`.
Status pulumi.StringPtrInput
// The tenant ID.
Tid pulumi.IntPtrInput
// The Alibaba Cloud unique ID (UID) of the user to add.
Uid pulumi.StringPtrInput
// The nickname of the user.
UserName pulumi.StringPtrInput
}
func (EnterpriseUserState) ElementType() reflect.Type {
return reflect.TypeOf((*enterpriseUserState)(nil)).Elem()
}
type enterpriseUserArgs struct {
// Maximum number of inquiries on the day.
MaxExecuteCount *int `pulumi:"maxExecuteCount"`
// Query the maximum number of rows on the day.
MaxResultCount *int `pulumi:"maxResultCount"`
// The DingTalk number or mobile number of the user.
Mobile *string `pulumi:"mobile"`
// It has been deprecated from 1.100.0 and use `userName` instead.
//
// Deprecated: Field 'nick_name' has been deprecated from version 1.100.0. Use 'user_name' instead.
NickName *string `pulumi:"nickName"`
// The roles that the user plays.
RoleNames []string `pulumi:"roleNames"`
// The state of DMS Enterprise User. Valid values: `NORMAL`, `DISABLE`.
Status *string `pulumi:"status"`
// The tenant ID.
Tid *int `pulumi:"tid"`
// The Alibaba Cloud unique ID (UID) of the user to add.
Uid string `pulumi:"uid"`
// The nickname of the user.
UserName *string `pulumi:"userName"`
}
// The set of arguments for constructing a EnterpriseUser resource.
type EnterpriseUserArgs struct {
// Maximum number of inquiries on the day.
MaxExecuteCount pulumi.IntPtrInput
// Query the maximum number of rows on the day.
MaxResultCount pulumi.IntPtrInput
// The DingTalk number or mobile number of the user.
Mobile pulumi.StringPtrInput
// It has been deprecated from 1.100.0 and use `userName` instead.
//
// Deprecated: Field 'nick_name' has been deprecated from version 1.100.0. Use 'user_name' instead.
NickName pulumi.StringPtrInput
// The roles that the user plays.
RoleNames pulumi.StringArrayInput
// The state of DMS Enterprise User. Valid values: `NORMAL`, `DISABLE`.
Status pulumi.StringPtrInput
// The tenant ID.
Tid pulumi.IntPtrInput
// The Alibaba Cloud unique ID (UID) of the user to add.
Uid pulumi.StringInput
// The nickname of the user.
UserName pulumi.StringPtrInput
}
func (EnterpriseUserArgs) ElementType() reflect.Type {
return reflect.TypeOf((*enterpriseUserArgs)(nil)).Elem()
}
type EnterpriseUserInput interface {
pulumi.Input
ToEnterpriseUserOutput() EnterpriseUserOutput
ToEnterpriseUserOutputWithContext(ctx context.Context) EnterpriseUserOutput
}
func (*EnterpriseUser) ElementType() reflect.Type {
return reflect.TypeOf((*EnterpriseUser)(nil))
}
func (i *EnterpriseUser) ToEnterpriseUserOutput() EnterpriseUserOutput {
return i.ToEnterpriseUserOutputWithContext(context.Background())
}
func (i *EnterpriseUser) ToEnterpriseUserOutputWithContext(ctx context.Context) EnterpriseUserOutput {
return pulumi.ToOutputWithContext(ctx, i).(EnterpriseUserOutput)
}
type EnterpriseUserOutput struct {
*pulumi.OutputState
}
func (EnterpriseUserOutput) ElementType() reflect.Type {
return reflect.TypeOf((*EnterpriseUser)(nil))
}
func (o EnterpriseUserOutput) ToEnterpriseUserOutput() EnterpriseUserOutput {
return o
}
func (o EnterpriseUserOutput) ToEnterpriseUserOutputWithContext(ctx context.Context) EnterpriseUserOutput {
return o
}
func init() {
pulumi.RegisterOutputType(EnterpriseUserOutput{})
}