generated from pulumi/pulumi-tf-provider-boilerplate
/
workflowRole.go
277 lines (229 loc) · 8.34 KB
/
workflowRole.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
// 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 sdm
import (
"context"
"reflect"
"errors"
"github.com/pierskarsenbarg/pulumi-sdm/sdk/go/sdm/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// WorkflowRole links a role to a workflow. The linked roles indicate which roles a user must be a part of
//
// to request access to a resource via the workflow.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pierskarsenbarg/pulumi-sdm/sdk/go/sdm"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := sdm.NewWorkflowRole(ctx, "workflowRoleExample", &sdm.WorkflowRoleArgs{
// RoleId: pulumi.String("r-243561"),
// WorkflowId: pulumi.String("aw-343865"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// This resource can be imported using the import command.
//
// ## Import
//
// A WorkflowRole can be imported using the id, e.g.,
//
// ```sh
//
// $ pulumi import sdm:index/workflowRole:WorkflowRole example wr-12345678
//
// ```
type WorkflowRole struct {
pulumi.CustomResourceState
// The role id.
RoleId pulumi.StringOutput `pulumi:"roleId"`
// The workflow id.
WorkflowId pulumi.StringOutput `pulumi:"workflowId"`
}
// NewWorkflowRole registers a new resource with the given unique name, arguments, and options.
func NewWorkflowRole(ctx *pulumi.Context,
name string, args *WorkflowRoleArgs, opts ...pulumi.ResourceOption) (*WorkflowRole, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.RoleId == nil {
return nil, errors.New("invalid value for required argument 'RoleId'")
}
if args.WorkflowId == nil {
return nil, errors.New("invalid value for required argument 'WorkflowId'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource WorkflowRole
err := ctx.RegisterResource("sdm:index/workflowRole:WorkflowRole", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetWorkflowRole gets an existing WorkflowRole 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 GetWorkflowRole(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *WorkflowRoleState, opts ...pulumi.ResourceOption) (*WorkflowRole, error) {
var resource WorkflowRole
err := ctx.ReadResource("sdm:index/workflowRole:WorkflowRole", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering WorkflowRole resources.
type workflowRoleState struct {
// The role id.
RoleId *string `pulumi:"roleId"`
// The workflow id.
WorkflowId *string `pulumi:"workflowId"`
}
type WorkflowRoleState struct {
// The role id.
RoleId pulumi.StringPtrInput
// The workflow id.
WorkflowId pulumi.StringPtrInput
}
func (WorkflowRoleState) ElementType() reflect.Type {
return reflect.TypeOf((*workflowRoleState)(nil)).Elem()
}
type workflowRoleArgs struct {
// The role id.
RoleId string `pulumi:"roleId"`
// The workflow id.
WorkflowId string `pulumi:"workflowId"`
}
// The set of arguments for constructing a WorkflowRole resource.
type WorkflowRoleArgs struct {
// The role id.
RoleId pulumi.StringInput
// The workflow id.
WorkflowId pulumi.StringInput
}
func (WorkflowRoleArgs) ElementType() reflect.Type {
return reflect.TypeOf((*workflowRoleArgs)(nil)).Elem()
}
type WorkflowRoleInput interface {
pulumi.Input
ToWorkflowRoleOutput() WorkflowRoleOutput
ToWorkflowRoleOutputWithContext(ctx context.Context) WorkflowRoleOutput
}
func (*WorkflowRole) ElementType() reflect.Type {
return reflect.TypeOf((**WorkflowRole)(nil)).Elem()
}
func (i *WorkflowRole) ToWorkflowRoleOutput() WorkflowRoleOutput {
return i.ToWorkflowRoleOutputWithContext(context.Background())
}
func (i *WorkflowRole) ToWorkflowRoleOutputWithContext(ctx context.Context) WorkflowRoleOutput {
return pulumi.ToOutputWithContext(ctx, i).(WorkflowRoleOutput)
}
// WorkflowRoleArrayInput is an input type that accepts WorkflowRoleArray and WorkflowRoleArrayOutput values.
// You can construct a concrete instance of `WorkflowRoleArrayInput` via:
//
// WorkflowRoleArray{ WorkflowRoleArgs{...} }
type WorkflowRoleArrayInput interface {
pulumi.Input
ToWorkflowRoleArrayOutput() WorkflowRoleArrayOutput
ToWorkflowRoleArrayOutputWithContext(context.Context) WorkflowRoleArrayOutput
}
type WorkflowRoleArray []WorkflowRoleInput
func (WorkflowRoleArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*WorkflowRole)(nil)).Elem()
}
func (i WorkflowRoleArray) ToWorkflowRoleArrayOutput() WorkflowRoleArrayOutput {
return i.ToWorkflowRoleArrayOutputWithContext(context.Background())
}
func (i WorkflowRoleArray) ToWorkflowRoleArrayOutputWithContext(ctx context.Context) WorkflowRoleArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(WorkflowRoleArrayOutput)
}
// WorkflowRoleMapInput is an input type that accepts WorkflowRoleMap and WorkflowRoleMapOutput values.
// You can construct a concrete instance of `WorkflowRoleMapInput` via:
//
// WorkflowRoleMap{ "key": WorkflowRoleArgs{...} }
type WorkflowRoleMapInput interface {
pulumi.Input
ToWorkflowRoleMapOutput() WorkflowRoleMapOutput
ToWorkflowRoleMapOutputWithContext(context.Context) WorkflowRoleMapOutput
}
type WorkflowRoleMap map[string]WorkflowRoleInput
func (WorkflowRoleMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*WorkflowRole)(nil)).Elem()
}
func (i WorkflowRoleMap) ToWorkflowRoleMapOutput() WorkflowRoleMapOutput {
return i.ToWorkflowRoleMapOutputWithContext(context.Background())
}
func (i WorkflowRoleMap) ToWorkflowRoleMapOutputWithContext(ctx context.Context) WorkflowRoleMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(WorkflowRoleMapOutput)
}
type WorkflowRoleOutput struct{ *pulumi.OutputState }
func (WorkflowRoleOutput) ElementType() reflect.Type {
return reflect.TypeOf((**WorkflowRole)(nil)).Elem()
}
func (o WorkflowRoleOutput) ToWorkflowRoleOutput() WorkflowRoleOutput {
return o
}
func (o WorkflowRoleOutput) ToWorkflowRoleOutputWithContext(ctx context.Context) WorkflowRoleOutput {
return o
}
// The role id.
func (o WorkflowRoleOutput) RoleId() pulumi.StringOutput {
return o.ApplyT(func(v *WorkflowRole) pulumi.StringOutput { return v.RoleId }).(pulumi.StringOutput)
}
// The workflow id.
func (o WorkflowRoleOutput) WorkflowId() pulumi.StringOutput {
return o.ApplyT(func(v *WorkflowRole) pulumi.StringOutput { return v.WorkflowId }).(pulumi.StringOutput)
}
type WorkflowRoleArrayOutput struct{ *pulumi.OutputState }
func (WorkflowRoleArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*WorkflowRole)(nil)).Elem()
}
func (o WorkflowRoleArrayOutput) ToWorkflowRoleArrayOutput() WorkflowRoleArrayOutput {
return o
}
func (o WorkflowRoleArrayOutput) ToWorkflowRoleArrayOutputWithContext(ctx context.Context) WorkflowRoleArrayOutput {
return o
}
func (o WorkflowRoleArrayOutput) Index(i pulumi.IntInput) WorkflowRoleOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *WorkflowRole {
return vs[0].([]*WorkflowRole)[vs[1].(int)]
}).(WorkflowRoleOutput)
}
type WorkflowRoleMapOutput struct{ *pulumi.OutputState }
func (WorkflowRoleMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*WorkflowRole)(nil)).Elem()
}
func (o WorkflowRoleMapOutput) ToWorkflowRoleMapOutput() WorkflowRoleMapOutput {
return o
}
func (o WorkflowRoleMapOutput) ToWorkflowRoleMapOutputWithContext(ctx context.Context) WorkflowRoleMapOutput {
return o
}
func (o WorkflowRoleMapOutput) MapIndex(k pulumi.StringInput) WorkflowRoleOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *WorkflowRole {
return vs[0].(map[string]*WorkflowRole)[vs[1].(string)]
}).(WorkflowRoleOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*WorkflowRoleInput)(nil)).Elem(), &WorkflowRole{})
pulumi.RegisterInputType(reflect.TypeOf((*WorkflowRoleArrayInput)(nil)).Elem(), WorkflowRoleArray{})
pulumi.RegisterInputType(reflect.TypeOf((*WorkflowRoleMapInput)(nil)).Elem(), WorkflowRoleMap{})
pulumi.RegisterOutputType(WorkflowRoleOutput{})
pulumi.RegisterOutputType(WorkflowRoleArrayOutput{})
pulumi.RegisterOutputType(WorkflowRoleMapOutput{})
}