attio-js
Version:
Developer-friendly & type-safe JS/TS SDK based on the official OpenAPI spec of Attio.
186 lines • 8.52 kB
JavaScript
/*
* 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 { List$inboundSchema, List$outboundSchema, } from "../components/list.js";
/**
* The level of access granted to all members of the workspace for this list. Pass `null` to keep the list private and only grant access to specific workspace members.
*/
export const PostV2ListsWorkspaceAccess = {
FullAccess: "full-access",
ReadAndWrite: "read-and-write",
ReadOnly: "read-only",
};
/**
* The level of access to the list.
*/
export const PostV2ListsLevel = {
FullAccess: "full-access",
ReadAndWrite: "read-and-write",
ReadOnly: "read-only",
};
/** @internal */
export const PostV2ListsWorkspaceAccess$inboundSchema = z.nativeEnum(PostV2ListsWorkspaceAccess);
/** @internal */
export const PostV2ListsWorkspaceAccess$outboundSchema = PostV2ListsWorkspaceAccess$inboundSchema;
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export var PostV2ListsWorkspaceAccess$;
(function (PostV2ListsWorkspaceAccess$) {
/** @deprecated use `PostV2ListsWorkspaceAccess$inboundSchema` instead. */
PostV2ListsWorkspaceAccess$.inboundSchema = PostV2ListsWorkspaceAccess$inboundSchema;
/** @deprecated use `PostV2ListsWorkspaceAccess$outboundSchema` instead. */
PostV2ListsWorkspaceAccess$.outboundSchema = PostV2ListsWorkspaceAccess$outboundSchema;
})(PostV2ListsWorkspaceAccess$ || (PostV2ListsWorkspaceAccess$ = {}));
/** @internal */
export const PostV2ListsLevel$inboundSchema = z.nativeEnum(PostV2ListsLevel);
/** @internal */
export const PostV2ListsLevel$outboundSchema = PostV2ListsLevel$inboundSchema;
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export var PostV2ListsLevel$;
(function (PostV2ListsLevel$) {
/** @deprecated use `PostV2ListsLevel$inboundSchema` instead. */
PostV2ListsLevel$.inboundSchema = PostV2ListsLevel$inboundSchema;
/** @deprecated use `PostV2ListsLevel$outboundSchema` instead. */
PostV2ListsLevel$.outboundSchema = PostV2ListsLevel$outboundSchema;
})(PostV2ListsLevel$ || (PostV2ListsLevel$ = {}));
/** @internal */
export const PostV2ListsWorkspaceMemberAccess$inboundSchema = z.object({
workspace_member_id: z.string(),
level: PostV2ListsLevel$inboundSchema,
}).transform((v) => {
return remap$(v, {
"workspace_member_id": "workspaceMemberId",
});
});
/** @internal */
export const PostV2ListsWorkspaceMemberAccess$outboundSchema = z.object({
workspaceMemberId: z.string(),
level: PostV2ListsLevel$outboundSchema,
}).transform((v) => {
return remap$(v, {
workspaceMemberId: "workspace_member_id",
});
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export var PostV2ListsWorkspaceMemberAccess$;
(function (PostV2ListsWorkspaceMemberAccess$) {
/** @deprecated use `PostV2ListsWorkspaceMemberAccess$inboundSchema` instead. */
PostV2ListsWorkspaceMemberAccess$.inboundSchema = PostV2ListsWorkspaceMemberAccess$inboundSchema;
/** @deprecated use `PostV2ListsWorkspaceMemberAccess$outboundSchema` instead. */
PostV2ListsWorkspaceMemberAccess$.outboundSchema = PostV2ListsWorkspaceMemberAccess$outboundSchema;
})(PostV2ListsWorkspaceMemberAccess$ || (PostV2ListsWorkspaceMemberAccess$ = {}));
export function postV2ListsWorkspaceMemberAccessToJSON(postV2ListsWorkspaceMemberAccess) {
return JSON.stringify(PostV2ListsWorkspaceMemberAccess$outboundSchema.parse(postV2ListsWorkspaceMemberAccess));
}
export function postV2ListsWorkspaceMemberAccessFromJSON(jsonString) {
return safeParse(jsonString, (x) => PostV2ListsWorkspaceMemberAccess$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PostV2ListsWorkspaceMemberAccess' from JSON`);
}
/** @internal */
export const PostV2ListsData$inboundSchema = z.object({
name: z.string(),
api_slug: z.string(),
parent_object: z.string(),
workspace_access: z.nullable(PostV2ListsWorkspaceAccess$inboundSchema),
workspace_member_access: z.array(z.lazy(() => PostV2ListsWorkspaceMemberAccess$inboundSchema)),
}).transform((v) => {
return remap$(v, {
"api_slug": "apiSlug",
"parent_object": "parentObject",
"workspace_access": "workspaceAccess",
"workspace_member_access": "workspaceMemberAccess",
});
});
/** @internal */
export const PostV2ListsData$outboundSchema = z.object({
name: z.string(),
apiSlug: z.string(),
parentObject: z.string(),
workspaceAccess: z.nullable(PostV2ListsWorkspaceAccess$outboundSchema),
workspaceMemberAccess: z.array(z.lazy(() => PostV2ListsWorkspaceMemberAccess$outboundSchema)),
}).transform((v) => {
return remap$(v, {
apiSlug: "api_slug",
parentObject: "parent_object",
workspaceAccess: "workspace_access",
workspaceMemberAccess: "workspace_member_access",
});
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export var PostV2ListsData$;
(function (PostV2ListsData$) {
/** @deprecated use `PostV2ListsData$inboundSchema` instead. */
PostV2ListsData$.inboundSchema = PostV2ListsData$inboundSchema;
/** @deprecated use `PostV2ListsData$outboundSchema` instead. */
PostV2ListsData$.outboundSchema = PostV2ListsData$outboundSchema;
})(PostV2ListsData$ || (PostV2ListsData$ = {}));
export function postV2ListsDataToJSON(postV2ListsData) {
return JSON.stringify(PostV2ListsData$outboundSchema.parse(postV2ListsData));
}
export function postV2ListsDataFromJSON(jsonString) {
return safeParse(jsonString, (x) => PostV2ListsData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PostV2ListsData' from JSON`);
}
/** @internal */
export const PostV2ListsRequest$inboundSchema = z.object({
data: z.lazy(() => PostV2ListsData$inboundSchema),
});
/** @internal */
export const PostV2ListsRequest$outboundSchema = z.object({
data: z.lazy(() => PostV2ListsData$outboundSchema),
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export var PostV2ListsRequest$;
(function (PostV2ListsRequest$) {
/** @deprecated use `PostV2ListsRequest$inboundSchema` instead. */
PostV2ListsRequest$.inboundSchema = PostV2ListsRequest$inboundSchema;
/** @deprecated use `PostV2ListsRequest$outboundSchema` instead. */
PostV2ListsRequest$.outboundSchema = PostV2ListsRequest$outboundSchema;
})(PostV2ListsRequest$ || (PostV2ListsRequest$ = {}));
export function postV2ListsRequestToJSON(postV2ListsRequest) {
return JSON.stringify(PostV2ListsRequest$outboundSchema.parse(postV2ListsRequest));
}
export function postV2ListsRequestFromJSON(jsonString) {
return safeParse(jsonString, (x) => PostV2ListsRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PostV2ListsRequest' from JSON`);
}
/** @internal */
export const PostV2ListsResponse$inboundSchema = z.object({
data: List$inboundSchema,
});
/** @internal */
export const PostV2ListsResponse$outboundSchema = z.object({
data: List$outboundSchema,
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export var PostV2ListsResponse$;
(function (PostV2ListsResponse$) {
/** @deprecated use `PostV2ListsResponse$inboundSchema` instead. */
PostV2ListsResponse$.inboundSchema = PostV2ListsResponse$inboundSchema;
/** @deprecated use `PostV2ListsResponse$outboundSchema` instead. */
PostV2ListsResponse$.outboundSchema = PostV2ListsResponse$outboundSchema;
})(PostV2ListsResponse$ || (PostV2ListsResponse$ = {}));
export function postV2ListsResponseToJSON(postV2ListsResponse) {
return JSON.stringify(PostV2ListsResponse$outboundSchema.parse(postV2ListsResponse));
}
export function postV2ListsResponseFromJSON(jsonString) {
return safeParse(jsonString, (x) => PostV2ListsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PostV2ListsResponse' from JSON`);
}
//# sourceMappingURL=postv2lists.js.map