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