// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../core/resource'; import * as RegisterExternalPipelineAPI from './register-external-pipeline'; import { APIPromise } from '../core/api-promise'; import { buildHeaders } from '../internal/headers'; import { RequestOptions } from '../internal/request-options'; import { path } from '../internal/utils/path'; export class ExternalPipeline extends APIResource { /** * Deregisters an EPS pipeline and removes all associated records (presets, * chatbots, catalogs). */ delete( pipelineID: string, params: ExternalPipelineDeleteParams | null | undefined = {}, options?: RequestOptions, ): APIPromise { const { 'Accept-Language': acceptLanguage, 'X-Error-Format': xErrorFormat } = params ?? {}; return this._client.delete(path`/external-pipeline/${pipelineID}`, { ...options, headers: buildHeaders([ { Accept: '*/*', ...(acceptLanguage != null ? { 'Accept-Language': acceptLanguage } : undefined), ...(xErrorFormat != null ? { 'X-Error-Format': xErrorFormat } : undefined), }, options?.headers, ]), }); } /** * Re-runs the /verify call for an existing EPS registration and updates its stored * configuration (supported models, version, attachment support, etc.) in-place. * The pipeline name/slug and catalog IDs are never changed. */ synchronize( pipelineID: string, params: ExternalPipelineSynchronizeParams | null | undefined = {}, options?: RequestOptions, ): APIPromise { const { 'Accept-Language': acceptLanguage, 'X-Error-Format': xErrorFormat } = params ?? {}; return this._client.post(path`/external-pipeline/${pipelineID}/synchronize`, { ...options, headers: buildHeaders([ { ...(acceptLanguage != null ? { 'Accept-Language': acceptLanguage } : undefined), ...(xErrorFormat != null ? { 'X-Error-Format': xErrorFormat } : undefined), }, options?.headers, ]), }); } } export interface ExternalPipelineDeleteParams { 'Accept-Language'?: string; /** * Set to `structured` to receive errors in the structured envelope. Omit it to * keep the legacy error body. */ 'X-Error-Format'?: string; } export interface ExternalPipelineSynchronizeParams { 'Accept-Language'?: string; /** * Set to `structured` to receive errors in the structured envelope. Omit it to * keep the legacy error body. */ 'X-Error-Format'?: string; } export declare namespace ExternalPipeline { export { type ExternalPipelineDeleteParams as ExternalPipelineDeleteParams, type ExternalPipelineSynchronizeParams as ExternalPipelineSynchronizeParams, }; }