attio-js
Version:
Developer-friendly & type-safe JS/TS SDK based on the official OpenAPI spec of Attio.
1,537 lines (1,418 loc) • 45 kB
text/typescript
/*
* 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 { ClosedEnum } from "../../types/enums.js";
import { Result as SafeParseResult } from "../../types/fp.js";
import {
Task,
Task$inboundSchema,
Task$Outbound,
Task$outboundSchema,
} from "../components/task.js";
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
/**
* The format of the task content to be created. Rich text formatting, links and @references are not supported.
*/
export const PostV2TasksFormat = {
Plaintext: "plaintext",
} as const;
/**
* The format of the task content to be created. Rich text formatting, links and @references are not supported.
*/
export type PostV2TasksFormat = ClosedEnum<typeof PostV2TasksFormat>;
export type PostV2TasksSlugOrIdOfMatchingAttribute5 = {
/**
* A raw text field. Values are limited to 10MB.
*/
value?: string | undefined;
};
/**
* The ISO 3166-1 alpha-2 country code representing the country that this phone number belongs to.
*/
export const PostV2TasksCountryCode = {
Af: "AF",
Ax: "AX",
Al: "AL",
Dz: "DZ",
As: "AS",
Ad: "AD",
Ao: "AO",
Ai: "AI",
Aq: "AQ",
Ag: "AG",
Ar: "AR",
Am: "AM",
Aw: "AW",
Au: "AU",
At: "AT",
Az: "AZ",
Bs: "BS",
Bh: "BH",
Bd: "BD",
Bb: "BB",
By: "BY",
Be: "BE",
Bz: "BZ",
Bj: "BJ",
Bm: "BM",
Bt: "BT",
Bo: "BO",
Ba: "BA",
Bw: "BW",
Bv: "BV",
Br: "BR",
Io: "IO",
Bn: "BN",
Bg: "BG",
Bf: "BF",
Bi: "BI",
Kh: "KH",
Cm: "CM",
Ca: "CA",
Cv: "CV",
Ky: "KY",
Cf: "CF",
Td: "TD",
Cl: "CL",
Cn: "CN",
Cx: "CX",
Cc: "CC",
Co: "CO",
Km: "KM",
Cg: "CG",
Cd: "CD",
Ck: "CK",
Cr: "CR",
Ci: "CI",
Hr: "HR",
Cu: "CU",
Cw: "CW",
Cy: "CY",
Cz: "CZ",
Dk: "DK",
Dj: "DJ",
Dm: "DM",
Do: "DO",
Ec: "EC",
Eg: "EG",
Sv: "SV",
Gq: "GQ",
Er: "ER",
Ee: "EE",
Et: "ET",
Fk: "FK",
Fo: "FO",
Fj: "FJ",
Fi: "FI",
Fr: "FR",
Gf: "GF",
Pf: "PF",
Tf: "TF",
Ga: "GA",
Gm: "GM",
Ge: "GE",
De: "DE",
Gh: "GH",
Gi: "GI",
Gr: "GR",
Gl: "GL",
Gd: "GD",
Gp: "GP",
Gu: "GU",
Gt: "GT",
Gg: "GG",
Gn: "GN",
Gw: "GW",
Gy: "GY",
Ht: "HT",
Hm: "HM",
Va: "VA",
Hn: "HN",
Hk: "HK",
Hu: "HU",
Is: "IS",
In: "IN",
Id: "ID",
Ir: "IR",
Iq: "IQ",
Ie: "IE",
Im: "IM",
Il: "IL",
It: "IT",
Jm: "JM",
Jp: "JP",
Je: "JE",
Jo: "JO",
Kz: "KZ",
Ke: "KE",
Ki: "KI",
Kr: "KR",
Kw: "KW",
Kg: "KG",
La: "LA",
Lv: "LV",
Lb: "LB",
Ls: "LS",
Lr: "LR",
Ly: "LY",
Li: "LI",
Lt: "LT",
Lu: "LU",
Mo: "MO",
Mk: "MK",
Mg: "MG",
Mw: "MW",
My: "MY",
Mv: "MV",
Ml: "ML",
Mt: "MT",
Mh: "MH",
Mq: "MQ",
Mr: "MR",
Mu: "MU",
Yt: "YT",
Mx: "MX",
Fm: "FM",
Md: "MD",
Mc: "MC",
Mn: "MN",
Me: "ME",
Ms: "MS",
Ma: "MA",
Mz: "MZ",
Mm: "MM",
Na: "NA",
Nr: "NR",
Np: "NP",
Nl: "NL",
An: "AN",
Nc: "NC",
Nz: "NZ",
Ni: "NI",
Ne: "NE",
Ng: "NG",
Nu: "NU",
Nf: "NF",
Mp: "MP",
No: "NO",
Om: "OM",
Pk: "PK",
Pw: "PW",
Ps: "PS",
Pa: "PA",
Pg: "PG",
Py: "PY",
Pe: "PE",
Ph: "PH",
Pn: "PN",
Pl: "PL",
Pt: "PT",
Pr: "PR",
Qa: "QA",
Re: "RE",
Ro: "RO",
Ru: "RU",
Rw: "RW",
Bl: "BL",
Sh: "SH",
Kn: "KN",
Lc: "LC",
Mf: "MF",
Pm: "PM",
Vc: "VC",
Ws: "WS",
Sm: "SM",
St: "ST",
Sa: "SA",
Sn: "SN",
Ss: "SS",
Rs: "RS",
Sc: "SC",
Sl: "SL",
Sg: "SG",
Sk: "SK",
Si: "SI",
Sb: "SB",
So: "SO",
Za: "ZA",
Gs: "GS",
Es: "ES",
Lk: "LK",
Sd: "SD",
Sr: "SR",
Sj: "SJ",
Sz: "SZ",
Se: "SE",
Ch: "CH",
Sy: "SY",
Tw: "TW",
Tj: "TJ",
Tz: "TZ",
Th: "TH",
Tl: "TL",
Tg: "TG",
Tk: "TK",
To: "TO",
Tt: "TT",
Tn: "TN",
Tr: "TR",
Tm: "TM",
Tc: "TC",
Tv: "TV",
Ug: "UG",
Ua: "UA",
Ae: "AE",
Gb: "GB",
Us: "US",
Um: "UM",
Uy: "UY",
Uz: "UZ",
Vu: "VU",
Ve: "VE",
Vn: "VN",
Vg: "VG",
Vi: "VI",
Wf: "WF",
Eh: "EH",
Ye: "YE",
Zm: "ZM",
Zw: "ZW",
} as const;
/**
* The ISO 3166-1 alpha-2 country code representing the country that this phone number belongs to.
*/
export type PostV2TasksCountryCode = ClosedEnum<typeof PostV2TasksCountryCode>;
export type PostV2TasksSlugOrIdOfMatchingAttribute4 = {
/**
* The raw, original phone number, as inputted.
*/
originalPhoneNumber?: string | undefined;
/**
* The ISO 3166-1 alpha-2 country code representing the country that this phone number belongs to.
*/
countryCode?: PostV2TasksCountryCode | null | undefined;
};
export type PostV2TasksSlugOrIdOfMatchingAttribute3 = {
/**
* Numbers are persisted as 64 bit floats.
*/
value?: number | undefined;
};
export type PostV2TasksSlugOrIdOfMatchingAttribute2 = {
/**
* An email address string
*/
emailAddress?: string | undefined;
};
export type PostV2TasksSlugOrIdOfMatchingAttribute1 = {
/**
* The full domain of the website.
*/
domain?: string | undefined;
};
export type PostV2TasksSlugOrIdOfMatchingAttributeUnion =
| PostV2TasksSlugOrIdOfMatchingAttribute1
| PostV2TasksSlugOrIdOfMatchingAttribute2
| PostV2TasksSlugOrIdOfMatchingAttribute3
| PostV2TasksSlugOrIdOfMatchingAttribute5
| PostV2TasksSlugOrIdOfMatchingAttribute4;
export type PostV2TasksLinkedRecord2 = {
/**
* A UUID or slug to identify the object that the referenced record belongs to.
*/
targetObject: string;
/**
* In addition to referencing records directly by record ID, you may also reference by a matching attribute of your choice. For example, if you want to add a reference to the person record with email "alice@website.com", you should pass a value with `target_object` set to `"people"` and `email_addresses` set to `[{email_address:"alice@website.com"}]`. The key should be the slug or ID of the matching attribute you would like to use and the value should be an array containing a single value of the appropriate attribute type (as specified below). Matching on multiple values is not currently supported. Matching attributes must be unique. This process is similar to how you use the `matching_attribute` query param in Attio's [assert endpoints](/reference/put_v2-objects-object-records).
*/
slugOrIdOfMatchingAttribute: Array<
| PostV2TasksSlugOrIdOfMatchingAttribute1
| PostV2TasksSlugOrIdOfMatchingAttribute2
| PostV2TasksSlugOrIdOfMatchingAttribute3
| PostV2TasksSlugOrIdOfMatchingAttribute5
| PostV2TasksSlugOrIdOfMatchingAttribute4
>;
};
export type PostV2TasksLinkedRecord1 = {
/**
* The ID or slug of the parent object the tasks refers to. This can reference both standard and custom objects.`
*/
targetObject: string;
/**
* The ID of the parent record the task refers to.
*/
targetRecordId: string;
};
export type PostV2TasksLinkedRecordUnion =
| PostV2TasksLinkedRecord1
| PostV2TasksLinkedRecord2;
export type PostV2TasksAssignee = {
/**
* Workspace member actors can be referenced by email address as well as actor ID.
*/
workspaceMemberEmailAddress: string;
};
/**
* The actor type of the task assignee. Only `workspace-member` actors can be assigned to tasks. [Read more information on actor types here](/docs/actors).
*/
export const PostV2TasksReferencedActorType = {
WorkspaceMember: "workspace-member",
} as const;
/**
* The actor type of the task assignee. Only `workspace-member` actors can be assigned to tasks. [Read more information on actor types here](/docs/actors).
*/
export type PostV2TasksReferencedActorType = ClosedEnum<
typeof PostV2TasksReferencedActorType
>;
export type PostV2TasksAssigneeWorkspaceMember = {
/**
* The actor type of the task assignee. Only `workspace-member` actors can be assigned to tasks. [Read more information on actor types here](/docs/actors).
*/
referencedActorType: PostV2TasksReferencedActorType;
/**
* The ID of the actor assigned to this task.
*/
referencedActorId: string;
};
export type PostV2TasksAssigneeUnion =
| PostV2TasksAssignee
| PostV2TasksAssigneeWorkspaceMember;
export type PostV2TasksData = {
/**
* The text content of the task, in the format specified by the `format` property.
*/
content: string;
/**
* The format of the task content to be created. Rich text formatting, links and @references are not supported.
*/
format: PostV2TasksFormat;
/**
* The deadline of the task, in ISO 8601 format.
*/
deadlineAt: string | null;
/**
* Whether the task has been completed.
*/
isCompleted: boolean;
/**
* Records linked to the task. Creating record links within task content text is not possible via the API at present.
*/
linkedRecords: Array<PostV2TasksLinkedRecord1 | PostV2TasksLinkedRecord2>;
/**
* Workspace members assigned to this task.
*/
assignees: Array<PostV2TasksAssignee | PostV2TasksAssigneeWorkspaceMember>;
};
export type PostV2TasksRequest = {
data: PostV2TasksData;
};
/**
* Success
*/
export type PostV2TasksResponse = {
data: Task;
};
/** @internal */
export const PostV2TasksFormat$inboundSchema: z.ZodNativeEnum<
typeof PostV2TasksFormat
> = z.nativeEnum(PostV2TasksFormat);
/** @internal */
export const PostV2TasksFormat$outboundSchema: z.ZodNativeEnum<
typeof PostV2TasksFormat
> = PostV2TasksFormat$inboundSchema;
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace PostV2TasksFormat$ {
/** @deprecated use `PostV2TasksFormat$inboundSchema` instead. */
export const inboundSchema = PostV2TasksFormat$inboundSchema;
/** @deprecated use `PostV2TasksFormat$outboundSchema` instead. */
export const outboundSchema = PostV2TasksFormat$outboundSchema;
}
/** @internal */
export const PostV2TasksSlugOrIdOfMatchingAttribute5$inboundSchema: z.ZodType<
PostV2TasksSlugOrIdOfMatchingAttribute5,
z.ZodTypeDef,
unknown
> = z.object({
value: z.string().optional(),
});
/** @internal */
export type PostV2TasksSlugOrIdOfMatchingAttribute5$Outbound = {
value?: string | undefined;
};
/** @internal */
export const PostV2TasksSlugOrIdOfMatchingAttribute5$outboundSchema: z.ZodType<
PostV2TasksSlugOrIdOfMatchingAttribute5$Outbound,
z.ZodTypeDef,
PostV2TasksSlugOrIdOfMatchingAttribute5
> = z.object({
value: z.string().optional(),
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace PostV2TasksSlugOrIdOfMatchingAttribute5$ {
/** @deprecated use `PostV2TasksSlugOrIdOfMatchingAttribute5$inboundSchema` instead. */
export const inboundSchema =
PostV2TasksSlugOrIdOfMatchingAttribute5$inboundSchema;
/** @deprecated use `PostV2TasksSlugOrIdOfMatchingAttribute5$outboundSchema` instead. */
export const outboundSchema =
PostV2TasksSlugOrIdOfMatchingAttribute5$outboundSchema;
/** @deprecated use `PostV2TasksSlugOrIdOfMatchingAttribute5$Outbound` instead. */
export type Outbound = PostV2TasksSlugOrIdOfMatchingAttribute5$Outbound;
}
export function postV2TasksSlugOrIdOfMatchingAttribute5ToJSON(
postV2TasksSlugOrIdOfMatchingAttribute5:
PostV2TasksSlugOrIdOfMatchingAttribute5,
): string {
return JSON.stringify(
PostV2TasksSlugOrIdOfMatchingAttribute5$outboundSchema.parse(
postV2TasksSlugOrIdOfMatchingAttribute5,
),
);
}
export function postV2TasksSlugOrIdOfMatchingAttribute5FromJSON(
jsonString: string,
): SafeParseResult<
PostV2TasksSlugOrIdOfMatchingAttribute5,
SDKValidationError
> {
return safeParse(
jsonString,
(x) =>
PostV2TasksSlugOrIdOfMatchingAttribute5$inboundSchema.parse(
JSON.parse(x),
),
`Failed to parse 'PostV2TasksSlugOrIdOfMatchingAttribute5' from JSON`,
);
}
/** @internal */
export const PostV2TasksCountryCode$inboundSchema: z.ZodNativeEnum<
typeof PostV2TasksCountryCode
> = z.nativeEnum(PostV2TasksCountryCode);
/** @internal */
export const PostV2TasksCountryCode$outboundSchema: z.ZodNativeEnum<
typeof PostV2TasksCountryCode
> = PostV2TasksCountryCode$inboundSchema;
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace PostV2TasksCountryCode$ {
/** @deprecated use `PostV2TasksCountryCode$inboundSchema` instead. */
export const inboundSchema = PostV2TasksCountryCode$inboundSchema;
/** @deprecated use `PostV2TasksCountryCode$outboundSchema` instead. */
export const outboundSchema = PostV2TasksCountryCode$outboundSchema;
}
/** @internal */
export const PostV2TasksSlugOrIdOfMatchingAttribute4$inboundSchema: z.ZodType<
PostV2TasksSlugOrIdOfMatchingAttribute4,
z.ZodTypeDef,
unknown
> = z.object({
original_phone_number: z.string().optional(),
country_code: z.nullable(PostV2TasksCountryCode$inboundSchema).optional(),
}).transform((v) => {
return remap$(v, {
"original_phone_number": "originalPhoneNumber",
"country_code": "countryCode",
});
});
/** @internal */
export type PostV2TasksSlugOrIdOfMatchingAttribute4$Outbound = {
original_phone_number?: string | undefined;
country_code?: string | null | undefined;
};
/** @internal */
export const PostV2TasksSlugOrIdOfMatchingAttribute4$outboundSchema: z.ZodType<
PostV2TasksSlugOrIdOfMatchingAttribute4$Outbound,
z.ZodTypeDef,
PostV2TasksSlugOrIdOfMatchingAttribute4
> = z.object({
originalPhoneNumber: z.string().optional(),
countryCode: z.nullable(PostV2TasksCountryCode$outboundSchema).optional(),
}).transform((v) => {
return remap$(v, {
originalPhoneNumber: "original_phone_number",
countryCode: "country_code",
});
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace PostV2TasksSlugOrIdOfMatchingAttribute4$ {
/** @deprecated use `PostV2TasksSlugOrIdOfMatchingAttribute4$inboundSchema` instead. */
export const inboundSchema =
PostV2TasksSlugOrIdOfMatchingAttribute4$inboundSchema;
/** @deprecated use `PostV2TasksSlugOrIdOfMatchingAttribute4$outboundSchema` instead. */
export const outboundSchema =
PostV2TasksSlugOrIdOfMatchingAttribute4$outboundSchema;
/** @deprecated use `PostV2TasksSlugOrIdOfMatchingAttribute4$Outbound` instead. */
export type Outbound = PostV2TasksSlugOrIdOfMatchingAttribute4$Outbound;
}
export function postV2TasksSlugOrIdOfMatchingAttribute4ToJSON(
postV2TasksSlugOrIdOfMatchingAttribute4:
PostV2TasksSlugOrIdOfMatchingAttribute4,
): string {
return JSON.stringify(
PostV2TasksSlugOrIdOfMatchingAttribute4$outboundSchema.parse(
postV2TasksSlugOrIdOfMatchingAttribute4,
),
);
}
export function postV2TasksSlugOrIdOfMatchingAttribute4FromJSON(
jsonString: string,
): SafeParseResult<
PostV2TasksSlugOrIdOfMatchingAttribute4,
SDKValidationError
> {
return safeParse(
jsonString,
(x) =>
PostV2TasksSlugOrIdOfMatchingAttribute4$inboundSchema.parse(
JSON.parse(x),
),
`Failed to parse 'PostV2TasksSlugOrIdOfMatchingAttribute4' from JSON`,
);
}
/** @internal */
export const PostV2TasksSlugOrIdOfMatchingAttribute3$inboundSchema: z.ZodType<
PostV2TasksSlugOrIdOfMatchingAttribute3,
z.ZodTypeDef,
unknown
> = z.object({
value: z.number().optional(),
});
/** @internal */
export type PostV2TasksSlugOrIdOfMatchingAttribute3$Outbound = {
value?: number | undefined;
};
/** @internal */
export const PostV2TasksSlugOrIdOfMatchingAttribute3$outboundSchema: z.ZodType<
PostV2TasksSlugOrIdOfMatchingAttribute3$Outbound,
z.ZodTypeDef,
PostV2TasksSlugOrIdOfMatchingAttribute3
> = z.object({
value: z.number().optional(),
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace PostV2TasksSlugOrIdOfMatchingAttribute3$ {
/** @deprecated use `PostV2TasksSlugOrIdOfMatchingAttribute3$inboundSchema` instead. */
export const inboundSchema =
PostV2TasksSlugOrIdOfMatchingAttribute3$inboundSchema;
/** @deprecated use `PostV2TasksSlugOrIdOfMatchingAttribute3$outboundSchema` instead. */
export const outboundSchema =
PostV2TasksSlugOrIdOfMatchingAttribute3$outboundSchema;
/** @deprecated use `PostV2TasksSlugOrIdOfMatchingAttribute3$Outbound` instead. */
export type Outbound = PostV2TasksSlugOrIdOfMatchingAttribute3$Outbound;
}
export function postV2TasksSlugOrIdOfMatchingAttribute3ToJSON(
postV2TasksSlugOrIdOfMatchingAttribute3:
PostV2TasksSlugOrIdOfMatchingAttribute3,
): string {
return JSON.stringify(
PostV2TasksSlugOrIdOfMatchingAttribute3$outboundSchema.parse(
postV2TasksSlugOrIdOfMatchingAttribute3,
),
);
}
export function postV2TasksSlugOrIdOfMatchingAttribute3FromJSON(
jsonString: string,
): SafeParseResult<
PostV2TasksSlugOrIdOfMatchingAttribute3,
SDKValidationError
> {
return safeParse(
jsonString,
(x) =>
PostV2TasksSlugOrIdOfMatchingAttribute3$inboundSchema.parse(
JSON.parse(x),
),
`Failed to parse 'PostV2TasksSlugOrIdOfMatchingAttribute3' from JSON`,
);
}
/** @internal */
export const PostV2TasksSlugOrIdOfMatchingAttribute2$inboundSchema: z.ZodType<
PostV2TasksSlugOrIdOfMatchingAttribute2,
z.ZodTypeDef,
unknown
> = z.object({
email_address: z.string().optional(),
}).transform((v) => {
return remap$(v, {
"email_address": "emailAddress",
});
});
/** @internal */
export type PostV2TasksSlugOrIdOfMatchingAttribute2$Outbound = {
email_address?: string | undefined;
};
/** @internal */
export const PostV2TasksSlugOrIdOfMatchingAttribute2$outboundSchema: z.ZodType<
PostV2TasksSlugOrIdOfMatchingAttribute2$Outbound,
z.ZodTypeDef,
PostV2TasksSlugOrIdOfMatchingAttribute2
> = z.object({
emailAddress: z.string().optional(),
}).transform((v) => {
return remap$(v, {
emailAddress: "email_address",
});
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace PostV2TasksSlugOrIdOfMatchingAttribute2$ {
/** @deprecated use `PostV2TasksSlugOrIdOfMatchingAttribute2$inboundSchema` instead. */
export const inboundSchema =
PostV2TasksSlugOrIdOfMatchingAttribute2$inboundSchema;
/** @deprecated use `PostV2TasksSlugOrIdOfMatchingAttribute2$outboundSchema` instead. */
export const outboundSchema =
PostV2TasksSlugOrIdOfMatchingAttribute2$outboundSchema;
/** @deprecated use `PostV2TasksSlugOrIdOfMatchingAttribute2$Outbound` instead. */
export type Outbound = PostV2TasksSlugOrIdOfMatchingAttribute2$Outbound;
}
export function postV2TasksSlugOrIdOfMatchingAttribute2ToJSON(
postV2TasksSlugOrIdOfMatchingAttribute2:
PostV2TasksSlugOrIdOfMatchingAttribute2,
): string {
return JSON.stringify(
PostV2TasksSlugOrIdOfMatchingAttribute2$outboundSchema.parse(
postV2TasksSlugOrIdOfMatchingAttribute2,
),
);
}
export function postV2TasksSlugOrIdOfMatchingAttribute2FromJSON(
jsonString: string,
): SafeParseResult<
PostV2TasksSlugOrIdOfMatchingAttribute2,
SDKValidationError
> {
return safeParse(
jsonString,
(x) =>
PostV2TasksSlugOrIdOfMatchingAttribute2$inboundSchema.parse(
JSON.parse(x),
),
`Failed to parse 'PostV2TasksSlugOrIdOfMatchingAttribute2' from JSON`,
);
}
/** @internal */
export const PostV2TasksSlugOrIdOfMatchingAttribute1$inboundSchema: z.ZodType<
PostV2TasksSlugOrIdOfMatchingAttribute1,
z.ZodTypeDef,
unknown
> = z.object({
domain: z.string().optional(),
});
/** @internal */
export type PostV2TasksSlugOrIdOfMatchingAttribute1$Outbound = {
domain?: string | undefined;
};
/** @internal */
export const PostV2TasksSlugOrIdOfMatchingAttribute1$outboundSchema: z.ZodType<
PostV2TasksSlugOrIdOfMatchingAttribute1$Outbound,
z.ZodTypeDef,
PostV2TasksSlugOrIdOfMatchingAttribute1
> = z.object({
domain: z.string().optional(),
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace PostV2TasksSlugOrIdOfMatchingAttribute1$ {
/** @deprecated use `PostV2TasksSlugOrIdOfMatchingAttribute1$inboundSchema` instead. */
export const inboundSchema =
PostV2TasksSlugOrIdOfMatchingAttribute1$inboundSchema;
/** @deprecated use `PostV2TasksSlugOrIdOfMatchingAttribute1$outboundSchema` instead. */
export const outboundSchema =
PostV2TasksSlugOrIdOfMatchingAttribute1$outboundSchema;
/** @deprecated use `PostV2TasksSlugOrIdOfMatchingAttribute1$Outbound` instead. */
export type Outbound = PostV2TasksSlugOrIdOfMatchingAttribute1$Outbound;
}
export function postV2TasksSlugOrIdOfMatchingAttribute1ToJSON(
postV2TasksSlugOrIdOfMatchingAttribute1:
PostV2TasksSlugOrIdOfMatchingAttribute1,
): string {
return JSON.stringify(
PostV2TasksSlugOrIdOfMatchingAttribute1$outboundSchema.parse(
postV2TasksSlugOrIdOfMatchingAttribute1,
),
);
}
export function postV2TasksSlugOrIdOfMatchingAttribute1FromJSON(
jsonString: string,
): SafeParseResult<
PostV2TasksSlugOrIdOfMatchingAttribute1,
SDKValidationError
> {
return safeParse(
jsonString,
(x) =>
PostV2TasksSlugOrIdOfMatchingAttribute1$inboundSchema.parse(
JSON.parse(x),
),
`Failed to parse 'PostV2TasksSlugOrIdOfMatchingAttribute1' from JSON`,
);
}
/** @internal */
export const PostV2TasksSlugOrIdOfMatchingAttributeUnion$inboundSchema:
z.ZodType<
PostV2TasksSlugOrIdOfMatchingAttributeUnion,
z.ZodTypeDef,
unknown
> = z.union([
z.lazy(() => PostV2TasksSlugOrIdOfMatchingAttribute1$inboundSchema),
z.lazy(() => PostV2TasksSlugOrIdOfMatchingAttribute2$inboundSchema),
z.lazy(() => PostV2TasksSlugOrIdOfMatchingAttribute3$inboundSchema),
z.lazy(() => PostV2TasksSlugOrIdOfMatchingAttribute5$inboundSchema),
z.lazy(() => PostV2TasksSlugOrIdOfMatchingAttribute4$inboundSchema),
]);
/** @internal */
export type PostV2TasksSlugOrIdOfMatchingAttributeUnion$Outbound =
| PostV2TasksSlugOrIdOfMatchingAttribute1$Outbound
| PostV2TasksSlugOrIdOfMatchingAttribute2$Outbound
| PostV2TasksSlugOrIdOfMatchingAttribute3$Outbound
| PostV2TasksSlugOrIdOfMatchingAttribute5$Outbound
| PostV2TasksSlugOrIdOfMatchingAttribute4$Outbound;
/** @internal */
export const PostV2TasksSlugOrIdOfMatchingAttributeUnion$outboundSchema:
z.ZodType<
PostV2TasksSlugOrIdOfMatchingAttributeUnion$Outbound,
z.ZodTypeDef,
PostV2TasksSlugOrIdOfMatchingAttributeUnion
> = z.union([
z.lazy(() => PostV2TasksSlugOrIdOfMatchingAttribute1$outboundSchema),
z.lazy(() => PostV2TasksSlugOrIdOfMatchingAttribute2$outboundSchema),
z.lazy(() => PostV2TasksSlugOrIdOfMatchingAttribute3$outboundSchema),
z.lazy(() => PostV2TasksSlugOrIdOfMatchingAttribute5$outboundSchema),
z.lazy(() => PostV2TasksSlugOrIdOfMatchingAttribute4$outboundSchema),
]);
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace PostV2TasksSlugOrIdOfMatchingAttributeUnion$ {
/** @deprecated use `PostV2TasksSlugOrIdOfMatchingAttributeUnion$inboundSchema` instead. */
export const inboundSchema =
PostV2TasksSlugOrIdOfMatchingAttributeUnion$inboundSchema;
/** @deprecated use `PostV2TasksSlugOrIdOfMatchingAttributeUnion$outboundSchema` instead. */
export const outboundSchema =
PostV2TasksSlugOrIdOfMatchingAttributeUnion$outboundSchema;
/** @deprecated use `PostV2TasksSlugOrIdOfMatchingAttributeUnion$Outbound` instead. */
export type Outbound = PostV2TasksSlugOrIdOfMatchingAttributeUnion$Outbound;
}
export function postV2TasksSlugOrIdOfMatchingAttributeUnionToJSON(
postV2TasksSlugOrIdOfMatchingAttributeUnion:
PostV2TasksSlugOrIdOfMatchingAttributeUnion,
): string {
return JSON.stringify(
PostV2TasksSlugOrIdOfMatchingAttributeUnion$outboundSchema.parse(
postV2TasksSlugOrIdOfMatchingAttributeUnion,
),
);
}
export function postV2TasksSlugOrIdOfMatchingAttributeUnionFromJSON(
jsonString: string,
): SafeParseResult<
PostV2TasksSlugOrIdOfMatchingAttributeUnion,
SDKValidationError
> {
return safeParse(
jsonString,
(x) =>
PostV2TasksSlugOrIdOfMatchingAttributeUnion$inboundSchema.parse(
JSON.parse(x),
),
`Failed to parse 'PostV2TasksSlugOrIdOfMatchingAttributeUnion' from JSON`,
);
}
/** @internal */
export const PostV2TasksLinkedRecord2$inboundSchema: z.ZodType<
PostV2TasksLinkedRecord2,
z.ZodTypeDef,
unknown
> = z.object({
target_object: z.string(),
"[slug_or_id_of_matching_attribute]": z.array(
z.union([
z.lazy(() => PostV2TasksSlugOrIdOfMatchingAttribute1$inboundSchema),
z.lazy(() => PostV2TasksSlugOrIdOfMatchingAttribute2$inboundSchema),
z.lazy(() => PostV2TasksSlugOrIdOfMatchingAttribute3$inboundSchema),
z.lazy(() => PostV2TasksSlugOrIdOfMatchingAttribute5$inboundSchema),
z.lazy(() => PostV2TasksSlugOrIdOfMatchingAttribute4$inboundSchema),
]),
),
}).transform((v) => {
return remap$(v, {
"target_object": "targetObject",
"[slug_or_id_of_matching_attribute]": "slugOrIdOfMatchingAttribute",
});
});
/** @internal */
export type PostV2TasksLinkedRecord2$Outbound = {
target_object: string;
"[slug_or_id_of_matching_attribute]": Array<
| PostV2TasksSlugOrIdOfMatchingAttribute1$Outbound
| PostV2TasksSlugOrIdOfMatchingAttribute2$Outbound
| PostV2TasksSlugOrIdOfMatchingAttribute3$Outbound
| PostV2TasksSlugOrIdOfMatchingAttribute5$Outbound
| PostV2TasksSlugOrIdOfMatchingAttribute4$Outbound
>;
};
/** @internal */
export const PostV2TasksLinkedRecord2$outboundSchema: z.ZodType<
PostV2TasksLinkedRecord2$Outbound,
z.ZodTypeDef,
PostV2TasksLinkedRecord2
> = z.object({
targetObject: z.string(),
slugOrIdOfMatchingAttribute: z.array(
z.union([
z.lazy(() => PostV2TasksSlugOrIdOfMatchingAttribute1$outboundSchema),
z.lazy(() => PostV2TasksSlugOrIdOfMatchingAttribute2$outboundSchema),
z.lazy(() => PostV2TasksSlugOrIdOfMatchingAttribute3$outboundSchema),
z.lazy(() => PostV2TasksSlugOrIdOfMatchingAttribute5$outboundSchema),
z.lazy(() => PostV2TasksSlugOrIdOfMatchingAttribute4$outboundSchema),
]),
),
}).transform((v) => {
return remap$(v, {
targetObject: "target_object",
slugOrIdOfMatchingAttribute: "[slug_or_id_of_matching_attribute]",
});
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace PostV2TasksLinkedRecord2$ {
/** @deprecated use `PostV2TasksLinkedRecord2$inboundSchema` instead. */
export const inboundSchema = PostV2TasksLinkedRecord2$inboundSchema;
/** @deprecated use `PostV2TasksLinkedRecord2$outboundSchema` instead. */
export const outboundSchema = PostV2TasksLinkedRecord2$outboundSchema;
/** @deprecated use `PostV2TasksLinkedRecord2$Outbound` instead. */
export type Outbound = PostV2TasksLinkedRecord2$Outbound;
}
export function postV2TasksLinkedRecord2ToJSON(
postV2TasksLinkedRecord2: PostV2TasksLinkedRecord2,
): string {
return JSON.stringify(
PostV2TasksLinkedRecord2$outboundSchema.parse(postV2TasksLinkedRecord2),
);
}
export function postV2TasksLinkedRecord2FromJSON(
jsonString: string,
): SafeParseResult<PostV2TasksLinkedRecord2, SDKValidationError> {
return safeParse(
jsonString,
(x) => PostV2TasksLinkedRecord2$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PostV2TasksLinkedRecord2' from JSON`,
);
}
/** @internal */
export const PostV2TasksLinkedRecord1$inboundSchema: z.ZodType<
PostV2TasksLinkedRecord1,
z.ZodTypeDef,
unknown
> = z.object({
target_object: z.string(),
target_record_id: z.string(),
}).transform((v) => {
return remap$(v, {
"target_object": "targetObject",
"target_record_id": "targetRecordId",
});
});
/** @internal */
export type PostV2TasksLinkedRecord1$Outbound = {
target_object: string;
target_record_id: string;
};
/** @internal */
export const PostV2TasksLinkedRecord1$outboundSchema: z.ZodType<
PostV2TasksLinkedRecord1$Outbound,
z.ZodTypeDef,
PostV2TasksLinkedRecord1
> = z.object({
targetObject: z.string(),
targetRecordId: z.string(),
}).transform((v) => {
return remap$(v, {
targetObject: "target_object",
targetRecordId: "target_record_id",
});
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace PostV2TasksLinkedRecord1$ {
/** @deprecated use `PostV2TasksLinkedRecord1$inboundSchema` instead. */
export const inboundSchema = PostV2TasksLinkedRecord1$inboundSchema;
/** @deprecated use `PostV2TasksLinkedRecord1$outboundSchema` instead. */
export const outboundSchema = PostV2TasksLinkedRecord1$outboundSchema;
/** @deprecated use `PostV2TasksLinkedRecord1$Outbound` instead. */
export type Outbound = PostV2TasksLinkedRecord1$Outbound;
}
export function postV2TasksLinkedRecord1ToJSON(
postV2TasksLinkedRecord1: PostV2TasksLinkedRecord1,
): string {
return JSON.stringify(
PostV2TasksLinkedRecord1$outboundSchema.parse(postV2TasksLinkedRecord1),
);
}
export function postV2TasksLinkedRecord1FromJSON(
jsonString: string,
): SafeParseResult<PostV2TasksLinkedRecord1, SDKValidationError> {
return safeParse(
jsonString,
(x) => PostV2TasksLinkedRecord1$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PostV2TasksLinkedRecord1' from JSON`,
);
}
/** @internal */
export const PostV2TasksLinkedRecordUnion$inboundSchema: z.ZodType<
PostV2TasksLinkedRecordUnion,
z.ZodTypeDef,
unknown
> = z.union([
z.lazy(() => PostV2TasksLinkedRecord1$inboundSchema),
z.lazy(() => PostV2TasksLinkedRecord2$inboundSchema),
]);
/** @internal */
export type PostV2TasksLinkedRecordUnion$Outbound =
| PostV2TasksLinkedRecord1$Outbound
| PostV2TasksLinkedRecord2$Outbound;
/** @internal */
export const PostV2TasksLinkedRecordUnion$outboundSchema: z.ZodType<
PostV2TasksLinkedRecordUnion$Outbound,
z.ZodTypeDef,
PostV2TasksLinkedRecordUnion
> = z.union([
z.lazy(() => PostV2TasksLinkedRecord1$outboundSchema),
z.lazy(() => PostV2TasksLinkedRecord2$outboundSchema),
]);
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace PostV2TasksLinkedRecordUnion$ {
/** @deprecated use `PostV2TasksLinkedRecordUnion$inboundSchema` instead. */
export const inboundSchema = PostV2TasksLinkedRecordUnion$inboundSchema;
/** @deprecated use `PostV2TasksLinkedRecordUnion$outboundSchema` instead. */
export const outboundSchema = PostV2TasksLinkedRecordUnion$outboundSchema;
/** @deprecated use `PostV2TasksLinkedRecordUnion$Outbound` instead. */
export type Outbound = PostV2TasksLinkedRecordUnion$Outbound;
}
export function postV2TasksLinkedRecordUnionToJSON(
postV2TasksLinkedRecordUnion: PostV2TasksLinkedRecordUnion,
): string {
return JSON.stringify(
PostV2TasksLinkedRecordUnion$outboundSchema.parse(
postV2TasksLinkedRecordUnion,
),
);
}
export function postV2TasksLinkedRecordUnionFromJSON(
jsonString: string,
): SafeParseResult<PostV2TasksLinkedRecordUnion, SDKValidationError> {
return safeParse(
jsonString,
(x) => PostV2TasksLinkedRecordUnion$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PostV2TasksLinkedRecordUnion' from JSON`,
);
}
/** @internal */
export const PostV2TasksAssignee$inboundSchema: z.ZodType<
PostV2TasksAssignee,
z.ZodTypeDef,
unknown
> = z.object({
workspace_member_email_address: z.string(),
}).transform((v) => {
return remap$(v, {
"workspace_member_email_address": "workspaceMemberEmailAddress",
});
});
/** @internal */
export type PostV2TasksAssignee$Outbound = {
workspace_member_email_address: string;
};
/** @internal */
export const PostV2TasksAssignee$outboundSchema: z.ZodType<
PostV2TasksAssignee$Outbound,
z.ZodTypeDef,
PostV2TasksAssignee
> = z.object({
workspaceMemberEmailAddress: z.string(),
}).transform((v) => {
return remap$(v, {
workspaceMemberEmailAddress: "workspace_member_email_address",
});
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace PostV2TasksAssignee$ {
/** @deprecated use `PostV2TasksAssignee$inboundSchema` instead. */
export const inboundSchema = PostV2TasksAssignee$inboundSchema;
/** @deprecated use `PostV2TasksAssignee$outboundSchema` instead. */
export const outboundSchema = PostV2TasksAssignee$outboundSchema;
/** @deprecated use `PostV2TasksAssignee$Outbound` instead. */
export type Outbound = PostV2TasksAssignee$Outbound;
}
export function postV2TasksAssigneeToJSON(
postV2TasksAssignee: PostV2TasksAssignee,
): string {
return JSON.stringify(
PostV2TasksAssignee$outboundSchema.parse(postV2TasksAssignee),
);
}
export function postV2TasksAssigneeFromJSON(
jsonString: string,
): SafeParseResult<PostV2TasksAssignee, SDKValidationError> {
return safeParse(
jsonString,
(x) => PostV2TasksAssignee$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PostV2TasksAssignee' from JSON`,
);
}
/** @internal */
export const PostV2TasksReferencedActorType$inboundSchema: z.ZodNativeEnum<
typeof PostV2TasksReferencedActorType
> = z.nativeEnum(PostV2TasksReferencedActorType);
/** @internal */
export const PostV2TasksReferencedActorType$outboundSchema: z.ZodNativeEnum<
typeof PostV2TasksReferencedActorType
> = PostV2TasksReferencedActorType$inboundSchema;
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace PostV2TasksReferencedActorType$ {
/** @deprecated use `PostV2TasksReferencedActorType$inboundSchema` instead. */
export const inboundSchema = PostV2TasksReferencedActorType$inboundSchema;
/** @deprecated use `PostV2TasksReferencedActorType$outboundSchema` instead. */
export const outboundSchema = PostV2TasksReferencedActorType$outboundSchema;
}
/** @internal */
export const PostV2TasksAssigneeWorkspaceMember$inboundSchema: z.ZodType<
PostV2TasksAssigneeWorkspaceMember,
z.ZodTypeDef,
unknown
> = z.object({
referenced_actor_type: PostV2TasksReferencedActorType$inboundSchema,
referenced_actor_id: z.string(),
}).transform((v) => {
return remap$(v, {
"referenced_actor_type": "referencedActorType",
"referenced_actor_id": "referencedActorId",
});
});
/** @internal */
export type PostV2TasksAssigneeWorkspaceMember$Outbound = {
referenced_actor_type: string;
referenced_actor_id: string;
};
/** @internal */
export const PostV2TasksAssigneeWorkspaceMember$outboundSchema: z.ZodType<
PostV2TasksAssigneeWorkspaceMember$Outbound,
z.ZodTypeDef,
PostV2TasksAssigneeWorkspaceMember
> = z.object({
referencedActorType: PostV2TasksReferencedActorType$outboundSchema,
referencedActorId: z.string(),
}).transform((v) => {
return remap$(v, {
referencedActorType: "referenced_actor_type",
referencedActorId: "referenced_actor_id",
});
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace PostV2TasksAssigneeWorkspaceMember$ {
/** @deprecated use `PostV2TasksAssigneeWorkspaceMember$inboundSchema` instead. */
export const inboundSchema = PostV2TasksAssigneeWorkspaceMember$inboundSchema;
/** @deprecated use `PostV2TasksAssigneeWorkspaceMember$outboundSchema` instead. */
export const outboundSchema =
PostV2TasksAssigneeWorkspaceMember$outboundSchema;
/** @deprecated use `PostV2TasksAssigneeWorkspaceMember$Outbound` instead. */
export type Outbound = PostV2TasksAssigneeWorkspaceMember$Outbound;
}
export function postV2TasksAssigneeWorkspaceMemberToJSON(
postV2TasksAssigneeWorkspaceMember: PostV2TasksAssigneeWorkspaceMember,
): string {
return JSON.stringify(
PostV2TasksAssigneeWorkspaceMember$outboundSchema.parse(
postV2TasksAssigneeWorkspaceMember,
),
);
}
export function postV2TasksAssigneeWorkspaceMemberFromJSON(
jsonString: string,
): SafeParseResult<PostV2TasksAssigneeWorkspaceMember, SDKValidationError> {
return safeParse(
jsonString,
(x) =>
PostV2TasksAssigneeWorkspaceMember$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PostV2TasksAssigneeWorkspaceMember' from JSON`,
);
}
/** @internal */
export const PostV2TasksAssigneeUnion$inboundSchema: z.ZodType<
PostV2TasksAssigneeUnion,
z.ZodTypeDef,
unknown
> = z.union([
z.lazy(() => PostV2TasksAssignee$inboundSchema),
z.lazy(() => PostV2TasksAssigneeWorkspaceMember$inboundSchema),
]);
/** @internal */
export type PostV2TasksAssigneeUnion$Outbound =
| PostV2TasksAssignee$Outbound
| PostV2TasksAssigneeWorkspaceMember$Outbound;
/** @internal */
export const PostV2TasksAssigneeUnion$outboundSchema: z.ZodType<
PostV2TasksAssigneeUnion$Outbound,
z.ZodTypeDef,
PostV2TasksAssigneeUnion
> = z.union([
z.lazy(() => PostV2TasksAssignee$outboundSchema),
z.lazy(() => PostV2TasksAssigneeWorkspaceMember$outboundSchema),
]);
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace PostV2TasksAssigneeUnion$ {
/** @deprecated use `PostV2TasksAssigneeUnion$inboundSchema` instead. */
export const inboundSchema = PostV2TasksAssigneeUnion$inboundSchema;
/** @deprecated use `PostV2TasksAssigneeUnion$outboundSchema` instead. */
export const outboundSchema = PostV2TasksAssigneeUnion$outboundSchema;
/** @deprecated use `PostV2TasksAssigneeUnion$Outbound` instead. */
export type Outbound = PostV2TasksAssigneeUnion$Outbound;
}
export function postV2TasksAssigneeUnionToJSON(
postV2TasksAssigneeUnion: PostV2TasksAssigneeUnion,
): string {
return JSON.stringify(
PostV2TasksAssigneeUnion$outboundSchema.parse(postV2TasksAssigneeUnion),
);
}
export function postV2TasksAssigneeUnionFromJSON(
jsonString: string,
): SafeParseResult<PostV2TasksAssigneeUnion, SDKValidationError> {
return safeParse(
jsonString,
(x) => PostV2TasksAssigneeUnion$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PostV2TasksAssigneeUnion' from JSON`,
);
}
/** @internal */
export const PostV2TasksData$inboundSchema: z.ZodType<
PostV2TasksData,
z.ZodTypeDef,
unknown
> = z.object({
content: z.string(),
format: PostV2TasksFormat$inboundSchema,
deadline_at: z.nullable(z.string()),
is_completed: z.boolean(),
linked_records: z.array(
z.union([
z.lazy(() => PostV2TasksLinkedRecord1$inboundSchema),
z.lazy(() => PostV2TasksLinkedRecord2$inboundSchema),
]),
),
assignees: z.array(
z.union([
z.lazy(() => PostV2TasksAssignee$inboundSchema),
z.lazy(() => PostV2TasksAssigneeWorkspaceMember$inboundSchema),
]),
),
}).transform((v) => {
return remap$(v, {
"deadline_at": "deadlineAt",
"is_completed": "isCompleted",
"linked_records": "linkedRecords",
});
});
/** @internal */
export type PostV2TasksData$Outbound = {
content: string;
format: string;
deadline_at: string | null;
is_completed: boolean;
linked_records: Array<
PostV2TasksLinkedRecord1$Outbound | PostV2TasksLinkedRecord2$Outbound
>;
assignees: Array<
PostV2TasksAssignee$Outbound | PostV2TasksAssigneeWorkspaceMember$Outbound
>;
};
/** @internal */
export const PostV2TasksData$outboundSchema: z.ZodType<
PostV2TasksData$Outbound,
z.ZodTypeDef,
PostV2TasksData
> = z.object({
content: z.string(),
format: PostV2TasksFormat$outboundSchema,
deadlineAt: z.nullable(z.string()),
isCompleted: z.boolean(),
linkedRecords: z.array(
z.union([
z.lazy(() => PostV2TasksLinkedRecord1$outboundSchema),
z.lazy(() => PostV2TasksLinkedRecord2$outboundSchema),
]),
),
assignees: z.array(
z.union([
z.lazy(() => PostV2TasksAssignee$outboundSchema),
z.lazy(() => PostV2TasksAssigneeWorkspaceMember$outboundSchema),
]),
),
}).transform((v) => {
return remap$(v, {
deadlineAt: "deadline_at",
isCompleted: "is_completed",
linkedRecords: "linked_records",
});
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace PostV2TasksData$ {
/** @deprecated use `PostV2TasksData$inboundSchema` instead. */
export const inboundSchema = PostV2TasksData$inboundSchema;
/** @deprecated use `PostV2TasksData$outboundSchema` instead. */
export const outboundSchema = PostV2TasksData$outboundSchema;
/** @deprecated use `PostV2TasksData$Outbound` instead. */
export type Outbound = PostV2TasksData$Outbound;
}
export function postV2TasksDataToJSON(
postV2TasksData: PostV2TasksData,
): string {
return JSON.stringify(PostV2TasksData$outboundSchema.parse(postV2TasksData));
}
export function postV2TasksDataFromJSON(
jsonString: string,
): SafeParseResult<PostV2TasksData, SDKValidationError> {
return safeParse(
jsonString,
(x) => PostV2TasksData$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PostV2TasksData' from JSON`,
);
}
/** @internal */
export const PostV2TasksRequest$inboundSchema: z.ZodType<
PostV2TasksRequest,
z.ZodTypeDef,
unknown
> = z.object({
data: z.lazy(() => PostV2TasksData$inboundSchema),
});
/** @internal */
export type PostV2TasksRequest$Outbound = {
data: PostV2TasksData$Outbound;
};
/** @internal */
export const PostV2TasksRequest$outboundSchema: z.ZodType<
PostV2TasksRequest$Outbound,
z.ZodTypeDef,
PostV2TasksRequest
> = z.object({
data: z.lazy(() => PostV2TasksData$outboundSchema),
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace PostV2TasksRequest$ {
/** @deprecated use `PostV2TasksRequest$inboundSchema` instead. */
export const inboundSchema = PostV2TasksRequest$inboundSchema;
/** @deprecated use `PostV2TasksRequest$outboundSchema` instead. */
export const outboundSchema = PostV2TasksRequest$outboundSchema;
/** @deprecated use `PostV2TasksRequest$Outbound` instead. */
export type Outbound = PostV2TasksRequest$Outbound;
}
export function postV2TasksRequestToJSON(
postV2TasksRequest: PostV2TasksRequest,
): string {
return JSON.stringify(
PostV2TasksRequest$outboundSchema.parse(postV2TasksRequest),
);
}
export function postV2TasksRequestFromJSON(
jsonString: string,
): SafeParseResult<PostV2TasksRequest, SDKValidationError> {
return safeParse(
jsonString,
(x) => PostV2TasksRequest$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PostV2TasksRequest' from JSON`,
);
}
/** @internal */
export const PostV2TasksResponse$inboundSchema: z.ZodType<
PostV2TasksResponse,
z.ZodTypeDef,
unknown
> = z.object({
data: Task$inboundSchema,
});
/** @internal */
export type PostV2TasksResponse$Outbound = {
data: Task$Outbound;
};
/** @internal */
export const PostV2TasksResponse$outboundSchema: z.ZodType<
PostV2TasksResponse$Outbound,
z.ZodTypeDef,
PostV2TasksResponse
> = z.object({
data: Task$outboundSchema,
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace PostV2TasksResponse$ {
/** @deprecated use `PostV2TasksResponse$inboundSchema` instead. */
export const inboundSchema = PostV2TasksResponse$inboundSchema;
/** @deprecated use `PostV2TasksResponse$outboundSchema` instead. */
export const outboundSchema = PostV2TasksResponse$outboundSchema;
/** @deprecated use `PostV2TasksResponse$Outbound` instead. */
export type Outbound = PostV2TasksResponse$Outbound;
}
export function postV2TasksResponseToJSON(
postV2TasksResponse: PostV2TasksResponse,
): string {
return JSON.stringify(
PostV2TasksResponse$outboundSchema.parse(postV2TasksResponse),
);
}
export function postV2TasksResponseFromJSON(
jsonString: string,
): SafeParseResult<PostV2TasksResponse, SDKValidationError> {
return safeParse(
jsonString,
(x) => PostV2TasksResponse$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PostV2TasksResponse' from JSON`,
);
}