aiconfigpatch.ts•2.38 kB
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import * as z from "zod";
import { safeParse } from "../../lib/schemas.js";
import { Result as SafeParseResult } from "../../types/fp.js";
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
export type AIConfigPatch = {
description?: string | undefined;
maintainerId?: string | undefined;
maintainerTeamKey?: string | undefined;
name?: string | undefined;
tags?: Array<string> | undefined;
};
/** @internal */
export const AIConfigPatch$inboundSchema: z.ZodType<
AIConfigPatch,
z.ZodTypeDef,
unknown
> = z.object({
description: z.string().optional(),
maintainerId: z.string().optional(),
maintainerTeamKey: z.string().optional(),
name: z.string().optional(),
tags: z.array(z.string()).optional(),
});
/** @internal */
export type AIConfigPatch$Outbound = {
description?: string | undefined;
maintainerId?: string | undefined;
maintainerTeamKey?: string | undefined;
name?: string | undefined;
tags?: Array<string> | undefined;
};
/** @internal */
export const AIConfigPatch$outboundSchema: z.ZodType<
AIConfigPatch$Outbound,
z.ZodTypeDef,
AIConfigPatch
> = z.object({
description: z.string().optional(),
maintainerId: z.string().optional(),
maintainerTeamKey: z.string().optional(),
name: z.string().optional(),
tags: z.array(z.string()).optional(),
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace AIConfigPatch$ {
/** @deprecated use `AIConfigPatch$inboundSchema` instead. */
export const inboundSchema = AIConfigPatch$inboundSchema;
/** @deprecated use `AIConfigPatch$outboundSchema` instead. */
export const outboundSchema = AIConfigPatch$outboundSchema;
/** @deprecated use `AIConfigPatch$Outbound` instead. */
export type Outbound = AIConfigPatch$Outbound;
}
export function aiConfigPatchToJSON(aiConfigPatch: AIConfigPatch): string {
return JSON.stringify(AIConfigPatch$outboundSchema.parse(aiConfigPatch));
}
export function aiConfigPatchFromJSON(
jsonString: string,
): SafeParseResult<AIConfigPatch, SDKValidationError> {
return safeParse(
jsonString,
(x) => AIConfigPatch$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'AIConfigPatch' from JSON`,
);
}