/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import * as models from "../index.js"; export type PostApiV1IndexerRequest = { forceSave?: boolean | undefined; indexerResource?: models.IndexerResourceInput | undefined; }; /** @internal */ export const PostApiV1IndexerRequest$inboundSchema: z.ZodType< PostApiV1IndexerRequest, z.ZodTypeDef, unknown > = z.object({ forceSave: z.boolean().default(false), IndexerResource: models.IndexerResourceInput$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "IndexerResource": "indexerResource", }); }); /** @internal */ export type PostApiV1IndexerRequest$Outbound = { forceSave: boolean; IndexerResource?: models.IndexerResourceInput$Outbound | undefined; }; /** @internal */ export const PostApiV1IndexerRequest$outboundSchema: z.ZodType< PostApiV1IndexerRequest$Outbound, z.ZodTypeDef, PostApiV1IndexerRequest > = z.object({ forceSave: z.boolean().default(false), indexerResource: models.IndexerResourceInput$outboundSchema.optional(), }).transform((v) => { return remap$(v, { indexerResource: "IndexerResource", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PostApiV1IndexerRequest$ { /** @deprecated use `PostApiV1IndexerRequest$inboundSchema` instead. */ export const inboundSchema = PostApiV1IndexerRequest$inboundSchema; /** @deprecated use `PostApiV1IndexerRequest$outboundSchema` instead. */ export const outboundSchema = PostApiV1IndexerRequest$outboundSchema; /** @deprecated use `PostApiV1IndexerRequest$Outbound` instead. */ export type Outbound = PostApiV1IndexerRequest$Outbound; } export function postApiV1IndexerRequestToJSON( postApiV1IndexerRequest: PostApiV1IndexerRequest, ): string { return JSON.stringify( PostApiV1IndexerRequest$outboundSchema.parse(postApiV1IndexerRequest), ); } export function postApiV1IndexerRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PostApiV1IndexerRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PostApiV1IndexerRequest' from JSON`, ); }