/* * 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 PostApiV1IndexerTestRequest = { forceTest?: boolean | undefined; indexerResource?: models.IndexerResourceInput | undefined; }; /** @internal */ export const PostApiV1IndexerTestRequest$inboundSchema: z.ZodType< PostApiV1IndexerTestRequest, z.ZodTypeDef, unknown > = z.object({ forceTest: z.boolean().default(false), IndexerResource: models.IndexerResourceInput$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "IndexerResource": "indexerResource", }); }); /** @internal */ export type PostApiV1IndexerTestRequest$Outbound = { forceTest: boolean; IndexerResource?: models.IndexerResourceInput$Outbound | undefined; }; /** @internal */ export const PostApiV1IndexerTestRequest$outboundSchema: z.ZodType< PostApiV1IndexerTestRequest$Outbound, z.ZodTypeDef, PostApiV1IndexerTestRequest > = z.object({ forceTest: 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 PostApiV1IndexerTestRequest$ { /** @deprecated use `PostApiV1IndexerTestRequest$inboundSchema` instead. */ export const inboundSchema = PostApiV1IndexerTestRequest$inboundSchema; /** @deprecated use `PostApiV1IndexerTestRequest$outboundSchema` instead. */ export const outboundSchema = PostApiV1IndexerTestRequest$outboundSchema; /** @deprecated use `PostApiV1IndexerTestRequest$Outbound` instead. */ export type Outbound = PostApiV1IndexerTestRequest$Outbound; } export function postApiV1IndexerTestRequestToJSON( postApiV1IndexerTestRequest: PostApiV1IndexerTestRequest, ): string { return JSON.stringify( PostApiV1IndexerTestRequest$outboundSchema.parse( postApiV1IndexerTestRequest, ), ); } export function postApiV1IndexerTestRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PostApiV1IndexerTestRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PostApiV1IndexerTestRequest' from JSON`, ); }