attio-js
Version:
Developer-friendly & type-safe JS/TS SDK based on the official OpenAPI spec of Attio.
815 lines (742 loc) • 26.9 kB
text/typescript
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import * as z from "zod";
import { remap as remap$ } from "../../lib/primitives.js";
import { safeParse } from "../../lib/schemas.js";
import { ClosedEnum } from "../../types/enums.js";
import { Result as SafeParseResult } from "../../types/fp.js";
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
/**
* The direction to sort the results by.
*/
export const PostV2ListsListEntriesQueryDirection2 = {
Asc: "asc",
Desc: "desc",
} as const;
/**
* The direction to sort the results by.
*/
export type PostV2ListsListEntriesQueryDirection2 = ClosedEnum<
typeof PostV2ListsListEntriesQueryDirection2
>;
/**
* Sort by path
*/
export type PostV2ListsListEntriesQuerySort2 = {
/**
* The direction to sort the results by.
*/
direction: PostV2ListsListEntriesQueryDirection2;
/**
* You may use the `path` property to traverse record reference attributes and parent records on list entries. `path` accepts an array of tuples where the first element of each tuple is the slug or ID of a list/object, and the second element is the slug or ID of an attribute on that list/object. The first element of the first tuple must correspond to the list or object that you are querying. For example, if you wanted to sort by the name of the parent record (a company) on a list with the slug "sales", you would pass the value `[['sales', 'parent_record'], ['companies', 'name']]`.
*/
path: Array<Array<string>>;
/**
* Which field on the value to sort by e.g. "last_name" on a name value.
*/
field?: string | undefined;
};
/**
* The direction to sort the results by.
*/
export const PostV2ListsListEntriesQueryDirection1 = {
Asc: "asc",
Desc: "desc",
} as const;
/**
* The direction to sort the results by.
*/
export type PostV2ListsListEntriesQueryDirection1 = ClosedEnum<
typeof PostV2ListsListEntriesQueryDirection1
>;
/**
* Sort by attribute
*/
export type PostV2ListsListEntriesQuerySort1 = {
/**
* The direction to sort the results by.
*/
direction: PostV2ListsListEntriesQueryDirection1;
/**
* A slug or ID to identify the attribute to sort by.
*/
attribute: string;
/**
* Which field on the value to sort by e.g. "last_name" on a name value.
*/
field?: string | undefined;
};
export type PostV2ListsListEntriesQuerySortUnion =
| PostV2ListsListEntriesQuerySort1
| PostV2ListsListEntriesQuerySort2;
export type PostV2ListsListEntriesQueryRequestBody = {
/**
* An object used to filter results to a subset of results. See the [full guide to filtering and sorting here](/docs/filtering-and-sorting).
*/
filter?: { [k: string]: any } | undefined;
/**
* An object used to sort results. See the [full guide to filtering and sorting here](/docs/filtering-and-sorting).
*/
sorts?:
| Array<PostV2ListsListEntriesQuerySort1 | PostV2ListsListEntriesQuerySort2>
| undefined;
/**
* The maximum number of results to return. Defaults to 500. See the [full guide to pagination here](/docs/pagination).
*/
limit?: number | undefined;
/**
* The number of results to skip over before returning. Defaults to 0. See the [full guide to pagination here](/docs/pagination).
*/
offset?: number | undefined;
};
export type PostV2ListsListEntriesQueryRequest = {
list: string;
requestBody: PostV2ListsListEntriesQueryRequestBody;
};
export type PostV2ListsListEntriesQueryId = {
/**
* 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 PostV2ListsListEntriesQueryEntryValues = {};
export type PostV2ListsListEntriesQueryData = {
id: PostV2ListsListEntriesQueryId;
/**
* 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: PostV2ListsListEntriesQueryEntryValues;
};
/**
* Success
*/
export type PostV2ListsListEntriesQueryResponse = {
data: Array<PostV2ListsListEntriesQueryData>;
};
/** @internal */
export const PostV2ListsListEntriesQueryDirection2$inboundSchema:
z.ZodNativeEnum<typeof PostV2ListsListEntriesQueryDirection2> = z.nativeEnum(
PostV2ListsListEntriesQueryDirection2,
);
/** @internal */
export const PostV2ListsListEntriesQueryDirection2$outboundSchema:
z.ZodNativeEnum<typeof PostV2ListsListEntriesQueryDirection2> =
PostV2ListsListEntriesQueryDirection2$inboundSchema;
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace PostV2ListsListEntriesQueryDirection2$ {
/** @deprecated use `PostV2ListsListEntriesQueryDirection2$inboundSchema` instead. */
export const inboundSchema =
PostV2ListsListEntriesQueryDirection2$inboundSchema;
/** @deprecated use `PostV2ListsListEntriesQueryDirection2$outboundSchema` instead. */
export const outboundSchema =
PostV2ListsListEntriesQueryDirection2$outboundSchema;
}
/** @internal */
export const PostV2ListsListEntriesQuerySort2$inboundSchema: z.ZodType<
PostV2ListsListEntriesQuerySort2,
z.ZodTypeDef,
unknown
> = z.object({
direction: PostV2ListsListEntriesQueryDirection2$inboundSchema,
path: z.array(z.array(z.string())),
field: z.string().optional(),
});
/** @internal */
export type PostV2ListsListEntriesQuerySort2$Outbound = {
direction: string;
path: Array<Array<string>>;
field?: string | undefined;
};
/** @internal */
export const PostV2ListsListEntriesQuerySort2$outboundSchema: z.ZodType<
PostV2ListsListEntriesQuerySort2$Outbound,
z.ZodTypeDef,
PostV2ListsListEntriesQuerySort2
> = z.object({
direction: PostV2ListsListEntriesQueryDirection2$outboundSchema,
path: z.array(z.array(z.string())),
field: z.string().optional(),
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace PostV2ListsListEntriesQuerySort2$ {
/** @deprecated use `PostV2ListsListEntriesQuerySort2$inboundSchema` instead. */
export const inboundSchema = PostV2ListsListEntriesQuerySort2$inboundSchema;
/** @deprecated use `PostV2ListsListEntriesQuerySort2$outboundSchema` instead. */
export const outboundSchema = PostV2ListsListEntriesQuerySort2$outboundSchema;
/** @deprecated use `PostV2ListsListEntriesQuerySort2$Outbound` instead. */
export type Outbound = PostV2ListsListEntriesQuerySort2$Outbound;
}
export function postV2ListsListEntriesQuerySort2ToJSON(
postV2ListsListEntriesQuerySort2: PostV2ListsListEntriesQuerySort2,
): string {
return JSON.stringify(
PostV2ListsListEntriesQuerySort2$outboundSchema.parse(
postV2ListsListEntriesQuerySort2,
),
);
}
export function postV2ListsListEntriesQuerySort2FromJSON(
jsonString: string,
): SafeParseResult<PostV2ListsListEntriesQuerySort2, SDKValidationError> {
return safeParse(
jsonString,
(x) => PostV2ListsListEntriesQuerySort2$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PostV2ListsListEntriesQuerySort2' from JSON`,
);
}
/** @internal */
export const PostV2ListsListEntriesQueryDirection1$inboundSchema:
z.ZodNativeEnum<typeof PostV2ListsListEntriesQueryDirection1> = z.nativeEnum(
PostV2ListsListEntriesQueryDirection1,
);
/** @internal */
export const PostV2ListsListEntriesQueryDirection1$outboundSchema:
z.ZodNativeEnum<typeof PostV2ListsListEntriesQueryDirection1> =
PostV2ListsListEntriesQueryDirection1$inboundSchema;
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace PostV2ListsListEntriesQueryDirection1$ {
/** @deprecated use `PostV2ListsListEntriesQueryDirection1$inboundSchema` instead. */
export const inboundSchema =
PostV2ListsListEntriesQueryDirection1$inboundSchema;
/** @deprecated use `PostV2ListsListEntriesQueryDirection1$outboundSchema` instead. */
export const outboundSchema =
PostV2ListsListEntriesQueryDirection1$outboundSchema;
}
/** @internal */
export const PostV2ListsListEntriesQuerySort1$inboundSchema: z.ZodType<
PostV2ListsListEntriesQuerySort1,
z.ZodTypeDef,
unknown
> = z.object({
direction: PostV2ListsListEntriesQueryDirection1$inboundSchema,
attribute: z.string(),
field: z.string().optional(),
});
/** @internal */
export type PostV2ListsListEntriesQuerySort1$Outbound = {
direction: string;
attribute: string;
field?: string | undefined;
};
/** @internal */
export const PostV2ListsListEntriesQuerySort1$outboundSchema: z.ZodType<
PostV2ListsListEntriesQuerySort1$Outbound,
z.ZodTypeDef,
PostV2ListsListEntriesQuerySort1
> = z.object({
direction: PostV2ListsListEntriesQueryDirection1$outboundSchema,
attribute: z.string(),
field: z.string().optional(),
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace PostV2ListsListEntriesQuerySort1$ {
/** @deprecated use `PostV2ListsListEntriesQuerySort1$inboundSchema` instead. */
export const inboundSchema = PostV2ListsListEntriesQuerySort1$inboundSchema;
/** @deprecated use `PostV2ListsListEntriesQuerySort1$outboundSchema` instead. */
export const outboundSchema = PostV2ListsListEntriesQuerySort1$outboundSchema;
/** @deprecated use `PostV2ListsListEntriesQuerySort1$Outbound` instead. */
export type Outbound = PostV2ListsListEntriesQuerySort1$Outbound;
}
export function postV2ListsListEntriesQuerySort1ToJSON(
postV2ListsListEntriesQuerySort1: PostV2ListsListEntriesQuerySort1,
): string {
return JSON.stringify(
PostV2ListsListEntriesQuerySort1$outboundSchema.parse(
postV2ListsListEntriesQuerySort1,
),
);
}
export function postV2ListsListEntriesQuerySort1FromJSON(
jsonString: string,
): SafeParseResult<PostV2ListsListEntriesQuerySort1, SDKValidationError> {
return safeParse(
jsonString,
(x) => PostV2ListsListEntriesQuerySort1$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PostV2ListsListEntriesQuerySort1' from JSON`,
);
}
/** @internal */
export const PostV2ListsListEntriesQuerySortUnion$inboundSchema: z.ZodType<
PostV2ListsListEntriesQuerySortUnion,
z.ZodTypeDef,
unknown
> = z.union([
z.lazy(() => PostV2ListsListEntriesQuerySort1$inboundSchema),
z.lazy(() => PostV2ListsListEntriesQuerySort2$inboundSchema),
]);
/** @internal */
export type PostV2ListsListEntriesQuerySortUnion$Outbound =
| PostV2ListsListEntriesQuerySort1$Outbound
| PostV2ListsListEntriesQuerySort2$Outbound;
/** @internal */
export const PostV2ListsListEntriesQuerySortUnion$outboundSchema: z.ZodType<
PostV2ListsListEntriesQuerySortUnion$Outbound,
z.ZodTypeDef,
PostV2ListsListEntriesQuerySortUnion
> = z.union([
z.lazy(() => PostV2ListsListEntriesQuerySort1$outboundSchema),
z.lazy(() => PostV2ListsListEntriesQuerySort2$outboundSchema),
]);
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace PostV2ListsListEntriesQuerySortUnion$ {
/** @deprecated use `PostV2ListsListEntriesQuerySortUnion$inboundSchema` instead. */
export const inboundSchema =
PostV2ListsListEntriesQuerySortUnion$inboundSchema;
/** @deprecated use `PostV2ListsListEntriesQuerySortUnion$outboundSchema` instead. */
export const outboundSchema =
PostV2ListsListEntriesQuerySortUnion$outboundSchema;
/** @deprecated use `PostV2ListsListEntriesQuerySortUnion$Outbound` instead. */
export type Outbound = PostV2ListsListEntriesQuerySortUnion$Outbound;
}
export function postV2ListsListEntriesQuerySortUnionToJSON(
postV2ListsListEntriesQuerySortUnion: PostV2ListsListEntriesQuerySortUnion,
): string {
return JSON.stringify(
PostV2ListsListEntriesQuerySortUnion$outboundSchema.parse(
postV2ListsListEntriesQuerySortUnion,
),
);
}
export function postV2ListsListEntriesQuerySortUnionFromJSON(
jsonString: string,
): SafeParseResult<PostV2ListsListEntriesQuerySortUnion, SDKValidationError> {
return safeParse(
jsonString,
(x) =>
PostV2ListsListEntriesQuerySortUnion$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PostV2ListsListEntriesQuerySortUnion' from JSON`,
);
}
/** @internal */
export const PostV2ListsListEntriesQueryRequestBody$inboundSchema: z.ZodType<
PostV2ListsListEntriesQueryRequestBody,
z.ZodTypeDef,
unknown
> = z.object({
filter: z.record(z.any()).optional(),
sorts: z.array(
z.union([
z.lazy(() => PostV2ListsListEntriesQuerySort1$inboundSchema),
z.lazy(() => PostV2ListsListEntriesQuerySort2$inboundSchema),
]),
).optional(),
limit: z.number().optional(),
offset: z.number().optional(),
});
/** @internal */
export type PostV2ListsListEntriesQueryRequestBody$Outbound = {
filter?: { [k: string]: any } | undefined;
sorts?:
| Array<
| PostV2ListsListEntriesQuerySort1$Outbound
| PostV2ListsListEntriesQuerySort2$Outbound
>
| undefined;
limit?: number | undefined;
offset?: number | undefined;
};
/** @internal */
export const PostV2ListsListEntriesQueryRequestBody$outboundSchema: z.ZodType<
PostV2ListsListEntriesQueryRequestBody$Outbound,
z.ZodTypeDef,
PostV2ListsListEntriesQueryRequestBody
> = z.object({
filter: z.record(z.any()).optional(),
sorts: z.array(
z.union([
z.lazy(() => PostV2ListsListEntriesQuerySort1$outboundSchema),
z.lazy(() => PostV2ListsListEntriesQuerySort2$outboundSchema),
]),
).optional(),
limit: z.number().optional(),
offset: z.number().optional(),
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace PostV2ListsListEntriesQueryRequestBody$ {
/** @deprecated use `PostV2ListsListEntriesQueryRequestBody$inboundSchema` instead. */
export const inboundSchema =
PostV2ListsListEntriesQueryRequestBody$inboundSchema;
/** @deprecated use `PostV2ListsListEntriesQueryRequestBody$outboundSchema` instead. */
export const outboundSchema =
PostV2ListsListEntriesQueryRequestBody$outboundSchema;
/** @deprecated use `PostV2ListsListEntriesQueryRequestBody$Outbound` instead. */
export type Outbound = PostV2ListsListEntriesQueryRequestBody$Outbound;
}
export function postV2ListsListEntriesQueryRequestBodyToJSON(
postV2ListsListEntriesQueryRequestBody:
PostV2ListsListEntriesQueryRequestBody,
): string {
return JSON.stringify(
PostV2ListsListEntriesQueryRequestBody$outboundSchema.parse(
postV2ListsListEntriesQueryRequestBody,
),
);
}
export function postV2ListsListEntriesQueryRequestBodyFromJSON(
jsonString: string,
): SafeParseResult<PostV2ListsListEntriesQueryRequestBody, SDKValidationError> {
return safeParse(
jsonString,
(x) =>
PostV2ListsListEntriesQueryRequestBody$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PostV2ListsListEntriesQueryRequestBody' from JSON`,
);
}
/** @internal */
export const PostV2ListsListEntriesQueryRequest$inboundSchema: z.ZodType<
PostV2ListsListEntriesQueryRequest,
z.ZodTypeDef,
unknown
> = z.object({
list: z.string(),
RequestBody: z.lazy(() =>
PostV2ListsListEntriesQueryRequestBody$inboundSchema
),
}).transform((v) => {
return remap$(v, {
"RequestBody": "requestBody",
});
});
/** @internal */
export type PostV2ListsListEntriesQueryRequest$Outbound = {
list: string;
RequestBody: PostV2ListsListEntriesQueryRequestBody$Outbound;
};
/** @internal */
export const PostV2ListsListEntriesQueryRequest$outboundSchema: z.ZodType<
PostV2ListsListEntriesQueryRequest$Outbound,
z.ZodTypeDef,
PostV2ListsListEntriesQueryRequest
> = z.object({
list: z.string(),
requestBody: z.lazy(() =>
PostV2ListsListEntriesQueryRequestBody$outboundSchema
),
}).transform((v) => {
return remap$(v, {
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 PostV2ListsListEntriesQueryRequest$ {
/** @deprecated use `PostV2ListsListEntriesQueryRequest$inboundSchema` instead. */
export const inboundSchema = PostV2ListsListEntriesQueryRequest$inboundSchema;
/** @deprecated use `PostV2ListsListEntriesQueryRequest$outboundSchema` instead. */
export const outboundSchema =
PostV2ListsListEntriesQueryRequest$outboundSchema;
/** @deprecated use `PostV2ListsListEntriesQueryRequest$Outbound` instead. */
export type Outbound = PostV2ListsListEntriesQueryRequest$Outbound;
}
export function postV2ListsListEntriesQueryRequestToJSON(
postV2ListsListEntriesQueryRequest: PostV2ListsListEntriesQueryRequest,
): string {
return JSON.stringify(
PostV2ListsListEntriesQueryRequest$outboundSchema.parse(
postV2ListsListEntriesQueryRequest,
),
);
}
export function postV2ListsListEntriesQueryRequestFromJSON(
jsonString: string,
): SafeParseResult<PostV2ListsListEntriesQueryRequest, SDKValidationError> {
return safeParse(
jsonString,
(x) =>
PostV2ListsListEntriesQueryRequest$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PostV2ListsListEntriesQueryRequest' from JSON`,
);
}
/** @internal */
export const PostV2ListsListEntriesQueryId$inboundSchema: z.ZodType<
PostV2ListsListEntriesQueryId,
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 PostV2ListsListEntriesQueryId$Outbound = {
workspace_id: string;
list_id: string;
entry_id: string;
};
/** @internal */
export const PostV2ListsListEntriesQueryId$outboundSchema: z.ZodType<
PostV2ListsListEntriesQueryId$Outbound,
z.ZodTypeDef,
PostV2ListsListEntriesQueryId
> = 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 PostV2ListsListEntriesQueryId$ {
/** @deprecated use `PostV2ListsListEntriesQueryId$inboundSchema` instead. */
export const inboundSchema = PostV2ListsListEntriesQueryId$inboundSchema;
/** @deprecated use `PostV2ListsListEntriesQueryId$outboundSchema` instead. */
export const outboundSchema = PostV2ListsListEntriesQueryId$outboundSchema;
/** @deprecated use `PostV2ListsListEntriesQueryId$Outbound` instead. */
export type Outbound = PostV2ListsListEntriesQueryId$Outbound;
}
export function postV2ListsListEntriesQueryIdToJSON(
postV2ListsListEntriesQueryId: PostV2ListsListEntriesQueryId,
): string {
return JSON.stringify(
PostV2ListsListEntriesQueryId$outboundSchema.parse(
postV2ListsListEntriesQueryId,
),
);
}
export function postV2ListsListEntriesQueryIdFromJSON(
jsonString: string,
): SafeParseResult<PostV2ListsListEntriesQueryId, SDKValidationError> {
return safeParse(
jsonString,
(x) => PostV2ListsListEntriesQueryId$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PostV2ListsListEntriesQueryId' from JSON`,
);
}
/** @internal */
export const PostV2ListsListEntriesQueryEntryValues$inboundSchema: z.ZodType<
PostV2ListsListEntriesQueryEntryValues,
z.ZodTypeDef,
unknown
> = z.object({});
/** @internal */
export type PostV2ListsListEntriesQueryEntryValues$Outbound = {};
/** @internal */
export const PostV2ListsListEntriesQueryEntryValues$outboundSchema: z.ZodType<
PostV2ListsListEntriesQueryEntryValues$Outbound,
z.ZodTypeDef,
PostV2ListsListEntriesQueryEntryValues
> = 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 PostV2ListsListEntriesQueryEntryValues$ {
/** @deprecated use `PostV2ListsListEntriesQueryEntryValues$inboundSchema` instead. */
export const inboundSchema =
PostV2ListsListEntriesQueryEntryValues$inboundSchema;
/** @deprecated use `PostV2ListsListEntriesQueryEntryValues$outboundSchema` instead. */
export const outboundSchema =
PostV2ListsListEntriesQueryEntryValues$outboundSchema;
/** @deprecated use `PostV2ListsListEntriesQueryEntryValues$Outbound` instead. */
export type Outbound = PostV2ListsListEntriesQueryEntryValues$Outbound;
}
export function postV2ListsListEntriesQueryEntryValuesToJSON(
postV2ListsListEntriesQueryEntryValues:
PostV2ListsListEntriesQueryEntryValues,
): string {
return JSON.stringify(
PostV2ListsListEntriesQueryEntryValues$outboundSchema.parse(
postV2ListsListEntriesQueryEntryValues,
),
);
}
export function postV2ListsListEntriesQueryEntryValuesFromJSON(
jsonString: string,
): SafeParseResult<PostV2ListsListEntriesQueryEntryValues, SDKValidationError> {
return safeParse(
jsonString,
(x) =>
PostV2ListsListEntriesQueryEntryValues$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PostV2ListsListEntriesQueryEntryValues' from JSON`,
);
}
/** @internal */
export const PostV2ListsListEntriesQueryData$inboundSchema: z.ZodType<
PostV2ListsListEntriesQueryData,
z.ZodTypeDef,
unknown
> = z.object({
id: z.lazy(() => PostV2ListsListEntriesQueryId$inboundSchema),
parent_record_id: z.string(),
parent_object: z.string(),
created_at: z.string(),
entry_values: z.lazy(() =>
PostV2ListsListEntriesQueryEntryValues$inboundSchema
),
}).transform((v) => {
return remap$(v, {
"parent_record_id": "parentRecordId",
"parent_object": "parentObject",
"created_at": "createdAt",
"entry_values": "entryValues",
});
});
/** @internal */
export type PostV2ListsListEntriesQueryData$Outbound = {
id: PostV2ListsListEntriesQueryId$Outbound;
parent_record_id: string;
parent_object: string;
created_at: string;
entry_values: PostV2ListsListEntriesQueryEntryValues$Outbound;
};
/** @internal */
export const PostV2ListsListEntriesQueryData$outboundSchema: z.ZodType<
PostV2ListsListEntriesQueryData$Outbound,
z.ZodTypeDef,
PostV2ListsListEntriesQueryData
> = z.object({
id: z.lazy(() => PostV2ListsListEntriesQueryId$outboundSchema),
parentRecordId: z.string(),
parentObject: z.string(),
createdAt: z.string(),
entryValues: z.lazy(() =>
PostV2ListsListEntriesQueryEntryValues$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 PostV2ListsListEntriesQueryData$ {
/** @deprecated use `PostV2ListsListEntriesQueryData$inboundSchema` instead. */
export const inboundSchema = PostV2ListsListEntriesQueryData$inboundSchema;
/** @deprecated use `PostV2ListsListEntriesQueryData$outboundSchema` instead. */
export const outboundSchema = PostV2ListsListEntriesQueryData$outboundSchema;
/** @deprecated use `PostV2ListsListEntriesQueryData$Outbound` instead. */
export type Outbound = PostV2ListsListEntriesQueryData$Outbound;
}
export function postV2ListsListEntriesQueryDataToJSON(
postV2ListsListEntriesQueryData: PostV2ListsListEntriesQueryData,
): string {
return JSON.stringify(
PostV2ListsListEntriesQueryData$outboundSchema.parse(
postV2ListsListEntriesQueryData,
),
);
}
export function postV2ListsListEntriesQueryDataFromJSON(
jsonString: string,
): SafeParseResult<PostV2ListsListEntriesQueryData, SDKValidationError> {
return safeParse(
jsonString,
(x) => PostV2ListsListEntriesQueryData$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PostV2ListsListEntriesQueryData' from JSON`,
);
}
/** @internal */
export const PostV2ListsListEntriesQueryResponse$inboundSchema: z.ZodType<
PostV2ListsListEntriesQueryResponse,
z.ZodTypeDef,
unknown
> = z.object({
data: z.array(z.lazy(() => PostV2ListsListEntriesQueryData$inboundSchema)),
});
/** @internal */
export type PostV2ListsListEntriesQueryResponse$Outbound = {
data: Array<PostV2ListsListEntriesQueryData$Outbound>;
};
/** @internal */
export const PostV2ListsListEntriesQueryResponse$outboundSchema: z.ZodType<
PostV2ListsListEntriesQueryResponse$Outbound,
z.ZodTypeDef,
PostV2ListsListEntriesQueryResponse
> = z.object({
data: z.array(z.lazy(() => PostV2ListsListEntriesQueryData$outboundSchema)),
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace PostV2ListsListEntriesQueryResponse$ {
/** @deprecated use `PostV2ListsListEntriesQueryResponse$inboundSchema` instead. */
export const inboundSchema =
PostV2ListsListEntriesQueryResponse$inboundSchema;
/** @deprecated use `PostV2ListsListEntriesQueryResponse$outboundSchema` instead. */
export const outboundSchema =
PostV2ListsListEntriesQueryResponse$outboundSchema;
/** @deprecated use `PostV2ListsListEntriesQueryResponse$Outbound` instead. */
export type Outbound = PostV2ListsListEntriesQueryResponse$Outbound;
}
export function postV2ListsListEntriesQueryResponseToJSON(
postV2ListsListEntriesQueryResponse: PostV2ListsListEntriesQueryResponse,
): string {
return JSON.stringify(
PostV2ListsListEntriesQueryResponse$outboundSchema.parse(
postV2ListsListEntriesQueryResponse,
),
);
}
export function postV2ListsListEntriesQueryResponseFromJSON(
jsonString: string,
): SafeParseResult<PostV2ListsListEntriesQueryResponse, SDKValidationError> {
return safeParse(
jsonString,
(x) =>
PostV2ListsListEntriesQueryResponse$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PostV2ListsListEntriesQueryResponse' from JSON`,
);
}