/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { attemptsGet } from "../funcs/attemptsGet.js"; import { attemptsList } from "../funcs/attemptsList.js"; import { attemptsRetry } from "../funcs/attemptsRetry.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; import * as operations from "../models/operations/index.js"; import { unwrapAsync } from "../types/fp.js"; import { PageIterator, unwrapResultIterator } from "../types/operations.js"; export class Attempts extends ClientSDK { /** * List Attempts * * @remarks * Retrieves a paginated list of attempts. * * When authenticated with a Tenant JWT, returns only attempts belonging to that tenant. * When authenticated with Admin API Key, returns attempts across all tenants. Use `tenant_id` query parameter to filter by tenant. */ async list( request: operations.ListAttemptsRequest, options?: RequestOptions, ): Promise< PageIterator > { return unwrapResultIterator(attemptsList( this, request, options, )); } /** * Get Attempt * * @remarks * Retrieves details for a specific attempt. * * When authenticated with a Tenant JWT, only attempts belonging to that tenant can be accessed. * When authenticated with Admin API Key, attempts from any tenant can be accessed. */ async get( attemptId: string, include?: operations.GetAttemptInclude | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(attemptsGet( this, attemptId, include, options, )); } /** * Retry Event Delivery * * @remarks * Triggers a retry for delivering an event to a destination. The event must exist and the destination must be enabled and match the event's topic. * * When authenticated with a Tenant JWT, only events belonging to that tenant can be retried. * When authenticated with Admin API Key, events from any tenant can be retried. */ async retry( request: components.RetryRequest, options?: RequestOptions, ): Promise { return unwrapAsync(attemptsRetry( this, request, options, )); } }