/* tslint:disable */ /* eslint-disable */ /** * MailSlurp API * MailSlurp is an API for sending and receiving emails and SMS from dynamically allocated email addresses and phone numbers. It\'s designed for developers and QA teams to test applications, process inbound emails, send templated notifications, attachments, and more. ## Resources - [Homepage](https://www.mailslurp.com) - Get an [API KEY](https://app.mailslurp.com/sign-up/) - Generated [SDK Clients](https://docs.mailslurp.com/) - [Examples](https://github.com/mailslurp/examples) repository * * The version of the OpenAPI document: 6.5.2 * Contact: contact@mailslurp.dev * * 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 { CreateDeliverabilitySimulationJobOptions, CreateDeliverabilitySimulationJobOptionsFromJSON, CreateDeliverabilitySimulationJobOptionsToJSON, CreateDeliverabilityTestOptions, CreateDeliverabilityTestOptionsFromJSON, CreateDeliverabilityTestOptionsToJSON, DeleteResult, DeleteResultFromJSON, DeleteResultToJSON, DeliverabilityAnalyticsSeriesDto, DeliverabilityAnalyticsSeriesDtoFromJSON, DeliverabilityAnalyticsSeriesDtoToJSON, DeliverabilityEntityResultPageDto, DeliverabilityEntityResultPageDtoFromJSON, DeliverabilityEntityResultPageDtoToJSON, DeliverabilityFailureHotspotsDto, DeliverabilityFailureHotspotsDtoFromJSON, DeliverabilityFailureHotspotsDtoToJSON, DeliverabilityPollStatusResultDto, DeliverabilityPollStatusResultDtoFromJSON, DeliverabilityPollStatusResultDtoToJSON, DeliverabilitySimulationJobDto, DeliverabilitySimulationJobDtoFromJSON, DeliverabilitySimulationJobDtoToJSON, DeliverabilitySimulationJobEventPageDto, DeliverabilitySimulationJobEventPageDtoFromJSON, DeliverabilitySimulationJobEventPageDtoToJSON, DeliverabilityTestDto, DeliverabilityTestDtoFromJSON, DeliverabilityTestDtoToJSON, DeliverabilityTestPageDto, DeliverabilityTestPageDtoFromJSON, DeliverabilityTestPageDtoToJSON, UpdateDeliverabilityTestOptions, UpdateDeliverabilityTestOptionsFromJSON, UpdateDeliverabilityTestOptionsToJSON, } from '../models'; export interface CancelDeliverabilitySimulationJobRequest { testId: string; jobId: string; } export interface CreateDeliverabilitySimulationJobRequest { testId: string; createDeliverabilitySimulationJobOptions: CreateDeliverabilitySimulationJobOptions; } export interface CreateDeliverabilityTestRequest { createDeliverabilityTestOptions: CreateDeliverabilityTestOptions; } export interface DeleteDeliverabilityTestRequest { testId: string; } export interface DuplicateDeliverabilityTestRequest { testId: string; } export interface ExportDeliverabilityTestReportRequest { testId: string; } export interface ExportDeliverabilityTestResultsRequest { testId: string; matched?: boolean; } export interface GetDeliverabilityAnalyticsSeriesRequest { since?: Date; before?: Date; scope?: GetDeliverabilityAnalyticsSeriesScopeEnum; bucket?: GetDeliverabilityAnalyticsSeriesBucketEnum; runLimit?: number; } export interface GetDeliverabilityFailureHotspotsRequest { since?: Date; before?: Date; scope?: GetDeliverabilityFailureHotspotsScopeEnum; limit?: number; } export interface GetDeliverabilitySimulationJobRequest { testId: string; jobId: string; } export interface GetDeliverabilitySimulationJobEventsRequest { testId: string; jobId: string; page?: number; size?: number; sort?: GetDeliverabilitySimulationJobEventsSortEnum; } export interface GetDeliverabilityTestRequest { testId: string; } export interface GetDeliverabilityTestResultsRequest { testId: string; matched?: boolean; page?: number; size?: number; sort?: GetDeliverabilityTestResultsSortEnum; } export interface GetDeliverabilityTestsRequest { page?: number; size?: number; sort?: GetDeliverabilityTestsSortEnum; } export interface GetLatestDeliverabilitySimulationJobRequest { testId: string; } export interface PauseDeliverabilitySimulationJobRequest { testId: string; jobId: string; } export interface PauseDeliverabilityTestRequest { testId: string; } export interface PollDeliverabilityTestStatusRequest { testId: string; } export interface ResumeDeliverabilitySimulationJobRequest { testId: string; jobId: string; } export interface StartDeliverabilityTestRequest { testId: string; } export interface StopDeliverabilityTestRequest { testId: string; } export interface UpdateDeliverabilityTestRequest { testId: string; updateDeliverabilityTestOptions: UpdateDeliverabilityTestOptions; } /** * */ export class DeliverabilityTestControllerApi extends runtime.BaseAPI { /** * Cancel a running or paused simulation job. * Cancel deliverability simulation job */ async cancelDeliverabilitySimulationJobRaw( requestParameters: CancelDeliverabilitySimulationJobRequest, initOverrides?: RequestInit ): Promise> { if ( requestParameters.testId === null || requestParameters.testId === undefined ) { throw new runtime.RequiredError( 'testId', 'Required parameter requestParameters.testId was null or undefined when calling cancelDeliverabilitySimulationJob.' ); } if ( requestParameters.jobId === null || requestParameters.jobId === undefined ) { throw new runtime.RequiredError( 'jobId', 'Required parameter requestParameters.jobId was null or undefined when calling cancelDeliverabilitySimulationJob.' ); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters['x-api-key'] = this.configuration.apiKey('x-api-key'); // API_KEY authentication } const response = await this.request( { path: `/test/deliverability/{testId}/simulation-jobs/{jobId}/cancel` .replace( `{${'testId'}}`, encodeURIComponent(String(requestParameters.testId)) ) .replace( `{${'jobId'}}`, encodeURIComponent(String(requestParameters.jobId)) ), method: 'POST', headers: headerParameters, query: queryParameters, }, initOverrides ); return new runtime.JSONApiResponse(response, (jsonValue) => DeliverabilitySimulationJobDtoFromJSON(jsonValue) ); } /** * Cancel a running or paused simulation job. * Cancel deliverability simulation job */ async cancelDeliverabilitySimulationJob( requestParameters: CancelDeliverabilitySimulationJobRequest, initOverrides?: RequestInit ): Promise { const response = await this.cancelDeliverabilitySimulationJobRaw( requestParameters, initOverrides ); return await response.value(); } /** * Create and start a simulation job for a running load test. Only one active simulation job is allowed per user. * Create deliverability simulation job */ async createDeliverabilitySimulationJobRaw( requestParameters: CreateDeliverabilitySimulationJobRequest, initOverrides?: RequestInit ): Promise> { if ( requestParameters.testId === null || requestParameters.testId === undefined ) { throw new runtime.RequiredError( 'testId', 'Required parameter requestParameters.testId was null or undefined when calling createDeliverabilitySimulationJob.' ); } if ( requestParameters.createDeliverabilitySimulationJobOptions === null || requestParameters.createDeliverabilitySimulationJobOptions === undefined ) { throw new runtime.RequiredError( 'createDeliverabilitySimulationJobOptions', 'Required parameter requestParameters.createDeliverabilitySimulationJobOptions was null or undefined when calling createDeliverabilitySimulationJob.' ); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; if (this.configuration && this.configuration.apiKey) { headerParameters['x-api-key'] = this.configuration.apiKey('x-api-key'); // API_KEY authentication } const response = await this.request( { path: `/test/deliverability/{testId}/simulation-jobs`.replace( `{${'testId'}}`, encodeURIComponent(String(requestParameters.testId)) ), method: 'POST', headers: headerParameters, query: queryParameters, body: CreateDeliverabilitySimulationJobOptionsToJSON( requestParameters.createDeliverabilitySimulationJobOptions ), }, initOverrides ); return new runtime.JSONApiResponse(response, (jsonValue) => DeliverabilitySimulationJobDtoFromJSON(jsonValue) ); } /** * Create and start a simulation job for a running load test. Only one active simulation job is allowed per user. * Create deliverability simulation job */ async createDeliverabilitySimulationJob( requestParameters: CreateDeliverabilitySimulationJobRequest, initOverrides?: RequestInit ): Promise { const response = await this.createDeliverabilitySimulationJobRaw( requestParameters, initOverrides ); return await response.value(); } /** * Create a load test for inboxes or phone numbers using ALL, PATTERN, or EXPLICIT selector scope. * Create load test */ async createDeliverabilityTestRaw( requestParameters: CreateDeliverabilityTestRequest, initOverrides?: RequestInit ): Promise> { if ( requestParameters.createDeliverabilityTestOptions === null || requestParameters.createDeliverabilityTestOptions === undefined ) { throw new runtime.RequiredError( 'createDeliverabilityTestOptions', 'Required parameter requestParameters.createDeliverabilityTestOptions was null or undefined when calling createDeliverabilityTest.' ); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; if (this.configuration && this.configuration.apiKey) { headerParameters['x-api-key'] = this.configuration.apiKey('x-api-key'); // API_KEY authentication } const response = await this.request( { path: `/test/deliverability`, method: 'POST', headers: headerParameters, query: queryParameters, body: CreateDeliverabilityTestOptionsToJSON( requestParameters.createDeliverabilityTestOptions ), }, initOverrides ); return new runtime.JSONApiResponse(response, (jsonValue) => DeliverabilityTestDtoFromJSON(jsonValue) ); } /** * Create a load test for inboxes or phone numbers using ALL, PATTERN, or EXPLICIT selector scope. * Create load test */ async createDeliverabilityTest( requestParameters: CreateDeliverabilityTestRequest, initOverrides?: RequestInit ): Promise { const response = await this.createDeliverabilityTestRaw( requestParameters, initOverrides ); return await response.value(); } /** * Delete test and all persisted entity-level results. * Delete load test */ async deleteDeliverabilityTestRaw( requestParameters: DeleteDeliverabilityTestRequest, initOverrides?: RequestInit ): Promise> { if ( requestParameters.testId === null || requestParameters.testId === undefined ) { throw new runtime.RequiredError( 'testId', 'Required parameter requestParameters.testId was null or undefined when calling deleteDeliverabilityTest.' ); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters['x-api-key'] = this.configuration.apiKey('x-api-key'); // API_KEY authentication } const response = await this.request( { path: `/test/deliverability/{testId}`.replace( `{${'testId'}}`, encodeURIComponent(String(requestParameters.testId)) ), method: 'DELETE', headers: headerParameters, query: queryParameters, }, initOverrides ); return new runtime.JSONApiResponse(response, (jsonValue) => DeleteResultFromJSON(jsonValue) ); } /** * Delete test and all persisted entity-level results. * Delete load test */ async deleteDeliverabilityTest( requestParameters: DeleteDeliverabilityTestRequest, initOverrides?: RequestInit ): Promise { const response = await this.deleteDeliverabilityTestRaw( requestParameters, initOverrides ); return await response.value(); } /** * Create a fresh load test using an existing test configuration, including selector scope, exclusions, and expectations. * Duplicate load test */ async duplicateDeliverabilityTestRaw( requestParameters: DuplicateDeliverabilityTestRequest, initOverrides?: RequestInit ): Promise> { if ( requestParameters.testId === null || requestParameters.testId === undefined ) { throw new runtime.RequiredError( 'testId', 'Required parameter requestParameters.testId was null or undefined when calling duplicateDeliverabilityTest.' ); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters['x-api-key'] = this.configuration.apiKey('x-api-key'); // API_KEY authentication } const response = await this.request( { path: `/test/deliverability/{testId}/duplicate`.replace( `{${'testId'}}`, encodeURIComponent(String(requestParameters.testId)) ), method: 'POST', headers: headerParameters, query: queryParameters, }, initOverrides ); return new runtime.JSONApiResponse(response, (jsonValue) => DeliverabilityTestDtoFromJSON(jsonValue) ); } /** * Create a fresh load test using an existing test configuration, including selector scope, exclusions, and expectations. * Duplicate load test */ async duplicateDeliverabilityTest( requestParameters: DuplicateDeliverabilityTestRequest, initOverrides?: RequestInit ): Promise { const response = await this.duplicateDeliverabilityTestRaw( requestParameters, initOverrides ); return await response.value(); } /** * Export a PDF report for a terminal load test (COMPLETE, FAILED, or STOPPED), including configuration, summary outcomes, and detailed entity-level results. * Export load-test report as PDF */ async exportDeliverabilityTestReportRaw( requestParameters: ExportDeliverabilityTestReportRequest, initOverrides?: RequestInit ): Promise> { if ( requestParameters.testId === null || requestParameters.testId === undefined ) { throw new runtime.RequiredError( 'testId', 'Required parameter requestParameters.testId was null or undefined when calling exportDeliverabilityTestReport.' ); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters['x-api-key'] = this.configuration.apiKey('x-api-key'); // API_KEY authentication } const response = await this.request( { path: `/test/deliverability/{testId}/report/export`.replace( `{${'testId'}}`, encodeURIComponent(String(requestParameters.testId)) ), method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides ); return new runtime.VoidApiResponse(response); } /** * Export a PDF report for a terminal load test (COMPLETE, FAILED, or STOPPED), including configuration, summary outcomes, and detailed entity-level results. * Export load-test report as PDF */ async exportDeliverabilityTestReport( requestParameters: ExportDeliverabilityTestReportRequest, initOverrides?: RequestInit ): Promise { await this.exportDeliverabilityTestReportRaw( requestParameters, initOverrides ); } /** * Export per-entity deliverability results including expectation-level pass/fail counts. The latest status is evaluated with the same polling safeguards before export. * Export load-test entity results as CSV */ async exportDeliverabilityTestResultsRaw( requestParameters: ExportDeliverabilityTestResultsRequest, initOverrides?: RequestInit ): Promise> { if ( requestParameters.testId === null || requestParameters.testId === undefined ) { throw new runtime.RequiredError( 'testId', 'Required parameter requestParameters.testId was null or undefined when calling exportDeliverabilityTestResults.' ); } const queryParameters: any = {}; if (requestParameters.matched !== undefined) { queryParameters['matched'] = requestParameters.matched; } const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters['x-api-key'] = this.configuration.apiKey('x-api-key'); // API_KEY authentication } const response = await this.request( { path: `/test/deliverability/{testId}/results/export`.replace( `{${'testId'}}`, encodeURIComponent(String(requestParameters.testId)) ), method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides ); return new runtime.VoidApiResponse(response); } /** * Export per-entity deliverability results including expectation-level pass/fail counts. The latest status is evaluated with the same polling safeguards before export. * Export load-test entity results as CSV */ async exportDeliverabilityTestResults( requestParameters: ExportDeliverabilityTestResultsRequest, initOverrides?: RequestInit ): Promise { await this.exportDeliverabilityTestResultsRaw( requestParameters, initOverrides ); } /** * Compare deliverability runs over a time range with bucketed chart metrics and run-level rows for table views. * Get deliverability analytics time series */ async getDeliverabilityAnalyticsSeriesRaw( requestParameters: GetDeliverabilityAnalyticsSeriesRequest, initOverrides?: RequestInit ): Promise> { const queryParameters: any = {}; if (requestParameters.since !== undefined) { queryParameters['since'] = (requestParameters.since as any).toISOString(); } if (requestParameters.before !== undefined) { queryParameters['before'] = ( requestParameters.before as any ).toISOString(); } if (requestParameters.scope !== undefined) { queryParameters['scope'] = requestParameters.scope; } if (requestParameters.bucket !== undefined) { queryParameters['bucket'] = requestParameters.bucket; } if (requestParameters.runLimit !== undefined) { queryParameters['runLimit'] = requestParameters.runLimit; } const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters['x-api-key'] = this.configuration.apiKey('x-api-key'); // API_KEY authentication } const response = await this.request( { path: `/test/deliverability/analytics/series`, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides ); return new runtime.JSONApiResponse(response, (jsonValue) => DeliverabilityAnalyticsSeriesDtoFromJSON(jsonValue) ); } /** * Compare deliverability runs over a time range with bucketed chart metrics and run-level rows for table views. * Get deliverability analytics time series */ async getDeliverabilityAnalyticsSeries( requestParameters: GetDeliverabilityAnalyticsSeriesRequest, initOverrides?: RequestInit ): Promise { const response = await this.getDeliverabilityAnalyticsSeriesRaw( requestParameters, initOverrides ); return await response.value(); } /** * Find commonly failing entities and phone country/variant dimensions across deliverability runs in a time range. * Get deliverability failure hotspots */ async getDeliverabilityFailureHotspotsRaw( requestParameters: GetDeliverabilityFailureHotspotsRequest, initOverrides?: RequestInit ): Promise> { const queryParameters: any = {}; if (requestParameters.since !== undefined) { queryParameters['since'] = (requestParameters.since as any).toISOString(); } if (requestParameters.before !== undefined) { queryParameters['before'] = ( requestParameters.before as any ).toISOString(); } if (requestParameters.scope !== undefined) { queryParameters['scope'] = requestParameters.scope; } if (requestParameters.limit !== undefined) { queryParameters['limit'] = requestParameters.limit; } const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters['x-api-key'] = this.configuration.apiKey('x-api-key'); // API_KEY authentication } const response = await this.request( { path: `/test/deliverability/analytics/hotspots`, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides ); return new runtime.JSONApiResponse(response, (jsonValue) => DeliverabilityFailureHotspotsDtoFromJSON(jsonValue) ); } /** * Find commonly failing entities and phone country/variant dimensions across deliverability runs in a time range. * Get deliverability failure hotspots */ async getDeliverabilityFailureHotspots( requestParameters: GetDeliverabilityFailureHotspotsRequest, initOverrides?: RequestInit ): Promise { const response = await this.getDeliverabilityFailureHotspotsRaw( requestParameters, initOverrides ); return await response.value(); } /** * Get simulation job status and progress counters. * Get deliverability simulation job */ async getDeliverabilitySimulationJobRaw( requestParameters: GetDeliverabilitySimulationJobRequest, initOverrides?: RequestInit ): Promise> { if ( requestParameters.testId === null || requestParameters.testId === undefined ) { throw new runtime.RequiredError( 'testId', 'Required parameter requestParameters.testId was null or undefined when calling getDeliverabilitySimulationJob.' ); } if ( requestParameters.jobId === null || requestParameters.jobId === undefined ) { throw new runtime.RequiredError( 'jobId', 'Required parameter requestParameters.jobId was null or undefined when calling getDeliverabilitySimulationJob.' ); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters['x-api-key'] = this.configuration.apiKey('x-api-key'); // API_KEY authentication } const response = await this.request( { path: `/test/deliverability/{testId}/simulation-jobs/{jobId}` .replace( `{${'testId'}}`, encodeURIComponent(String(requestParameters.testId)) ) .replace( `{${'jobId'}}`, encodeURIComponent(String(requestParameters.jobId)) ), method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides ); return new runtime.JSONApiResponse(response, (jsonValue) => DeliverabilitySimulationJobDtoFromJSON(jsonValue) ); } /** * Get simulation job status and progress counters. * Get deliverability simulation job */ async getDeliverabilitySimulationJob( requestParameters: GetDeliverabilitySimulationJobRequest, initOverrides?: RequestInit ): Promise { const response = await this.getDeliverabilitySimulationJobRaw( requestParameters, initOverrides ); return await response.value(); } /** * Get paged simulation events including send successes and failures. * Get deliverability simulation job events */ async getDeliverabilitySimulationJobEventsRaw( requestParameters: GetDeliverabilitySimulationJobEventsRequest, initOverrides?: RequestInit ): Promise> { if ( requestParameters.testId === null || requestParameters.testId === undefined ) { throw new runtime.RequiredError( 'testId', 'Required parameter requestParameters.testId was null or undefined when calling getDeliverabilitySimulationJobEvents.' ); } if ( requestParameters.jobId === null || requestParameters.jobId === undefined ) { throw new runtime.RequiredError( 'jobId', 'Required parameter requestParameters.jobId was null or undefined when calling getDeliverabilitySimulationJobEvents.' ); } const queryParameters: any = {}; if (requestParameters.page !== undefined) { queryParameters['page'] = requestParameters.page; } if (requestParameters.size !== undefined) { queryParameters['size'] = requestParameters.size; } if (requestParameters.sort !== undefined) { queryParameters['sort'] = requestParameters.sort; } const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters['x-api-key'] = this.configuration.apiKey('x-api-key'); // API_KEY authentication } const response = await this.request( { path: `/test/deliverability/{testId}/simulation-jobs/{jobId}/events` .replace( `{${'testId'}}`, encodeURIComponent(String(requestParameters.testId)) ) .replace( `{${'jobId'}}`, encodeURIComponent(String(requestParameters.jobId)) ), method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides ); return new runtime.JSONApiResponse(response, (jsonValue) => DeliverabilitySimulationJobEventPageDtoFromJSON(jsonValue) ); } /** * Get paged simulation events including send successes and failures. * Get deliverability simulation job events */ async getDeliverabilitySimulationJobEvents( requestParameters: GetDeliverabilitySimulationJobEventsRequest, initOverrides?: RequestInit ): Promise { const response = await this.getDeliverabilitySimulationJobEventsRaw( requestParameters, initOverrides ); return await response.value(); } /** * Get load-test configuration and latest progress counters. * Get load test */ async getDeliverabilityTestRaw( requestParameters: GetDeliverabilityTestRequest, initOverrides?: RequestInit ): Promise> { if ( requestParameters.testId === null || requestParameters.testId === undefined ) { throw new runtime.RequiredError( 'testId', 'Required parameter requestParameters.testId was null or undefined when calling getDeliverabilityTest.' ); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters['x-api-key'] = this.configuration.apiKey('x-api-key'); // API_KEY authentication } const response = await this.request( { path: `/test/deliverability/{testId}`.replace( `{${'testId'}}`, encodeURIComponent(String(requestParameters.testId)) ), method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides ); return new runtime.JSONApiResponse(response, (jsonValue) => DeliverabilityTestDtoFromJSON(jsonValue) ); } /** * Get load-test configuration and latest progress counters. * Get load test */ async getDeliverabilityTest( requestParameters: GetDeliverabilityTestRequest, initOverrides?: RequestInit ): Promise { const response = await this.getDeliverabilityTestRaw( requestParameters, initOverrides ); return await response.value(); } /** * Get paged per-entity expectation results with optional matched/unmatched filtering. * Get load-test entity results */ async getDeliverabilityTestResultsRaw( requestParameters: GetDeliverabilityTestResultsRequest, initOverrides?: RequestInit ): Promise> { if ( requestParameters.testId === null || requestParameters.testId === undefined ) { throw new runtime.RequiredError( 'testId', 'Required parameter requestParameters.testId was null or undefined when calling getDeliverabilityTestResults.' ); } const queryParameters: any = {}; if (requestParameters.matched !== undefined) { queryParameters['matched'] = requestParameters.matched; } if (requestParameters.page !== undefined) { queryParameters['page'] = requestParameters.page; } if (requestParameters.size !== undefined) { queryParameters['size'] = requestParameters.size; } if (requestParameters.sort !== undefined) { queryParameters['sort'] = requestParameters.sort; } const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters['x-api-key'] = this.configuration.apiKey('x-api-key'); // API_KEY authentication } const response = await this.request( { path: `/test/deliverability/{testId}/results`.replace( `{${'testId'}}`, encodeURIComponent(String(requestParameters.testId)) ), method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides ); return new runtime.JSONApiResponse(response, (jsonValue) => DeliverabilityEntityResultPageDtoFromJSON(jsonValue) ); } /** * Get paged per-entity expectation results with optional matched/unmatched filtering. * Get load-test entity results */ async getDeliverabilityTestResults( requestParameters: GetDeliverabilityTestResultsRequest, initOverrides?: RequestInit ): Promise { const response = await this.getDeliverabilityTestResultsRaw( requestParameters, initOverrides ); return await response.value(); } /** * List load tests for the authenticated account. * List load tests */ async getDeliverabilityTestsRaw( requestParameters: GetDeliverabilityTestsRequest, initOverrides?: RequestInit ): Promise> { const queryParameters: any = {}; if (requestParameters.page !== undefined) { queryParameters['page'] = requestParameters.page; } if (requestParameters.size !== undefined) { queryParameters['size'] = requestParameters.size; } if (requestParameters.sort !== undefined) { queryParameters['sort'] = requestParameters.sort; } const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters['x-api-key'] = this.configuration.apiKey('x-api-key'); // API_KEY authentication } const response = await this.request( { path: `/test/deliverability`, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides ); return new runtime.JSONApiResponse(response, (jsonValue) => DeliverabilityTestPageDtoFromJSON(jsonValue) ); } /** * List load tests for the authenticated account. * List load tests */ async getDeliverabilityTests( requestParameters: GetDeliverabilityTestsRequest, initOverrides?: RequestInit ): Promise { const response = await this.getDeliverabilityTestsRaw( requestParameters, initOverrides ); return await response.value(); } /** * Get the most recent simulation job for a load test. * Get latest deliverability simulation job */ async getLatestDeliverabilitySimulationJobRaw( requestParameters: GetLatestDeliverabilitySimulationJobRequest, initOverrides?: RequestInit ): Promise> { if ( requestParameters.testId === null || requestParameters.testId === undefined ) { throw new runtime.RequiredError( 'testId', 'Required parameter requestParameters.testId was null or undefined when calling getLatestDeliverabilitySimulationJob.' ); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters['x-api-key'] = this.configuration.apiKey('x-api-key'); // API_KEY authentication } const response = await this.request( { path: `/test/deliverability/{testId}/simulation-jobs/latest`.replace( `{${'testId'}}`, encodeURIComponent(String(requestParameters.testId)) ), method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides ); return new runtime.JSONApiResponse(response, (jsonValue) => DeliverabilitySimulationJobDtoFromJSON(jsonValue) ); } /** * Get the most recent simulation job for a load test. * Get latest deliverability simulation job */ async getLatestDeliverabilitySimulationJob( requestParameters: GetLatestDeliverabilitySimulationJobRequest, initOverrides?: RequestInit ): Promise { const response = await this.getLatestDeliverabilitySimulationJobRaw( requestParameters, initOverrides ); return await response.value(); } /** * Pause a running simulation job. * Pause deliverability simulation job */ async pauseDeliverabilitySimulationJobRaw( requestParameters: PauseDeliverabilitySimulationJobRequest, initOverrides?: RequestInit ): Promise> { if ( requestParameters.testId === null || requestParameters.testId === undefined ) { throw new runtime.RequiredError( 'testId', 'Required parameter requestParameters.testId was null or undefined when calling pauseDeliverabilitySimulationJob.' ); } if ( requestParameters.jobId === null || requestParameters.jobId === undefined ) { throw new runtime.RequiredError( 'jobId', 'Required parameter requestParameters.jobId was null or undefined when calling pauseDeliverabilitySimulationJob.' ); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters['x-api-key'] = this.configuration.apiKey('x-api-key'); // API_KEY authentication } const response = await this.request( { path: `/test/deliverability/{testId}/simulation-jobs/{jobId}/pause` .replace( `{${'testId'}}`, encodeURIComponent(String(requestParameters.testId)) ) .replace( `{${'jobId'}}`, encodeURIComponent(String(requestParameters.jobId)) ), method: 'POST', headers: headerParameters, query: queryParameters, }, initOverrides ); return new runtime.JSONApiResponse(response, (jsonValue) => DeliverabilitySimulationJobDtoFromJSON(jsonValue) ); } /** * Pause a running simulation job. * Pause deliverability simulation job */ async pauseDeliverabilitySimulationJob( requestParameters: PauseDeliverabilitySimulationJobRequest, initOverrides?: RequestInit ): Promise { const response = await this.pauseDeliverabilitySimulationJobRaw( requestParameters, initOverrides ); return await response.value(); } /** * Pause a RUNNING or SCHEDULED load test. * Pause load test */ async pauseDeliverabilityTestRaw( requestParameters: PauseDeliverabilityTestRequest, initOverrides?: RequestInit ): Promise> { if ( requestParameters.testId === null || requestParameters.testId === undefined ) { throw new runtime.RequiredError( 'testId', 'Required parameter requestParameters.testId was null or undefined when calling pauseDeliverabilityTest.' ); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters['x-api-key'] = this.configuration.apiKey('x-api-key'); // API_KEY authentication } const response = await this.request( { path: `/test/deliverability/{testId}/pause`.replace( `{${'testId'}}`, encodeURIComponent(String(requestParameters.testId)) ), method: 'POST', headers: headerParameters, query: queryParameters, }, initOverrides ); return new runtime.JSONApiResponse(response, (jsonValue) => DeliverabilityTestDtoFromJSON(jsonValue) ); } /** * Pause a RUNNING or SCHEDULED load test. * Pause load test */ async pauseDeliverabilityTest( requestParameters: PauseDeliverabilityTestRequest, initOverrides?: RequestInit ): Promise { const response = await this.pauseDeliverabilityTestRaw( requestParameters, initOverrides ); return await response.value(); } /** * Poll test progress. Evaluation is throttled with a 5-second cache window to protect backing data stores. * Poll load-test status */ async pollDeliverabilityTestStatusRaw( requestParameters: PollDeliverabilityTestStatusRequest, initOverrides?: RequestInit ): Promise> { if ( requestParameters.testId === null || requestParameters.testId === undefined ) { throw new runtime.RequiredError( 'testId', 'Required parameter requestParameters.testId was null or undefined when calling pollDeliverabilityTestStatus.' ); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters['x-api-key'] = this.configuration.apiKey('x-api-key'); // API_KEY authentication } const response = await this.request( { path: `/test/deliverability/{testId}/status`.replace( `{${'testId'}}`, encodeURIComponent(String(requestParameters.testId)) ), method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides ); return new runtime.JSONApiResponse(response, (jsonValue) => DeliverabilityPollStatusResultDtoFromJSON(jsonValue) ); } /** * Poll test progress. Evaluation is throttled with a 5-second cache window to protect backing data stores. * Poll load-test status */ async pollDeliverabilityTestStatus( requestParameters: PollDeliverabilityTestStatusRequest, initOverrides?: RequestInit ): Promise { const response = await this.pollDeliverabilityTestStatusRaw( requestParameters, initOverrides ); return await response.value(); } /** * Resume a paused simulation job. * Resume deliverability simulation job */ async resumeDeliverabilitySimulationJobRaw( requestParameters: ResumeDeliverabilitySimulationJobRequest, initOverrides?: RequestInit ): Promise> { if ( requestParameters.testId === null || requestParameters.testId === undefined ) { throw new runtime.RequiredError( 'testId', 'Required parameter requestParameters.testId was null or undefined when calling resumeDeliverabilitySimulationJob.' ); } if ( requestParameters.jobId === null || requestParameters.jobId === undefined ) { throw new runtime.RequiredError( 'jobId', 'Required parameter requestParameters.jobId was null or undefined when calling resumeDeliverabilitySimulationJob.' ); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters['x-api-key'] = this.configuration.apiKey('x-api-key'); // API_KEY authentication } const response = await this.request( { path: `/test/deliverability/{testId}/simulation-jobs/{jobId}/resume` .replace( `{${'testId'}}`, encodeURIComponent(String(requestParameters.testId)) ) .replace( `{${'jobId'}}`, encodeURIComponent(String(requestParameters.jobId)) ), method: 'POST', headers: headerParameters, query: queryParameters, }, initOverrides ); return new runtime.JSONApiResponse(response, (jsonValue) => DeliverabilitySimulationJobDtoFromJSON(jsonValue) ); } /** * Resume a paused simulation job. * Resume deliverability simulation job */ async resumeDeliverabilitySimulationJob( requestParameters: ResumeDeliverabilitySimulationJobRequest, initOverrides?: RequestInit ): Promise { const response = await this.resumeDeliverabilitySimulationJobRaw( requestParameters, initOverrides ); return await response.value(); } /** * Start a CREATED test or resume a PAUSED/SCHEDULED test. * Start or resume load test */ async startDeliverabilityTestRaw( requestParameters: StartDeliverabilityTestRequest, initOverrides?: RequestInit ): Promise> { if ( requestParameters.testId === null || requestParameters.testId === undefined ) { throw new runtime.RequiredError( 'testId', 'Required parameter requestParameters.testId was null or undefined when calling startDeliverabilityTest.' ); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters['x-api-key'] = this.configuration.apiKey('x-api-key'); // API_KEY authentication } const response = await this.request( { path: `/test/deliverability/{testId}/start`.replace( `{${'testId'}}`, encodeURIComponent(String(requestParameters.testId)) ), method: 'POST', headers: headerParameters, query: queryParameters, }, initOverrides ); return new runtime.JSONApiResponse(response, (jsonValue) => DeliverabilityTestDtoFromJSON(jsonValue) ); } /** * Start a CREATED test or resume a PAUSED/SCHEDULED test. * Start or resume load test */ async startDeliverabilityTest( requestParameters: StartDeliverabilityTestRequest, initOverrides?: RequestInit ): Promise { const response = await this.startDeliverabilityTestRaw( requestParameters, initOverrides ); return await response.value(); } /** * Stop a load test and mark it terminal. * Stop load test */ async stopDeliverabilityTestRaw( requestParameters: StopDeliverabilityTestRequest, initOverrides?: RequestInit ): Promise> { if ( requestParameters.testId === null || requestParameters.testId === undefined ) { throw new runtime.RequiredError( 'testId', 'Required parameter requestParameters.testId was null or undefined when calling stopDeliverabilityTest.' ); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters['x-api-key'] = this.configuration.apiKey('x-api-key'); // API_KEY authentication } const response = await this.request( { path: `/test/deliverability/{testId}/stop`.replace( `{${'testId'}}`, encodeURIComponent(String(requestParameters.testId)) ), method: 'POST', headers: headerParameters, query: queryParameters, }, initOverrides ); return new runtime.JSONApiResponse(response, (jsonValue) => DeliverabilityTestDtoFromJSON(jsonValue) ); } /** * Stop a load test and mark it terminal. * Stop load test */ async stopDeliverabilityTest( requestParameters: StopDeliverabilityTestRequest, initOverrides?: RequestInit ): Promise { const response = await this.stopDeliverabilityTestRaw( requestParameters, initOverrides ); return await response.value(); } /** * Update metadata, timeout, and expectations for a non-running non-terminal test. * Update load test */ async updateDeliverabilityTestRaw( requestParameters: UpdateDeliverabilityTestRequest, initOverrides?: RequestInit ): Promise> { if ( requestParameters.testId === null || requestParameters.testId === undefined ) { throw new runtime.RequiredError( 'testId', 'Required parameter requestParameters.testId was null or undefined when calling updateDeliverabilityTest.' ); } if ( requestParameters.updateDeliverabilityTestOptions === null || requestParameters.updateDeliverabilityTestOptions === undefined ) { throw new runtime.RequiredError( 'updateDeliverabilityTestOptions', 'Required parameter requestParameters.updateDeliverabilityTestOptions was null or undefined when calling updateDeliverabilityTest.' ); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; if (this.configuration && this.configuration.apiKey) { headerParameters['x-api-key'] = this.configuration.apiKey('x-api-key'); // API_KEY authentication } const response = await this.request( { path: `/test/deliverability/{testId}`.replace( `{${'testId'}}`, encodeURIComponent(String(requestParameters.testId)) ), method: 'PATCH', headers: headerParameters, query: queryParameters, body: UpdateDeliverabilityTestOptionsToJSON( requestParameters.updateDeliverabilityTestOptions ), }, initOverrides ); return new runtime.JSONApiResponse(response, (jsonValue) => DeliverabilityTestDtoFromJSON(jsonValue) ); } /** * Update metadata, timeout, and expectations for a non-running non-terminal test. * Update load test */ async updateDeliverabilityTest( requestParameters: UpdateDeliverabilityTestRequest, initOverrides?: RequestInit ): Promise { const response = await this.updateDeliverabilityTestRaw( requestParameters, initOverrides ); return await response.value(); } } /** * @export * @enum {string} */ export enum GetDeliverabilityAnalyticsSeriesScopeEnum { INBOX = 'INBOX', PHONE = 'PHONE', } /** * @export * @enum {string} */ export enum GetDeliverabilityAnalyticsSeriesBucketEnum { HOUR = 'HOUR', DAY = 'DAY', } /** * @export * @enum {string} */ export enum GetDeliverabilityFailureHotspotsScopeEnum { INBOX = 'INBOX', PHONE = 'PHONE', } /** * @export * @enum {string} */ export enum GetDeliverabilitySimulationJobEventsSortEnum { ASC = 'ASC', DESC = 'DESC', } /** * @export * @enum {string} */ export enum GetDeliverabilityTestResultsSortEnum { ASC = 'ASC', DESC = 'DESC', } /** * @export * @enum {string} */ export enum GetDeliverabilityTestsSortEnum { ASC = 'ASC', DESC = 'DESC', }