/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; import { lazySchema as lazySchema$, safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as types from "../../types/primitives.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { PassThroughBody, PassThroughBody$inboundSchema, } from "./passthroughbody.js"; export type CollectionTicketComment = { /** * A unique identifier for an object. */ id?: string | undefined; /** * Body of the comment */ body?: string | null | undefined; /** * When custom mappings are configured on the resource, the result is included here. */ customMappings?: { [k: string]: any } | null | undefined; /** * The user who created the object. */ createdBy?: string | null | undefined; /** * The date and time when the object was last updated. */ updatedAt?: Date | null | undefined; /** * The date and time when the object was created. */ createdAt?: Date | 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 CollectionTicketComment$inboundSchema: z.ZodType< CollectionTicketComment, z.ZodTypeDef, unknown > = /* @__PURE__ */ lazySchema$(() => z.object({ id: types.optional(types.string()), body: z.nullable(types.string()).optional(), custom_mappings: z.nullable(z.record(z.any())).optional(), created_by: z.nullable(types.string()).optional(), updated_at: z.nullable(types.date()).optional(), created_at: z.nullable(types.date()).optional(), pass_through: types.optional(z.array(PassThroughBody$inboundSchema)), }).transform((v) => { return remap$(v, { "custom_mappings": "customMappings", "created_by": "createdBy", "updated_at": "updatedAt", "created_at": "createdAt", "pass_through": "passThrough", }); }) ); export function collectionTicketCommentFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CollectionTicketComment$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CollectionTicketComment' from JSON`, ); }