UNPKG

attio-js

Version:

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

1,985 lines (1,679 loc) 137 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 { ClosedEnum } from "../../types/enums.js"; export const NotFoundType = { InvalidRequestError: "invalid_request_error", } as const; export type NotFoundType = ClosedEnum<typeof NotFoundType>; export const NotFoundCode = { NotFound: "not_found", } as const; export type NotFoundCode = ClosedEnum<typeof NotFoundCode>; /** * Not Found */ export type GetV2ObjectsObjectNotFoundErrorData = { statusCode: number; type: NotFoundType; code: NotFoundCode; message: string; }; /** * Not Found */ export class GetV2ObjectsObjectNotFoundError extends Error { statusCode: number; type: NotFoundType; code: NotFoundCode; /** The original data that was passed to this error instance. */ data$: GetV2ObjectsObjectNotFoundErrorData; constructor(err: GetV2ObjectsObjectNotFoundErrorData) { const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`; super(message); this.data$ = err; this.statusCode = err.statusCode; this.type = err.type; this.code = err.code; this.name = "GetV2ObjectsObjectNotFoundError"; } } export const ConflictType = { InvalidRequestError: "invalid_request_error", } as const; export type ConflictType = ClosedEnum<typeof ConflictType>; export const ConflictCode = { SlugConflict: "slug_conflict", } as const; export type ConflictCode = ClosedEnum<typeof ConflictCode>; /** * Conflict */ export type PostV2ObjectsSlugConflictErrorData = { statusCode: number; type: ConflictType; code: ConflictCode; message: string; }; /** * Conflict */ export class PostV2ObjectsSlugConflictError extends Error { statusCode: number; type: ConflictType; code: ConflictCode; /** The original data that was passed to this error instance. */ data$: PostV2ObjectsSlugConflictErrorData; constructor(err: PostV2ObjectsSlugConflictErrorData) { const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`; super(message); this.data$ = err; this.statusCode = err.statusCode; this.type = err.type; this.code = err.code; this.name = "PostV2ObjectsSlugConflictError"; } } /** * Conflict */ export type PatchV2ObjectsObjectSlugConflictErrorData = { statusCode: number; type: ConflictType; code: ConflictCode; message: string; }; /** * Conflict */ export class PatchV2ObjectsObjectSlugConflictError extends Error { statusCode: number; type: ConflictType; code: ConflictCode; /** The original data that was passed to this error instance. */ data$: PatchV2ObjectsObjectSlugConflictErrorData; constructor(err: PatchV2ObjectsObjectSlugConflictErrorData) { const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`; super(message); this.data$ = err; this.statusCode = err.statusCode; this.type = err.type; this.code = err.code; this.name = "PatchV2ObjectsObjectSlugConflictError"; } } export const BadRequestType = { InvalidRequestError: "invalid_request_error", } as const; export type BadRequestType = ClosedEnum<typeof BadRequestType>; export const CodeValidationType = { ValidationType: "validation_type", } as const; export type CodeValidationType = ClosedEnum<typeof CodeValidationType>; /** * Bad Request */ export type PatchV2ObjectsObjectValidationTypeErrorData = { statusCode: number; type: BadRequestType; code: CodeValidationType; message: string; }; /** * Bad Request */ export class PatchV2ObjectsObjectValidationTypeError extends Error { statusCode: number; type: BadRequestType; code: CodeValidationType; /** The original data that was passed to this error instance. */ data$: PatchV2ObjectsObjectValidationTypeErrorData; constructor(err: PatchV2ObjectsObjectValidationTypeErrorData) { const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`; super(message); this.data$ = err; this.statusCode = err.statusCode; this.type = err.type; this.code = err.code; this.name = "PatchV2ObjectsObjectValidationTypeError"; } } /** * Conflict */ export type PostV2TargetIdentifierAttributesSlugConflictErrorData = { statusCode: number; type: ConflictType; code: ConflictCode; message: string; }; /** * Conflict */ export class PostV2TargetIdentifierAttributesSlugConflictError extends Error { statusCode: number; type: ConflictType; code: ConflictCode; /** The original data that was passed to this error instance. */ data$: PostV2TargetIdentifierAttributesSlugConflictErrorData; constructor(err: PostV2TargetIdentifierAttributesSlugConflictErrorData) { const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`; super(message); this.data$ = err; this.statusCode = err.statusCode; this.type = err.type; this.code = err.code; this.name = "PostV2TargetIdentifierAttributesSlugConflictError"; } } /** * Not Found */ export type PostV2TargetIdentifierAttributesNotFoundErrorData = { statusCode: number; type: NotFoundType; code: NotFoundCode; message: string; }; /** * Not Found */ export class PostV2TargetIdentifierAttributesNotFoundError extends Error { statusCode: number; type: NotFoundType; code: NotFoundCode; /** The original data that was passed to this error instance. */ data$: PostV2TargetIdentifierAttributesNotFoundErrorData; constructor(err: PostV2TargetIdentifierAttributesNotFoundErrorData) { const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`; super(message); this.data$ = err; this.statusCode = err.statusCode; this.type = err.type; this.code = err.code; this.name = "PostV2TargetIdentifierAttributesNotFoundError"; } } /** * Bad Request */ export type PostV2TargetIdentifierAttributesValidationTypeErrorData = { statusCode: number; type: BadRequestType; code: CodeValidationType; message: string; }; /** * Bad Request */ export class PostV2TargetIdentifierAttributesValidationTypeError extends Error { statusCode: number; type: BadRequestType; code: CodeValidationType; /** The original data that was passed to this error instance. */ data$: PostV2TargetIdentifierAttributesValidationTypeErrorData; constructor(err: PostV2TargetIdentifierAttributesValidationTypeErrorData) { const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`; super(message); this.data$ = err; this.statusCode = err.statusCode; this.type = err.type; this.code = err.code; this.name = "PostV2TargetIdentifierAttributesValidationTypeError"; } } /** * Not Found */ export type GetV2TargetIdentifierAttributesAttributeNotFoundErrorData = { statusCode: number; type: NotFoundType; code: NotFoundCode; message: string; }; /** * Not Found */ export class GetV2TargetIdentifierAttributesAttributeNotFoundError extends Error { statusCode: number; type: NotFoundType; code: NotFoundCode; /** The original data that was passed to this error instance. */ data$: GetV2TargetIdentifierAttributesAttributeNotFoundErrorData; constructor(err: GetV2TargetIdentifierAttributesAttributeNotFoundErrorData) { const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`; super(message); this.data$ = err; this.statusCode = err.statusCode; this.type = err.type; this.code = err.code; this.name = "GetV2TargetIdentifierAttributesAttributeNotFoundError"; } } export const PatchV2TargetIdentifierAttributesAttributeCode = { SystemEditUnauthorized: "system_edit_unauthorized", } as const; export type PatchV2TargetIdentifierAttributesAttributeCode = ClosedEnum< typeof PatchV2TargetIdentifierAttributesAttributeCode >; /** * Bad Request */ export type SystemEditUnauthorizedErrorData = { statusCode: number; type: BadRequestType; code: PatchV2TargetIdentifierAttributesAttributeCode; message: string; }; /** * Bad Request */ export class SystemEditUnauthorizedError extends Error { statusCode: number; type: BadRequestType; code: PatchV2TargetIdentifierAttributesAttributeCode; /** The original data that was passed to this error instance. */ data$: SystemEditUnauthorizedErrorData; constructor(err: SystemEditUnauthorizedErrorData) { const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`; super(message); this.data$ = err; this.statusCode = err.statusCode; this.type = err.type; this.code = err.code; this.name = "SystemEditUnauthorizedError"; } } /** * Conflict */ export type PostV2TargetIdentifierAttributesAttributeOptionsSlugConflictErrorData = { statusCode: number; type: ConflictType; code: ConflictCode; message: string; }; /** * Conflict */ export class PostV2TargetIdentifierAttributesAttributeOptionsSlugConflictError extends Error { statusCode: number; type: ConflictType; code: ConflictCode; /** The original data that was passed to this error instance. */ data$: PostV2TargetIdentifierAttributesAttributeOptionsSlugConflictErrorData; constructor( err: PostV2TargetIdentifierAttributesAttributeOptionsSlugConflictErrorData, ) { const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`; super(message); this.data$ = err; this.statusCode = err.statusCode; this.type = err.type; this.code = err.code; this.name = "PostV2TargetIdentifierAttributesAttributeOptionsSlugConflictError"; } } /** * Bad Request */ export type PostV2TargetIdentifierAttributesAttributeOptionsValidationTypeErrorData = { statusCode: number; type: BadRequestType; code: CodeValidationType; message: string; }; /** * Bad Request */ export class PostV2TargetIdentifierAttributesAttributeOptionsValidationTypeError extends Error { statusCode: number; type: BadRequestType; code: CodeValidationType; /** The original data that was passed to this error instance. */ data$: PostV2TargetIdentifierAttributesAttributeOptionsValidationTypeErrorData; constructor( err: PostV2TargetIdentifierAttributesAttributeOptionsValidationTypeErrorData, ) { const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`; super(message); this.data$ = err; this.statusCode = err.statusCode; this.type = err.type; this.code = err.code; this.name = "PostV2TargetIdentifierAttributesAttributeOptionsValidationTypeError"; } } export const BadRequestCode = { ValueNotFound: "value_not_found", MissingValue: "missing_value", } as const; export type BadRequestCode = ClosedEnum<typeof BadRequestCode>; /** * Bad Request */ export type PatchV2TargetIdentifierAttributesAttributeOptionsOptionInvalidRequestErrorData = { statusCode: number; type: BadRequestType; code: BadRequestCode; message: string; }; /** * Bad Request */ export class PatchV2TargetIdentifierAttributesAttributeOptionsOptionInvalidRequestError extends Error { statusCode: number; type: BadRequestType; code: BadRequestCode; /** The original data that was passed to this error instance. */ data$: PatchV2TargetIdentifierAttributesAttributeOptionsOptionInvalidRequestErrorData; constructor( err: PatchV2TargetIdentifierAttributesAttributeOptionsOptionInvalidRequestErrorData, ) { const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`; super(message); this.data$ = err; this.statusCode = err.statusCode; this.type = err.type; this.code = err.code; this.name = "PatchV2TargetIdentifierAttributesAttributeOptionsOptionInvalidRequestError"; } } /** * Conflict */ export type PostV2TargetIdentifierAttributesAttributeStatusesSlugConflictErrorData = { statusCode: number; type: ConflictType; code: ConflictCode; message: string; }; /** * Conflict */ export class PostV2TargetIdentifierAttributesAttributeStatusesSlugConflictError extends Error { statusCode: number; type: ConflictType; code: ConflictCode; /** The original data that was passed to this error instance. */ data$: PostV2TargetIdentifierAttributesAttributeStatusesSlugConflictErrorData; constructor( err: PostV2TargetIdentifierAttributesAttributeStatusesSlugConflictErrorData, ) { const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`; super(message); this.data$ = err; this.statusCode = err.statusCode; this.type = err.type; this.code = err.code; this.name = "PostV2TargetIdentifierAttributesAttributeStatusesSlugConflictError"; } } /** * Bad Request */ export type PostV2TargetIdentifierAttributesAttributeStatusesValidationTypeErrorData = { statusCode: number; type: BadRequestType; code: CodeValidationType; message: string; }; /** * Bad Request */ export class PostV2TargetIdentifierAttributesAttributeStatusesValidationTypeError extends Error { statusCode: number; type: BadRequestType; code: CodeValidationType; /** The original data that was passed to this error instance. */ data$: PostV2TargetIdentifierAttributesAttributeStatusesValidationTypeErrorData; constructor( err: PostV2TargetIdentifierAttributesAttributeStatusesValidationTypeErrorData, ) { const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`; super(message); this.data$ = err; this.statusCode = err.statusCode; this.type = err.type; this.code = err.code; this.name = "PostV2TargetIdentifierAttributesAttributeStatusesValidationTypeError"; } } /** * Bad Request */ export type PatchV2TargetIdentifierAttributesAttributeStatusesStatusInvalidRequestErrorData = { statusCode: number; type: BadRequestType; code: BadRequestCode; message: string; }; /** * Bad Request */ export class PatchV2TargetIdentifierAttributesAttributeStatusesStatusInvalidRequestError extends Error { statusCode: number; type: BadRequestType; code: BadRequestCode; /** The original data that was passed to this error instance. */ data$: PatchV2TargetIdentifierAttributesAttributeStatusesStatusInvalidRequestErrorData; constructor( err: PatchV2TargetIdentifierAttributesAttributeStatusesStatusInvalidRequestErrorData, ) { const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`; super(message); this.data$ = err; this.statusCode = err.statusCode; this.type = err.type; this.code = err.code; this.name = "PatchV2TargetIdentifierAttributesAttributeStatusesStatusInvalidRequestError"; } } /** * Not Found */ export type PostV2ObjectsObjectRecordsQueryNotFoundErrorData = { statusCode: number; type: NotFoundType; code: NotFoundCode; message: string; }; /** * Not Found */ export class PostV2ObjectsObjectRecordsQueryNotFoundError extends Error { statusCode: number; type: NotFoundType; code: NotFoundCode; /** The original data that was passed to this error instance. */ data$: PostV2ObjectsObjectRecordsQueryNotFoundErrorData; constructor(err: PostV2ObjectsObjectRecordsQueryNotFoundErrorData) { const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`; super(message); this.data$ = err; this.statusCode = err.statusCode; this.type = err.type; this.code = err.code; this.name = "PostV2ObjectsObjectRecordsQueryNotFoundError"; } } export const PostV2ObjectsObjectRecordsQueryCode = { FilterError: "filter_error", } as const; export type PostV2ObjectsObjectRecordsQueryCode = ClosedEnum< typeof PostV2ObjectsObjectRecordsQueryCode >; /** * Bad Request */ export type FilterErrorData = { statusCode: number; type: BadRequestType; code: PostV2ObjectsObjectRecordsQueryCode; message: string; }; /** * Bad Request */ export class FilterError extends Error { statusCode: number; type: BadRequestType; code: PostV2ObjectsObjectRecordsQueryCode; /** The original data that was passed to this error instance. */ data$: FilterErrorData; constructor(err: FilterErrorData) { const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`; super(message); this.data$ = err; this.statusCode = err.statusCode; this.type = err.type; this.code = err.code; this.name = "FilterError"; } } /** * Bad Request */ export type PostV2ObjectsObjectRecordsInvalidRequestErrorData = { statusCode: number; type: BadRequestType; code: BadRequestCode; message: string; }; /** * Bad Request */ export class PostV2ObjectsObjectRecordsInvalidRequestError extends Error { statusCode: number; type: BadRequestType; code: BadRequestCode; /** The original data that was passed to this error instance. */ data$: PostV2ObjectsObjectRecordsInvalidRequestErrorData; constructor(err: PostV2ObjectsObjectRecordsInvalidRequestErrorData) { const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`; super(message); this.data$ = err; this.statusCode = err.statusCode; this.type = err.type; this.code = err.code; this.name = "PostV2ObjectsObjectRecordsInvalidRequestError"; } } /** * Bad Request */ export type PutV2ObjectsObjectRecordsInvalidRequestErrorData = { statusCode: number; type: BadRequestType; code: BadRequestCode; message: string; }; /** * Bad Request */ export class PutV2ObjectsObjectRecordsInvalidRequestError extends Error { statusCode: number; type: BadRequestType; code: BadRequestCode; /** The original data that was passed to this error instance. */ data$: PutV2ObjectsObjectRecordsInvalidRequestErrorData; constructor(err: PutV2ObjectsObjectRecordsInvalidRequestErrorData) { const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`; super(message); this.data$ = err; this.statusCode = err.statusCode; this.type = err.type; this.code = err.code; this.name = "PutV2ObjectsObjectRecordsInvalidRequestError"; } } /** * Not Found */ export type GetV2ObjectsObjectRecordsRecordIdInvalidRequestErrorData = { statusCode: number; type: NotFoundType; code: NotFoundCode; message: string; }; /** * Not Found */ export class GetV2ObjectsObjectRecordsRecordIdInvalidRequestError extends Error { statusCode: number; type: NotFoundType; code: NotFoundCode; /** The original data that was passed to this error instance. */ data$: GetV2ObjectsObjectRecordsRecordIdInvalidRequestErrorData; constructor(err: GetV2ObjectsObjectRecordsRecordIdInvalidRequestErrorData) { const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`; super(message); this.data$ = err; this.statusCode = err.statusCode; this.type = err.type; this.code = err.code; this.name = "GetV2ObjectsObjectRecordsRecordIdInvalidRequestError"; } } export const CodeMissingValue = { MissingValue: "missing_value", } as const; export type CodeMissingValue = ClosedEnum<typeof CodeMissingValue>; /** * Bad Request */ export type MissingValueErrorData = { statusCode: number; type: BadRequestType; code: CodeMissingValue; message: string; }; /** * Bad Request */ export class MissingValueError extends Error { statusCode: number; type: BadRequestType; code: CodeMissingValue; /** The original data that was passed to this error instance. */ data$: MissingValueErrorData; constructor(err: MissingValueErrorData) { const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`; super(message); this.data$ = err; this.statusCode = err.statusCode; this.type = err.type; this.code = err.code; this.name = "MissingValueError"; } } /** * Bad Request */ export type GetV2ObjectsObjectRecordsRecordIdAttributesAttributeValuesValidationTypeErrorData = { statusCode: number; type: BadRequestType; code: CodeValidationType; message: string; }; /** * Bad Request */ export class GetV2ObjectsObjectRecordsRecordIdAttributesAttributeValuesValidationTypeError extends Error { statusCode: number; type: BadRequestType; code: CodeValidationType; /** The original data that was passed to this error instance. */ data$: GetV2ObjectsObjectRecordsRecordIdAttributesAttributeValuesValidationTypeErrorData; constructor( err: GetV2ObjectsObjectRecordsRecordIdAttributesAttributeValuesValidationTypeErrorData, ) { const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`; super(message); this.data$ = err; this.statusCode = err.statusCode; this.type = err.type; this.code = err.code; this.name = "GetV2ObjectsObjectRecordsRecordIdAttributesAttributeValuesValidationTypeError"; } } /** * Not Found */ export type PostV2ListsNotFoundErrorData = { statusCode: number; type: NotFoundType; code: NotFoundCode; message: string; }; /** * Not Found */ export class PostV2ListsNotFoundError extends Error { statusCode: number; type: NotFoundType; code: NotFoundCode; /** The original data that was passed to this error instance. */ data$: PostV2ListsNotFoundErrorData; constructor(err: PostV2ListsNotFoundErrorData) { const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`; super(message); this.data$ = err; this.statusCode = err.statusCode; this.type = err.type; this.code = err.code; this.name = "PostV2ListsNotFoundError"; } } export const PostV2ListsType = { AuthError: "auth_error", } as const; export type PostV2ListsType = ClosedEnum<typeof PostV2ListsType>; export const PostV2ListsCode = { BillingError: "billing_error", } as const; export type PostV2ListsCode = ClosedEnum<typeof PostV2ListsCode>; /** * Forbidden */ export type BillingErrorData = { statusCode: number; type: PostV2ListsType; code: PostV2ListsCode; message: string; }; /** * Forbidden */ export class BillingError extends Error { statusCode: number; type: PostV2ListsType; code: PostV2ListsCode; /** The original data that was passed to this error instance. */ data$: BillingErrorData; constructor(err: BillingErrorData) { const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`; super(message); this.data$ = err; this.statusCode = err.statusCode; this.type = err.type; this.code = err.code; this.name = "BillingError"; } } /** * Bad Request */ export type PostV2ListsInvalidRequestErrorData = { statusCode: number; type: BadRequestType; code: BadRequestCode; message: string; }; /** * Bad Request */ export class PostV2ListsInvalidRequestError extends Error { statusCode: number; type: BadRequestType; code: BadRequestCode; /** The original data that was passed to this error instance. */ data$: PostV2ListsInvalidRequestErrorData; constructor(err: PostV2ListsInvalidRequestErrorData) { const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`; super(message); this.data$ = err; this.statusCode = err.statusCode; this.type = err.type; this.code = err.code; this.name = "PostV2ListsInvalidRequestError"; } } /** * Not Found */ export type GetV2ListsListNotFoundErrorData = { statusCode: number; type: NotFoundType; code: NotFoundCode; message: string; }; /** * Not Found */ export class GetV2ListsListNotFoundError extends Error { statusCode: number; type: NotFoundType; code: NotFoundCode; /** The original data that was passed to this error instance. */ data$: GetV2ListsListNotFoundErrorData; constructor(err: GetV2ListsListNotFoundErrorData) { const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`; super(message); this.data$ = err; this.statusCode = err.statusCode; this.type = err.type; this.code = err.code; this.name = "GetV2ListsListNotFoundError"; } } /** * Not Found */ export type PostV2ListsListEntriesNotFoundErrorData = { statusCode: number; type: NotFoundType; code: NotFoundCode; message: string; }; /** * Not Found */ export class PostV2ListsListEntriesNotFoundError extends Error { statusCode: number; type: NotFoundType; code: NotFoundCode; /** The original data that was passed to this error instance. */ data$: PostV2ListsListEntriesNotFoundErrorData; constructor(err: PostV2ListsListEntriesNotFoundErrorData) { const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`; super(message); this.data$ = err; this.statusCode = err.statusCode; this.type = err.type; this.code = err.code; this.name = "PostV2ListsListEntriesNotFoundError"; } } /** * Bad Request */ export type PostV2ListsListEntriesInvalidRequestErrorData = { statusCode: number; type: BadRequestType; code: BadRequestCode; message: string; }; /** * Bad Request */ export class PostV2ListsListEntriesInvalidRequestError extends Error { statusCode: number; type: BadRequestType; code: BadRequestCode; /** The original data that was passed to this error instance. */ data$: PostV2ListsListEntriesInvalidRequestErrorData; constructor(err: PostV2ListsListEntriesInvalidRequestErrorData) { const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`; super(message); this.data$ = err; this.statusCode = err.statusCode; this.type = err.type; this.code = err.code; this.name = "PostV2ListsListEntriesInvalidRequestError"; } } /** * Not Found */ export type PutV2ListsListEntriesNotFoundErrorData = { statusCode: number; type: NotFoundType; code: NotFoundCode; message: string; }; /** * Not Found */ export class PutV2ListsListEntriesNotFoundError extends Error { statusCode: number; type: NotFoundType; code: NotFoundCode; /** The original data that was passed to this error instance. */ data$: PutV2ListsListEntriesNotFoundErrorData; constructor(err: PutV2ListsListEntriesNotFoundErrorData) { const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`; super(message); this.data$ = err; this.statusCode = err.statusCode; this.type = err.type; this.code = err.code; this.name = "PutV2ListsListEntriesNotFoundError"; } } export const PutV2ListsListEntriesCode = { MultipleMatchResults: "multiple_match_results", } as const; export type PutV2ListsListEntriesCode = ClosedEnum< typeof PutV2ListsListEntriesCode >; /** * Bad Request */ export type MultipleMatchResultsErrorData = { statusCode: number; type: BadRequestType; code: PutV2ListsListEntriesCode; message: string; }; /** * Bad Request */ export class MultipleMatchResultsError extends Error { statusCode: number; type: BadRequestType; code: PutV2ListsListEntriesCode; /** The original data that was passed to this error instance. */ data$: MultipleMatchResultsErrorData; constructor(err: MultipleMatchResultsErrorData) { const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`; super(message); this.data$ = err; this.statusCode = err.statusCode; this.type = err.type; this.code = err.code; this.name = "MultipleMatchResultsError"; } } export const CodeImmutableValue = { ImmutableValue: "immutable_value", } as const; export type CodeImmutableValue = ClosedEnum<typeof CodeImmutableValue>; /** * Bad Request */ export type ImmutableValueErrorData = { statusCode: number; type: BadRequestType; code: CodeImmutableValue; message: string; }; /** * Bad Request */ export class ImmutableValueError extends Error { statusCode: number; type: BadRequestType; code: CodeImmutableValue; /** The original data that was passed to this error instance. */ data$: ImmutableValueErrorData; constructor(err: ImmutableValueErrorData) { const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`; super(message); this.data$ = err; this.statusCode = err.statusCode; this.type = err.type; this.code = err.code; this.name = "ImmutableValueError"; } } /** * Not Found */ export type GetV2WorkspaceMembersWorkspaceMemberIdInvalidRequestErrorData = { statusCode: number; type: NotFoundType; code: NotFoundCode; message: string; }; /** * Not Found */ export class GetV2WorkspaceMembersWorkspaceMemberIdInvalidRequestError extends Error { statusCode: number; type: NotFoundType; code: NotFoundCode; /** The original data that was passed to this error instance. */ data$: GetV2WorkspaceMembersWorkspaceMemberIdInvalidRequestErrorData; constructor( err: GetV2WorkspaceMembersWorkspaceMemberIdInvalidRequestErrorData, ) { const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`; super(message); this.data$ = err; this.statusCode = err.statusCode; this.type = err.type; this.code = err.code; this.name = "GetV2WorkspaceMembersWorkspaceMemberIdInvalidRequestError"; } } /** * Not Found */ export type GetV2NotesNoteIdNotFoundErrorData = { statusCode: number; type: NotFoundType; code: NotFoundCode; message: string; }; /** * Not Found */ export class GetV2NotesNoteIdNotFoundError extends Error { statusCode: number; type: NotFoundType; code: NotFoundCode; /** The original data that was passed to this error instance. */ data$: GetV2NotesNoteIdNotFoundErrorData; constructor(err: GetV2NotesNoteIdNotFoundErrorData) { const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`; super(message); this.data$ = err; this.statusCode = err.statusCode; this.type = err.type; this.code = err.code; this.name = "GetV2NotesNoteIdNotFoundError"; } } /** * Bad Request */ export type PostV2TasksValidationTypeErrorData = { statusCode: number; type: BadRequestType; code: CodeValidationType; message: string; }; /** * Bad Request */ export class PostV2TasksValidationTypeError extends Error { statusCode: number; type: BadRequestType; code: CodeValidationType; /** The original data that was passed to this error instance. */ data$: PostV2TasksValidationTypeErrorData; constructor(err: PostV2TasksValidationTypeErrorData) { const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`; super(message); this.data$ = err; this.statusCode = err.statusCode; this.type = err.type; this.code = err.code; this.name = "PostV2TasksValidationTypeError"; } } /** * Not Found */ export type GetV2TasksTaskIdNotFoundErrorData = { statusCode: number; type: NotFoundType; code: NotFoundCode; message: string; }; /** * Not Found */ export class GetV2TasksTaskIdNotFoundError extends Error { statusCode: number; type: NotFoundType; code: NotFoundCode; /** The original data that was passed to this error instance. */ data$: GetV2TasksTaskIdNotFoundErrorData; constructor(err: GetV2TasksTaskIdNotFoundErrorData) { const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`; super(message); this.data$ = err; this.statusCode = err.statusCode; this.type = err.type; this.code = err.code; this.name = "GetV2TasksTaskIdNotFoundError"; } } /** * Not Found */ export type PatchV2TasksTaskIdNotFoundErrorData = { statusCode: number; type: NotFoundType; code: NotFoundCode; message: string; }; /** * Not Found */ export class PatchV2TasksTaskIdNotFoundError extends Error { statusCode: number; type: NotFoundType; code: NotFoundCode; /** The original data that was passed to this error instance. */ data$: PatchV2TasksTaskIdNotFoundErrorData; constructor(err: PatchV2TasksTaskIdNotFoundErrorData) { const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`; super(message); this.data$ = err; this.statusCode = err.statusCode; this.type = err.type; this.code = err.code; this.name = "PatchV2TasksTaskIdNotFoundError"; } } /** * Not Found */ export type GetV2ThreadsThreadIdNotFoundErrorData = { statusCode: number; type: NotFoundType; code: NotFoundCode; message: string; }; /** * Not Found */ export class GetV2ThreadsThreadIdNotFoundError extends Error { statusCode: number; type: NotFoundType; code: NotFoundCode; /** The original data that was passed to this error instance. */ data$: GetV2ThreadsThreadIdNotFoundErrorData; constructor(err: GetV2ThreadsThreadIdNotFoundErrorData) { const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`; super(message); this.data$ = err; this.statusCode = err.statusCode; this.type = err.type; this.code = err.code; this.name = "GetV2ThreadsThreadIdNotFoundError"; } } /** * Bad Request */ export type PostV2CommentsInvalidRequestErrorData = { statusCode: number; type: BadRequestType; code: BadRequestCode; message: string; }; /** * Bad Request */ export class PostV2CommentsInvalidRequestError extends Error { statusCode: number; type: BadRequestType; code: BadRequestCode; /** The original data that was passed to this error instance. */ data$: PostV2CommentsInvalidRequestErrorData; constructor(err: PostV2CommentsInvalidRequestErrorData) { const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`; super(message); this.data$ = err; this.statusCode = err.statusCode; this.type = err.type; this.code = err.code; this.name = "PostV2CommentsInvalidRequestError"; } } /** * Not Found */ export type GetV2CommentsCommentIdNotFoundErrorData = { statusCode: number; type: NotFoundType; code: NotFoundCode; message: string; }; /** * Not Found */ export class GetV2CommentsCommentIdNotFoundError extends Error { statusCode: number; type: NotFoundType; code: NotFoundCode; /** The original data that was passed to this error instance. */ data$: GetV2CommentsCommentIdNotFoundErrorData; constructor(err: GetV2CommentsCommentIdNotFoundErrorData) { const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`; super(message); this.data$ = err; this.statusCode = err.statusCode; this.type = err.type; this.code = err.code; this.name = "GetV2CommentsCommentIdNotFoundError"; } } /** * Not Found */ export type DeleteV2CommentsCommentIdNotFoundErrorData = { statusCode: number; type: NotFoundType; code: NotFoundCode; message: string; }; /** * Not Found */ export class DeleteV2CommentsCommentIdNotFoundError extends Error { statusCode: number; type: NotFoundType; code: NotFoundCode; /** The original data that was passed to this error instance. */ data$: DeleteV2CommentsCommentIdNotFoundErrorData; constructor(err: DeleteV2CommentsCommentIdNotFoundErrorData) { const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`; super(message); this.data$ = err; this.statusCode = err.statusCode; this.type = err.type; this.code = err.code; this.name = "DeleteV2CommentsCommentIdNotFoundError"; } } /** * Bad Request */ export type PostV2WebhooksValidationTypeErrorData = { statusCode: number; type: BadRequestType; code: CodeValidationType; message: string; }; /** * Bad Request */ export class PostV2WebhooksValidationTypeError extends Error { statusCode: number; type: BadRequestType; code: CodeValidationType; /** The original data that was passed to this error instance. */ data$: PostV2WebhooksValidationTypeErrorData; constructor(err: PostV2WebhooksValidationTypeErrorData) { const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`; super(message); this.data$ = err; this.statusCode = err.statusCode; this.type = err.type; this.code = err.code; this.name = "PostV2WebhooksValidationTypeError"; } } /** * Not Found */ export type GetV2WebhooksWebhookIdNotFoundErrorData = { statusCode: number; type: NotFoundType; code: NotFoundCode; message: string; }; /** * Not Found */ export class GetV2WebhooksWebhookIdNotFoundError extends Error { statusCode: number; type: NotFoundType; code: NotFoundCode; /** The original data that was passed to this error instance. */ data$: GetV2WebhooksWebhookIdNotFoundErrorData; constructor(err: GetV2WebhooksWebhookIdNotFoundErrorData) { const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`; super(message); this.data$ = err; this.statusCode = err.statusCode; this.type = err.type; this.code = err.code; this.name = "GetV2WebhooksWebhookIdNotFoundError"; } } /** * Not Found */ export type DeleteV2WebhooksWebhookIdNotFoundErrorData = { statusCode: number; type: NotFoundType; code: NotFoundCode; message: string; }; /** * Not Found */ export class DeleteV2WebhooksWebhookIdNotFoundError extends Error { statusCode: number; type: NotFoundType; code: NotFoundCode; /** The original data that was passed to this error instance. */ data$: DeleteV2WebhooksWebhookIdNotFoundErrorData; constructor(err: DeleteV2WebhooksWebhookIdNotFoundErrorData) { const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`; super(message); this.data$ = err; this.statusCode = err.statusCode; this.type = err.type; this.code = err.code; this.name = "DeleteV2WebhooksWebhookIdNotFoundError"; } } /** @internal */ export const NotFoundType$inboundSchema: z.ZodNativeEnum<typeof NotFoundType> = z.nativeEnum(NotFoundType); /** @internal */ export const NotFoundType$outboundSchema: z.ZodNativeEnum<typeof NotFoundType> = NotFoundType$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace NotFoundType$ { /** @deprecated use `NotFoundType$inboundSchema` instead. */ export const inboundSchema = NotFoundType$inboundSchema; /** @deprecated use `NotFoundType$outboundSchema` instead. */ export const outboundSchema = NotFoundType$outboundSchema; } /** @internal */ export const NotFoundCode$inboundSchema: z.ZodNativeEnum<typeof NotFoundCode> = z.nativeEnum(NotFoundCode); /** @internal */ export const NotFoundCode$outboundSchema: z.ZodNativeEnum<typeof NotFoundCode> = NotFoundCode$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace NotFoundCode$ { /** @deprecated use `NotFoundCode$inboundSchema` instead. */ export const inboundSchema = NotFoundCode$inboundSchema; /** @deprecated use `NotFoundCode$outboundSchema` instead. */ export const outboundSchema = NotFoundCode$outboundSchema; } /** @internal */ export const GetV2ObjectsObjectNotFoundError$inboundSchema: z.ZodType< GetV2ObjectsObjectNotFoundError, z.ZodTypeDef, unknown > = z.object({ status_code: z.number(), type: NotFoundType$inboundSchema, code: NotFoundCode$inboundSchema, message: z.string(), }) .transform((v) => { const remapped = remap$(v, { "status_code": "statusCode", }); return new GetV2ObjectsObjectNotFoundError(remapped); }); /** @internal */ export type GetV2ObjectsObjectNotFoundError$Outbound = { status_code: number; type: string; code: string; message: string; }; /** @internal */ export const GetV2ObjectsObjectNotFoundError$outboundSchema: z.ZodType< GetV2ObjectsObjectNotFoundError$Outbound, z.ZodTypeDef, GetV2ObjectsObjectNotFoundError > = z.instanceof(GetV2ObjectsObjectNotFoundError) .transform(v => v.data$) .pipe( z.object({ statusCode: z.number(), type: NotFoundType$outboundSchema, code: NotFoundCode$outboundSchema, message: z.string(), }).transform((v) => { return remap$(v, { statusCode: "status_code", }); }), ); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetV2ObjectsObjectNotFoundError$ { /** @deprecated use `GetV2ObjectsObjectNotFoundError$inboundSchema` instead. */ export const inboundSchema = GetV2ObjectsObjectNotFoundError$inboundSchema; /** @deprecated use `GetV2ObjectsObjectNotFoundError$outboundSchema` instead. */ export const outboundSchema = GetV2ObjectsObjectNotFoundError$outboundSchema; /** @deprecated use `GetV2ObjectsObjectNotFoundError$Outbound` instead. */ export type Outbound = GetV2ObjectsObjectNotFoundError$Outbound; } /** @internal */ export const ConflictType$inboundSchema: z.ZodNativeEnum<typeof ConflictType> = z.nativeEnum(ConflictType); /** @internal */ export const ConflictType$outboundSchema: z.ZodNativeEnum<typeof ConflictType> = ConflictType$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace ConflictType$ { /** @deprecated use `ConflictType$inboundSchema` instead. */ export const inboundSchema = ConflictType$inboundSchema; /** @deprecated use `ConflictType$outboundSchema` instead. */ export const outboundSchema = ConflictType$outboundSchema; } /** @internal */ export const ConflictCode$inboundSchema: z.ZodNativeEnum<typeof ConflictCode> = z.nativeEnum(ConflictCode); /** @internal */ export const ConflictCode$outboundSchema: z.ZodNativeEnum<typeof ConflictCode> = ConflictCode$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace ConflictCode$ { /** @deprecated use `ConflictCode$inboundSchema` instead. */ export const inboundSchema = ConflictCode$inboundSchema; /** @deprecated use `ConflictCode$outboundSchema` instead. */ export const outboundSchema = ConflictCode$outboundSchema; } /** @internal */ export const PostV2ObjectsSlugConflictError$inboundSchema: z.ZodType< PostV2ObjectsSlugConflictError, z.ZodTypeDef, unknown > = z.object({ status_code: z.number(), type: ConflictType$inboundSchema, code: ConflictCode$inboundSchema, message: z.string(), }) .transform((v) => { const remapped = remap$(v, { "status_code": "statusCode", }); return new PostV2ObjectsSlugConflictError(remapped); }); /** @internal */ export type PostV2ObjectsSlugConflictError$Outbound = { status_code: number; type: string; code: string; message: string; }; /** @internal */ export const PostV2ObjectsSlugConflictError$outboundSchema: z.ZodType< PostV2ObjectsSlugConflictError$Outbound, z.ZodTypeDef, PostV2ObjectsSlugConflictError > = z.instanceof(PostV2ObjectsSlugConflictError) .transform(v => v.data$) .pipe( z.object({ statusCode: z.number(), type: ConflictType$outboundSchema, code: ConflictCode$outboundSchema, message: z.string(), }).transform((v) => { return remap$(v, { statusCode: "status_code", }); }), ); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PostV2ObjectsSlugConflictError$ { /** @deprecated use `PostV2ObjectsSlugConflictError$inboundSchema` instead. */ export const inboundSchema = PostV2ObjectsSlugConflictError$inboundSchema; /** @deprecated use `PostV2ObjectsSlugConflictError$outboundSchema` instead. */ export const outboundSchema = PostV2ObjectsSlugConflictError$outboundSchema; /** @deprecated use `PostV2ObjectsSlugConflictError$Outbound` instead. */ export type Outbound = PostV2ObjectsSlugConflictError$Outbound; } /** @internal */ export const PatchV2ObjectsObjectSlugConflictError$inboundSchema: z.ZodType< PatchV2ObjectsObjectSlugConflictError, z.ZodTypeDef, unknown > = z.object({ status_code: z.number(), type: ConflictType$inboundSchema, code: ConflictCode$inboundSchema, message: z.string(), }) .transform((v) => { const remapped = remap$(v, { "status_code": "statusCode", }); return new PatchV2ObjectsObjectSlugConflictError(remapped); }); /** @internal */ export type PatchV2ObjectsObjectSlugConflictError$Outbound = { status_code: number; type: string; code: string; message: string; }; /** @internal */ export const PatchV2ObjectsObjectSlugConflictError$outboundSchema: z.ZodType< PatchV2ObjectsObjectSlugConflictError$Outbound, z.ZodTypeDef, PatchV2ObjectsObjectSlugConflictError > = z.instanceof(PatchV2ObjectsObjectSlugConflictError) .transform(v => v.data$) .pipe( z.object({ statusCode: z.number(), type: ConflictType$outboundSchema, code: ConflictCode$outboundSchema, message: z.string(), }).transform((v) => { return remap$(v, { statusCode: "status_code", }); }), ); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PatchV2ObjectsObjectSlugConflictError$ { /** @deprecated use `PatchV2ObjectsObjectSlugConflictError$inboundSchema` instead. */ export const inboundSchema = PatchV2ObjectsObjectSlugConflictError$inboundSchema; /** @deprecated use `PatchV2ObjectsObjectSlugConflictError$outboundSchema` instead. */ export const outboundSchema = PatchV2ObjectsObjectSlugConflictError$outboundSchema; /** @deprecated use `PatchV2ObjectsObjectSlugConflictError$Outbound` instead. */ export type Outbound = PatchV2ObjectsObjectSlugConflictError$Outbound; } /** @internal */ export const BadRequestType$inboundSchema: z.ZodNativeEnum< typeof BadRequestType > = z.nativeEnum(BadRequestType); /** @internal */ export const BadRequestType$outboundSchema: z.ZodNativeEnum< typeof BadRequestType > = BadRequestType$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace BadRequestType$ { /** @deprecated use `BadRequestType$inboundSchema` instead. */ export const inboundSchema = BadRequestType$inboundSchema; /** @deprecated use `BadRequestType$outboundSchema` instead. */ export const outboundSchema = BadRequestType$outboundSchema; } /** @internal */ export const CodeValidationType$inboundSchema: z.ZodNativeEnum< typeof CodeValidationType > = z.nativeEnum(CodeValidationType); /** @internal */ export const CodeValidationType$outboundSchema: z.ZodNativeEnum< typeof CodeValidationType > = CodeValidationType$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this modu