UNPKG

attio-js

Version:

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

410 lines (373 loc) 12.7 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 GetV2ListsListEntriesEntryIdRequest = { list: string; entryId: string; }; export type GetV2ListsListEntriesEntryIdId = { /** * 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 GetV2ListsListEntriesEntryIdEntryValues = {}; export type GetV2ListsListEntriesEntryIdData = { id: GetV2ListsListEntriesEntryIdId; /** * 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: GetV2ListsListEntriesEntryIdEntryValues; }; /** * Success */ export type GetV2ListsListEntriesEntryIdResponse = { data: GetV2ListsListEntriesEntryIdData; }; /** @internal */ export const GetV2ListsListEntriesEntryIdRequest$inboundSchema: z.ZodType< GetV2ListsListEntriesEntryIdRequest, z.ZodTypeDef, unknown > = z.object({ list: z.string(), entry_id: z.string(), }).transform((v) => { return remap$(v, { "entry_id": "entryId", }); }); /** @internal */ export type GetV2ListsListEntriesEntryIdRequest$Outbound = { list: string; entry_id: string; }; /** @internal */ export const GetV2ListsListEntriesEntryIdRequest$outboundSchema: z.ZodType< GetV2ListsListEntriesEntryIdRequest$Outbound, z.ZodTypeDef, GetV2ListsListEntriesEntryIdRequest > = z.object({ list: z.string(), entryId: z.string(), }).transform((v) => { return remap$(v, { 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 GetV2ListsListEntriesEntryIdRequest$ { /** @deprecated use `GetV2ListsListEntriesEntryIdRequest$inboundSchema` instead. */ export const inboundSchema = GetV2ListsListEntriesEntryIdRequest$inboundSchema; /** @deprecated use `GetV2ListsListEntriesEntryIdRequest$outboundSchema` instead. */ export const outboundSchema = GetV2ListsListEntriesEntryIdRequest$outboundSchema; /** @deprecated use `GetV2ListsListEntriesEntryIdRequest$Outbound` instead. */ export type Outbound = GetV2ListsListEntriesEntryIdRequest$Outbound; } export function getV2ListsListEntriesEntryIdRequestToJSON( getV2ListsListEntriesEntryIdRequest: GetV2ListsListEntriesEntryIdRequest, ): string { return JSON.stringify( GetV2ListsListEntriesEntryIdRequest$outboundSchema.parse( getV2ListsListEntriesEntryIdRequest, ), ); } export function getV2ListsListEntriesEntryIdRequestFromJSON( jsonString: string, ): SafeParseResult<GetV2ListsListEntriesEntryIdRequest, SDKValidationError> { return safeParse( jsonString, (x) => GetV2ListsListEntriesEntryIdRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetV2ListsListEntriesEntryIdRequest' from JSON`, ); } /** @internal */ export const GetV2ListsListEntriesEntryIdId$inboundSchema: z.ZodType< GetV2ListsListEntriesEntryIdId, 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 GetV2ListsListEntriesEntryIdId$Outbound = { workspace_id: string; list_id: string; entry_id: string; }; /** @internal */ export const GetV2ListsListEntriesEntryIdId$outboundSchema: z.ZodType< GetV2ListsListEntriesEntryIdId$Outbound, z.ZodTypeDef, GetV2ListsListEntriesEntryIdId > = 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 GetV2ListsListEntriesEntryIdId$ { /** @deprecated use `GetV2ListsListEntriesEntryIdId$inboundSchema` instead. */ export const inboundSchema = GetV2ListsListEntriesEntryIdId$inboundSchema; /** @deprecated use `GetV2ListsListEntriesEntryIdId$outboundSchema` instead. */ export const outboundSchema = GetV2ListsListEntriesEntryIdId$outboundSchema; /** @deprecated use `GetV2ListsListEntriesEntryIdId$Outbound` instead. */ export type Outbound = GetV2ListsListEntriesEntryIdId$Outbound; } export function getV2ListsListEntriesEntryIdIdToJSON( getV2ListsListEntriesEntryIdId: GetV2ListsListEntriesEntryIdId, ): string { return JSON.stringify( GetV2ListsListEntriesEntryIdId$outboundSchema.parse( getV2ListsListEntriesEntryIdId, ), ); } export function getV2ListsListEntriesEntryIdIdFromJSON( jsonString: string, ): SafeParseResult<GetV2ListsListEntriesEntryIdId, SDKValidationError> { return safeParse( jsonString, (x) => GetV2ListsListEntriesEntryIdId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetV2ListsListEntriesEntryIdId' from JSON`, ); } /** @internal */ export const GetV2ListsListEntriesEntryIdEntryValues$inboundSchema: z.ZodType< GetV2ListsListEntriesEntryIdEntryValues, z.ZodTypeDef, unknown > = z.object({}); /** @internal */ export type GetV2ListsListEntriesEntryIdEntryValues$Outbound = {}; /** @internal */ export const GetV2ListsListEntriesEntryIdEntryValues$outboundSchema: z.ZodType< GetV2ListsListEntriesEntryIdEntryValues$Outbound, z.ZodTypeDef, GetV2ListsListEntriesEntryIdEntryValues > = 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 GetV2ListsListEntriesEntryIdEntryValues$ { /** @deprecated use `GetV2ListsListEntriesEntryIdEntryValues$inboundSchema` instead. */ export const inboundSchema = GetV2ListsListEntriesEntryIdEntryValues$inboundSchema; /** @deprecated use `GetV2ListsListEntriesEntryIdEntryValues$outboundSchema` instead. */ export const outboundSchema = GetV2ListsListEntriesEntryIdEntryValues$outboundSchema; /** @deprecated use `GetV2ListsListEntriesEntryIdEntryValues$Outbound` instead. */ export type Outbound = GetV2ListsListEntriesEntryIdEntryValues$Outbound; } export function getV2ListsListEntriesEntryIdEntryValuesToJSON( getV2ListsListEntriesEntryIdEntryValues: GetV2ListsListEntriesEntryIdEntryValues, ): string { return JSON.stringify( GetV2ListsListEntriesEntryIdEntryValues$outboundSchema.parse( getV2ListsListEntriesEntryIdEntryValues, ), ); } export function getV2ListsListEntriesEntryIdEntryValuesFromJSON( jsonString: string, ): SafeParseResult< GetV2ListsListEntriesEntryIdEntryValues, SDKValidationError > { return safeParse( jsonString, (x) => GetV2ListsListEntriesEntryIdEntryValues$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'GetV2ListsListEntriesEntryIdEntryValues' from JSON`, ); } /** @internal */ export const GetV2ListsListEntriesEntryIdData$inboundSchema: z.ZodType< GetV2ListsListEntriesEntryIdData, z.ZodTypeDef, unknown > = z.object({ id: z.lazy(() => GetV2ListsListEntriesEntryIdId$inboundSchema), parent_record_id: z.string(), parent_object: z.string(), created_at: z.string(), entry_values: z.lazy(() => GetV2ListsListEntriesEntryIdEntryValues$inboundSchema ), }).transform((v) => { return remap$(v, { "parent_record_id": "parentRecordId", "parent_object": "parentObject", "created_at": "createdAt", "entry_values": "entryValues", }); }); /** @internal */ export type GetV2ListsListEntriesEntryIdData$Outbound = { id: GetV2ListsListEntriesEntryIdId$Outbound; parent_record_id: string; parent_object: string; created_at: string; entry_values: GetV2ListsListEntriesEntryIdEntryValues$Outbound; }; /** @internal */ export const GetV2ListsListEntriesEntryIdData$outboundSchema: z.ZodType< GetV2ListsListEntriesEntryIdData$Outbound, z.ZodTypeDef, GetV2ListsListEntriesEntryIdData > = z.object({ id: z.lazy(() => GetV2ListsListEntriesEntryIdId$outboundSchema), parentRecordId: z.string(), parentObject: z.string(), createdAt: z.string(), entryValues: z.lazy(() => GetV2ListsListEntriesEntryIdEntryValues$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 GetV2ListsListEntriesEntryIdData$ { /** @deprecated use `GetV2ListsListEntriesEntryIdData$inboundSchema` instead. */ export const inboundSchema = GetV2ListsListEntriesEntryIdData$inboundSchema; /** @deprecated use `GetV2ListsListEntriesEntryIdData$outboundSchema` instead. */ export const outboundSchema = GetV2ListsListEntriesEntryIdData$outboundSchema; /** @deprecated use `GetV2ListsListEntriesEntryIdData$Outbound` instead. */ export type Outbound = GetV2ListsListEntriesEntryIdData$Outbound; } export function getV2ListsListEntriesEntryIdDataToJSON( getV2ListsListEntriesEntryIdData: GetV2ListsListEntriesEntryIdData, ): string { return JSON.stringify( GetV2ListsListEntriesEntryIdData$outboundSchema.parse( getV2ListsListEntriesEntryIdData, ), ); } export function getV2ListsListEntriesEntryIdDataFromJSON( jsonString: string, ): SafeParseResult<GetV2ListsListEntriesEntryIdData, SDKValidationError> { return safeParse( jsonString, (x) => GetV2ListsListEntriesEntryIdData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetV2ListsListEntriesEntryIdData' from JSON`, ); } /** @internal */ export const GetV2ListsListEntriesEntryIdResponse$inboundSchema: z.ZodType< GetV2ListsListEntriesEntryIdResponse, z.ZodTypeDef, unknown > = z.object({ data: z.lazy(() => GetV2ListsListEntriesEntryIdData$inboundSchema), }); /** @internal */ export type GetV2ListsListEntriesEntryIdResponse$Outbound = { data: GetV2ListsListEntriesEntryIdData$Outbound; }; /** @internal */ export const GetV2ListsListEntriesEntryIdResponse$outboundSchema: z.ZodType< GetV2ListsListEntriesEntryIdResponse$Outbound, z.ZodTypeDef, GetV2ListsListEntriesEntryIdResponse > = z.object({ data: z.lazy(() => GetV2ListsListEntriesEntryIdData$outboundSchema), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetV2ListsListEntriesEntryIdResponse$ { /** @deprecated use `GetV2ListsListEntriesEntryIdResponse$inboundSchema` instead. */ export const inboundSchema = GetV2ListsListEntriesEntryIdResponse$inboundSchema; /** @deprecated use `GetV2ListsListEntriesEntryIdResponse$outboundSchema` instead. */ export const outboundSchema = GetV2ListsListEntriesEntryIdResponse$outboundSchema; /** @deprecated use `GetV2ListsListEntriesEntryIdResponse$Outbound` instead. */ export type Outbound = GetV2ListsListEntriesEntryIdResponse$Outbound; } export function getV2ListsListEntriesEntryIdResponseToJSON( getV2ListsListEntriesEntryIdResponse: GetV2ListsListEntriesEntryIdResponse, ): string { return JSON.stringify( GetV2ListsListEntriesEntryIdResponse$outboundSchema.parse( getV2ListsListEntriesEntryIdResponse, ), ); } export function getV2ListsListEntriesEntryIdResponseFromJSON( jsonString: string, ): SafeParseResult<GetV2ListsListEntriesEntryIdResponse, SDKValidationError> { return safeParse( jsonString, (x) => GetV2ListsListEntriesEntryIdResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetV2ListsListEntriesEntryIdResponse' from JSON`, ); }