UNPKG

attio-js

Version:

Developer-friendly & type-safe JS/TS SDK based on the official OpenAPI spec of Attio.

78 lines 3.33 kB
/* * 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 { Thread$inboundSchema, Thread$outboundSchema, } from "../components/thread.js"; /** @internal */ export const GetV2ThreadsRequest$inboundSchema = z.object({ record_id: z.string().optional(), object: z.string().optional(), entry_id: z.string().optional(), list: z.string().optional(), limit: z.number().int().optional(), offset: z.number().int().optional(), }).transform((v) => { return remap$(v, { "record_id": "recordId", "entry_id": "entryId", }); }); /** @internal */ export const GetV2ThreadsRequest$outboundSchema = z.object({ recordId: z.string().optional(), object: z.string().optional(), entryId: z.string().optional(), list: z.string().optional(), limit: z.number().int().optional(), offset: z.number().int().optional(), }).transform((v) => { return remap$(v, { recordId: "record_id", entryId: "entry_id", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export var GetV2ThreadsRequest$; (function (GetV2ThreadsRequest$) { /** @deprecated use `GetV2ThreadsRequest$inboundSchema` instead. */ GetV2ThreadsRequest$.inboundSchema = GetV2ThreadsRequest$inboundSchema; /** @deprecated use `GetV2ThreadsRequest$outboundSchema` instead. */ GetV2ThreadsRequest$.outboundSchema = GetV2ThreadsRequest$outboundSchema; })(GetV2ThreadsRequest$ || (GetV2ThreadsRequest$ = {})); export function getV2ThreadsRequestToJSON(getV2ThreadsRequest) { return JSON.stringify(GetV2ThreadsRequest$outboundSchema.parse(getV2ThreadsRequest)); } export function getV2ThreadsRequestFromJSON(jsonString) { return safeParse(jsonString, (x) => GetV2ThreadsRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetV2ThreadsRequest' from JSON`); } /** @internal */ export const GetV2ThreadsResponse$inboundSchema = z.object({ data: z.array(Thread$inboundSchema), }); /** @internal */ export const GetV2ThreadsResponse$outboundSchema = z.object({ data: z.array(Thread$outboundSchema), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export var GetV2ThreadsResponse$; (function (GetV2ThreadsResponse$) { /** @deprecated use `GetV2ThreadsResponse$inboundSchema` instead. */ GetV2ThreadsResponse$.inboundSchema = GetV2ThreadsResponse$inboundSchema; /** @deprecated use `GetV2ThreadsResponse$outboundSchema` instead. */ GetV2ThreadsResponse$.outboundSchema = GetV2ThreadsResponse$outboundSchema; })(GetV2ThreadsResponse$ || (GetV2ThreadsResponse$ = {})); export function getV2ThreadsResponseToJSON(getV2ThreadsResponse) { return JSON.stringify(GetV2ThreadsResponse$outboundSchema.parse(getV2ThreadsResponse)); } export function getV2ThreadsResponseFromJSON(jsonString) { return safeParse(jsonString, (x) => GetV2ThreadsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetV2ThreadsResponse' from JSON`); } //# sourceMappingURL=getv2threads.js.map