/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { destinationsCreate } from "../funcs/destinationsCreate.js"; import { destinationsDelete } from "../funcs/destinationsDelete.js"; import { destinationsDisable } from "../funcs/destinationsDisable.js"; import { destinationsEnable } from "../funcs/destinationsEnable.js"; import { destinationsGet } from "../funcs/destinationsGet.js"; import { destinationsGetAttempt } from "../funcs/destinationsGetAttempt.js"; import { destinationsList } from "../funcs/destinationsList.js"; import { destinationsListAttempts } from "../funcs/destinationsListAttempts.js"; import { destinationsUpdate } from "../funcs/destinationsUpdate.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 Destinations extends ClientSDK { /** * List Destinations * * @remarks * Return a list of the destinations for the tenant. The endpoint is not paged. */ async list( tenantId: string, type?: operations.ListTenantDestinationsType | undefined, topics?: operations.Topics | undefined, options?: RequestOptions, ): Promise> { return unwrapAsync(destinationsList( this, tenantId, type, topics, options, )); } /** * Create Destination * * @remarks * Creates a new destination for the tenant. The request body structure depends on the `type`. */ async create( tenantId: string, body: components.DestinationCreate, options?: RequestOptions, ): Promise { return unwrapAsync(destinationsCreate( this, tenantId, body, options, )); } /** * Get Destination * * @remarks * Retrieves details for a specific destination. */ async get( tenantId: string, destinationId: string, options?: RequestOptions, ): Promise { return unwrapAsync(destinationsGet( this, tenantId, destinationId, options, )); } /** * Update Destination * * @remarks * Updates the configuration of an existing destination. The request body structure depends on the destination's `type`. Type itself cannot be updated. May return an OAuth redirect URL for certain types. */ async update( tenantId: string, destinationId: string, body: components.DestinationUpdate, options?: RequestOptions, ): Promise { return unwrapAsync(destinationsUpdate( this, tenantId, destinationId, body, options, )); } /** * Delete Destination * * @remarks * Deletes a specific destination. */ async delete( tenantId: string, destinationId: string, options?: RequestOptions, ): Promise { return unwrapAsync(destinationsDelete( this, tenantId, destinationId, options, )); } /** * Enable Destination * * @remarks * Enables a previously disabled destination. */ async enable( tenantId: string, destinationId: string, options?: RequestOptions, ): Promise { return unwrapAsync(destinationsEnable( this, tenantId, destinationId, options, )); } /** * Disable Destination * * @remarks * Disables a previously enabled destination. */ async disable( tenantId: string, destinationId: string, options?: RequestOptions, ): Promise { return unwrapAsync(destinationsDisable( this, tenantId, destinationId, options, )); } /** * List Destination Attempts * * @remarks * Retrieves a paginated list of attempts scoped to a specific destination. */ async listAttempts( request: operations.ListTenantDestinationAttemptsRequest, options?: RequestOptions, ): Promise< PageIterator< operations.ListTenantDestinationAttemptsResponse, { cursor: string } > > { return unwrapResultIterator(destinationsListAttempts( this, request, options, )); } /** * Get Destination Attempt * * @remarks * Retrieves details for a specific attempt scoped to a destination. */ async getAttempt( tenantId: string, destinationId: string, attemptId: string, include?: operations.GetTenantDestinationAttemptInclude | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(destinationsGetAttempt( this, tenantId, destinationId, attemptId, include, options, )); } }