/* * 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 * as components from "../components/index.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type AccountingSuppliersOneGlobals = { /** * ID of the consumer which you want to get or push data from */ consumerId?: string | undefined; /** * The ID of your Unify application */ appId?: string | undefined; }; export type AccountingSuppliersOneRequest = { /** * ID of the record you are acting upon. */ id: string; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ serviceId?: string | undefined; /** * Include raw response. Mostly used for debugging purposes */ raw?: boolean | undefined; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: `fields=name,email,addresses.city`

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ fields?: string | null | undefined; }; export type AccountingSuppliersOneResponse = { httpMeta: components.HTTPMetadata; /** * Supplier */ getSupplierResponse?: components.GetSupplierResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export const AccountingSuppliersOneGlobals$inboundSchema: z.ZodType< AccountingSuppliersOneGlobals, z.ZodTypeDef, unknown > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** @internal */ export type AccountingSuppliersOneGlobals$Outbound = { consumerId?: string | undefined; appId?: string | undefined; }; /** @internal */ export const AccountingSuppliersOneGlobals$outboundSchema: z.ZodType< AccountingSuppliersOneGlobals$Outbound, z.ZodTypeDef, AccountingSuppliersOneGlobals > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AccountingSuppliersOneGlobals$ { /** @deprecated use `AccountingSuppliersOneGlobals$inboundSchema` instead. */ export const inboundSchema = AccountingSuppliersOneGlobals$inboundSchema; /** @deprecated use `AccountingSuppliersOneGlobals$outboundSchema` instead. */ export const outboundSchema = AccountingSuppliersOneGlobals$outboundSchema; /** @deprecated use `AccountingSuppliersOneGlobals$Outbound` instead. */ export type Outbound = AccountingSuppliersOneGlobals$Outbound; } export function accountingSuppliersOneGlobalsToJSON( accountingSuppliersOneGlobals: AccountingSuppliersOneGlobals, ): string { return JSON.stringify( AccountingSuppliersOneGlobals$outboundSchema.parse( accountingSuppliersOneGlobals, ), ); } export function accountingSuppliersOneGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountingSuppliersOneGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountingSuppliersOneGlobals' from JSON`, ); } /** @internal */ export const AccountingSuppliersOneRequest$inboundSchema: z.ZodType< AccountingSuppliersOneRequest, z.ZodTypeDef, unknown > = z.object({ id: z.string(), serviceId: z.string().optional(), raw: z.boolean().default(false), fields: z.nullable(z.string()).optional(), }); /** @internal */ export type AccountingSuppliersOneRequest$Outbound = { id: string; serviceId?: string | undefined; raw: boolean; fields?: string | null | undefined; }; /** @internal */ export const AccountingSuppliersOneRequest$outboundSchema: z.ZodType< AccountingSuppliersOneRequest$Outbound, z.ZodTypeDef, AccountingSuppliersOneRequest > = z.object({ id: z.string(), serviceId: z.string().optional(), raw: z.boolean().default(false), fields: z.nullable(z.string()).optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AccountingSuppliersOneRequest$ { /** @deprecated use `AccountingSuppliersOneRequest$inboundSchema` instead. */ export const inboundSchema = AccountingSuppliersOneRequest$inboundSchema; /** @deprecated use `AccountingSuppliersOneRequest$outboundSchema` instead. */ export const outboundSchema = AccountingSuppliersOneRequest$outboundSchema; /** @deprecated use `AccountingSuppliersOneRequest$Outbound` instead. */ export type Outbound = AccountingSuppliersOneRequest$Outbound; } export function accountingSuppliersOneRequestToJSON( accountingSuppliersOneRequest: AccountingSuppliersOneRequest, ): string { return JSON.stringify( AccountingSuppliersOneRequest$outboundSchema.parse( accountingSuppliersOneRequest, ), ); } export function accountingSuppliersOneRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountingSuppliersOneRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountingSuppliersOneRequest' from JSON`, ); } /** @internal */ export const AccountingSuppliersOneResponse$inboundSchema: z.ZodType< AccountingSuppliersOneResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, GetSupplierResponse: components.GetSupplierResponse$inboundSchema.optional(), UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "GetSupplierResponse": "getSupplierResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }); /** @internal */ export type AccountingSuppliersOneResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; GetSupplierResponse?: components.GetSupplierResponse$Outbound | undefined; UnexpectedErrorResponse?: | components.UnexpectedErrorResponse$Outbound | undefined; }; /** @internal */ export const AccountingSuppliersOneResponse$outboundSchema: z.ZodType< AccountingSuppliersOneResponse$Outbound, z.ZodTypeDef, AccountingSuppliersOneResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, getSupplierResponse: components.GetSupplierResponse$outboundSchema.optional(), unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema .optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", getSupplierResponse: "GetSupplierResponse", unexpectedErrorResponse: "UnexpectedErrorResponse", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AccountingSuppliersOneResponse$ { /** @deprecated use `AccountingSuppliersOneResponse$inboundSchema` instead. */ export const inboundSchema = AccountingSuppliersOneResponse$inboundSchema; /** @deprecated use `AccountingSuppliersOneResponse$outboundSchema` instead. */ export const outboundSchema = AccountingSuppliersOneResponse$outboundSchema; /** @deprecated use `AccountingSuppliersOneResponse$Outbound` instead. */ export type Outbound = AccountingSuppliersOneResponse$Outbound; } export function accountingSuppliersOneResponseToJSON( accountingSuppliersOneResponse: AccountingSuppliersOneResponse, ): string { return JSON.stringify( AccountingSuppliersOneResponse$outboundSchema.parse( accountingSuppliersOneResponse, ), ); } export function accountingSuppliersOneResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountingSuppliersOneResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountingSuppliersOneResponse' from JSON`, ); }