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