-
Notifications
You must be signed in to change notification settings - Fork 7
/
prompt.go
320 lines (265 loc) · 10.4 KB
/
prompt.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
312
313
314
315
316
317
318
319
320
// 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 auth0
import (
"context"
"reflect"
"github.com/pulumi/pulumi-auth0/sdk/v2/go/auth0/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumix"
)
// With this resource, you can manage your Auth0 prompts, including choosing the login experience version.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-auth0/sdk/v2/go/auth0"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := auth0.NewPrompt(ctx, "myPrompt", &auth0.PromptArgs{
// IdentifierFirst: pulumi.Bool(false),
// UniversalLoginExperience: pulumi.String("new"),
// WebauthnPlatformFirstFactor: pulumi.Bool(true),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// As this is not a resource identifiable by an ID within the Auth0 Management API, prompts can be imported using a random string. # We recommend [Version 4 UUID](https://www.uuidgenerator.net/version4) # Example
//
// ```sh
//
// $ pulumi import auth0:index/prompt:Prompt my_prompt 22f4f21b-017a-319d-92e7-2291c1ca36c4
//
// ```
type Prompt struct {
pulumi.CustomResourceState
// Indicates whether the identifier first is used when using the new Universal Login experience.
IdentifierFirst pulumi.BoolPtrOutput `pulumi:"identifierFirst"`
// Which login experience to use. Options include `classic` and `new`.
UniversalLoginExperience pulumi.StringOutput `pulumi:"universalLoginExperience"`
// Determines if the login screen uses identifier and biometrics first.
WebauthnPlatformFirstFactor pulumi.BoolOutput `pulumi:"webauthnPlatformFirstFactor"`
}
// NewPrompt registers a new resource with the given unique name, arguments, and options.
func NewPrompt(ctx *pulumi.Context,
name string, args *PromptArgs, opts ...pulumi.ResourceOption) (*Prompt, error) {
if args == nil {
args = &PromptArgs{}
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource Prompt
err := ctx.RegisterResource("auth0:index/prompt:Prompt", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetPrompt gets an existing Prompt 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 GetPrompt(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *PromptState, opts ...pulumi.ResourceOption) (*Prompt, error) {
var resource Prompt
err := ctx.ReadResource("auth0:index/prompt:Prompt", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Prompt resources.
type promptState struct {
// Indicates whether the identifier first is used when using the new Universal Login experience.
IdentifierFirst *bool `pulumi:"identifierFirst"`
// Which login experience to use. Options include `classic` and `new`.
UniversalLoginExperience *string `pulumi:"universalLoginExperience"`
// Determines if the login screen uses identifier and biometrics first.
WebauthnPlatformFirstFactor *bool `pulumi:"webauthnPlatformFirstFactor"`
}
type PromptState struct {
// Indicates whether the identifier first is used when using the new Universal Login experience.
IdentifierFirst pulumi.BoolPtrInput
// Which login experience to use. Options include `classic` and `new`.
UniversalLoginExperience pulumi.StringPtrInput
// Determines if the login screen uses identifier and biometrics first.
WebauthnPlatformFirstFactor pulumi.BoolPtrInput
}
func (PromptState) ElementType() reflect.Type {
return reflect.TypeOf((*promptState)(nil)).Elem()
}
type promptArgs struct {
// Indicates whether the identifier first is used when using the new Universal Login experience.
IdentifierFirst *bool `pulumi:"identifierFirst"`
// Which login experience to use. Options include `classic` and `new`.
UniversalLoginExperience *string `pulumi:"universalLoginExperience"`
// Determines if the login screen uses identifier and biometrics first.
WebauthnPlatformFirstFactor *bool `pulumi:"webauthnPlatformFirstFactor"`
}
// The set of arguments for constructing a Prompt resource.
type PromptArgs struct {
// Indicates whether the identifier first is used when using the new Universal Login experience.
IdentifierFirst pulumi.BoolPtrInput
// Which login experience to use. Options include `classic` and `new`.
UniversalLoginExperience pulumi.StringPtrInput
// Determines if the login screen uses identifier and biometrics first.
WebauthnPlatformFirstFactor pulumi.BoolPtrInput
}
func (PromptArgs) ElementType() reflect.Type {
return reflect.TypeOf((*promptArgs)(nil)).Elem()
}
type PromptInput interface {
pulumi.Input
ToPromptOutput() PromptOutput
ToPromptOutputWithContext(ctx context.Context) PromptOutput
}
func (*Prompt) ElementType() reflect.Type {
return reflect.TypeOf((**Prompt)(nil)).Elem()
}
func (i *Prompt) ToPromptOutput() PromptOutput {
return i.ToPromptOutputWithContext(context.Background())
}
func (i *Prompt) ToPromptOutputWithContext(ctx context.Context) PromptOutput {
return pulumi.ToOutputWithContext(ctx, i).(PromptOutput)
}
func (i *Prompt) ToOutput(ctx context.Context) pulumix.Output[*Prompt] {
return pulumix.Output[*Prompt]{
OutputState: i.ToPromptOutputWithContext(ctx).OutputState,
}
}
// PromptArrayInput is an input type that accepts PromptArray and PromptArrayOutput values.
// You can construct a concrete instance of `PromptArrayInput` via:
//
// PromptArray{ PromptArgs{...} }
type PromptArrayInput interface {
pulumi.Input
ToPromptArrayOutput() PromptArrayOutput
ToPromptArrayOutputWithContext(context.Context) PromptArrayOutput
}
type PromptArray []PromptInput
func (PromptArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Prompt)(nil)).Elem()
}
func (i PromptArray) ToPromptArrayOutput() PromptArrayOutput {
return i.ToPromptArrayOutputWithContext(context.Background())
}
func (i PromptArray) ToPromptArrayOutputWithContext(ctx context.Context) PromptArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(PromptArrayOutput)
}
func (i PromptArray) ToOutput(ctx context.Context) pulumix.Output[[]*Prompt] {
return pulumix.Output[[]*Prompt]{
OutputState: i.ToPromptArrayOutputWithContext(ctx).OutputState,
}
}
// PromptMapInput is an input type that accepts PromptMap and PromptMapOutput values.
// You can construct a concrete instance of `PromptMapInput` via:
//
// PromptMap{ "key": PromptArgs{...} }
type PromptMapInput interface {
pulumi.Input
ToPromptMapOutput() PromptMapOutput
ToPromptMapOutputWithContext(context.Context) PromptMapOutput
}
type PromptMap map[string]PromptInput
func (PromptMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Prompt)(nil)).Elem()
}
func (i PromptMap) ToPromptMapOutput() PromptMapOutput {
return i.ToPromptMapOutputWithContext(context.Background())
}
func (i PromptMap) ToPromptMapOutputWithContext(ctx context.Context) PromptMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(PromptMapOutput)
}
func (i PromptMap) ToOutput(ctx context.Context) pulumix.Output[map[string]*Prompt] {
return pulumix.Output[map[string]*Prompt]{
OutputState: i.ToPromptMapOutputWithContext(ctx).OutputState,
}
}
type PromptOutput struct{ *pulumi.OutputState }
func (PromptOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Prompt)(nil)).Elem()
}
func (o PromptOutput) ToPromptOutput() PromptOutput {
return o
}
func (o PromptOutput) ToPromptOutputWithContext(ctx context.Context) PromptOutput {
return o
}
func (o PromptOutput) ToOutput(ctx context.Context) pulumix.Output[*Prompt] {
return pulumix.Output[*Prompt]{
OutputState: o.OutputState,
}
}
// Indicates whether the identifier first is used when using the new Universal Login experience.
func (o PromptOutput) IdentifierFirst() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *Prompt) pulumi.BoolPtrOutput { return v.IdentifierFirst }).(pulumi.BoolPtrOutput)
}
// Which login experience to use. Options include `classic` and `new`.
func (o PromptOutput) UniversalLoginExperience() pulumi.StringOutput {
return o.ApplyT(func(v *Prompt) pulumi.StringOutput { return v.UniversalLoginExperience }).(pulumi.StringOutput)
}
// Determines if the login screen uses identifier and biometrics first.
func (o PromptOutput) WebauthnPlatformFirstFactor() pulumi.BoolOutput {
return o.ApplyT(func(v *Prompt) pulumi.BoolOutput { return v.WebauthnPlatformFirstFactor }).(pulumi.BoolOutput)
}
type PromptArrayOutput struct{ *pulumi.OutputState }
func (PromptArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Prompt)(nil)).Elem()
}
func (o PromptArrayOutput) ToPromptArrayOutput() PromptArrayOutput {
return o
}
func (o PromptArrayOutput) ToPromptArrayOutputWithContext(ctx context.Context) PromptArrayOutput {
return o
}
func (o PromptArrayOutput) ToOutput(ctx context.Context) pulumix.Output[[]*Prompt] {
return pulumix.Output[[]*Prompt]{
OutputState: o.OutputState,
}
}
func (o PromptArrayOutput) Index(i pulumi.IntInput) PromptOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Prompt {
return vs[0].([]*Prompt)[vs[1].(int)]
}).(PromptOutput)
}
type PromptMapOutput struct{ *pulumi.OutputState }
func (PromptMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Prompt)(nil)).Elem()
}
func (o PromptMapOutput) ToPromptMapOutput() PromptMapOutput {
return o
}
func (o PromptMapOutput) ToPromptMapOutputWithContext(ctx context.Context) PromptMapOutput {
return o
}
func (o PromptMapOutput) ToOutput(ctx context.Context) pulumix.Output[map[string]*Prompt] {
return pulumix.Output[map[string]*Prompt]{
OutputState: o.OutputState,
}
}
func (o PromptMapOutput) MapIndex(k pulumi.StringInput) PromptOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Prompt {
return vs[0].(map[string]*Prompt)[vs[1].(string)]
}).(PromptOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*PromptInput)(nil)).Elem(), &Prompt{})
pulumi.RegisterInputType(reflect.TypeOf((*PromptArrayInput)(nil)).Elem(), PromptArray{})
pulumi.RegisterInputType(reflect.TypeOf((*PromptMapInput)(nil)).Elem(), PromptMap{})
pulumi.RegisterOutputType(PromptOutput{})
pulumi.RegisterOutputType(PromptArrayOutput{})
pulumi.RegisterOutputType(PromptMapOutput{})
}