Skip to content

Commit cf502a0

Browse files
authored
Feat/ Add Phone Template Support (#1139)
2 parents e022a2c + d6f4a61 commit cf502a0

File tree

3 files changed

+1149
-0
lines changed

3 files changed

+1149
-0
lines changed

src/management/__generated/managers/branding-manager.ts

Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,34 @@ import * as runtime from '../../../lib/runtime.js';
22
import type { InitOverride, ApiResponse } from '../../../lib/runtime.js';
33
import type {
44
CreatePhoneProviderRequest,
5+
CreatePhoneTemplateRequestContent,
6+
CreatePhoneTemplateResponseContent,
57
GetBranding200Response,
68
GetBrandingPhoneProviders200Response,
79
GetBrandingPhoneProviders200ResponseProvidersInner,
10+
GetPhoneTemplateResponseContent,
811
GetUniversalLogin200Response,
12+
ListPhoneTemplatesResponseContent,
913
PatchBrandingRequest,
1014
PostBrandingTheme200Response,
1115
PostBrandingThemeRequest,
1216
PutUniversalLoginRequest,
17+
ResetPhoneTemplateResponseContent,
1318
UpdatePhoneProviderRequest,
19+
UpdatePhoneTemplateRequestContent,
20+
UpdatePhoneTemplateResponseContent,
1421
DeleteBrandingThemeRequest,
1522
DeletePhoneProviderRequest,
23+
DeletePhoneTemplateRequest,
1624
GetBrandingPhoneProvidersRequest,
1725
GetBrandingThemeRequest,
1826
GetPhoneProviderRequest,
27+
GetPhoneTemplateRequest,
28+
GetPhoneTemplatesRequest,
1929
PatchBrandingThemeRequest,
30+
ResetPhoneTemplateRequest,
2031
UpdatePhoneProviderOperationRequest,
32+
UpdatePhoneTemplateRequest,
2133
} from '../models/index.js';
2234

2335
const { BaseAPI } = runtime;
@@ -55,6 +67,32 @@ export class BrandingManager extends BaseAPI {
5567
return runtime.JSONApiResponse.fromResponse(response);
5668
}
5769

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+
5896
/**
5997
* Delete branding theme.
6098
* Delete branding theme
@@ -108,6 +146,31 @@ export class BrandingManager extends BaseAPI {
108146
return runtime.VoidApiResponse.fromResponse(response);
109147
}
110148

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+
111174
/**
112175
* Delete template for New Universal Login Experience
113176
*
@@ -246,6 +309,59 @@ export class BrandingManager extends BaseAPI {
246309
return runtime.JSONApiResponse.fromResponse(response);
247310
}
248311

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+
249365
/**
250366
* Get template for New Universal Login Experience
251367
*
@@ -404,6 +520,38 @@ export class BrandingManager extends BaseAPI {
404520
return runtime.VoidApiResponse.fromResponse(response);
405521
}
406522

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+
407555
/**
408556
* Update a <a href="https://auth0.com/docs/customize/phone-messages/configure-phone-messaging-providers">phone provider</a>.
409557
* 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 {
438586

439587
return runtime.JSONApiResponse.fromResponse(response);
440588
}
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+
}
441621
}

0 commit comments

Comments
 (0)