diff --git a/playground/handlers.ts b/playground/handlers.ts index ec8699453..3b6bb33c1 100644 --- a/playground/handlers.ts +++ b/playground/handlers.ts @@ -324,14 +324,16 @@ export async function clients() { const mgmntClient = new ManagementClient(program.opts()); const { data: newClient } = await mgmntClient.clients.create({ name: uuid() }); console.log('Create a client: ' + newClient.name); - const { data: client } = await mgmntClient.clients.get({ id: newClient.client_id as string }); + const { data: client } = await mgmntClient.clients.get({ + client_id: newClient.client_id as string, + }); console.log('Get the client: ' + client.name); const { data: updatedClient } = await mgmntClient.clients.update( - { id: client.client_id as string }, + { client_id: client.client_id as string }, { name: uuid() } ); console.log('Updated the client: ' + updatedClient.name); - await mgmntClient.clients.delete({ id: newClient.client_id as string }); + await mgmntClient.clients.delete({ client_id: newClient.client_id as string }); console.log('Removed the client: ' + updatedClient.name); } @@ -524,8 +526,8 @@ export async function guardian() { const { data: smsTemplates } = await mgmntClient.guardian.getSmsFactorTemplates(); - console.log(`Get SMS enrollement message: ${smsTemplates.enrollment_message}`); - console.log(`Get SMS verification message: ${smsTemplates.verification_message}`); + console.log(`Get SMS enrollement message: ${smsTemplates?.enrollment_message}`); + console.log(`Get SMS verification message: ${smsTemplates?.verification_message}`); const { data: updateSmsTemplates } = await mgmntClient.guardian.setSmsFactorTemplates({ enrollment_message: 'This is the encrollment message ' + uuid(), @@ -794,7 +796,9 @@ export async function keys() { const { data: newClient } = await mgmntClient.clients.create({ name: uuid() }); console.log('Create a client: ' + newClient.name); - const { data: client } = await mgmntClient.clients.get({ id: newClient.client_id as string }); + const { data: client } = await mgmntClient.clients.get({ + client_id: newClient.client_id as string, + }); const cert = client.signing_keys![0].cert; const { data: keys } = await mgmntClient.keys.getAll(); @@ -803,7 +807,7 @@ export async function keys() { const { data: key } = await mgmntClient.keys.get({ kid }); console.log('Got key:', key.kid); - await mgmntClient.clients.delete({ id: newClient.client_id as string }); + await mgmntClient.clients.delete({ client_id: newClient.client_id as string }); console.log('Removed the client: ' + newClient.name); } diff --git a/src/management/__generated/managers/guardian-manager.ts b/src/management/__generated/managers/guardian-manager.ts index 50cdce4be..4edf301a3 100644 --- a/src/management/__generated/managers/guardian-manager.ts +++ b/src/management/__generated/managers/guardian-manager.ts @@ -135,7 +135,7 @@ export class GuardianManager extends BaseAPI { */ async getSmsFactorTemplates( initOverrides?: InitOverride - ): Promise> { + ): Promise> { const response = await this.request( { path: `/guardian/factors/sms/templates`, @@ -144,7 +144,9 @@ export class GuardianManager extends BaseAPI { initOverrides ); - return runtime.JSONApiResponse.fromResponse(response); + return response.status === 204 + ? runtime.VoidApiResponse.fromResponse(response) + : runtime.JSONApiResponse.fromResponse(response); } /** diff --git a/src/management/__generated/managers/jobs-manager.ts b/src/management/__generated/managers/jobs-manager.ts index f1dc6a839..d2648aa5c 100644 --- a/src/management/__generated/managers/jobs-manager.ts +++ b/src/management/__generated/managers/jobs-manager.ts @@ -25,7 +25,7 @@ export class JobsManager extends BaseAPI { async getErrors( requestParameters: GetErrorsRequest, initOverrides?: InitOverride - ): Promise> { + ): Promise> { runtime.validateRequiredRequestParams(requestParameters, ['id']); const response = await this.request( @@ -36,7 +36,9 @@ export class JobsManager extends BaseAPI { initOverrides ); - return runtime.JSONApiResponse.fromResponse(response); + return response.status === 204 + ? runtime.VoidApiResponse.fromResponse(response) + : runtime.JSONApiResponse.fromResponse(response); } /**