// This file is auto-generated by @hey-api/openapi-ts

export type ClientOptions = {
    baseUrl: 'http://localhost:4000' | (string & {});
};

/**
 * Channel
 *
 * A configured channel source, identified by (adapter_id, id).
 */
export type Channel = {
    /**
     * Channel adapter id, e.g. "feishu".
     */
    adapter_id: string;
    /**
     * Public source projection. Secret fields are masked to {present: boolean}.
     */
    config: {
        [key: string]: unknown;
    };
    enabled: boolean;
    /**
     * Source id within the adapter, e.g. "main".
     */
    id: string;
};

/**
 * ChannelAdapter
 *
 * An available channel adapter and the schema describing its config form.
 */
export type ChannelAdapter = {
    /**
     * Adapter-provided form schema (sections, fields, defaults).
     */
    form_schema: {
        [key: string]: unknown;
    };
    id: string;
    label: string;
    plugin_id: string;
};

/**
 * ChannelAdapterList
 */
export type ChannelAdapterList = {
    data: Array<ChannelAdapter>;
    /**
     * OIDC callback URL with __source_id__ placeholder for the source id.
     */
    oidc_callback_url_template: string;
};

/**
 * ChannelCreateRequest
 */
export type ChannelCreateRequest = {
    adapter_id: string;
    /**
     * Raw form values for the source (must include id for multi-source adapters).
     */
    source: {
        [key: string]: unknown;
    };
};

/**
 * ChannelList
 */
export type ChannelList = {
    data: Array<Channel>;
};

/**
 * ChannelUpdateRequest
 */
export type ChannelUpdateRequest = {
    /**
     * Raw form values. Omitted secret fields keep their stored value.
     */
    source: {
        [key: string]: unknown;
    };
};

/**
 * ConnectivityCheckRequest
 */
export type ConnectivityCheckRequest = {
    adapter_id: string;
    source: {
        [key: string]: unknown;
    };
};

/**
 * ConnectivityCheckResult
 */
export type ConnectivityCheckResult = {
    ok: boolean;
    result: {
        [key: string]: unknown;
    };
};

/**
 * Error
 */
export type Error = {
    errors?: Array<{
        [key: string]: unknown;
    }> | null;
    field?: string | null;
    message: string;
    [key: string]: unknown;
};

export type ListChannelAdaptersData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/.internal-apis/v1/channel-adapters';
};

export type ListChannelAdaptersResponses = {
    /**
     * Adapters
     */
    200: ChannelAdapterList;
};

export type ListChannelAdaptersResponse = ListChannelAdaptersResponses[keyof ListChannelAdaptersResponses];

export type ListChannelsData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/.internal-apis/v1/channels';
};

export type ListChannelsResponses = {
    /**
     * Channels
     */
    200: ChannelList;
};

export type ListChannelsResponse = ListChannelsResponses[keyof ListChannelsResponses];

export type CreateChannelData = {
    /**
     * Channel to create
     */
    body?: ChannelCreateRequest;
    path?: never;
    query?: never;
    url: '/.internal-apis/v1/channels';
};

export type CreateChannelErrors = {
    /**
     * Validation error
     */
    422: Error;
};

export type CreateChannelError = CreateChannelErrors[keyof CreateChannelErrors];

export type CreateChannelResponses = {
    /**
     * Created channel
     */
    201: Channel;
};

export type CreateChannelResponse = CreateChannelResponses[keyof CreateChannelResponses];

export type CheckChannelConnectivityData = {
    /**
     * Source to check
     */
    body?: ConnectivityCheckRequest;
    path?: never;
    query?: never;
    url: '/.internal-apis/v1/channels/connectivity-check';
};

export type CheckChannelConnectivityErrors = {
    /**
     * Error
     */
    422: Error;
};

export type CheckChannelConnectivityError = CheckChannelConnectivityErrors[keyof CheckChannelConnectivityErrors];

export type CheckChannelConnectivityResponses = {
    /**
     * Connectivity result
     */
    200: ConnectivityCheckResult;
};

export type CheckChannelConnectivityResponse = CheckChannelConnectivityResponses[keyof CheckChannelConnectivityResponses];

export type DeleteChannelData = {
    body?: never;
    path: {
        /**
         * Channel adapter id.
         */
        adapter_id: string;
        /**
         * Source id within the adapter.
         */
        id: string;
    };
    query?: never;
    url: '/.internal-apis/v1/channels/{adapter_id}/{id}';
};

export type DeleteChannelErrors = {
    /**
     * Not found
     */
    404: Error;
    /**
     * Error
     */
    422: Error;
};

export type DeleteChannelError = DeleteChannelErrors[keyof DeleteChannelErrors];

export type DeleteChannelResponses = {
    /**
     * Channel deleted
     */
    204: void;
};

export type DeleteChannelResponse = DeleteChannelResponses[keyof DeleteChannelResponses];

export type GetChannelData = {
    body?: never;
    path: {
        /**
         * Channel adapter id.
         */
        adapter_id: string;
        /**
         * Source id within the adapter.
         */
        id: string;
    };
    query?: never;
    url: '/.internal-apis/v1/channels/{adapter_id}/{id}';
};

export type GetChannelErrors = {
    /**
     * Not found
     */
    404: Error;
};

export type GetChannelError = GetChannelErrors[keyof GetChannelErrors];

export type GetChannelResponses = {
    /**
     * Channel
     */
    200: Channel;
};

export type GetChannelResponse = GetChannelResponses[keyof GetChannelResponses];

export type UpdateChannelData = {
    /**
     * Channel changes
     */
    body?: ChannelUpdateRequest;
    path: {
        /**
         * Channel adapter id.
         */
        adapter_id: string;
        /**
         * Source id within the adapter.
         */
        id: string;
    };
    query?: never;
    url: '/.internal-apis/v1/channels/{adapter_id}/{id}';
};

export type UpdateChannelErrors = {
    /**
     * Not found
     */
    404: Error;
    /**
     * Validation error
     */
    422: Error;
};

export type UpdateChannelError = UpdateChannelErrors[keyof UpdateChannelErrors];

export type UpdateChannelResponses = {
    /**
     * Updated channel
     */
    200: Channel;
};

export type UpdateChannelResponse = UpdateChannelResponses[keyof UpdateChannelResponses];

export type BullXWebApiSpecServiceDescData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/.well-known/service-desc';
};

export type BullXWebApiSpecServiceDescResponses = {
    /**
     * OpenAPI document.
     */
    200: {
        [key: string]: unknown;
    };
};

export type BullXWebApiSpecServiceDescResponse = BullXWebApiSpecServiceDescResponses[keyof BullXWebApiSpecServiceDescResponses];
