/* * 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 { PassThroughBody, PassThroughBody$inboundSchema, PassThroughBody$Outbound, PassThroughBody$outboundSchema, } from "./passthroughbody.js"; export type CollectionTicketCommentInput = { /** * Body of the comment */ body?: string | null | undefined; /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ passThrough?: Array | undefined; }; /** @internal */ export const CollectionTicketCommentInput$inboundSchema: z.ZodType< CollectionTicketCommentInput, z.ZodTypeDef, unknown > = z.object({ body: z.nullable(z.string()).optional(), pass_through: z.array(PassThroughBody$inboundSchema).optional(), }).transform((v) => { return remap$(v, { "pass_through": "passThrough", }); }); /** @internal */ export type CollectionTicketCommentInput$Outbound = { body?: string | null | undefined; pass_through?: Array | undefined; }; /** @internal */ export const CollectionTicketCommentInput$outboundSchema: z.ZodType< CollectionTicketCommentInput$Outbound, z.ZodTypeDef, CollectionTicketCommentInput > = z.object({ body: z.nullable(z.string()).optional(), passThrough: z.array(PassThroughBody$outboundSchema).optional(), }).transform((v) => { return remap$(v, { passThrough: "pass_through", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace CollectionTicketCommentInput$ { /** @deprecated use `CollectionTicketCommentInput$inboundSchema` instead. */ export const inboundSchema = CollectionTicketCommentInput$inboundSchema; /** @deprecated use `CollectionTicketCommentInput$outboundSchema` instead. */ export const outboundSchema = CollectionTicketCommentInput$outboundSchema; /** @deprecated use `CollectionTicketCommentInput$Outbound` instead. */ export type Outbound = CollectionTicketCommentInput$Outbound; } export function collectionTicketCommentInputToJSON( collectionTicketCommentInput: CollectionTicketCommentInput, ): string { return JSON.stringify( CollectionTicketCommentInput$outboundSchema.parse( collectionTicketCommentInput, ), ); } export function collectionTicketCommentInputFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CollectionTicketCommentInput$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CollectionTicketCommentInput' from JSON`, ); }