/
groupAssignment.go
311 lines (251 loc) · 11.2 KB
/
groupAssignment.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
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
// *** 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 app
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// ## Import
//
// An application group assignment can be imported via the `app_id` and the `group_id`.
//
// ```sh
// $ pulumi import okta:app/groupAssignment:GroupAssignment example <app_id>/<group_id>
// ```
type GroupAssignment struct {
pulumi.CustomResourceState
// The ID of the application to assign a group to.
AppId pulumi.StringOutput `pulumi:"appId"`
// The ID of the group to assign the app to.
GroupId pulumi.StringOutput `pulumi:"groupId"`
Priority pulumi.IntPtrOutput `pulumi:"priority"`
// JSON document containing [application profile](https://developer.okta.com/docs/reference/api/apps/#profile-object)
Profile pulumi.StringPtrOutput `pulumi:"profile"`
// Retain the group assignment on destroy. If set to true, the resource will be removed from state but not from the Okta app.
RetainAssignment pulumi.BoolPtrOutput `pulumi:"retainAssignment"`
}
// NewGroupAssignment registers a new resource with the given unique name, arguments, and options.
func NewGroupAssignment(ctx *pulumi.Context,
name string, args *GroupAssignmentArgs, opts ...pulumi.ResourceOption) (*GroupAssignment, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.AppId == nil {
return nil, errors.New("invalid value for required argument 'AppId'")
}
if args.GroupId == nil {
return nil, errors.New("invalid value for required argument 'GroupId'")
}
var resource GroupAssignment
err := ctx.RegisterResource("okta:app/groupAssignment:GroupAssignment", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetGroupAssignment gets an existing GroupAssignment 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 GetGroupAssignment(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *GroupAssignmentState, opts ...pulumi.ResourceOption) (*GroupAssignment, error) {
var resource GroupAssignment
err := ctx.ReadResource("okta:app/groupAssignment:GroupAssignment", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering GroupAssignment resources.
type groupAssignmentState struct {
// The ID of the application to assign a group to.
AppId *string `pulumi:"appId"`
// The ID of the group to assign the app to.
GroupId *string `pulumi:"groupId"`
Priority *int `pulumi:"priority"`
// JSON document containing [application profile](https://developer.okta.com/docs/reference/api/apps/#profile-object)
Profile *string `pulumi:"profile"`
// Retain the group assignment on destroy. If set to true, the resource will be removed from state but not from the Okta app.
RetainAssignment *bool `pulumi:"retainAssignment"`
}
type GroupAssignmentState struct {
// The ID of the application to assign a group to.
AppId pulumi.StringPtrInput
// The ID of the group to assign the app to.
GroupId pulumi.StringPtrInput
Priority pulumi.IntPtrInput
// JSON document containing [application profile](https://developer.okta.com/docs/reference/api/apps/#profile-object)
Profile pulumi.StringPtrInput
// Retain the group assignment on destroy. If set to true, the resource will be removed from state but not from the Okta app.
RetainAssignment pulumi.BoolPtrInput
}
func (GroupAssignmentState) ElementType() reflect.Type {
return reflect.TypeOf((*groupAssignmentState)(nil)).Elem()
}
type groupAssignmentArgs struct {
// The ID of the application to assign a group to.
AppId string `pulumi:"appId"`
// The ID of the group to assign the app to.
GroupId string `pulumi:"groupId"`
Priority *int `pulumi:"priority"`
// JSON document containing [application profile](https://developer.okta.com/docs/reference/api/apps/#profile-object)
Profile *string `pulumi:"profile"`
// Retain the group assignment on destroy. If set to true, the resource will be removed from state but not from the Okta app.
RetainAssignment *bool `pulumi:"retainAssignment"`
}
// The set of arguments for constructing a GroupAssignment resource.
type GroupAssignmentArgs struct {
// The ID of the application to assign a group to.
AppId pulumi.StringInput
// The ID of the group to assign the app to.
GroupId pulumi.StringInput
Priority pulumi.IntPtrInput
// JSON document containing [application profile](https://developer.okta.com/docs/reference/api/apps/#profile-object)
Profile pulumi.StringPtrInput
// Retain the group assignment on destroy. If set to true, the resource will be removed from state but not from the Okta app.
RetainAssignment pulumi.BoolPtrInput
}
func (GroupAssignmentArgs) ElementType() reflect.Type {
return reflect.TypeOf((*groupAssignmentArgs)(nil)).Elem()
}
type GroupAssignmentInput interface {
pulumi.Input
ToGroupAssignmentOutput() GroupAssignmentOutput
ToGroupAssignmentOutputWithContext(ctx context.Context) GroupAssignmentOutput
}
func (*GroupAssignment) ElementType() reflect.Type {
return reflect.TypeOf((*GroupAssignment)(nil))
}
func (i *GroupAssignment) ToGroupAssignmentOutput() GroupAssignmentOutput {
return i.ToGroupAssignmentOutputWithContext(context.Background())
}
func (i *GroupAssignment) ToGroupAssignmentOutputWithContext(ctx context.Context) GroupAssignmentOutput {
return pulumi.ToOutputWithContext(ctx, i).(GroupAssignmentOutput)
}
func (i *GroupAssignment) ToGroupAssignmentPtrOutput() GroupAssignmentPtrOutput {
return i.ToGroupAssignmentPtrOutputWithContext(context.Background())
}
func (i *GroupAssignment) ToGroupAssignmentPtrOutputWithContext(ctx context.Context) GroupAssignmentPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(GroupAssignmentPtrOutput)
}
type GroupAssignmentPtrInput interface {
pulumi.Input
ToGroupAssignmentPtrOutput() GroupAssignmentPtrOutput
ToGroupAssignmentPtrOutputWithContext(ctx context.Context) GroupAssignmentPtrOutput
}
type groupAssignmentPtrType GroupAssignmentArgs
func (*groupAssignmentPtrType) ElementType() reflect.Type {
return reflect.TypeOf((**GroupAssignment)(nil))
}
func (i *groupAssignmentPtrType) ToGroupAssignmentPtrOutput() GroupAssignmentPtrOutput {
return i.ToGroupAssignmentPtrOutputWithContext(context.Background())
}
func (i *groupAssignmentPtrType) ToGroupAssignmentPtrOutputWithContext(ctx context.Context) GroupAssignmentPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(GroupAssignmentPtrOutput)
}
// GroupAssignmentArrayInput is an input type that accepts GroupAssignmentArray and GroupAssignmentArrayOutput values.
// You can construct a concrete instance of `GroupAssignmentArrayInput` via:
//
// GroupAssignmentArray{ GroupAssignmentArgs{...} }
type GroupAssignmentArrayInput interface {
pulumi.Input
ToGroupAssignmentArrayOutput() GroupAssignmentArrayOutput
ToGroupAssignmentArrayOutputWithContext(context.Context) GroupAssignmentArrayOutput
}
type GroupAssignmentArray []GroupAssignmentInput
func (GroupAssignmentArray) ElementType() reflect.Type {
return reflect.TypeOf(([]*GroupAssignment)(nil))
}
func (i GroupAssignmentArray) ToGroupAssignmentArrayOutput() GroupAssignmentArrayOutput {
return i.ToGroupAssignmentArrayOutputWithContext(context.Background())
}
func (i GroupAssignmentArray) ToGroupAssignmentArrayOutputWithContext(ctx context.Context) GroupAssignmentArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(GroupAssignmentArrayOutput)
}
// GroupAssignmentMapInput is an input type that accepts GroupAssignmentMap and GroupAssignmentMapOutput values.
// You can construct a concrete instance of `GroupAssignmentMapInput` via:
//
// GroupAssignmentMap{ "key": GroupAssignmentArgs{...} }
type GroupAssignmentMapInput interface {
pulumi.Input
ToGroupAssignmentMapOutput() GroupAssignmentMapOutput
ToGroupAssignmentMapOutputWithContext(context.Context) GroupAssignmentMapOutput
}
type GroupAssignmentMap map[string]GroupAssignmentInput
func (GroupAssignmentMap) ElementType() reflect.Type {
return reflect.TypeOf((map[string]*GroupAssignment)(nil))
}
func (i GroupAssignmentMap) ToGroupAssignmentMapOutput() GroupAssignmentMapOutput {
return i.ToGroupAssignmentMapOutputWithContext(context.Background())
}
func (i GroupAssignmentMap) ToGroupAssignmentMapOutputWithContext(ctx context.Context) GroupAssignmentMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(GroupAssignmentMapOutput)
}
type GroupAssignmentOutput struct {
*pulumi.OutputState
}
func (GroupAssignmentOutput) ElementType() reflect.Type {
return reflect.TypeOf((*GroupAssignment)(nil))
}
func (o GroupAssignmentOutput) ToGroupAssignmentOutput() GroupAssignmentOutput {
return o
}
func (o GroupAssignmentOutput) ToGroupAssignmentOutputWithContext(ctx context.Context) GroupAssignmentOutput {
return o
}
func (o GroupAssignmentOutput) ToGroupAssignmentPtrOutput() GroupAssignmentPtrOutput {
return o.ToGroupAssignmentPtrOutputWithContext(context.Background())
}
func (o GroupAssignmentOutput) ToGroupAssignmentPtrOutputWithContext(ctx context.Context) GroupAssignmentPtrOutput {
return o.ApplyT(func(v GroupAssignment) *GroupAssignment {
return &v
}).(GroupAssignmentPtrOutput)
}
type GroupAssignmentPtrOutput struct {
*pulumi.OutputState
}
func (GroupAssignmentPtrOutput) ElementType() reflect.Type {
return reflect.TypeOf((**GroupAssignment)(nil))
}
func (o GroupAssignmentPtrOutput) ToGroupAssignmentPtrOutput() GroupAssignmentPtrOutput {
return o
}
func (o GroupAssignmentPtrOutput) ToGroupAssignmentPtrOutputWithContext(ctx context.Context) GroupAssignmentPtrOutput {
return o
}
type GroupAssignmentArrayOutput struct{ *pulumi.OutputState }
func (GroupAssignmentArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]GroupAssignment)(nil))
}
func (o GroupAssignmentArrayOutput) ToGroupAssignmentArrayOutput() GroupAssignmentArrayOutput {
return o
}
func (o GroupAssignmentArrayOutput) ToGroupAssignmentArrayOutputWithContext(ctx context.Context) GroupAssignmentArrayOutput {
return o
}
func (o GroupAssignmentArrayOutput) Index(i pulumi.IntInput) GroupAssignmentOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) GroupAssignment {
return vs[0].([]GroupAssignment)[vs[1].(int)]
}).(GroupAssignmentOutput)
}
type GroupAssignmentMapOutput struct{ *pulumi.OutputState }
func (GroupAssignmentMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]GroupAssignment)(nil))
}
func (o GroupAssignmentMapOutput) ToGroupAssignmentMapOutput() GroupAssignmentMapOutput {
return o
}
func (o GroupAssignmentMapOutput) ToGroupAssignmentMapOutputWithContext(ctx context.Context) GroupAssignmentMapOutput {
return o
}
func (o GroupAssignmentMapOutput) MapIndex(k pulumi.StringInput) GroupAssignmentOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) GroupAssignment {
return vs[0].(map[string]GroupAssignment)[vs[1].(string)]
}).(GroupAssignmentOutput)
}
func init() {
pulumi.RegisterOutputType(GroupAssignmentOutput{})
pulumi.RegisterOutputType(GroupAssignmentPtrOutput{})
pulumi.RegisterOutputType(GroupAssignmentArrayOutput{})
pulumi.RegisterOutputType(GroupAssignmentMapOutput{})
}