attio-js
Version:
Developer-friendly & type-safe JS/TS SDK based on the official OpenAPI spec of Attio.
99 lines • 4.35 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 { ObjectT$inboundSchema, ObjectT$outboundSchema, } from "../components/object.js";
/** @internal */
export const PostV2ObjectsData$inboundSchema = z.object({
api_slug: z.string(),
singular_noun: z.string(),
plural_noun: z.string(),
}).transform((v) => {
return remap$(v, {
"api_slug": "apiSlug",
"singular_noun": "singularNoun",
"plural_noun": "pluralNoun",
});
});
/** @internal */
export const PostV2ObjectsData$outboundSchema = z.object({
apiSlug: z.string(),
singularNoun: z.string(),
pluralNoun: z.string(),
}).transform((v) => {
return remap$(v, {
apiSlug: "api_slug",
singularNoun: "singular_noun",
pluralNoun: "plural_noun",
});
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export var PostV2ObjectsData$;
(function (PostV2ObjectsData$) {
/** @deprecated use `PostV2ObjectsData$inboundSchema` instead. */
PostV2ObjectsData$.inboundSchema = PostV2ObjectsData$inboundSchema;
/** @deprecated use `PostV2ObjectsData$outboundSchema` instead. */
PostV2ObjectsData$.outboundSchema = PostV2ObjectsData$outboundSchema;
})(PostV2ObjectsData$ || (PostV2ObjectsData$ = {}));
export function postV2ObjectsDataToJSON(postV2ObjectsData) {
return JSON.stringify(PostV2ObjectsData$outboundSchema.parse(postV2ObjectsData));
}
export function postV2ObjectsDataFromJSON(jsonString) {
return safeParse(jsonString, (x) => PostV2ObjectsData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PostV2ObjectsData' from JSON`);
}
/** @internal */
export const PostV2ObjectsRequest$inboundSchema = z.object({
data: z.lazy(() => PostV2ObjectsData$inboundSchema),
});
/** @internal */
export const PostV2ObjectsRequest$outboundSchema = z.object({
data: z.lazy(() => PostV2ObjectsData$outboundSchema),
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export var PostV2ObjectsRequest$;
(function (PostV2ObjectsRequest$) {
/** @deprecated use `PostV2ObjectsRequest$inboundSchema` instead. */
PostV2ObjectsRequest$.inboundSchema = PostV2ObjectsRequest$inboundSchema;
/** @deprecated use `PostV2ObjectsRequest$outboundSchema` instead. */
PostV2ObjectsRequest$.outboundSchema = PostV2ObjectsRequest$outboundSchema;
})(PostV2ObjectsRequest$ || (PostV2ObjectsRequest$ = {}));
export function postV2ObjectsRequestToJSON(postV2ObjectsRequest) {
return JSON.stringify(PostV2ObjectsRequest$outboundSchema.parse(postV2ObjectsRequest));
}
export function postV2ObjectsRequestFromJSON(jsonString) {
return safeParse(jsonString, (x) => PostV2ObjectsRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PostV2ObjectsRequest' from JSON`);
}
/** @internal */
export const PostV2ObjectsResponse$inboundSchema = z.object({
data: ObjectT$inboundSchema,
});
/** @internal */
export const PostV2ObjectsResponse$outboundSchema = z.object({
data: ObjectT$outboundSchema,
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export var PostV2ObjectsResponse$;
(function (PostV2ObjectsResponse$) {
/** @deprecated use `PostV2ObjectsResponse$inboundSchema` instead. */
PostV2ObjectsResponse$.inboundSchema = PostV2ObjectsResponse$inboundSchema;
/** @deprecated use `PostV2ObjectsResponse$outboundSchema` instead. */
PostV2ObjectsResponse$.outboundSchema = PostV2ObjectsResponse$outboundSchema;
})(PostV2ObjectsResponse$ || (PostV2ObjectsResponse$ = {}));
export function postV2ObjectsResponseToJSON(postV2ObjectsResponse) {
return JSON.stringify(PostV2ObjectsResponse$outboundSchema.parse(postV2ObjectsResponse));
}
export function postV2ObjectsResponseFromJSON(jsonString) {
return safeParse(jsonString, (x) => PostV2ObjectsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PostV2ObjectsResponse' from JSON`);
}
//# sourceMappingURL=postv2objects.js.map