@@ -3614,13 +3614,19 @@ export class DefaultApi {
36143614 */
36153615 public async generateMfaToken(
36163616 authorization: string,
3617+ userId: number,
36173618 generateMfaTokenRequest: GenerateMfaTokenRequest,
36183619 options: { headers: { [name: string]: string } } = { headers: {} }
36193620 ): Promise<{
36203621 response: http.IncomingMessage;
36213622 body: GenerateMfaToken200Response;
36223623 }> {
3623- const localVarPath = this.basePath + "/api/2/mfa/users/{user_id}/mfa_token";
3624+ const localVarPath =
3625+ this.basePath +
3626+ "/api/1/users/{user_id}/mfa_token".replace(
3627+ "{" + "user_id" + "}",
3628+ encodeURIComponent(String(userId))
3629+ );
36243630 let localVarQueryParameters: any = {};
36253631 let localVarHeaderParams: any = (<any>Object).assign(
36263632 {},
@@ -16188,4 +16194,122 @@ export class DefaultApi {
1618816194 });
1618916195 });
1619016196 }
16197+
16198+ public async verifyingFactor(
16199+ authorization: string,
16200+ userId: number,
16201+ verifyFactorRequest: VerifyFactorRequest,
16202+ options: { headers: { [name: string]: string } } = { headers: {} }
16203+ ): Promise<{
16204+ response: http.IncomingMessage;
16205+ body: VerifyFactorVoice200ResponseInner;
16206+ }> {
16207+ const localVarPath =
16208+ this.basePath +
16209+ "/api/2/mfa/users/{user_id}/verifications/".replace(
16210+ "{" + "user_id" + "}",
16211+ encodeURIComponent(String(userId))
16212+ );
16213+ let localVarQueryParameters: any = {};
16214+ let localVarHeaderParams: any = (<any>Object).assign(
16215+ {},
16216+ this._defaultHeaders
16217+ );
16218+ const produces = ["application/json"];
16219+ // give precedence to 'application/json'
16220+ if (produces.indexOf("application/json") >= 0) {
16221+ localVarHeaderParams.Accept = "application/json";
16222+ } else {
16223+ localVarHeaderParams.Accept = produces.join(",");
16224+ }
16225+ let localVarFormParams: any = {};
16226+
16227+ // verify required parameter 'authorization' is not null or undefined
16228+ if (authorization === null || authorization === undefined) {
16229+ throw new Error(
16230+ "Required parameter authorization was null or undefined when calling verifyingFactor."
16231+ );
16232+ }
16233+
16234+ // verify required parameter 'userId' is not null or undefined
16235+ if (userId === null || userId === undefined) {
16236+ throw new Error(
16237+ "Required parameter userId was null or undefined when calling verifyingFactor."
16238+ );
16239+ }
16240+
16241+ // verify required parameter 'verifyFactorRequest' is not null or undefined
16242+ if (verifyFactorRequest === null || verifyFactorRequest === undefined) {
16243+ throw new Error(
16244+ "Required parameter verifyFactorRequest was null or undefined when calling verifyingFactor."
16245+ );
16246+ }
16247+
16248+ localVarHeaderParams["Authorization"] = ObjectSerializer.serialize(
16249+ authorization,
16250+ "string"
16251+ );
16252+ (<any>Object).assign(localVarHeaderParams, options.headers);
16253+
16254+ let localVarUseFormData = false;
16255+
16256+ let localVarRequestOptions: localVarRequest.Options = {
16257+ method: "POST",
16258+ qs: localVarQueryParameters,
16259+ headers: localVarHeaderParams,
16260+ uri: localVarPath,
16261+ useQuerystring: this._useQuerystring,
16262+ json: true,
16263+ body: ObjectSerializer.serialize(
16264+ verifyFactorRequest,
16265+ "VerifyFactorRequest"
16266+ ),
16267+ };
16268+
16269+ let authenticationPromise = Promise.resolve();
16270+ authenticationPromise = authenticationPromise.then(() =>
16271+ this.authentications.default.applyToRequest(localVarRequestOptions)
16272+ );
16273+
16274+ let interceptorPromise = authenticationPromise;
16275+ for (const interceptor of this.interceptors) {
16276+ interceptorPromise = interceptorPromise.then(() =>
16277+ interceptor(localVarRequestOptions)
16278+ );
16279+ }
16280+
16281+ return interceptorPromise.then(() => {
16282+ if (Object.keys(localVarFormParams).length) {
16283+ if (localVarUseFormData) {
16284+ (<any>localVarRequestOptions).formData = localVarFormParams;
16285+ } else {
16286+ localVarRequestOptions.form = localVarFormParams;
16287+ }
16288+ }
16289+ return new Promise<{
16290+ response: http.IncomingMessage;
16291+ body: VerifyFactorVoice200ResponseInner;
16292+ }>((resolve, reject) => {
16293+ localVarRequest(localVarRequestOptions, (error, response, body) => {
16294+ if (error) {
16295+ reject(error);
16296+ } else {
16297+ if (
16298+ response.statusCode &&
16299+ response.statusCode >= 200 &&
16300+ response.statusCode <= 299
16301+ ) {
16302+ body = ObjectSerializer.deserialize(
16303+ body,
16304+ "VerifyFactorVoice200ResponseInner"
16305+ );
16306+ resolve({ response: response, body: body });
16307+ } else {
16308+ reject(new HttpError(response, body, response.statusCode));
16309+ }
16310+ }
16311+ });
16312+ });
16313+ });
16314+ }
1619116315}
0 commit comments