UNPKG

attio-js

Version:

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

583 lines (532 loc) 18.8 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 { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type PatchV2ListsListEntriesEntryIdDataRequest = { /** * An object with an attribute `api_slug` or `attribute_id` as the key, and a single value (for single-select attributes), or an array of values (for single or multi-select attributes) as the values. For complete documentation on values for all attribute types, please see our [attribute type docs](/docs/attribute-types). */ entryValues: { [k: string]: any }; }; export type PatchV2ListsListEntriesEntryIdRequestBody = { data: PatchV2ListsListEntriesEntryIdDataRequest; }; export type PatchV2ListsListEntriesEntryIdRequest = { list: string; entryId: string; requestBody: PatchV2ListsListEntriesEntryIdRequestBody; }; export type PatchV2ListsListEntriesEntryIdId = { /** * A UUID identifying the workspace this entry belongs to. */ workspaceId: string; /** * A UUID identifying the list this entry is in. */ listId: string; /** * A UUID identifying this entry. */ entryId: string; }; /** * A list of attribute values for the list entry (not attribute values for its parent record). */ export type PatchV2ListsListEntriesEntryIdEntryValues = {}; export type PatchV2ListsListEntriesEntryIdDataResponse = { id: PatchV2ListsListEntriesEntryIdId; /** * A UUID identifying the record that is parent of the list entry. */ parentRecordId: string; /** * A UUID or slug identifying the object that the parent record belongs to. */ parentObject: string; /** * When this entry was created. */ createdAt: string; /** * A list of attribute values for the list entry (not attribute values for its parent record). */ entryValues: PatchV2ListsListEntriesEntryIdEntryValues; }; /** * Success */ export type PatchV2ListsListEntriesEntryIdResponse = { data: PatchV2ListsListEntriesEntryIdDataResponse; }; /** @internal */ export const PatchV2ListsListEntriesEntryIdDataRequest$inboundSchema: z.ZodType< PatchV2ListsListEntriesEntryIdDataRequest, z.ZodTypeDef, unknown > = z.object({ entry_values: z.record(z.any()), }).transform((v) => { return remap$(v, { "entry_values": "entryValues", }); }); /** @internal */ export type PatchV2ListsListEntriesEntryIdDataRequest$Outbound = { entry_values: { [k: string]: any }; }; /** @internal */ export const PatchV2ListsListEntriesEntryIdDataRequest$outboundSchema: z.ZodType< PatchV2ListsListEntriesEntryIdDataRequest$Outbound, z.ZodTypeDef, PatchV2ListsListEntriesEntryIdDataRequest > = z.object({ entryValues: z.record(z.any()), }).transform((v) => { return remap$(v, { entryValues: "entry_values", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PatchV2ListsListEntriesEntryIdDataRequest$ { /** @deprecated use `PatchV2ListsListEntriesEntryIdDataRequest$inboundSchema` instead. */ export const inboundSchema = PatchV2ListsListEntriesEntryIdDataRequest$inboundSchema; /** @deprecated use `PatchV2ListsListEntriesEntryIdDataRequest$outboundSchema` instead. */ export const outboundSchema = PatchV2ListsListEntriesEntryIdDataRequest$outboundSchema; /** @deprecated use `PatchV2ListsListEntriesEntryIdDataRequest$Outbound` instead. */ export type Outbound = PatchV2ListsListEntriesEntryIdDataRequest$Outbound; } export function patchV2ListsListEntriesEntryIdDataRequestToJSON( patchV2ListsListEntriesEntryIdDataRequest: PatchV2ListsListEntriesEntryIdDataRequest, ): string { return JSON.stringify( PatchV2ListsListEntriesEntryIdDataRequest$outboundSchema.parse( patchV2ListsListEntriesEntryIdDataRequest, ), ); } export function patchV2ListsListEntriesEntryIdDataRequestFromJSON( jsonString: string, ): SafeParseResult< PatchV2ListsListEntriesEntryIdDataRequest, SDKValidationError > { return safeParse( jsonString, (x) => PatchV2ListsListEntriesEntryIdDataRequest$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'PatchV2ListsListEntriesEntryIdDataRequest' from JSON`, ); } /** @internal */ export const PatchV2ListsListEntriesEntryIdRequestBody$inboundSchema: z.ZodType< PatchV2ListsListEntriesEntryIdRequestBody, z.ZodTypeDef, unknown > = z.object({ data: z.lazy(() => PatchV2ListsListEntriesEntryIdDataRequest$inboundSchema), }); /** @internal */ export type PatchV2ListsListEntriesEntryIdRequestBody$Outbound = { data: PatchV2ListsListEntriesEntryIdDataRequest$Outbound; }; /** @internal */ export const PatchV2ListsListEntriesEntryIdRequestBody$outboundSchema: z.ZodType< PatchV2ListsListEntriesEntryIdRequestBody$Outbound, z.ZodTypeDef, PatchV2ListsListEntriesEntryIdRequestBody > = z.object({ data: z.lazy(() => PatchV2ListsListEntriesEntryIdDataRequest$outboundSchema ), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PatchV2ListsListEntriesEntryIdRequestBody$ { /** @deprecated use `PatchV2ListsListEntriesEntryIdRequestBody$inboundSchema` instead. */ export const inboundSchema = PatchV2ListsListEntriesEntryIdRequestBody$inboundSchema; /** @deprecated use `PatchV2ListsListEntriesEntryIdRequestBody$outboundSchema` instead. */ export const outboundSchema = PatchV2ListsListEntriesEntryIdRequestBody$outboundSchema; /** @deprecated use `PatchV2ListsListEntriesEntryIdRequestBody$Outbound` instead. */ export type Outbound = PatchV2ListsListEntriesEntryIdRequestBody$Outbound; } export function patchV2ListsListEntriesEntryIdRequestBodyToJSON( patchV2ListsListEntriesEntryIdRequestBody: PatchV2ListsListEntriesEntryIdRequestBody, ): string { return JSON.stringify( PatchV2ListsListEntriesEntryIdRequestBody$outboundSchema.parse( patchV2ListsListEntriesEntryIdRequestBody, ), ); } export function patchV2ListsListEntriesEntryIdRequestBodyFromJSON( jsonString: string, ): SafeParseResult< PatchV2ListsListEntriesEntryIdRequestBody, SDKValidationError > { return safeParse( jsonString, (x) => PatchV2ListsListEntriesEntryIdRequestBody$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'PatchV2ListsListEntriesEntryIdRequestBody' from JSON`, ); } /** @internal */ export const PatchV2ListsListEntriesEntryIdRequest$inboundSchema: z.ZodType< PatchV2ListsListEntriesEntryIdRequest, z.ZodTypeDef, unknown > = z.object({ list: z.string(), entry_id: z.string(), RequestBody: z.lazy(() => PatchV2ListsListEntriesEntryIdRequestBody$inboundSchema ), }).transform((v) => { return remap$(v, { "entry_id": "entryId", "RequestBody": "requestBody", }); }); /** @internal */ export type PatchV2ListsListEntriesEntryIdRequest$Outbound = { list: string; entry_id: string; RequestBody: PatchV2ListsListEntriesEntryIdRequestBody$Outbound; }; /** @internal */ export const PatchV2ListsListEntriesEntryIdRequest$outboundSchema: z.ZodType< PatchV2ListsListEntriesEntryIdRequest$Outbound, z.ZodTypeDef, PatchV2ListsListEntriesEntryIdRequest > = z.object({ list: z.string(), entryId: z.string(), requestBody: z.lazy(() => PatchV2ListsListEntriesEntryIdRequestBody$outboundSchema ), }).transform((v) => { return remap$(v, { entryId: "entry_id", requestBody: "RequestBody", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PatchV2ListsListEntriesEntryIdRequest$ { /** @deprecated use `PatchV2ListsListEntriesEntryIdRequest$inboundSchema` instead. */ export const inboundSchema = PatchV2ListsListEntriesEntryIdRequest$inboundSchema; /** @deprecated use `PatchV2ListsListEntriesEntryIdRequest$outboundSchema` instead. */ export const outboundSchema = PatchV2ListsListEntriesEntryIdRequest$outboundSchema; /** @deprecated use `PatchV2ListsListEntriesEntryIdRequest$Outbound` instead. */ export type Outbound = PatchV2ListsListEntriesEntryIdRequest$Outbound; } export function patchV2ListsListEntriesEntryIdRequestToJSON( patchV2ListsListEntriesEntryIdRequest: PatchV2ListsListEntriesEntryIdRequest, ): string { return JSON.stringify( PatchV2ListsListEntriesEntryIdRequest$outboundSchema.parse( patchV2ListsListEntriesEntryIdRequest, ), ); } export function patchV2ListsListEntriesEntryIdRequestFromJSON( jsonString: string, ): SafeParseResult<PatchV2ListsListEntriesEntryIdRequest, SDKValidationError> { return safeParse( jsonString, (x) => PatchV2ListsListEntriesEntryIdRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PatchV2ListsListEntriesEntryIdRequest' from JSON`, ); } /** @internal */ export const PatchV2ListsListEntriesEntryIdId$inboundSchema: z.ZodType< PatchV2ListsListEntriesEntryIdId, z.ZodTypeDef, unknown > = z.object({ workspace_id: z.string(), list_id: z.string(), entry_id: z.string(), }).transform((v) => { return remap$(v, { "workspace_id": "workspaceId", "list_id": "listId", "entry_id": "entryId", }); }); /** @internal */ export type PatchV2ListsListEntriesEntryIdId$Outbound = { workspace_id: string; list_id: string; entry_id: string; }; /** @internal */ export const PatchV2ListsListEntriesEntryIdId$outboundSchema: z.ZodType< PatchV2ListsListEntriesEntryIdId$Outbound, z.ZodTypeDef, PatchV2ListsListEntriesEntryIdId > = z.object({ workspaceId: z.string(), listId: z.string(), entryId: z.string(), }).transform((v) => { return remap$(v, { workspaceId: "workspace_id", listId: "list_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 namespace PatchV2ListsListEntriesEntryIdId$ { /** @deprecated use `PatchV2ListsListEntriesEntryIdId$inboundSchema` instead. */ export const inboundSchema = PatchV2ListsListEntriesEntryIdId$inboundSchema; /** @deprecated use `PatchV2ListsListEntriesEntryIdId$outboundSchema` instead. */ export const outboundSchema = PatchV2ListsListEntriesEntryIdId$outboundSchema; /** @deprecated use `PatchV2ListsListEntriesEntryIdId$Outbound` instead. */ export type Outbound = PatchV2ListsListEntriesEntryIdId$Outbound; } export function patchV2ListsListEntriesEntryIdIdToJSON( patchV2ListsListEntriesEntryIdId: PatchV2ListsListEntriesEntryIdId, ): string { return JSON.stringify( PatchV2ListsListEntriesEntryIdId$outboundSchema.parse( patchV2ListsListEntriesEntryIdId, ), ); } export function patchV2ListsListEntriesEntryIdIdFromJSON( jsonString: string, ): SafeParseResult<PatchV2ListsListEntriesEntryIdId, SDKValidationError> { return safeParse( jsonString, (x) => PatchV2ListsListEntriesEntryIdId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PatchV2ListsListEntriesEntryIdId' from JSON`, ); } /** @internal */ export const PatchV2ListsListEntriesEntryIdEntryValues$inboundSchema: z.ZodType< PatchV2ListsListEntriesEntryIdEntryValues, z.ZodTypeDef, unknown > = z.object({}); /** @internal */ export type PatchV2ListsListEntriesEntryIdEntryValues$Outbound = {}; /** @internal */ export const PatchV2ListsListEntriesEntryIdEntryValues$outboundSchema: z.ZodType< PatchV2ListsListEntriesEntryIdEntryValues$Outbound, z.ZodTypeDef, PatchV2ListsListEntriesEntryIdEntryValues > = z.object({}); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PatchV2ListsListEntriesEntryIdEntryValues$ { /** @deprecated use `PatchV2ListsListEntriesEntryIdEntryValues$inboundSchema` instead. */ export const inboundSchema = PatchV2ListsListEntriesEntryIdEntryValues$inboundSchema; /** @deprecated use `PatchV2ListsListEntriesEntryIdEntryValues$outboundSchema` instead. */ export const outboundSchema = PatchV2ListsListEntriesEntryIdEntryValues$outboundSchema; /** @deprecated use `PatchV2ListsListEntriesEntryIdEntryValues$Outbound` instead. */ export type Outbound = PatchV2ListsListEntriesEntryIdEntryValues$Outbound; } export function patchV2ListsListEntriesEntryIdEntryValuesToJSON( patchV2ListsListEntriesEntryIdEntryValues: PatchV2ListsListEntriesEntryIdEntryValues, ): string { return JSON.stringify( PatchV2ListsListEntriesEntryIdEntryValues$outboundSchema.parse( patchV2ListsListEntriesEntryIdEntryValues, ), ); } export function patchV2ListsListEntriesEntryIdEntryValuesFromJSON( jsonString: string, ): SafeParseResult< PatchV2ListsListEntriesEntryIdEntryValues, SDKValidationError > { return safeParse( jsonString, (x) => PatchV2ListsListEntriesEntryIdEntryValues$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'PatchV2ListsListEntriesEntryIdEntryValues' from JSON`, ); } /** @internal */ export const PatchV2ListsListEntriesEntryIdDataResponse$inboundSchema: z.ZodType<PatchV2ListsListEntriesEntryIdDataResponse, z.ZodTypeDef, unknown> = z.object({ id: z.lazy(() => PatchV2ListsListEntriesEntryIdId$inboundSchema), parent_record_id: z.string(), parent_object: z.string(), created_at: z.string(), entry_values: z.lazy(() => PatchV2ListsListEntriesEntryIdEntryValues$inboundSchema ), }).transform((v) => { return remap$(v, { "parent_record_id": "parentRecordId", "parent_object": "parentObject", "created_at": "createdAt", "entry_values": "entryValues", }); }); /** @internal */ export type PatchV2ListsListEntriesEntryIdDataResponse$Outbound = { id: PatchV2ListsListEntriesEntryIdId$Outbound; parent_record_id: string; parent_object: string; created_at: string; entry_values: PatchV2ListsListEntriesEntryIdEntryValues$Outbound; }; /** @internal */ export const PatchV2ListsListEntriesEntryIdDataResponse$outboundSchema: z.ZodType< PatchV2ListsListEntriesEntryIdDataResponse$Outbound, z.ZodTypeDef, PatchV2ListsListEntriesEntryIdDataResponse > = z.object({ id: z.lazy(() => PatchV2ListsListEntriesEntryIdId$outboundSchema), parentRecordId: z.string(), parentObject: z.string(), createdAt: z.string(), entryValues: z.lazy(() => PatchV2ListsListEntriesEntryIdEntryValues$outboundSchema ), }).transform((v) => { return remap$(v, { parentRecordId: "parent_record_id", parentObject: "parent_object", createdAt: "created_at", entryValues: "entry_values", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PatchV2ListsListEntriesEntryIdDataResponse$ { /** @deprecated use `PatchV2ListsListEntriesEntryIdDataResponse$inboundSchema` instead. */ export const inboundSchema = PatchV2ListsListEntriesEntryIdDataResponse$inboundSchema; /** @deprecated use `PatchV2ListsListEntriesEntryIdDataResponse$outboundSchema` instead. */ export const outboundSchema = PatchV2ListsListEntriesEntryIdDataResponse$outboundSchema; /** @deprecated use `PatchV2ListsListEntriesEntryIdDataResponse$Outbound` instead. */ export type Outbound = PatchV2ListsListEntriesEntryIdDataResponse$Outbound; } export function patchV2ListsListEntriesEntryIdDataResponseToJSON( patchV2ListsListEntriesEntryIdDataResponse: PatchV2ListsListEntriesEntryIdDataResponse, ): string { return JSON.stringify( PatchV2ListsListEntriesEntryIdDataResponse$outboundSchema.parse( patchV2ListsListEntriesEntryIdDataResponse, ), ); } export function patchV2ListsListEntriesEntryIdDataResponseFromJSON( jsonString: string, ): SafeParseResult< PatchV2ListsListEntriesEntryIdDataResponse, SDKValidationError > { return safeParse( jsonString, (x) => PatchV2ListsListEntriesEntryIdDataResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'PatchV2ListsListEntriesEntryIdDataResponse' from JSON`, ); } /** @internal */ export const PatchV2ListsListEntriesEntryIdResponse$inboundSchema: z.ZodType< PatchV2ListsListEntriesEntryIdResponse, z.ZodTypeDef, unknown > = z.object({ data: z.lazy(() => PatchV2ListsListEntriesEntryIdDataResponse$inboundSchema), }); /** @internal */ export type PatchV2ListsListEntriesEntryIdResponse$Outbound = { data: PatchV2ListsListEntriesEntryIdDataResponse$Outbound; }; /** @internal */ export const PatchV2ListsListEntriesEntryIdResponse$outboundSchema: z.ZodType< PatchV2ListsListEntriesEntryIdResponse$Outbound, z.ZodTypeDef, PatchV2ListsListEntriesEntryIdResponse > = z.object({ data: z.lazy(() => PatchV2ListsListEntriesEntryIdDataResponse$outboundSchema), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PatchV2ListsListEntriesEntryIdResponse$ { /** @deprecated use `PatchV2ListsListEntriesEntryIdResponse$inboundSchema` instead. */ export const inboundSchema = PatchV2ListsListEntriesEntryIdResponse$inboundSchema; /** @deprecated use `PatchV2ListsListEntriesEntryIdResponse$outboundSchema` instead. */ export const outboundSchema = PatchV2ListsListEntriesEntryIdResponse$outboundSchema; /** @deprecated use `PatchV2ListsListEntriesEntryIdResponse$Outbound` instead. */ export type Outbound = PatchV2ListsListEntriesEntryIdResponse$Outbound; } export function patchV2ListsListEntriesEntryIdResponseToJSON( patchV2ListsListEntriesEntryIdResponse: PatchV2ListsListEntriesEntryIdResponse, ): string { return JSON.stringify( PatchV2ListsListEntriesEntryIdResponse$outboundSchema.parse( patchV2ListsListEntriesEntryIdResponse, ), ); } export function patchV2ListsListEntriesEntryIdResponseFromJSON( jsonString: string, ): SafeParseResult<PatchV2ListsListEntriesEntryIdResponse, SDKValidationError> { return safeParse( jsonString, (x) => PatchV2ListsListEntriesEntryIdResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PatchV2ListsListEntriesEntryIdResponse' from JSON`, ); }