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

import type { Client, Options as Options2, TDataShape } from './client';
import { client } from './client.gen';
import type { ApplyBatchData, ApplyBatchErrors, ApplyBatchResponses, ApplyDeploymentData, ApplyDeploymentErrors, ApplyDeploymentResponses, ApplyRuntimeData, ApplyRuntimeErrors, ApplyRuntimeResponses, DeleteAgentData, DeleteAgentErrors, DeleteAgentResponses, DeleteBatchData, DeleteBatchErrors, DeleteBatchResponses, DeleteDeploymentData, DeleteDeploymentErrors, DeleteDeploymentResponses, DeleteMcpserverData, DeleteMcpserverErrors, DeleteMcpserverResponses, DeletePromptData, DeletePromptErrors, DeletePromptResponses, DeleteRuntimeData, DeleteRuntimeErrors, DeleteRuntimeResponses, DeleteSkillData, DeleteSkillErrors, DeleteSkillResponses, GetAgentData, GetAgentErrors, GetAgentResponses, GetHealthV0Data, GetHealthV0Errors, GetHealthV0Responses, GetLatestAgentData, GetLatestAgentErrors, GetLatestAgentResponses, GetLatestDeploymentData, GetLatestDeploymentErrors, GetLatestDeploymentResponses, GetLatestMcpserverData, GetLatestMcpserverErrors, GetLatestMcpserverResponses, GetLatestPromptData, GetLatestPromptErrors, GetLatestPromptResponses, GetLatestRuntimeData, GetLatestRuntimeErrors, GetLatestRuntimeResponses, GetLatestSkillData, GetLatestSkillErrors, GetLatestSkillResponses, GetMcpserverData, GetMcpserverErrors, GetMcpserverResponses, GetPromptData, GetPromptErrors, GetPromptResponses, GetSkillData, GetSkillErrors, GetSkillResponses, GetVersionV0Data, GetVersionV0Errors, GetVersionV0Responses, ListAgentsData, ListAgentsErrors, ListAgentsResponses, ListDeploymentsData, ListDeploymentsErrors, ListDeploymentsResponses, ListMcpserversData, ListMcpserversErrors, ListMcpserversResponses, ListPromptsData, ListPromptsErrors, ListPromptsResponses, ListRuntimesData, ListRuntimesErrors, ListRuntimesResponses, ListSkillsData, ListSkillsErrors, ListSkillsResponses, ListTagsAgentData, ListTagsAgentErrors, ListTagsAgentResponses, ListTagsMcpserverData, ListTagsMcpserverErrors, ListTagsMcpserverResponses, ListTagsPromptData, ListTagsPromptErrors, ListTagsPromptResponses, ListTagsSkillData, ListTagsSkillErrors, ListTagsSkillResponses, PingV0Data, PingV0Errors, PingV0Responses } from './types.gen';

export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options2<TData, ThrowOnError> & {
    /**
     * You can provide a client instance returned by `createClient()` instead of
     * individual options. This might be also useful if you want to implement a
     * custom client.
     */
    client?: Client;
    /**
     * You can pass arbitrary values through the `meta` object. This can be
     * used to access values that aren't defined as part of the SDK function.
     */
    meta?: Record<string, unknown>;
};

/**
 * List Agent (scoped by ?namespace)
 */
export const listAgents = <ThrowOnError extends boolean = false>(options?: Options<ListAgentsData, ThrowOnError>) => (options?.client ?? client).get<ListAgentsResponses, ListAgentsErrors, ThrowOnError>({ url: '/v0/agents', ...options });

/**
 * Get the latest Agent
 */
export const getLatestAgent = <ThrowOnError extends boolean = false>(options: Options<GetLatestAgentData, ThrowOnError>) => (options.client ?? client).get<GetLatestAgentResponses, GetLatestAgentErrors, ThrowOnError>({ url: '/v0/agents/{name}', ...options });

/**
 * Delete a Agent (soft-delete: sets deletionTimestamp)
 */
export const deleteAgent = <ThrowOnError extends boolean = false>(options: Options<DeleteAgentData, ThrowOnError>) => (options.client ?? client).delete<DeleteAgentResponses, DeleteAgentErrors, ThrowOnError>({ url: '/v0/agents/{name}/{tag}', ...options });

/**
 * Get a Agent by name and tag
 */
export const getAgent = <ThrowOnError extends boolean = false>(options: Options<GetAgentData, ThrowOnError>) => (options.client ?? client).get<GetAgentResponses, GetAgentErrors, ThrowOnError>({ url: '/v0/agents/{name}/{tag}', ...options });

/**
 * List all tags of a Agent
 */
export const listTagsAgent = <ThrowOnError extends boolean = false>(options: Options<ListTagsAgentData, ThrowOnError>) => (options.client ?? client).get<ListTagsAgentResponses, ListTagsAgentErrors, ThrowOnError>({ url: '/v0/agents/{name}/tags', ...options });

/**
 * Delete v1alpha1 resources identified by a multi-doc YAML stream
 */
export const deleteBatch = <ThrowOnError extends boolean = false>(options: Options<DeleteBatchData, ThrowOnError>) => (options.client ?? client).delete<DeleteBatchResponses, DeleteBatchErrors, ThrowOnError>({
    bodySerializer: null,
    url: '/v0/apply',
    ...options,
    headers: {
        'Content-Type': 'application/yaml',
        ...options.headers
    }
});

/**
 * Apply a multi-doc YAML stream of v1alpha1 resources
 */
export const applyBatch = <ThrowOnError extends boolean = false>(options: Options<ApplyBatchData, ThrowOnError>) => (options.client ?? client).post<ApplyBatchResponses, ApplyBatchErrors, ThrowOnError>({
    bodySerializer: null,
    url: '/v0/apply',
    ...options,
    headers: {
        'Content-Type': 'application/yaml',
        ...options.headers
    }
});

/**
 * List Deployment (scoped by ?namespace)
 */
export const listDeployments = <ThrowOnError extends boolean = false>(options?: Options<ListDeploymentsData, ThrowOnError>) => (options?.client ?? client).get<ListDeploymentsResponses, ListDeploymentsErrors, ThrowOnError>({ url: '/v0/deployments', ...options });

/**
 * Delete a Deployment (soft-delete: sets deletionTimestamp)
 */
export const deleteDeployment = <ThrowOnError extends boolean = false>(options: Options<DeleteDeploymentData, ThrowOnError>) => (options.client ?? client).delete<DeleteDeploymentResponses, DeleteDeploymentErrors, ThrowOnError>({ url: '/v0/deployments/{name}', ...options });

/**
 * Get the latest Deployment
 */
export const getLatestDeployment = <ThrowOnError extends boolean = false>(options: Options<GetLatestDeploymentData, ThrowOnError>) => (options.client ?? client).get<GetLatestDeploymentResponses, GetLatestDeploymentErrors, ThrowOnError>({ url: '/v0/deployments/{name}', ...options });

/**
 * Apply a Deployment (idempotent upsert)
 */
export const applyDeployment = <ThrowOnError extends boolean = false>(options: Options<ApplyDeploymentData, ThrowOnError>) => (options.client ?? client).put<ApplyDeploymentResponses, ApplyDeploymentErrors, ThrowOnError>({
    url: '/v0/deployments/{name}',
    ...options,
    headers: {
        'Content-Type': 'application/json',
        ...options.headers
    }
});

/**
 * Health check
 *
 * Check the health status of the API
 */
export const getHealthV0 = <ThrowOnError extends boolean = false>(options?: Options<GetHealthV0Data, ThrowOnError>) => (options?.client ?? client).get<GetHealthV0Responses, GetHealthV0Errors, ThrowOnError>({ url: '/v0/health', ...options });

/**
 * List MCPServer (scoped by ?namespace)
 */
export const listMcpservers = <ThrowOnError extends boolean = false>(options?: Options<ListMcpserversData, ThrowOnError>) => (options?.client ?? client).get<ListMcpserversResponses, ListMcpserversErrors, ThrowOnError>({ url: '/v0/mcpservers', ...options });

/**
 * Get the latest MCPServer
 */
export const getLatestMcpserver = <ThrowOnError extends boolean = false>(options: Options<GetLatestMcpserverData, ThrowOnError>) => (options.client ?? client).get<GetLatestMcpserverResponses, GetLatestMcpserverErrors, ThrowOnError>({ url: '/v0/mcpservers/{name}', ...options });

/**
 * Delete a MCPServer (soft-delete: sets deletionTimestamp)
 */
export const deleteMcpserver = <ThrowOnError extends boolean = false>(options: Options<DeleteMcpserverData, ThrowOnError>) => (options.client ?? client).delete<DeleteMcpserverResponses, DeleteMcpserverErrors, ThrowOnError>({ url: '/v0/mcpservers/{name}/{tag}', ...options });

/**
 * Get a MCPServer by name and tag
 */
export const getMcpserver = <ThrowOnError extends boolean = false>(options: Options<GetMcpserverData, ThrowOnError>) => (options.client ?? client).get<GetMcpserverResponses, GetMcpserverErrors, ThrowOnError>({ url: '/v0/mcpservers/{name}/{tag}', ...options });

/**
 * List all tags of a MCPServer
 */
export const listTagsMcpserver = <ThrowOnError extends boolean = false>(options: Options<ListTagsMcpserverData, ThrowOnError>) => (options.client ?? client).get<ListTagsMcpserverResponses, ListTagsMcpserverErrors, ThrowOnError>({ url: '/v0/mcpservers/{name}/tags', ...options });

/**
 * Ping
 *
 * Simple ping endpoint
 */
export const pingV0 = <ThrowOnError extends boolean = false>(options?: Options<PingV0Data, ThrowOnError>) => (options?.client ?? client).get<PingV0Responses, PingV0Errors, ThrowOnError>({ url: '/v0/ping', ...options });

/**
 * List Prompt (scoped by ?namespace)
 */
export const listPrompts = <ThrowOnError extends boolean = false>(options?: Options<ListPromptsData, ThrowOnError>) => (options?.client ?? client).get<ListPromptsResponses, ListPromptsErrors, ThrowOnError>({ url: '/v0/prompts', ...options });

/**
 * Get the latest Prompt
 */
export const getLatestPrompt = <ThrowOnError extends boolean = false>(options: Options<GetLatestPromptData, ThrowOnError>) => (options.client ?? client).get<GetLatestPromptResponses, GetLatestPromptErrors, ThrowOnError>({ url: '/v0/prompts/{name}', ...options });

/**
 * Delete a Prompt (soft-delete: sets deletionTimestamp)
 */
export const deletePrompt = <ThrowOnError extends boolean = false>(options: Options<DeletePromptData, ThrowOnError>) => (options.client ?? client).delete<DeletePromptResponses, DeletePromptErrors, ThrowOnError>({ url: '/v0/prompts/{name}/{tag}', ...options });

/**
 * Get a Prompt by name and tag
 */
export const getPrompt = <ThrowOnError extends boolean = false>(options: Options<GetPromptData, ThrowOnError>) => (options.client ?? client).get<GetPromptResponses, GetPromptErrors, ThrowOnError>({ url: '/v0/prompts/{name}/{tag}', ...options });

/**
 * List all tags of a Prompt
 */
export const listTagsPrompt = <ThrowOnError extends boolean = false>(options: Options<ListTagsPromptData, ThrowOnError>) => (options.client ?? client).get<ListTagsPromptResponses, ListTagsPromptErrors, ThrowOnError>({ url: '/v0/prompts/{name}/tags', ...options });

/**
 * List Runtime (scoped by ?namespace)
 */
export const listRuntimes = <ThrowOnError extends boolean = false>(options?: Options<ListRuntimesData, ThrowOnError>) => (options?.client ?? client).get<ListRuntimesResponses, ListRuntimesErrors, ThrowOnError>({ url: '/v0/runtimes', ...options });

/**
 * Delete a Runtime (soft-delete: sets deletionTimestamp)
 */
export const deleteRuntime = <ThrowOnError extends boolean = false>(options: Options<DeleteRuntimeData, ThrowOnError>) => (options.client ?? client).delete<DeleteRuntimeResponses, DeleteRuntimeErrors, ThrowOnError>({ url: '/v0/runtimes/{name}', ...options });

/**
 * Get the latest Runtime
 */
export const getLatestRuntime = <ThrowOnError extends boolean = false>(options: Options<GetLatestRuntimeData, ThrowOnError>) => (options.client ?? client).get<GetLatestRuntimeResponses, GetLatestRuntimeErrors, ThrowOnError>({ url: '/v0/runtimes/{name}', ...options });

/**
 * Apply a Runtime (idempotent upsert)
 */
export const applyRuntime = <ThrowOnError extends boolean = false>(options: Options<ApplyRuntimeData, ThrowOnError>) => (options.client ?? client).put<ApplyRuntimeResponses, ApplyRuntimeErrors, ThrowOnError>({
    url: '/v0/runtimes/{name}',
    ...options,
    headers: {
        'Content-Type': 'application/json',
        ...options.headers
    }
});

/**
 * List Skill (scoped by ?namespace)
 */
export const listSkills = <ThrowOnError extends boolean = false>(options?: Options<ListSkillsData, ThrowOnError>) => (options?.client ?? client).get<ListSkillsResponses, ListSkillsErrors, ThrowOnError>({ url: '/v0/skills', ...options });

/**
 * Get the latest Skill
 */
export const getLatestSkill = <ThrowOnError extends boolean = false>(options: Options<GetLatestSkillData, ThrowOnError>) => (options.client ?? client).get<GetLatestSkillResponses, GetLatestSkillErrors, ThrowOnError>({ url: '/v0/skills/{name}', ...options });

/**
 * Delete a Skill (soft-delete: sets deletionTimestamp)
 */
export const deleteSkill = <ThrowOnError extends boolean = false>(options: Options<DeleteSkillData, ThrowOnError>) => (options.client ?? client).delete<DeleteSkillResponses, DeleteSkillErrors, ThrowOnError>({ url: '/v0/skills/{name}/{tag}', ...options });

/**
 * Get a Skill by name and tag
 */
export const getSkill = <ThrowOnError extends boolean = false>(options: Options<GetSkillData, ThrowOnError>) => (options.client ?? client).get<GetSkillResponses, GetSkillErrors, ThrowOnError>({ url: '/v0/skills/{name}/{tag}', ...options });

/**
 * List all tags of a Skill
 */
export const listTagsSkill = <ThrowOnError extends boolean = false>(options: Options<ListTagsSkillData, ThrowOnError>) => (options.client ?? client).get<ListTagsSkillResponses, ListTagsSkillErrors, ThrowOnError>({ url: '/v0/skills/{name}/tags', ...options });

/**
 * Get version information
 *
 * Returns the version, git commit, and build time of the registry application
 */
export const getVersionV0 = <ThrowOnError extends boolean = false>(options?: Options<GetVersionV0Data, ThrowOnError>) => (options?.client ?? client).get<GetVersionV0Responses, GetVersionV0Errors, ThrowOnError>({ url: '/v0/version', ...options });
