/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { channelConnectionsCreate } from "../funcs/channelConnectionsCreate.js"; import { channelConnectionsDelete } from "../funcs/channelConnectionsDelete.js"; import { channelConnectionsList } from "../funcs/channelConnectionsList.js"; import { channelConnectionsRetrieve } from "../funcs/channelConnectionsRetrieve.js"; import { channelConnectionsUpdate } from "../funcs/channelConnectionsUpdate.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"; export class ChannelConnections extends ClientSDK { /** * List all channel connections * * @remarks * List all channel connections for a resource. */ async list( request: operations.ChannelConnectionsControllerListChannelConnectionsRequest, options?: RequestOptions, ): Promise< operations.ChannelConnectionsControllerListChannelConnectionsResponse > { return unwrapAsync(channelConnectionsList( this, request, options, )); } /** * Create a channel connection * * @remarks * Create a new channel connection for a resource for given integration. Only one channel connection is allowed per resource and integration. */ async create( createChannelConnectionRequestDto: components.CreateChannelConnectionRequestDto, idempotencyKey?: string | undefined, options?: RequestOptions, ): Promise< operations.ChannelConnectionsControllerCreateChannelConnectionResponse > { return unwrapAsync(channelConnectionsCreate( this, createChannelConnectionRequestDto, idempotencyKey, options, )); } /** * Retrieve a channel connection * * @remarks * Retrieve a specific channel connection by its unique identifier. */ async retrieve( identifier: string, idempotencyKey?: string | undefined, options?: RequestOptions, ): Promise< operations.ChannelConnectionsControllerGetChannelConnectionByIdentifierResponse > { return unwrapAsync(channelConnectionsRetrieve( this, identifier, idempotencyKey, options, )); } /** * Update a channel connection * * @remarks * Update an existing channel connection by its unique identifier. */ async update( updateChannelConnectionRequestDto: components.UpdateChannelConnectionRequestDto, identifier: string, idempotencyKey?: string | undefined, options?: RequestOptions, ): Promise< operations.ChannelConnectionsControllerUpdateChannelConnectionResponse > { return unwrapAsync(channelConnectionsUpdate( this, updateChannelConnectionRequestDto, identifier, idempotencyKey, options, )); } /** * Delete a channel connection * * @remarks * Delete a specific channel connection by its unique identifier. */ async delete( identifier: string, idempotencyKey?: string | undefined, options?: RequestOptions, ): Promise< | operations.ChannelConnectionsControllerDeleteChannelConnectionResponse | undefined > { return unwrapAsync(channelConnectionsDelete( this, identifier, idempotencyKey, options, )); } }