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