generated from pulumi/pulumi-tf-provider-boilerplate
/
userPermission.go
247 lines (199 loc) · 10.1 KB
/
userPermission.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
// 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 servicemesh
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides a Service Mesh UserPermission resource.
//
// For information about Service Mesh User Permission and how to use it, see [What is User Permission](https://help.aliyun.com/document_detail/171622.html).
//
// > **NOTE:** Available in v1.174.0+.
//
// ## Import
//
// Service Mesh User Permission can be imported using the id, e.g.
//
// ```sh
//
// $ pulumi import alicloud:servicemesh/userPermission:UserPermission example <id>
//
// ```
type UserPermission struct {
pulumi.CustomResourceState
// List of permissions. **Warning:** The list requires the full amount of permission information to be passed. Adding permissions means adding items to the list, and deleting them or inputting nothing means removing items. See the following `Block permissions`.
Permissions UserPermissionPermissionArrayOutput `pulumi:"permissions"`
// The configuration of the Load Balancer. See the following `Block loadBalancer`.
SubAccountUserId pulumi.StringOutput `pulumi:"subAccountUserId"`
}
// NewUserPermission registers a new resource with the given unique name, arguments, and options.
func NewUserPermission(ctx *pulumi.Context,
name string, args *UserPermissionArgs, opts ...pulumi.ResourceOption) (*UserPermission, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.SubAccountUserId == nil {
return nil, errors.New("invalid value for required argument 'SubAccountUserId'")
}
opts = pkgResourceDefaultOpts(opts)
var resource UserPermission
err := ctx.RegisterResource("alicloud:servicemesh/userPermission:UserPermission", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetUserPermission gets an existing UserPermission 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 GetUserPermission(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *UserPermissionState, opts ...pulumi.ResourceOption) (*UserPermission, error) {
var resource UserPermission
err := ctx.ReadResource("alicloud:servicemesh/userPermission:UserPermission", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering UserPermission resources.
type userPermissionState struct {
// List of permissions. **Warning:** The list requires the full amount of permission information to be passed. Adding permissions means adding items to the list, and deleting them or inputting nothing means removing items. See the following `Block permissions`.
Permissions []UserPermissionPermission `pulumi:"permissions"`
// The configuration of the Load Balancer. See the following `Block loadBalancer`.
SubAccountUserId *string `pulumi:"subAccountUserId"`
}
type UserPermissionState struct {
// List of permissions. **Warning:** The list requires the full amount of permission information to be passed. Adding permissions means adding items to the list, and deleting them or inputting nothing means removing items. See the following `Block permissions`.
Permissions UserPermissionPermissionArrayInput
// The configuration of the Load Balancer. See the following `Block loadBalancer`.
SubAccountUserId pulumi.StringPtrInput
}
func (UserPermissionState) ElementType() reflect.Type {
return reflect.TypeOf((*userPermissionState)(nil)).Elem()
}
type userPermissionArgs struct {
// List of permissions. **Warning:** The list requires the full amount of permission information to be passed. Adding permissions means adding items to the list, and deleting them or inputting nothing means removing items. See the following `Block permissions`.
Permissions []UserPermissionPermission `pulumi:"permissions"`
// The configuration of the Load Balancer. See the following `Block loadBalancer`.
SubAccountUserId string `pulumi:"subAccountUserId"`
}
// The set of arguments for constructing a UserPermission resource.
type UserPermissionArgs struct {
// List of permissions. **Warning:** The list requires the full amount of permission information to be passed. Adding permissions means adding items to the list, and deleting them or inputting nothing means removing items. See the following `Block permissions`.
Permissions UserPermissionPermissionArrayInput
// The configuration of the Load Balancer. See the following `Block loadBalancer`.
SubAccountUserId pulumi.StringInput
}
func (UserPermissionArgs) ElementType() reflect.Type {
return reflect.TypeOf((*userPermissionArgs)(nil)).Elem()
}
type UserPermissionInput interface {
pulumi.Input
ToUserPermissionOutput() UserPermissionOutput
ToUserPermissionOutputWithContext(ctx context.Context) UserPermissionOutput
}
func (*UserPermission) ElementType() reflect.Type {
return reflect.TypeOf((**UserPermission)(nil)).Elem()
}
func (i *UserPermission) ToUserPermissionOutput() UserPermissionOutput {
return i.ToUserPermissionOutputWithContext(context.Background())
}
func (i *UserPermission) ToUserPermissionOutputWithContext(ctx context.Context) UserPermissionOutput {
return pulumi.ToOutputWithContext(ctx, i).(UserPermissionOutput)
}
// UserPermissionArrayInput is an input type that accepts UserPermissionArray and UserPermissionArrayOutput values.
// You can construct a concrete instance of `UserPermissionArrayInput` via:
//
// UserPermissionArray{ UserPermissionArgs{...} }
type UserPermissionArrayInput interface {
pulumi.Input
ToUserPermissionArrayOutput() UserPermissionArrayOutput
ToUserPermissionArrayOutputWithContext(context.Context) UserPermissionArrayOutput
}
type UserPermissionArray []UserPermissionInput
func (UserPermissionArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*UserPermission)(nil)).Elem()
}
func (i UserPermissionArray) ToUserPermissionArrayOutput() UserPermissionArrayOutput {
return i.ToUserPermissionArrayOutputWithContext(context.Background())
}
func (i UserPermissionArray) ToUserPermissionArrayOutputWithContext(ctx context.Context) UserPermissionArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(UserPermissionArrayOutput)
}
// UserPermissionMapInput is an input type that accepts UserPermissionMap and UserPermissionMapOutput values.
// You can construct a concrete instance of `UserPermissionMapInput` via:
//
// UserPermissionMap{ "key": UserPermissionArgs{...} }
type UserPermissionMapInput interface {
pulumi.Input
ToUserPermissionMapOutput() UserPermissionMapOutput
ToUserPermissionMapOutputWithContext(context.Context) UserPermissionMapOutput
}
type UserPermissionMap map[string]UserPermissionInput
func (UserPermissionMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*UserPermission)(nil)).Elem()
}
func (i UserPermissionMap) ToUserPermissionMapOutput() UserPermissionMapOutput {
return i.ToUserPermissionMapOutputWithContext(context.Background())
}
func (i UserPermissionMap) ToUserPermissionMapOutputWithContext(ctx context.Context) UserPermissionMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(UserPermissionMapOutput)
}
type UserPermissionOutput struct{ *pulumi.OutputState }
func (UserPermissionOutput) ElementType() reflect.Type {
return reflect.TypeOf((**UserPermission)(nil)).Elem()
}
func (o UserPermissionOutput) ToUserPermissionOutput() UserPermissionOutput {
return o
}
func (o UserPermissionOutput) ToUserPermissionOutputWithContext(ctx context.Context) UserPermissionOutput {
return o
}
// List of permissions. **Warning:** The list requires the full amount of permission information to be passed. Adding permissions means adding items to the list, and deleting them or inputting nothing means removing items. See the following `Block permissions`.
func (o UserPermissionOutput) Permissions() UserPermissionPermissionArrayOutput {
return o.ApplyT(func(v *UserPermission) UserPermissionPermissionArrayOutput { return v.Permissions }).(UserPermissionPermissionArrayOutput)
}
// The configuration of the Load Balancer. See the following `Block loadBalancer`.
func (o UserPermissionOutput) SubAccountUserId() pulumi.StringOutput {
return o.ApplyT(func(v *UserPermission) pulumi.StringOutput { return v.SubAccountUserId }).(pulumi.StringOutput)
}
type UserPermissionArrayOutput struct{ *pulumi.OutputState }
func (UserPermissionArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*UserPermission)(nil)).Elem()
}
func (o UserPermissionArrayOutput) ToUserPermissionArrayOutput() UserPermissionArrayOutput {
return o
}
func (o UserPermissionArrayOutput) ToUserPermissionArrayOutputWithContext(ctx context.Context) UserPermissionArrayOutput {
return o
}
func (o UserPermissionArrayOutput) Index(i pulumi.IntInput) UserPermissionOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *UserPermission {
return vs[0].([]*UserPermission)[vs[1].(int)]
}).(UserPermissionOutput)
}
type UserPermissionMapOutput struct{ *pulumi.OutputState }
func (UserPermissionMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*UserPermission)(nil)).Elem()
}
func (o UserPermissionMapOutput) ToUserPermissionMapOutput() UserPermissionMapOutput {
return o
}
func (o UserPermissionMapOutput) ToUserPermissionMapOutputWithContext(ctx context.Context) UserPermissionMapOutput {
return o
}
func (o UserPermissionMapOutput) MapIndex(k pulumi.StringInput) UserPermissionOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *UserPermission {
return vs[0].(map[string]*UserPermission)[vs[1].(string)]
}).(UserPermissionOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*UserPermissionInput)(nil)).Elem(), &UserPermission{})
pulumi.RegisterInputType(reflect.TypeOf((*UserPermissionArrayInput)(nil)).Elem(), UserPermissionArray{})
pulumi.RegisterInputType(reflect.TypeOf((*UserPermissionMapInput)(nil)).Elem(), UserPermissionMap{})
pulumi.RegisterOutputType(UserPermissionOutput{})
pulumi.RegisterOutputType(UserPermissionArrayOutput{})
pulumi.RegisterOutputType(UserPermissionMapOutput{})
}