attio-js
Version:
Developer-friendly & type-safe JS/TS SDK based on the official OpenAPI spec of Attio.
89 lines • 3.23 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";
/** @internal */
export const SelectOptionId$inboundSchema = z.object({
workspace_id: z.string(),
object_id: z.string(),
attribute_id: z.string(),
option_id: z.string(),
}).transform((v) => {
return remap$(v, {
"workspace_id": "workspaceId",
"object_id": "objectId",
"attribute_id": "attributeId",
"option_id": "optionId",
});
});
/** @internal */
export const SelectOptionId$outboundSchema = z.object({
workspaceId: z.string(),
objectId: z.string(),
attributeId: z.string(),
optionId: z.string(),
}).transform((v) => {
return remap$(v, {
workspaceId: "workspace_id",
objectId: "object_id",
attributeId: "attribute_id",
optionId: "option_id",
});
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export var SelectOptionId$;
(function (SelectOptionId$) {
/** @deprecated use `SelectOptionId$inboundSchema` instead. */
SelectOptionId$.inboundSchema = SelectOptionId$inboundSchema;
/** @deprecated use `SelectOptionId$outboundSchema` instead. */
SelectOptionId$.outboundSchema = SelectOptionId$outboundSchema;
})(SelectOptionId$ || (SelectOptionId$ = {}));
export function selectOptionIdToJSON(selectOptionId) {
return JSON.stringify(SelectOptionId$outboundSchema.parse(selectOptionId));
}
export function selectOptionIdFromJSON(jsonString) {
return safeParse(jsonString, (x) => SelectOptionId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SelectOptionId' from JSON`);
}
/** @internal */
export const SelectOption$inboundSchema = z.object({
id: z.lazy(() => SelectOptionId$inboundSchema),
title: z.string(),
is_archived: z.boolean(),
}).transform((v) => {
return remap$(v, {
"is_archived": "isArchived",
});
});
/** @internal */
export const SelectOption$outboundSchema = z.object({
id: z.lazy(() => SelectOptionId$outboundSchema),
title: z.string(),
isArchived: z.boolean(),
}).transform((v) => {
return remap$(v, {
isArchived: "is_archived",
});
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export var SelectOption$;
(function (SelectOption$) {
/** @deprecated use `SelectOption$inboundSchema` instead. */
SelectOption$.inboundSchema = SelectOption$inboundSchema;
/** @deprecated use `SelectOption$outboundSchema` instead. */
SelectOption$.outboundSchema = SelectOption$outboundSchema;
})(SelectOption$ || (SelectOption$ = {}));
export function selectOptionToJSON(selectOption) {
return JSON.stringify(SelectOption$outboundSchema.parse(selectOption));
}
export function selectOptionFromJSON(jsonString) {
return safeParse(jsonString, (x) => SelectOption$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SelectOption' from JSON`);
}
//# sourceMappingURL=selectoption.js.map