attio-js
Version:
Developer-friendly & type-safe JS/TS SDK based on the official OpenAPI spec of Attio.
578 lines (527 loc) • 18.3 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 { Result as SafeParseResult } from "../../types/fp.js";
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
export type PutV2ListsListEntriesEntryIdDataRequest = {
/**
* 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 PutV2ListsListEntriesEntryIdRequestBody = {
data: PutV2ListsListEntriesEntryIdDataRequest;
};
export type PutV2ListsListEntriesEntryIdRequest = {
list: string;
entryId: string;
requestBody: PutV2ListsListEntriesEntryIdRequestBody;
};
export type PutV2ListsListEntriesEntryIdId = {
/**
* 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 PutV2ListsListEntriesEntryIdEntryValues = {};
export type PutV2ListsListEntriesEntryIdDataResponse = {
id: PutV2ListsListEntriesEntryIdId;
/**
* 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: PutV2ListsListEntriesEntryIdEntryValues;
};
/**
* Success
*/
export type PutV2ListsListEntriesEntryIdResponse = {
data: PutV2ListsListEntriesEntryIdDataResponse;
};
/** @internal */
export const PutV2ListsListEntriesEntryIdDataRequest$inboundSchema: z.ZodType<
PutV2ListsListEntriesEntryIdDataRequest,
z.ZodTypeDef,
unknown
> = z.object({
entry_values: z.record(z.any()),
}).transform((v) => {
return remap$(v, {
"entry_values": "entryValues",
});
});
/** @internal */
export type PutV2ListsListEntriesEntryIdDataRequest$Outbound = {
entry_values: { [k: string]: any };
};
/** @internal */
export const PutV2ListsListEntriesEntryIdDataRequest$outboundSchema: z.ZodType<
PutV2ListsListEntriesEntryIdDataRequest$Outbound,
z.ZodTypeDef,
PutV2ListsListEntriesEntryIdDataRequest
> = 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 PutV2ListsListEntriesEntryIdDataRequest$ {
/** @deprecated use `PutV2ListsListEntriesEntryIdDataRequest$inboundSchema` instead. */
export const inboundSchema =
PutV2ListsListEntriesEntryIdDataRequest$inboundSchema;
/** @deprecated use `PutV2ListsListEntriesEntryIdDataRequest$outboundSchema` instead. */
export const outboundSchema =
PutV2ListsListEntriesEntryIdDataRequest$outboundSchema;
/** @deprecated use `PutV2ListsListEntriesEntryIdDataRequest$Outbound` instead. */
export type Outbound = PutV2ListsListEntriesEntryIdDataRequest$Outbound;
}
export function putV2ListsListEntriesEntryIdDataRequestToJSON(
putV2ListsListEntriesEntryIdDataRequest:
PutV2ListsListEntriesEntryIdDataRequest,
): string {
return JSON.stringify(
PutV2ListsListEntriesEntryIdDataRequest$outboundSchema.parse(
putV2ListsListEntriesEntryIdDataRequest,
),
);
}
export function putV2ListsListEntriesEntryIdDataRequestFromJSON(
jsonString: string,
): SafeParseResult<
PutV2ListsListEntriesEntryIdDataRequest,
SDKValidationError
> {
return safeParse(
jsonString,
(x) =>
PutV2ListsListEntriesEntryIdDataRequest$inboundSchema.parse(
JSON.parse(x),
),
`Failed to parse 'PutV2ListsListEntriesEntryIdDataRequest' from JSON`,
);
}
/** @internal */
export const PutV2ListsListEntriesEntryIdRequestBody$inboundSchema: z.ZodType<
PutV2ListsListEntriesEntryIdRequestBody,
z.ZodTypeDef,
unknown
> = z.object({
data: z.lazy(() => PutV2ListsListEntriesEntryIdDataRequest$inboundSchema),
});
/** @internal */
export type PutV2ListsListEntriesEntryIdRequestBody$Outbound = {
data: PutV2ListsListEntriesEntryIdDataRequest$Outbound;
};
/** @internal */
export const PutV2ListsListEntriesEntryIdRequestBody$outboundSchema: z.ZodType<
PutV2ListsListEntriesEntryIdRequestBody$Outbound,
z.ZodTypeDef,
PutV2ListsListEntriesEntryIdRequestBody
> = z.object({
data: z.lazy(() => PutV2ListsListEntriesEntryIdDataRequest$outboundSchema),
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace PutV2ListsListEntriesEntryIdRequestBody$ {
/** @deprecated use `PutV2ListsListEntriesEntryIdRequestBody$inboundSchema` instead. */
export const inboundSchema =
PutV2ListsListEntriesEntryIdRequestBody$inboundSchema;
/** @deprecated use `PutV2ListsListEntriesEntryIdRequestBody$outboundSchema` instead. */
export const outboundSchema =
PutV2ListsListEntriesEntryIdRequestBody$outboundSchema;
/** @deprecated use `PutV2ListsListEntriesEntryIdRequestBody$Outbound` instead. */
export type Outbound = PutV2ListsListEntriesEntryIdRequestBody$Outbound;
}
export function putV2ListsListEntriesEntryIdRequestBodyToJSON(
putV2ListsListEntriesEntryIdRequestBody:
PutV2ListsListEntriesEntryIdRequestBody,
): string {
return JSON.stringify(
PutV2ListsListEntriesEntryIdRequestBody$outboundSchema.parse(
putV2ListsListEntriesEntryIdRequestBody,
),
);
}
export function putV2ListsListEntriesEntryIdRequestBodyFromJSON(
jsonString: string,
): SafeParseResult<
PutV2ListsListEntriesEntryIdRequestBody,
SDKValidationError
> {
return safeParse(
jsonString,
(x) =>
PutV2ListsListEntriesEntryIdRequestBody$inboundSchema.parse(
JSON.parse(x),
),
`Failed to parse 'PutV2ListsListEntriesEntryIdRequestBody' from JSON`,
);
}
/** @internal */
export const PutV2ListsListEntriesEntryIdRequest$inboundSchema: z.ZodType<
PutV2ListsListEntriesEntryIdRequest,
z.ZodTypeDef,
unknown
> = z.object({
list: z.string(),
entry_id: z.string(),
RequestBody: z.lazy(() =>
PutV2ListsListEntriesEntryIdRequestBody$inboundSchema
),
}).transform((v) => {
return remap$(v, {
"entry_id": "entryId",
"RequestBody": "requestBody",
});
});
/** @internal */
export type PutV2ListsListEntriesEntryIdRequest$Outbound = {
list: string;
entry_id: string;
RequestBody: PutV2ListsListEntriesEntryIdRequestBody$Outbound;
};
/** @internal */
export const PutV2ListsListEntriesEntryIdRequest$outboundSchema: z.ZodType<
PutV2ListsListEntriesEntryIdRequest$Outbound,
z.ZodTypeDef,
PutV2ListsListEntriesEntryIdRequest
> = z.object({
list: z.string(),
entryId: z.string(),
requestBody: z.lazy(() =>
PutV2ListsListEntriesEntryIdRequestBody$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 PutV2ListsListEntriesEntryIdRequest$ {
/** @deprecated use `PutV2ListsListEntriesEntryIdRequest$inboundSchema` instead. */
export const inboundSchema =
PutV2ListsListEntriesEntryIdRequest$inboundSchema;
/** @deprecated use `PutV2ListsListEntriesEntryIdRequest$outboundSchema` instead. */
export const outboundSchema =
PutV2ListsListEntriesEntryIdRequest$outboundSchema;
/** @deprecated use `PutV2ListsListEntriesEntryIdRequest$Outbound` instead. */
export type Outbound = PutV2ListsListEntriesEntryIdRequest$Outbound;
}
export function putV2ListsListEntriesEntryIdRequestToJSON(
putV2ListsListEntriesEntryIdRequest: PutV2ListsListEntriesEntryIdRequest,
): string {
return JSON.stringify(
PutV2ListsListEntriesEntryIdRequest$outboundSchema.parse(
putV2ListsListEntriesEntryIdRequest,
),
);
}
export function putV2ListsListEntriesEntryIdRequestFromJSON(
jsonString: string,
): SafeParseResult<PutV2ListsListEntriesEntryIdRequest, SDKValidationError> {
return safeParse(
jsonString,
(x) =>
PutV2ListsListEntriesEntryIdRequest$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PutV2ListsListEntriesEntryIdRequest' from JSON`,
);
}
/** @internal */
export const PutV2ListsListEntriesEntryIdId$inboundSchema: z.ZodType<
PutV2ListsListEntriesEntryIdId,
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 PutV2ListsListEntriesEntryIdId$Outbound = {
workspace_id: string;
list_id: string;
entry_id: string;
};
/** @internal */
export const PutV2ListsListEntriesEntryIdId$outboundSchema: z.ZodType<
PutV2ListsListEntriesEntryIdId$Outbound,
z.ZodTypeDef,
PutV2ListsListEntriesEntryIdId
> = 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 PutV2ListsListEntriesEntryIdId$ {
/** @deprecated use `PutV2ListsListEntriesEntryIdId$inboundSchema` instead. */
export const inboundSchema = PutV2ListsListEntriesEntryIdId$inboundSchema;
/** @deprecated use `PutV2ListsListEntriesEntryIdId$outboundSchema` instead. */
export const outboundSchema = PutV2ListsListEntriesEntryIdId$outboundSchema;
/** @deprecated use `PutV2ListsListEntriesEntryIdId$Outbound` instead. */
export type Outbound = PutV2ListsListEntriesEntryIdId$Outbound;
}
export function putV2ListsListEntriesEntryIdIdToJSON(
putV2ListsListEntriesEntryIdId: PutV2ListsListEntriesEntryIdId,
): string {
return JSON.stringify(
PutV2ListsListEntriesEntryIdId$outboundSchema.parse(
putV2ListsListEntriesEntryIdId,
),
);
}
export function putV2ListsListEntriesEntryIdIdFromJSON(
jsonString: string,
): SafeParseResult<PutV2ListsListEntriesEntryIdId, SDKValidationError> {
return safeParse(
jsonString,
(x) => PutV2ListsListEntriesEntryIdId$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PutV2ListsListEntriesEntryIdId' from JSON`,
);
}
/** @internal */
export const PutV2ListsListEntriesEntryIdEntryValues$inboundSchema: z.ZodType<
PutV2ListsListEntriesEntryIdEntryValues,
z.ZodTypeDef,
unknown
> = z.object({});
/** @internal */
export type PutV2ListsListEntriesEntryIdEntryValues$Outbound = {};
/** @internal */
export const PutV2ListsListEntriesEntryIdEntryValues$outboundSchema: z.ZodType<
PutV2ListsListEntriesEntryIdEntryValues$Outbound,
z.ZodTypeDef,
PutV2ListsListEntriesEntryIdEntryValues
> = 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 PutV2ListsListEntriesEntryIdEntryValues$ {
/** @deprecated use `PutV2ListsListEntriesEntryIdEntryValues$inboundSchema` instead. */
export const inboundSchema =
PutV2ListsListEntriesEntryIdEntryValues$inboundSchema;
/** @deprecated use `PutV2ListsListEntriesEntryIdEntryValues$outboundSchema` instead. */
export const outboundSchema =
PutV2ListsListEntriesEntryIdEntryValues$outboundSchema;
/** @deprecated use `PutV2ListsListEntriesEntryIdEntryValues$Outbound` instead. */
export type Outbound = PutV2ListsListEntriesEntryIdEntryValues$Outbound;
}
export function putV2ListsListEntriesEntryIdEntryValuesToJSON(
putV2ListsListEntriesEntryIdEntryValues:
PutV2ListsListEntriesEntryIdEntryValues,
): string {
return JSON.stringify(
PutV2ListsListEntriesEntryIdEntryValues$outboundSchema.parse(
putV2ListsListEntriesEntryIdEntryValues,
),
);
}
export function putV2ListsListEntriesEntryIdEntryValuesFromJSON(
jsonString: string,
): SafeParseResult<
PutV2ListsListEntriesEntryIdEntryValues,
SDKValidationError
> {
return safeParse(
jsonString,
(x) =>
PutV2ListsListEntriesEntryIdEntryValues$inboundSchema.parse(
JSON.parse(x),
),
`Failed to parse 'PutV2ListsListEntriesEntryIdEntryValues' from JSON`,
);
}
/** @internal */
export const PutV2ListsListEntriesEntryIdDataResponse$inboundSchema: z.ZodType<
PutV2ListsListEntriesEntryIdDataResponse,
z.ZodTypeDef,
unknown
> = z.object({
id: z.lazy(() => PutV2ListsListEntriesEntryIdId$inboundSchema),
parent_record_id: z.string(),
parent_object: z.string(),
created_at: z.string(),
entry_values: z.lazy(() =>
PutV2ListsListEntriesEntryIdEntryValues$inboundSchema
),
}).transform((v) => {
return remap$(v, {
"parent_record_id": "parentRecordId",
"parent_object": "parentObject",
"created_at": "createdAt",
"entry_values": "entryValues",
});
});
/** @internal */
export type PutV2ListsListEntriesEntryIdDataResponse$Outbound = {
id: PutV2ListsListEntriesEntryIdId$Outbound;
parent_record_id: string;
parent_object: string;
created_at: string;
entry_values: PutV2ListsListEntriesEntryIdEntryValues$Outbound;
};
/** @internal */
export const PutV2ListsListEntriesEntryIdDataResponse$outboundSchema: z.ZodType<
PutV2ListsListEntriesEntryIdDataResponse$Outbound,
z.ZodTypeDef,
PutV2ListsListEntriesEntryIdDataResponse
> = z.object({
id: z.lazy(() => PutV2ListsListEntriesEntryIdId$outboundSchema),
parentRecordId: z.string(),
parentObject: z.string(),
createdAt: z.string(),
entryValues: z.lazy(() =>
PutV2ListsListEntriesEntryIdEntryValues$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 PutV2ListsListEntriesEntryIdDataResponse$ {
/** @deprecated use `PutV2ListsListEntriesEntryIdDataResponse$inboundSchema` instead. */
export const inboundSchema =
PutV2ListsListEntriesEntryIdDataResponse$inboundSchema;
/** @deprecated use `PutV2ListsListEntriesEntryIdDataResponse$outboundSchema` instead. */
export const outboundSchema =
PutV2ListsListEntriesEntryIdDataResponse$outboundSchema;
/** @deprecated use `PutV2ListsListEntriesEntryIdDataResponse$Outbound` instead. */
export type Outbound = PutV2ListsListEntriesEntryIdDataResponse$Outbound;
}
export function putV2ListsListEntriesEntryIdDataResponseToJSON(
putV2ListsListEntriesEntryIdDataResponse:
PutV2ListsListEntriesEntryIdDataResponse,
): string {
return JSON.stringify(
PutV2ListsListEntriesEntryIdDataResponse$outboundSchema.parse(
putV2ListsListEntriesEntryIdDataResponse,
),
);
}
export function putV2ListsListEntriesEntryIdDataResponseFromJSON(
jsonString: string,
): SafeParseResult<
PutV2ListsListEntriesEntryIdDataResponse,
SDKValidationError
> {
return safeParse(
jsonString,
(x) =>
PutV2ListsListEntriesEntryIdDataResponse$inboundSchema.parse(
JSON.parse(x),
),
`Failed to parse 'PutV2ListsListEntriesEntryIdDataResponse' from JSON`,
);
}
/** @internal */
export const PutV2ListsListEntriesEntryIdResponse$inboundSchema: z.ZodType<
PutV2ListsListEntriesEntryIdResponse,
z.ZodTypeDef,
unknown
> = z.object({
data: z.lazy(() => PutV2ListsListEntriesEntryIdDataResponse$inboundSchema),
});
/** @internal */
export type PutV2ListsListEntriesEntryIdResponse$Outbound = {
data: PutV2ListsListEntriesEntryIdDataResponse$Outbound;
};
/** @internal */
export const PutV2ListsListEntriesEntryIdResponse$outboundSchema: z.ZodType<
PutV2ListsListEntriesEntryIdResponse$Outbound,
z.ZodTypeDef,
PutV2ListsListEntriesEntryIdResponse
> = z.object({
data: z.lazy(() => PutV2ListsListEntriesEntryIdDataResponse$outboundSchema),
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace PutV2ListsListEntriesEntryIdResponse$ {
/** @deprecated use `PutV2ListsListEntriesEntryIdResponse$inboundSchema` instead. */
export const inboundSchema =
PutV2ListsListEntriesEntryIdResponse$inboundSchema;
/** @deprecated use `PutV2ListsListEntriesEntryIdResponse$outboundSchema` instead. */
export const outboundSchema =
PutV2ListsListEntriesEntryIdResponse$outboundSchema;
/** @deprecated use `PutV2ListsListEntriesEntryIdResponse$Outbound` instead. */
export type Outbound = PutV2ListsListEntriesEntryIdResponse$Outbound;
}
export function putV2ListsListEntriesEntryIdResponseToJSON(
putV2ListsListEntriesEntryIdResponse: PutV2ListsListEntriesEntryIdResponse,
): string {
return JSON.stringify(
PutV2ListsListEntriesEntryIdResponse$outboundSchema.parse(
putV2ListsListEntriesEntryIdResponse,
),
);
}
export function putV2ListsListEntriesEntryIdResponseFromJSON(
jsonString: string,
): SafeParseResult<PutV2ListsListEntriesEntryIdResponse, SDKValidationError> {
return safeParse(
jsonString,
(x) =>
PutV2ListsListEntriesEntryIdResponse$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PutV2ListsListEntriesEntryIdResponse' from JSON`,
);
}