attio-js
Version:
Developer-friendly & type-safe JS/TS SDK based on the official OpenAPI spec of Attio.
74 lines • 3.17 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 { Note$inboundSchema, Note$outboundSchema, } from "../components/note.js";
/** @internal */
export const GetV2NotesRequest$inboundSchema = z.object({
limit: z.number().int().optional(),
offset: z.number().int().optional(),
parent_object: z.string().optional(),
parent_record_id: z.string().optional(),
}).transform((v) => {
return remap$(v, {
"parent_object": "parentObject",
"parent_record_id": "parentRecordId",
});
});
/** @internal */
export const GetV2NotesRequest$outboundSchema = z.object({
limit: z.number().int().optional(),
offset: z.number().int().optional(),
parentObject: z.string().optional(),
parentRecordId: z.string().optional(),
}).transform((v) => {
return remap$(v, {
parentObject: "parent_object",
parentRecordId: "parent_record_id",
});
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export var GetV2NotesRequest$;
(function (GetV2NotesRequest$) {
/** @deprecated use `GetV2NotesRequest$inboundSchema` instead. */
GetV2NotesRequest$.inboundSchema = GetV2NotesRequest$inboundSchema;
/** @deprecated use `GetV2NotesRequest$outboundSchema` instead. */
GetV2NotesRequest$.outboundSchema = GetV2NotesRequest$outboundSchema;
})(GetV2NotesRequest$ || (GetV2NotesRequest$ = {}));
export function getV2NotesRequestToJSON(getV2NotesRequest) {
return JSON.stringify(GetV2NotesRequest$outboundSchema.parse(getV2NotesRequest));
}
export function getV2NotesRequestFromJSON(jsonString) {
return safeParse(jsonString, (x) => GetV2NotesRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetV2NotesRequest' from JSON`);
}
/** @internal */
export const GetV2NotesResponse$inboundSchema = z.object({
data: z.array(Note$inboundSchema),
});
/** @internal */
export const GetV2NotesResponse$outboundSchema = z.object({
data: z.array(Note$outboundSchema),
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export var GetV2NotesResponse$;
(function (GetV2NotesResponse$) {
/** @deprecated use `GetV2NotesResponse$inboundSchema` instead. */
GetV2NotesResponse$.inboundSchema = GetV2NotesResponse$inboundSchema;
/** @deprecated use `GetV2NotesResponse$outboundSchema` instead. */
GetV2NotesResponse$.outboundSchema = GetV2NotesResponse$outboundSchema;
})(GetV2NotesResponse$ || (GetV2NotesResponse$ = {}));
export function getV2NotesResponseToJSON(getV2NotesResponse) {
return JSON.stringify(GetV2NotesResponse$outboundSchema.parse(getV2NotesResponse));
}
export function getV2NotesResponseFromJSON(jsonString) {
return safeParse(jsonString, (x) => GetV2NotesResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetV2NotesResponse' from JSON`);
}
//# sourceMappingURL=getv2notes.js.map