attio-js
Version:
Developer-friendly & type-safe JS/TS SDK based on the official OpenAPI spec of Attio.
765 lines (699 loc) • 25.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 { 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 PostV2ObjectsObjectRecordsQueryDirection2 = {
Asc: "asc",
Desc: "desc",
} as const;
/**
* The direction to sort the results by.
*/
export type PostV2ObjectsObjectRecordsQueryDirection2 = ClosedEnum<
typeof PostV2ObjectsObjectRecordsQueryDirection2
>;
/**
* Sort by path
*/
export type PostV2ObjectsObjectRecordsQuerySort2 = {
/**
* The direction to sort the results by.
*/
direction: PostV2ObjectsObjectRecordsQueryDirection2;
/**
* 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 PostV2ObjectsObjectRecordsQueryDirection1 = {
Asc: "asc",
Desc: "desc",
} as const;
/**
* The direction to sort the results by.
*/
export type PostV2ObjectsObjectRecordsQueryDirection1 = ClosedEnum<
typeof PostV2ObjectsObjectRecordsQueryDirection1
>;
/**
* Sort by attribute
*/
export type PostV2ObjectsObjectRecordsQuerySort1 = {
/**
* The direction to sort the results by.
*/
direction: PostV2ObjectsObjectRecordsQueryDirection1;
/**
* 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 PostV2ObjectsObjectRecordsQuerySortUnion =
| PostV2ObjectsObjectRecordsQuerySort1
| PostV2ObjectsObjectRecordsQuerySort2;
export type PostV2ObjectsObjectRecordsQueryRequestBody = {
/**
* 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<
| PostV2ObjectsObjectRecordsQuerySort1
| PostV2ObjectsObjectRecordsQuerySort2
>
| 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 PostV2ObjectsObjectRecordsQueryRequest = {
object: string;
requestBody: PostV2ObjectsObjectRecordsQueryRequestBody;
};
export type PostV2ObjectsObjectRecordsQueryId = {
/**
* A UUID identifying the workspace this record belongs to.
*/
workspaceId: string;
/**
* A UUID identifying the object this record belongs to.
*/
objectId: string;
/**
* A UUID identifying this record.
*/
recordId: string;
};
export type PostV2ObjectsObjectRecordsQueryData = {
id: PostV2ObjectsObjectRecordsQueryId;
/**
* When this record was created.
*/
createdAt: string;
/**
* A record type with an attribute `api_slug` as the key, and an array of value objects as the values.
*/
values: { [k: string]: any };
};
/**
* Success
*/
export type PostV2ObjectsObjectRecordsQueryResponse = {
data: Array<PostV2ObjectsObjectRecordsQueryData>;
};
/** @internal */
export const PostV2ObjectsObjectRecordsQueryDirection2$inboundSchema:
z.ZodNativeEnum<typeof PostV2ObjectsObjectRecordsQueryDirection2> = z
.nativeEnum(PostV2ObjectsObjectRecordsQueryDirection2);
/** @internal */
export const PostV2ObjectsObjectRecordsQueryDirection2$outboundSchema:
z.ZodNativeEnum<typeof PostV2ObjectsObjectRecordsQueryDirection2> =
PostV2ObjectsObjectRecordsQueryDirection2$inboundSchema;
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace PostV2ObjectsObjectRecordsQueryDirection2$ {
/** @deprecated use `PostV2ObjectsObjectRecordsQueryDirection2$inboundSchema` instead. */
export const inboundSchema =
PostV2ObjectsObjectRecordsQueryDirection2$inboundSchema;
/** @deprecated use `PostV2ObjectsObjectRecordsQueryDirection2$outboundSchema` instead. */
export const outboundSchema =
PostV2ObjectsObjectRecordsQueryDirection2$outboundSchema;
}
/** @internal */
export const PostV2ObjectsObjectRecordsQuerySort2$inboundSchema: z.ZodType<
PostV2ObjectsObjectRecordsQuerySort2,
z.ZodTypeDef,
unknown
> = z.object({
direction: PostV2ObjectsObjectRecordsQueryDirection2$inboundSchema,
path: z.array(z.array(z.string())),
field: z.string().optional(),
});
/** @internal */
export type PostV2ObjectsObjectRecordsQuerySort2$Outbound = {
direction: string;
path: Array<Array<string>>;
field?: string | undefined;
};
/** @internal */
export const PostV2ObjectsObjectRecordsQuerySort2$outboundSchema: z.ZodType<
PostV2ObjectsObjectRecordsQuerySort2$Outbound,
z.ZodTypeDef,
PostV2ObjectsObjectRecordsQuerySort2
> = z.object({
direction: PostV2ObjectsObjectRecordsQueryDirection2$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 PostV2ObjectsObjectRecordsQuerySort2$ {
/** @deprecated use `PostV2ObjectsObjectRecordsQuerySort2$inboundSchema` instead. */
export const inboundSchema =
PostV2ObjectsObjectRecordsQuerySort2$inboundSchema;
/** @deprecated use `PostV2ObjectsObjectRecordsQuerySort2$outboundSchema` instead. */
export const outboundSchema =
PostV2ObjectsObjectRecordsQuerySort2$outboundSchema;
/** @deprecated use `PostV2ObjectsObjectRecordsQuerySort2$Outbound` instead. */
export type Outbound = PostV2ObjectsObjectRecordsQuerySort2$Outbound;
}
export function postV2ObjectsObjectRecordsQuerySort2ToJSON(
postV2ObjectsObjectRecordsQuerySort2: PostV2ObjectsObjectRecordsQuerySort2,
): string {
return JSON.stringify(
PostV2ObjectsObjectRecordsQuerySort2$outboundSchema.parse(
postV2ObjectsObjectRecordsQuerySort2,
),
);
}
export function postV2ObjectsObjectRecordsQuerySort2FromJSON(
jsonString: string,
): SafeParseResult<PostV2ObjectsObjectRecordsQuerySort2, SDKValidationError> {
return safeParse(
jsonString,
(x) =>
PostV2ObjectsObjectRecordsQuerySort2$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PostV2ObjectsObjectRecordsQuerySort2' from JSON`,
);
}
/** @internal */
export const PostV2ObjectsObjectRecordsQueryDirection1$inboundSchema:
z.ZodNativeEnum<typeof PostV2ObjectsObjectRecordsQueryDirection1> = z
.nativeEnum(PostV2ObjectsObjectRecordsQueryDirection1);
/** @internal */
export const PostV2ObjectsObjectRecordsQueryDirection1$outboundSchema:
z.ZodNativeEnum<typeof PostV2ObjectsObjectRecordsQueryDirection1> =
PostV2ObjectsObjectRecordsQueryDirection1$inboundSchema;
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace PostV2ObjectsObjectRecordsQueryDirection1$ {
/** @deprecated use `PostV2ObjectsObjectRecordsQueryDirection1$inboundSchema` instead. */
export const inboundSchema =
PostV2ObjectsObjectRecordsQueryDirection1$inboundSchema;
/** @deprecated use `PostV2ObjectsObjectRecordsQueryDirection1$outboundSchema` instead. */
export const outboundSchema =
PostV2ObjectsObjectRecordsQueryDirection1$outboundSchema;
}
/** @internal */
export const PostV2ObjectsObjectRecordsQuerySort1$inboundSchema: z.ZodType<
PostV2ObjectsObjectRecordsQuerySort1,
z.ZodTypeDef,
unknown
> = z.object({
direction: PostV2ObjectsObjectRecordsQueryDirection1$inboundSchema,
attribute: z.string(),
field: z.string().optional(),
});
/** @internal */
export type PostV2ObjectsObjectRecordsQuerySort1$Outbound = {
direction: string;
attribute: string;
field?: string | undefined;
};
/** @internal */
export const PostV2ObjectsObjectRecordsQuerySort1$outboundSchema: z.ZodType<
PostV2ObjectsObjectRecordsQuerySort1$Outbound,
z.ZodTypeDef,
PostV2ObjectsObjectRecordsQuerySort1
> = z.object({
direction: PostV2ObjectsObjectRecordsQueryDirection1$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 PostV2ObjectsObjectRecordsQuerySort1$ {
/** @deprecated use `PostV2ObjectsObjectRecordsQuerySort1$inboundSchema` instead. */
export const inboundSchema =
PostV2ObjectsObjectRecordsQuerySort1$inboundSchema;
/** @deprecated use `PostV2ObjectsObjectRecordsQuerySort1$outboundSchema` instead. */
export const outboundSchema =
PostV2ObjectsObjectRecordsQuerySort1$outboundSchema;
/** @deprecated use `PostV2ObjectsObjectRecordsQuerySort1$Outbound` instead. */
export type Outbound = PostV2ObjectsObjectRecordsQuerySort1$Outbound;
}
export function postV2ObjectsObjectRecordsQuerySort1ToJSON(
postV2ObjectsObjectRecordsQuerySort1: PostV2ObjectsObjectRecordsQuerySort1,
): string {
return JSON.stringify(
PostV2ObjectsObjectRecordsQuerySort1$outboundSchema.parse(
postV2ObjectsObjectRecordsQuerySort1,
),
);
}
export function postV2ObjectsObjectRecordsQuerySort1FromJSON(
jsonString: string,
): SafeParseResult<PostV2ObjectsObjectRecordsQuerySort1, SDKValidationError> {
return safeParse(
jsonString,
(x) =>
PostV2ObjectsObjectRecordsQuerySort1$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PostV2ObjectsObjectRecordsQuerySort1' from JSON`,
);
}
/** @internal */
export const PostV2ObjectsObjectRecordsQuerySortUnion$inboundSchema: z.ZodType<
PostV2ObjectsObjectRecordsQuerySortUnion,
z.ZodTypeDef,
unknown
> = z.union([
z.lazy(() => PostV2ObjectsObjectRecordsQuerySort1$inboundSchema),
z.lazy(() => PostV2ObjectsObjectRecordsQuerySort2$inboundSchema),
]);
/** @internal */
export type PostV2ObjectsObjectRecordsQuerySortUnion$Outbound =
| PostV2ObjectsObjectRecordsQuerySort1$Outbound
| PostV2ObjectsObjectRecordsQuerySort2$Outbound;
/** @internal */
export const PostV2ObjectsObjectRecordsQuerySortUnion$outboundSchema: z.ZodType<
PostV2ObjectsObjectRecordsQuerySortUnion$Outbound,
z.ZodTypeDef,
PostV2ObjectsObjectRecordsQuerySortUnion
> = z.union([
z.lazy(() => PostV2ObjectsObjectRecordsQuerySort1$outboundSchema),
z.lazy(() => PostV2ObjectsObjectRecordsQuerySort2$outboundSchema),
]);
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace PostV2ObjectsObjectRecordsQuerySortUnion$ {
/** @deprecated use `PostV2ObjectsObjectRecordsQuerySortUnion$inboundSchema` instead. */
export const inboundSchema =
PostV2ObjectsObjectRecordsQuerySortUnion$inboundSchema;
/** @deprecated use `PostV2ObjectsObjectRecordsQuerySortUnion$outboundSchema` instead. */
export const outboundSchema =
PostV2ObjectsObjectRecordsQuerySortUnion$outboundSchema;
/** @deprecated use `PostV2ObjectsObjectRecordsQuerySortUnion$Outbound` instead. */
export type Outbound = PostV2ObjectsObjectRecordsQuerySortUnion$Outbound;
}
export function postV2ObjectsObjectRecordsQuerySortUnionToJSON(
postV2ObjectsObjectRecordsQuerySortUnion:
PostV2ObjectsObjectRecordsQuerySortUnion,
): string {
return JSON.stringify(
PostV2ObjectsObjectRecordsQuerySortUnion$outboundSchema.parse(
postV2ObjectsObjectRecordsQuerySortUnion,
),
);
}
export function postV2ObjectsObjectRecordsQuerySortUnionFromJSON(
jsonString: string,
): SafeParseResult<
PostV2ObjectsObjectRecordsQuerySortUnion,
SDKValidationError
> {
return safeParse(
jsonString,
(x) =>
PostV2ObjectsObjectRecordsQuerySortUnion$inboundSchema.parse(
JSON.parse(x),
),
`Failed to parse 'PostV2ObjectsObjectRecordsQuerySortUnion' from JSON`,
);
}
/** @internal */
export const PostV2ObjectsObjectRecordsQueryRequestBody$inboundSchema:
z.ZodType<PostV2ObjectsObjectRecordsQueryRequestBody, z.ZodTypeDef, unknown> =
z.object({
filter: z.record(z.any()).optional(),
sorts: z.array(
z.union([
z.lazy(() => PostV2ObjectsObjectRecordsQuerySort1$inboundSchema),
z.lazy(() => PostV2ObjectsObjectRecordsQuerySort2$inboundSchema),
]),
).optional(),
limit: z.number().optional(),
offset: z.number().optional(),
});
/** @internal */
export type PostV2ObjectsObjectRecordsQueryRequestBody$Outbound = {
filter?: { [k: string]: any } | undefined;
sorts?:
| Array<
| PostV2ObjectsObjectRecordsQuerySort1$Outbound
| PostV2ObjectsObjectRecordsQuerySort2$Outbound
>
| undefined;
limit?: number | undefined;
offset?: number | undefined;
};
/** @internal */
export const PostV2ObjectsObjectRecordsQueryRequestBody$outboundSchema:
z.ZodType<
PostV2ObjectsObjectRecordsQueryRequestBody$Outbound,
z.ZodTypeDef,
PostV2ObjectsObjectRecordsQueryRequestBody
> = z.object({
filter: z.record(z.any()).optional(),
sorts: z.array(
z.union([
z.lazy(() => PostV2ObjectsObjectRecordsQuerySort1$outboundSchema),
z.lazy(() => PostV2ObjectsObjectRecordsQuerySort2$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 PostV2ObjectsObjectRecordsQueryRequestBody$ {
/** @deprecated use `PostV2ObjectsObjectRecordsQueryRequestBody$inboundSchema` instead. */
export const inboundSchema =
PostV2ObjectsObjectRecordsQueryRequestBody$inboundSchema;
/** @deprecated use `PostV2ObjectsObjectRecordsQueryRequestBody$outboundSchema` instead. */
export const outboundSchema =
PostV2ObjectsObjectRecordsQueryRequestBody$outboundSchema;
/** @deprecated use `PostV2ObjectsObjectRecordsQueryRequestBody$Outbound` instead. */
export type Outbound = PostV2ObjectsObjectRecordsQueryRequestBody$Outbound;
}
export function postV2ObjectsObjectRecordsQueryRequestBodyToJSON(
postV2ObjectsObjectRecordsQueryRequestBody:
PostV2ObjectsObjectRecordsQueryRequestBody,
): string {
return JSON.stringify(
PostV2ObjectsObjectRecordsQueryRequestBody$outboundSchema.parse(
postV2ObjectsObjectRecordsQueryRequestBody,
),
);
}
export function postV2ObjectsObjectRecordsQueryRequestBodyFromJSON(
jsonString: string,
): SafeParseResult<
PostV2ObjectsObjectRecordsQueryRequestBody,
SDKValidationError
> {
return safeParse(
jsonString,
(x) =>
PostV2ObjectsObjectRecordsQueryRequestBody$inboundSchema.parse(
JSON.parse(x),
),
`Failed to parse 'PostV2ObjectsObjectRecordsQueryRequestBody' from JSON`,
);
}
/** @internal */
export const PostV2ObjectsObjectRecordsQueryRequest$inboundSchema: z.ZodType<
PostV2ObjectsObjectRecordsQueryRequest,
z.ZodTypeDef,
unknown
> = z.object({
object: z.string(),
RequestBody: z.lazy(() =>
PostV2ObjectsObjectRecordsQueryRequestBody$inboundSchema
),
}).transform((v) => {
return remap$(v, {
"RequestBody": "requestBody",
});
});
/** @internal */
export type PostV2ObjectsObjectRecordsQueryRequest$Outbound = {
object: string;
RequestBody: PostV2ObjectsObjectRecordsQueryRequestBody$Outbound;
};
/** @internal */
export const PostV2ObjectsObjectRecordsQueryRequest$outboundSchema: z.ZodType<
PostV2ObjectsObjectRecordsQueryRequest$Outbound,
z.ZodTypeDef,
PostV2ObjectsObjectRecordsQueryRequest
> = z.object({
object: z.string(),
requestBody: z.lazy(() =>
PostV2ObjectsObjectRecordsQueryRequestBody$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 PostV2ObjectsObjectRecordsQueryRequest$ {
/** @deprecated use `PostV2ObjectsObjectRecordsQueryRequest$inboundSchema` instead. */
export const inboundSchema =
PostV2ObjectsObjectRecordsQueryRequest$inboundSchema;
/** @deprecated use `PostV2ObjectsObjectRecordsQueryRequest$outboundSchema` instead. */
export const outboundSchema =
PostV2ObjectsObjectRecordsQueryRequest$outboundSchema;
/** @deprecated use `PostV2ObjectsObjectRecordsQueryRequest$Outbound` instead. */
export type Outbound = PostV2ObjectsObjectRecordsQueryRequest$Outbound;
}
export function postV2ObjectsObjectRecordsQueryRequestToJSON(
postV2ObjectsObjectRecordsQueryRequest:
PostV2ObjectsObjectRecordsQueryRequest,
): string {
return JSON.stringify(
PostV2ObjectsObjectRecordsQueryRequest$outboundSchema.parse(
postV2ObjectsObjectRecordsQueryRequest,
),
);
}
export function postV2ObjectsObjectRecordsQueryRequestFromJSON(
jsonString: string,
): SafeParseResult<PostV2ObjectsObjectRecordsQueryRequest, SDKValidationError> {
return safeParse(
jsonString,
(x) =>
PostV2ObjectsObjectRecordsQueryRequest$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PostV2ObjectsObjectRecordsQueryRequest' from JSON`,
);
}
/** @internal */
export const PostV2ObjectsObjectRecordsQueryId$inboundSchema: z.ZodType<
PostV2ObjectsObjectRecordsQueryId,
z.ZodTypeDef,
unknown
> = z.object({
workspace_id: z.string(),
object_id: z.string(),
record_id: z.string(),
}).transform((v) => {
return remap$(v, {
"workspace_id": "workspaceId",
"object_id": "objectId",
"record_id": "recordId",
});
});
/** @internal */
export type PostV2ObjectsObjectRecordsQueryId$Outbound = {
workspace_id: string;
object_id: string;
record_id: string;
};
/** @internal */
export const PostV2ObjectsObjectRecordsQueryId$outboundSchema: z.ZodType<
PostV2ObjectsObjectRecordsQueryId$Outbound,
z.ZodTypeDef,
PostV2ObjectsObjectRecordsQueryId
> = z.object({
workspaceId: z.string(),
objectId: z.string(),
recordId: z.string(),
}).transform((v) => {
return remap$(v, {
workspaceId: "workspace_id",
objectId: "object_id",
recordId: "record_id",
});
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace PostV2ObjectsObjectRecordsQueryId$ {
/** @deprecated use `PostV2ObjectsObjectRecordsQueryId$inboundSchema` instead. */
export const inboundSchema = PostV2ObjectsObjectRecordsQueryId$inboundSchema;
/** @deprecated use `PostV2ObjectsObjectRecordsQueryId$outboundSchema` instead. */
export const outboundSchema =
PostV2ObjectsObjectRecordsQueryId$outboundSchema;
/** @deprecated use `PostV2ObjectsObjectRecordsQueryId$Outbound` instead. */
export type Outbound = PostV2ObjectsObjectRecordsQueryId$Outbound;
}
export function postV2ObjectsObjectRecordsQueryIdToJSON(
postV2ObjectsObjectRecordsQueryId: PostV2ObjectsObjectRecordsQueryId,
): string {
return JSON.stringify(
PostV2ObjectsObjectRecordsQueryId$outboundSchema.parse(
postV2ObjectsObjectRecordsQueryId,
),
);
}
export function postV2ObjectsObjectRecordsQueryIdFromJSON(
jsonString: string,
): SafeParseResult<PostV2ObjectsObjectRecordsQueryId, SDKValidationError> {
return safeParse(
jsonString,
(x) => PostV2ObjectsObjectRecordsQueryId$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PostV2ObjectsObjectRecordsQueryId' from JSON`,
);
}
/** @internal */
export const PostV2ObjectsObjectRecordsQueryData$inboundSchema: z.ZodType<
PostV2ObjectsObjectRecordsQueryData,
z.ZodTypeDef,
unknown
> = z.object({
id: z.lazy(() => PostV2ObjectsObjectRecordsQueryId$inboundSchema),
created_at: z.string(),
values: z.record(z.any()),
}).transform((v) => {
return remap$(v, {
"created_at": "createdAt",
});
});
/** @internal */
export type PostV2ObjectsObjectRecordsQueryData$Outbound = {
id: PostV2ObjectsObjectRecordsQueryId$Outbound;
created_at: string;
values: { [k: string]: any };
};
/** @internal */
export const PostV2ObjectsObjectRecordsQueryData$outboundSchema: z.ZodType<
PostV2ObjectsObjectRecordsQueryData$Outbound,
z.ZodTypeDef,
PostV2ObjectsObjectRecordsQueryData
> = z.object({
id: z.lazy(() => PostV2ObjectsObjectRecordsQueryId$outboundSchema),
createdAt: z.string(),
values: z.record(z.any()),
}).transform((v) => {
return remap$(v, {
createdAt: "created_at",
});
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace PostV2ObjectsObjectRecordsQueryData$ {
/** @deprecated use `PostV2ObjectsObjectRecordsQueryData$inboundSchema` instead. */
export const inboundSchema =
PostV2ObjectsObjectRecordsQueryData$inboundSchema;
/** @deprecated use `PostV2ObjectsObjectRecordsQueryData$outboundSchema` instead. */
export const outboundSchema =
PostV2ObjectsObjectRecordsQueryData$outboundSchema;
/** @deprecated use `PostV2ObjectsObjectRecordsQueryData$Outbound` instead. */
export type Outbound = PostV2ObjectsObjectRecordsQueryData$Outbound;
}
export function postV2ObjectsObjectRecordsQueryDataToJSON(
postV2ObjectsObjectRecordsQueryData: PostV2ObjectsObjectRecordsQueryData,
): string {
return JSON.stringify(
PostV2ObjectsObjectRecordsQueryData$outboundSchema.parse(
postV2ObjectsObjectRecordsQueryData,
),
);
}
export function postV2ObjectsObjectRecordsQueryDataFromJSON(
jsonString: string,
): SafeParseResult<PostV2ObjectsObjectRecordsQueryData, SDKValidationError> {
return safeParse(
jsonString,
(x) =>
PostV2ObjectsObjectRecordsQueryData$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PostV2ObjectsObjectRecordsQueryData' from JSON`,
);
}
/** @internal */
export const PostV2ObjectsObjectRecordsQueryResponse$inboundSchema: z.ZodType<
PostV2ObjectsObjectRecordsQueryResponse,
z.ZodTypeDef,
unknown
> = z.object({
data: z.array(
z.lazy(() => PostV2ObjectsObjectRecordsQueryData$inboundSchema),
),
});
/** @internal */
export type PostV2ObjectsObjectRecordsQueryResponse$Outbound = {
data: Array<PostV2ObjectsObjectRecordsQueryData$Outbound>;
};
/** @internal */
export const PostV2ObjectsObjectRecordsQueryResponse$outboundSchema: z.ZodType<
PostV2ObjectsObjectRecordsQueryResponse$Outbound,
z.ZodTypeDef,
PostV2ObjectsObjectRecordsQueryResponse
> = z.object({
data: z.array(
z.lazy(() => PostV2ObjectsObjectRecordsQueryData$outboundSchema),
),
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace PostV2ObjectsObjectRecordsQueryResponse$ {
/** @deprecated use `PostV2ObjectsObjectRecordsQueryResponse$inboundSchema` instead. */
export const inboundSchema =
PostV2ObjectsObjectRecordsQueryResponse$inboundSchema;
/** @deprecated use `PostV2ObjectsObjectRecordsQueryResponse$outboundSchema` instead. */
export const outboundSchema =
PostV2ObjectsObjectRecordsQueryResponse$outboundSchema;
/** @deprecated use `PostV2ObjectsObjectRecordsQueryResponse$Outbound` instead. */
export type Outbound = PostV2ObjectsObjectRecordsQueryResponse$Outbound;
}
export function postV2ObjectsObjectRecordsQueryResponseToJSON(
postV2ObjectsObjectRecordsQueryResponse:
PostV2ObjectsObjectRecordsQueryResponse,
): string {
return JSON.stringify(
PostV2ObjectsObjectRecordsQueryResponse$outboundSchema.parse(
postV2ObjectsObjectRecordsQueryResponse,
),
);
}
export function postV2ObjectsObjectRecordsQueryResponseFromJSON(
jsonString: string,
): SafeParseResult<
PostV2ObjectsObjectRecordsQueryResponse,
SDKValidationError
> {
return safeParse(
jsonString,
(x) =>
PostV2ObjectsObjectRecordsQueryResponse$inboundSchema.parse(
JSON.parse(x),
),
`Failed to parse 'PostV2ObjectsObjectRecordsQueryResponse' from JSON`,
);
}