import { BaseApi } from "../base-api"; import type { ApiRecords } from "../types"; import type { ConnectionAppRef, ConnectionFilters, ConnectionProfileRef, ConnectionQueryType, ConnectionStatus, ConnectionType, ConnectionV2, CreateConnectionRequest, CreateDatasetConnectionRequest, CreateModelConnectionRequest, DatasetConnection, ModelConnection } from "./types"; /** * Class representing the API for connections. * * @module ConnectionsApi * @extends BaseApi * @description This class provides methods for fetching and managing connection records via the * `/v2/connections` API. */ declare class ConnectionsApi extends BaseApi { /** * Retrieves a specific connection by its ID. * * @public * @async * @param {string} connectionId - The ID of the connection to retrieve. * @returns {Promise} A promise that resolves to the connection object. * @throws Will throw an error if the API call fails. */ getConnection(connectionId: string): Promise; /** * Lists the calling company's connections, optionally filtered by app, connection type, dataset, model, or * profile. * * @public * @async * @param {ConnectionFilters} [filters] - Optional filters to narrow the returned connections. * @returns {Promise>} A promise that resolves to an array of connection objects. * @throws Will throw an error if the API call fails. */ getConnections(filters?: ConnectionFilters): Promise>; /** * Retrieves all connections associated with a specific dataset. * * @public * @async * @param {number} datasetId - The ID of the dataset to retrieve connections for. * @returns {Promise>} A promise that resolves to an array of connection objects. * @throws Will throw an error if the API call fails. */ getDatasetConnections(datasetId: number): Promise>; /** * Retrieves all connections associated with a specific profile. * * @public * @async * @param {string} profileId - The ID of the profile to retrieve connections for. * @returns {Promise>} A promise that resolves to an array of connection objects. * @throws Will throw an error if the API call fails. */ getProfileConnections(profileId: string): Promise>; /** * Creates a new connection routing a dataset's or model's data to a connector app. * * @public * @async * @param {CreateConnectionRequest} newConnection - The connection data to create; a discriminated union keyed * on `type` (`connections_dataset` | `connections_model`). * @returns {Promise} A promise that resolves to the newly created connection object. * @throws Will throw an error if the API call fails. */ createConnection(newConnection: CreateConnectionRequest): Promise; /** * Archives a connection. The connection is not deleted; its status becomes `archived`. * * @public * @async * @param {string} connectionId - The ID of the connection to archive. * @returns {Promise} A promise that resolves when the connection is archived. * @throws Will throw an error if the API call fails. */ deleteConnection(connectionId: string): Promise; } export { type ConnectionAppRef, type ConnectionFilters, type ConnectionProfileRef, type ConnectionQueryType, type ConnectionStatus, ConnectionsApi, type ConnectionType, type ConnectionV2, type CreateConnectionRequest, type CreateDatasetConnectionRequest, type CreateModelConnectionRequest, type DatasetConnection, type ModelConnection, };