/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { IdDisplayNameFamily, IdDisplayNameFamily$Outbound, IdDisplayNameFamily$outboundSchema, } from "./id-display-name-family.js"; /** * Per-entry credential material to merge over the stored values, keyed by the catalog wire names for this provider. Keys you omit are left untouched; an explicit null clears the field, and is refused if the catalog declares it required. The merged result is validated as a whole, so a patch that leaves the configuration incomplete is refused even when every value it carries is individually valid. A secret sent here is extracted and encrypted, never stored in the clear. */ export type CredentialFields = {}; export type NameApiKeyCredentialFields = { /** * Updated display name */ name?: string | undefined; /** * New API key (will be re-encrypted) */ apiKey?: string | undefined; /** * Per-entry credential material to merge over the stored values, keyed by the catalog wire names for this provider. Keys you omit are left untouched; an explicit null clears the field, and is refused if the catalog declares it required. The merged result is validated as a whole, so a patch that leaves the configuration incomplete is refused even when every value it carries is individually valid. A secret sent here is extracted and encrypted, never stored in the clear. */ credentialFields?: CredentialFields | undefined; /** * Updated base URL (null to clear) */ baseUrl?: string | null | undefined; /** * Updated model mappings (null to clear) */ modelOverrides?: { [k: string]: string } | null | undefined; /** * Activate or deactivate this config */ isActive?: boolean | undefined; /** * Set or unset as default provider */ isDefault?: boolean | undefined; /** * Which hosted model family a gateway configuration targets (null to clear). Named for the column it populates. */ hostedFamily?: string | null | undefined; /** * Updated declared models (null to clear) */ supportedModels?: Array | null | undefined; /** * Updated API version (null to clear) */ apiVersion?: string | null | undefined; /** * Updated metadata (null to clear) */ metadata?: { [k: string]: any } | null | undefined; }; /** @internal */ export type CredentialFields$Outbound = {}; /** @internal */ export const CredentialFields$outboundSchema: z.ZodMiniType< CredentialFields$Outbound, CredentialFields > = z.object({}); export function credentialFieldsToJSON( credentialFields: CredentialFields, ): string { return JSON.stringify( CredentialFields$outboundSchema.parse(credentialFields), ); } /** @internal */ export type NameApiKeyCredentialFields$Outbound = { name?: string | undefined; apiKey?: string | undefined; credentialFields?: CredentialFields$Outbound | undefined; baseUrl?: string | null | undefined; modelOverrides?: { [k: string]: string } | null | undefined; isActive?: boolean | undefined; isDefault?: boolean | undefined; hostedFamily?: string | null | undefined; supportedModels?: Array | null | undefined; apiVersion?: string | null | undefined; metadata?: { [k: string]: any } | null | undefined; }; /** @internal */ export const NameApiKeyCredentialFields$outboundSchema: z.ZodMiniType< NameApiKeyCredentialFields$Outbound, NameApiKeyCredentialFields > = z.object({ name: z.optional(z.string()), apiKey: z.optional(z.string()), credentialFields: z.optional(z.lazy(() => CredentialFields$outboundSchema)), baseUrl: z.optional(z.nullable(z.string())), modelOverrides: z.optional(z.nullable(z.record(z.string(), z.string()))), isActive: z.optional(z.boolean()), isDefault: z.optional(z.boolean()), hostedFamily: z.optional(z.nullable(z.string())), supportedModels: z.optional( z.nullable(z.array(IdDisplayNameFamily$outboundSchema)), ), apiVersion: z.optional(z.nullable(z.string())), metadata: z.optional(z.nullable(z.record(z.string(), z.any()))), }); export function nameApiKeyCredentialFieldsToJSON( nameApiKeyCredentialFields: NameApiKeyCredentialFields, ): string { return JSON.stringify( NameApiKeyCredentialFields$outboundSchema.parse(nameApiKeyCredentialFields), ); }