UNPKG

@ringer-tel/telique

Version:
80 lines (66 loc) 3.13 kB
/* tslint:disable */ /* eslint-disable */ /** * Telique API * The Ringer Telique API provides access to telecommunications data, including caller name (CNAM) data, line type information, and more. The API also includes services for checking phone numbers against Do Not Originate (DNO) and Do Not Call (DNC) databases, as well as STIR/SHAKEN call authentication validation. ## Authentication This API uses IP whitelist authentication. Your server\'s IP address must be registered with Ringer before making API calls. Contact support@ringer.tel to register your IP address. * * The version of the OpenAPI document: 1.0.18 * Contact: support@ringer.tel * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import * as runtime from '../runtime'; import type { StirShakenRequest, StirShakenResponse, } from '../models/index'; import { StirShakenRequestFromJSON, StirShakenRequestToJSON, StirShakenResponseFromJSON, StirShakenResponseToJSON, } from '../models/index'; export interface ValidateStirShakenRequest { stirShakenRequest: StirShakenRequest; } /** * */ export class STIRSHAKENApi extends runtime.BaseAPI { /** * Validates STIR/SHAKEN call authentication by checking the provided identity token. * Validate STIR/SHAKEN Identity */ async validateStirShakenRaw(requestParameters: ValidateStirShakenRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<StirShakenResponse>> { if (requestParameters['stirShakenRequest'] == null) { throw new runtime.RequiredError( 'stirShakenRequest', 'Required parameter "stirShakenRequest" was null or undefined when calling validateStirShaken().' ); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; if (this.configuration && this.configuration.apiKey) { headerParameters["X-Forwarded-For"] = await this.configuration.apiKey("X-Forwarded-For"); // ipWhitelist authentication } const response = await this.request({ path: `/telique/stirshaken/validate`, method: 'POST', headers: headerParameters, query: queryParameters, body: StirShakenRequestToJSON(requestParameters['stirShakenRequest']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => StirShakenResponseFromJSON(jsonValue)); } /** * Validates STIR/SHAKEN call authentication by checking the provided identity token. * Validate STIR/SHAKEN Identity */ async validateStirShaken(requestParameters: ValidateStirShakenRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<StirShakenResponse> { const response = await this.validateStirShakenRaw(requestParameters, initOverrides); return await response.value(); } }