// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../core/resource'; import { APIPromise } from '../core/api-promise'; import { type Uploadable } from '../core/uploads'; import { buildHeaders } from '../internal/headers'; import { RequestOptions } from '../internal/request-options'; import { multipartFormRequestOptions } from '../internal/uploads'; export class PipelinePlugin extends APIResource { /** * Uploads and registers a new pipeline plugin from a ZIP file. The plugin must be * properly formatted and contain all necessary components for pipeline execution. * This endpoint validates the ZIP file format and contents before registration. */ create( params: PipelinePluginCreateParams, options?: RequestOptions, ): APIPromise { const { 'Accept-Language': acceptLanguage, 'X-Error-Format': xErrorFormat, ...body } = params; return this._client.post( '/register-pipeline-plugin', multipartFormRequestOptions( { body, ...options, headers: buildHeaders([ { ...(acceptLanguage != null ? { 'Accept-Language': acceptLanguage } : undefined), ...(xErrorFormat != null ? { 'X-Error-Format': xErrorFormat } : undefined), }, options?.headers, ]), }, this._client, ), ); } /** * Unregisters a pipeline plugin by its ID. This endpoint removes the plugin from * the system and invalidates any references to it in the configuration. */ delete( params: PipelinePluginDeleteParams, options?: RequestOptions, ): APIPromise { const { body, 'Accept-Language': acceptLanguage, 'X-Error-Format': xErrorFormat } = params; return this._client.post('/unregister-pipeline-plugin', { body: body, ...options, headers: buildHeaders([ { ...(acceptLanguage != null ? { 'Accept-Language': acceptLanguage } : undefined), ...(xErrorFormat != null ? { 'X-Error-Format': xErrorFormat } : undefined), }, options?.headers, ]), }); } } /** * Response model for registering pipeline plugins. * * Attributes: status (str): The status of the pipeline plugin registration. * registered_pipelines (List[str]): Names of pipelines that were successfully * registered. */ export interface PipelinePluginCreateResponse { /** * List of pipelines that were successfully registered */ registered_pipelines: Array; /** * The status of the pipeline plugin registration */ status: string; } /** * Response model for unregistering pipeline plugins. * * Attributes: status (str): The status of the pipeline plugin unregistration. * unregistered_pipelines (List[str]): Names of pipelines that were successfully * unregistered. */ export interface PipelinePluginDeleteResponse { /** * The status of the pipeline plugin unregistration */ status: string; /** * List of pipelines that were successfully unregistered */ unregistered_pipelines: Array; } export interface PipelinePluginCreateParams { /** * Body param: A ZIP file containing the pipeline plugin to be registered. The file * must be properly formatted and include all necessary plugin components. */ zip_file: Uploadable; /** * Header param */ 'Accept-Language'?: string; /** * Header param: Set to `structured` to receive errors in the structured envelope. * Omit it to keep the legacy error body. */ 'X-Error-Format'?: string; } export interface PipelinePluginDeleteParams { /** * Body param */ body: Array; /** * Header param */ 'Accept-Language'?: string; /** * Header param: 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 PipelinePlugin { export { type PipelinePluginCreateResponse as PipelinePluginCreateResponse, type PipelinePluginDeleteResponse as PipelinePluginDeleteResponse, type PipelinePluginCreateParams as PipelinePluginCreateParams, type PipelinePluginDeleteParams as PipelinePluginDeleteParams, }; }