export type ConnectionStatus = "active" | "archived"; /** Discriminator values for a {@link ConnectionV2}. */ export type ConnectionType = "connections_dataset" | "connections_model"; /** Values accepted by the `connection_type` list filter (distinct from the {@link ConnectionType} discriminator). */ export type ConnectionQueryType = "dataset" | "model"; export interface ConnectionAppRef { id: number; name: string; } export interface ConnectionProfileRef { id: string; name: string; } interface ConnectionV2Base { id: string; app: ConnectionAppRef; created_at: string; installation_id: number; /** Optional connector-specific settings, validated by the connector. */ quick_settings?: Record; /** @deprecated kept for backward compatibility, use {@link ConnectionV2Base.profile} instead. */ profile_id: string; profile: ConnectionProfileRef; status: ConnectionStatus; } export interface DatasetConnection extends ConnectionV2Base { type: "connections_dataset"; dataset_id: number; } export interface ModelConnection extends ConnectionV2Base { type: "connections_model"; model_id: number; } /** * A connection routing a dataset's or model's data to a connector app. * * Discriminated on `type`. */ export type ConnectionV2 = DatasetConnection | ModelConnection; export interface CreateDatasetConnectionRequest { type: "connections_dataset"; /** The dataset whose data is routed to the connector. */ dataset_id: number; profile_id: string; /** Optional connector-specific settings, validated by the connector. */ quick_settings?: Record; } export interface CreateModelConnectionRequest { type: "connections_model"; /** The model connected to the connector. */ model_id: number; profile_id: string; /** Optional connector-specific settings, validated by the connector. */ quick_settings?: Record; } /** * Request body for creating a connection. * * Discriminated on `type`. */ export type CreateConnectionRequest = CreateDatasetConnectionRequest | CreateModelConnectionRequest; export interface ConnectionFilters { /** Only return connections to this app. */ app_id?: number; /** Only return connections of this type. */ connection_type?: ConnectionQueryType; /** Only return connections from this dataset. */ dataset_id?: number; /** Only return connections from this model. */ model_id?: number; /** Only return connections created against this app profile. */ profile_id?: string; } export {};