UNPKG

attio-js

Version:

Developer-friendly & type-safe JS/TS SDK based on the official OpenAPI spec of Attio.

143 lines (127 loc) 4.01 kB
/* * 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 { Result as SafeParseResult } from "../../types/fp.js"; import { Note, Note$inboundSchema, Note$Outbound, Note$outboundSchema, } from "../components/note.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type GetV2NotesNoteIdRequest = { noteId: string; }; /** * Success */ export type GetV2NotesNoteIdResponse = { data: Note; }; /** @internal */ export const GetV2NotesNoteIdRequest$inboundSchema: z.ZodType< GetV2NotesNoteIdRequest, z.ZodTypeDef, unknown > = z.object({ note_id: z.string(), }).transform((v) => { return remap$(v, { "note_id": "noteId", }); }); /** @internal */ export type GetV2NotesNoteIdRequest$Outbound = { note_id: string; }; /** @internal */ export const GetV2NotesNoteIdRequest$outboundSchema: z.ZodType< GetV2NotesNoteIdRequest$Outbound, z.ZodTypeDef, GetV2NotesNoteIdRequest > = z.object({ noteId: z.string(), }).transform((v) => { return remap$(v, { noteId: "note_id", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetV2NotesNoteIdRequest$ { /** @deprecated use `GetV2NotesNoteIdRequest$inboundSchema` instead. */ export const inboundSchema = GetV2NotesNoteIdRequest$inboundSchema; /** @deprecated use `GetV2NotesNoteIdRequest$outboundSchema` instead. */ export const outboundSchema = GetV2NotesNoteIdRequest$outboundSchema; /** @deprecated use `GetV2NotesNoteIdRequest$Outbound` instead. */ export type Outbound = GetV2NotesNoteIdRequest$Outbound; } export function getV2NotesNoteIdRequestToJSON( getV2NotesNoteIdRequest: GetV2NotesNoteIdRequest, ): string { return JSON.stringify( GetV2NotesNoteIdRequest$outboundSchema.parse(getV2NotesNoteIdRequest), ); } export function getV2NotesNoteIdRequestFromJSON( jsonString: string, ): SafeParseResult<GetV2NotesNoteIdRequest, SDKValidationError> { return safeParse( jsonString, (x) => GetV2NotesNoteIdRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetV2NotesNoteIdRequest' from JSON`, ); } /** @internal */ export const GetV2NotesNoteIdResponse$inboundSchema: z.ZodType< GetV2NotesNoteIdResponse, z.ZodTypeDef, unknown > = z.object({ data: Note$inboundSchema, }); /** @internal */ export type GetV2NotesNoteIdResponse$Outbound = { data: Note$Outbound; }; /** @internal */ export const GetV2NotesNoteIdResponse$outboundSchema: z.ZodType< GetV2NotesNoteIdResponse$Outbound, z.ZodTypeDef, GetV2NotesNoteIdResponse > = z.object({ data: Note$outboundSchema, }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetV2NotesNoteIdResponse$ { /** @deprecated use `GetV2NotesNoteIdResponse$inboundSchema` instead. */ export const inboundSchema = GetV2NotesNoteIdResponse$inboundSchema; /** @deprecated use `GetV2NotesNoteIdResponse$outboundSchema` instead. */ export const outboundSchema = GetV2NotesNoteIdResponse$outboundSchema; /** @deprecated use `GetV2NotesNoteIdResponse$Outbound` instead. */ export type Outbound = GetV2NotesNoteIdResponse$Outbound; } export function getV2NotesNoteIdResponseToJSON( getV2NotesNoteIdResponse: GetV2NotesNoteIdResponse, ): string { return JSON.stringify( GetV2NotesNoteIdResponse$outboundSchema.parse(getV2NotesNoteIdResponse), ); } export function getV2NotesNoteIdResponseFromJSON( jsonString: string, ): SafeParseResult<GetV2NotesNoteIdResponse, SDKValidationError> { return safeParse( jsonString, (x) => GetV2NotesNoteIdResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetV2NotesNoteIdResponse' from JSON`, ); }