@@ -2,22 +2,34 @@ import * as runtime from '../../../lib/runtime.js';
2
2
import type { InitOverride , ApiResponse } from '../../../lib/runtime.js' ;
3
3
import type {
4
4
CreatePhoneProviderRequest ,
5
+ CreatePhoneTemplateRequestContent ,
6
+ CreatePhoneTemplateResponseContent ,
5
7
GetBranding200Response ,
6
8
GetBrandingPhoneProviders200Response ,
7
9
GetBrandingPhoneProviders200ResponseProvidersInner ,
10
+ GetPhoneTemplateResponseContent ,
8
11
GetUniversalLogin200Response ,
12
+ ListPhoneTemplatesResponseContent ,
9
13
PatchBrandingRequest ,
10
14
PostBrandingTheme200Response ,
11
15
PostBrandingThemeRequest ,
12
16
PutUniversalLoginRequest ,
17
+ ResetPhoneTemplateResponseContent ,
13
18
UpdatePhoneProviderRequest ,
19
+ UpdatePhoneTemplateRequestContent ,
20
+ UpdatePhoneTemplateResponseContent ,
14
21
DeleteBrandingThemeRequest ,
15
22
DeletePhoneProviderRequest ,
23
+ DeletePhoneTemplateRequest ,
16
24
GetBrandingPhoneProvidersRequest ,
17
25
GetBrandingThemeRequest ,
18
26
GetPhoneProviderRequest ,
27
+ GetPhoneTemplateRequest ,
28
+ GetPhoneTemplatesRequest ,
19
29
PatchBrandingThemeRequest ,
30
+ ResetPhoneTemplateRequest ,
20
31
UpdatePhoneProviderOperationRequest ,
32
+ UpdatePhoneTemplateRequest ,
21
33
} from '../models/index.js' ;
22
34
23
35
const { BaseAPI } = runtime ;
@@ -55,6 +67,32 @@ export class BrandingManager extends BaseAPI {
55
67
return runtime . JSONApiResponse . fromResponse ( response ) ;
56
68
}
57
69
70
+ /**
71
+ * Create a phone notification template
72
+ *
73
+ * @throws {RequiredError }
74
+ */
75
+ async createPhoneTemplate (
76
+ bodyParameters : CreatePhoneTemplateRequestContent ,
77
+ initOverrides ?: InitOverride
78
+ ) : Promise < ApiResponse < CreatePhoneTemplateResponseContent > > {
79
+ const headerParameters : runtime . HTTPHeaders = { } ;
80
+
81
+ headerParameters [ 'Content-Type' ] = 'application/json' ;
82
+
83
+ const response = await this . request (
84
+ {
85
+ path : `/branding/phone/templates` ,
86
+ method : 'POST' ,
87
+ headers : headerParameters ,
88
+ body : bodyParameters ,
89
+ } ,
90
+ initOverrides
91
+ ) ;
92
+
93
+ return runtime . JSONApiResponse . fromResponse ( response ) ;
94
+ }
95
+
58
96
/**
59
97
* Delete branding theme.
60
98
* Delete branding theme
@@ -108,6 +146,31 @@ export class BrandingManager extends BaseAPI {
108
146
return runtime . VoidApiResponse . fromResponse ( response ) ;
109
147
}
110
148
149
+ /**
150
+ * Delete a phone notification template
151
+ *
152
+ * @throws {RequiredError }
153
+ */
154
+ async deletePhoneTemplate (
155
+ requestParameters : DeletePhoneTemplateRequest ,
156
+ initOverrides ?: InitOverride
157
+ ) : Promise < ApiResponse < void > > {
158
+ runtime . validateRequiredRequestParams ( requestParameters , [ 'id' ] ) ;
159
+
160
+ const response = await this . request (
161
+ {
162
+ path : `/branding/phone/templates/{id}` . replace (
163
+ '{id}' ,
164
+ encodeURIComponent ( String ( requestParameters . id ) )
165
+ ) ,
166
+ method : 'DELETE' ,
167
+ } ,
168
+ initOverrides
169
+ ) ;
170
+
171
+ return runtime . VoidApiResponse . fromResponse ( response ) ;
172
+ }
173
+
111
174
/**
112
175
* Delete template for New Universal Login Experience
113
176
*
@@ -246,6 +309,59 @@ export class BrandingManager extends BaseAPI {
246
309
return runtime . JSONApiResponse . fromResponse ( response ) ;
247
310
}
248
311
312
+ /**
313
+ * Get a phone notification template
314
+ *
315
+ * @throws {RequiredError }
316
+ */
317
+ async getPhoneTemplate (
318
+ requestParameters : GetPhoneTemplateRequest ,
319
+ initOverrides ?: InitOverride
320
+ ) : Promise < ApiResponse < GetPhoneTemplateResponseContent > > {
321
+ runtime . validateRequiredRequestParams ( requestParameters , [ 'id' ] ) ;
322
+
323
+ const response = await this . request (
324
+ {
325
+ path : `/branding/phone/templates/{id}` . replace (
326
+ '{id}' ,
327
+ encodeURIComponent ( String ( requestParameters . id ) )
328
+ ) ,
329
+ method : 'GET' ,
330
+ } ,
331
+ initOverrides
332
+ ) ;
333
+
334
+ return runtime . JSONApiResponse . fromResponse ( response ) ;
335
+ }
336
+
337
+ /**
338
+ * Get a list of phone notification templates
339
+ *
340
+ * @throws {RequiredError }
341
+ */
342
+ async getAllPhoneTemplates (
343
+ requestParameters : GetPhoneTemplatesRequest = { } ,
344
+ initOverrides ?: InitOverride
345
+ ) : Promise < ApiResponse < ListPhoneTemplatesResponseContent > > {
346
+ const queryParameters = runtime . applyQueryParams ( requestParameters , [
347
+ {
348
+ key : 'disabled' ,
349
+ config : { } ,
350
+ } ,
351
+ ] ) ;
352
+
353
+ const response = await this . request (
354
+ {
355
+ path : `/branding/phone/templates` ,
356
+ method : 'GET' ,
357
+ query : queryParameters ,
358
+ } ,
359
+ initOverrides
360
+ ) ;
361
+
362
+ return runtime . JSONApiResponse . fromResponse ( response ) ;
363
+ }
364
+
249
365
/**
250
366
* Get template for New Universal Login Experience
251
367
*
@@ -404,6 +520,38 @@ export class BrandingManager extends BaseAPI {
404
520
return runtime . VoidApiResponse . fromResponse ( response ) ;
405
521
}
406
522
523
+ /**
524
+ * Resets a phone notification template values
525
+ *
526
+ * @throws {RequiredError }
527
+ */
528
+ async resetTemplate (
529
+ requestParameters : ResetPhoneTemplateRequest ,
530
+ bodyParameters : any | null ,
531
+ initOverrides ?: InitOverride
532
+ ) : Promise < ApiResponse < ResetPhoneTemplateResponseContent > > {
533
+ runtime . validateRequiredRequestParams ( requestParameters , [ 'id' ] ) ;
534
+
535
+ const headerParameters : runtime . HTTPHeaders = { } ;
536
+
537
+ headerParameters [ 'Content-Type' ] = 'application/json' ;
538
+
539
+ const response = await this . request (
540
+ {
541
+ path : `/branding/phone/templates/{id}/reset` . replace (
542
+ '{id}' ,
543
+ encodeURIComponent ( String ( requestParameters . id ) )
544
+ ) ,
545
+ method : 'PATCH' ,
546
+ headers : headerParameters ,
547
+ body : bodyParameters as any ,
548
+ } ,
549
+ initOverrides
550
+ ) ;
551
+
552
+ return runtime . JSONApiResponse . fromResponse ( response ) ;
553
+ }
554
+
407
555
/**
408
556
* Update a <a href="https://auth0.com/docs/customize/phone-messages/configure-phone-messaging-providers">phone provider</a>.
409
557
* The <code>credentials</code> object requires different properties depending on the phone provider (which is specified using the <code>name</code> property).
@@ -438,4 +586,36 @@ export class BrandingManager extends BaseAPI {
438
586
439
587
return runtime . JSONApiResponse . fromResponse ( response ) ;
440
588
}
589
+
590
+ /**
591
+ * Update a phone notification template
592
+ *
593
+ * @throws {RequiredError }
594
+ */
595
+ async updatePhoneTemplate (
596
+ requestParameters : UpdatePhoneTemplateRequest ,
597
+ bodyParameters : UpdatePhoneTemplateRequestContent ,
598
+ initOverrides ?: InitOverride
599
+ ) : Promise < ApiResponse < UpdatePhoneTemplateResponseContent > > {
600
+ runtime . validateRequiredRequestParams ( requestParameters , [ 'id' ] ) ;
601
+
602
+ const headerParameters : runtime . HTTPHeaders = { } ;
603
+
604
+ headerParameters [ 'Content-Type' ] = 'application/json' ;
605
+
606
+ const response = await this . request (
607
+ {
608
+ path : `/branding/phone/templates/{id}` . replace (
609
+ '{id}' ,
610
+ encodeURIComponent ( String ( requestParameters . id ) )
611
+ ) ,
612
+ method : 'PATCH' ,
613
+ headers : headerParameters ,
614
+ body : bodyParameters ,
615
+ } ,
616
+ initOverrides
617
+ ) ;
618
+
619
+ return runtime . JSONApiResponse . fromResponse ( response ) ;
620
+ }
441
621
}
0 commit comments