aiconfigslink.ts•1.88 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 AiConfigsLink = {
href?: string | undefined;
type?: string | undefined;
};
/** @internal */
export const AiConfigsLink$inboundSchema: z.ZodType<
AiConfigsLink,
z.ZodTypeDef,
unknown
> = z.object({
href: z.string().optional(),
type: z.string().optional(),
});
/** @internal */
export type AiConfigsLink$Outbound = {
href?: string | undefined;
type?: string | undefined;
};
/** @internal */
export const AiConfigsLink$outboundSchema: z.ZodType<
AiConfigsLink$Outbound,
z.ZodTypeDef,
AiConfigsLink
> = z.object({
href: z.string().optional(),
type: 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 AiConfigsLink$ {
/** @deprecated use `AiConfigsLink$inboundSchema` instead. */
export const inboundSchema = AiConfigsLink$inboundSchema;
/** @deprecated use `AiConfigsLink$outboundSchema` instead. */
export const outboundSchema = AiConfigsLink$outboundSchema;
/** @deprecated use `AiConfigsLink$Outbound` instead. */
export type Outbound = AiConfigsLink$Outbound;
}
export function aiConfigsLinkToJSON(aiConfigsLink: AiConfigsLink): string {
return JSON.stringify(AiConfigsLink$outboundSchema.parse(aiConfigsLink));
}
export function aiConfigsLinkFromJSON(
jsonString: string,
): SafeParseResult<AiConfigsLink, SDKValidationError> {
return safeParse(
jsonString,
(x) => AiConfigsLink$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'AiConfigsLink' from JSON`,
);
}