/* * 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 AccountingCustomersOneGlobals = { /** * 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 AccountingCustomersOneRequest = { /** * 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 AccountingCustomersOneResponse = { httpMeta: components.HTTPMetadata; /** * Customer */ getCustomerResponse?: components.GetCustomerResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export const AccountingCustomersOneGlobals$inboundSchema: z.ZodType< AccountingCustomersOneGlobals, z.ZodTypeDef, unknown > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** @internal */ export type AccountingCustomersOneGlobals$Outbound = { consumerId?: string | undefined; appId?: string | undefined; }; /** @internal */ export const AccountingCustomersOneGlobals$outboundSchema: z.ZodType< AccountingCustomersOneGlobals$Outbound, z.ZodTypeDef, AccountingCustomersOneGlobals > = 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 AccountingCustomersOneGlobals$ { /** @deprecated use `AccountingCustomersOneGlobals$inboundSchema` instead. */ export const inboundSchema = AccountingCustomersOneGlobals$inboundSchema; /** @deprecated use `AccountingCustomersOneGlobals$outboundSchema` instead. */ export const outboundSchema = AccountingCustomersOneGlobals$outboundSchema; /** @deprecated use `AccountingCustomersOneGlobals$Outbound` instead. */ export type Outbound = AccountingCustomersOneGlobals$Outbound; } export function accountingCustomersOneGlobalsToJSON( accountingCustomersOneGlobals: AccountingCustomersOneGlobals, ): string { return JSON.stringify( AccountingCustomersOneGlobals$outboundSchema.parse( accountingCustomersOneGlobals, ), ); } export function accountingCustomersOneGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountingCustomersOneGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountingCustomersOneGlobals' from JSON`, ); } /** @internal */ export const AccountingCustomersOneRequest$inboundSchema: z.ZodType< AccountingCustomersOneRequest, 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 AccountingCustomersOneRequest$Outbound = { id: string; serviceId?: string | undefined; raw: boolean; fields?: string | null | undefined; }; /** @internal */ export const AccountingCustomersOneRequest$outboundSchema: z.ZodType< AccountingCustomersOneRequest$Outbound, z.ZodTypeDef, AccountingCustomersOneRequest > = 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 AccountingCustomersOneRequest$ { /** @deprecated use `AccountingCustomersOneRequest$inboundSchema` instead. */ export const inboundSchema = AccountingCustomersOneRequest$inboundSchema; /** @deprecated use `AccountingCustomersOneRequest$outboundSchema` instead. */ export const outboundSchema = AccountingCustomersOneRequest$outboundSchema; /** @deprecated use `AccountingCustomersOneRequest$Outbound` instead. */ export type Outbound = AccountingCustomersOneRequest$Outbound; } export function accountingCustomersOneRequestToJSON( accountingCustomersOneRequest: AccountingCustomersOneRequest, ): string { return JSON.stringify( AccountingCustomersOneRequest$outboundSchema.parse( accountingCustomersOneRequest, ), ); } export function accountingCustomersOneRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountingCustomersOneRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountingCustomersOneRequest' from JSON`, ); } /** @internal */ export const AccountingCustomersOneResponse$inboundSchema: z.ZodType< AccountingCustomersOneResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, GetCustomerResponse: components.GetCustomerResponse$inboundSchema.optional(), UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "GetCustomerResponse": "getCustomerResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }); /** @internal */ export type AccountingCustomersOneResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; GetCustomerResponse?: components.GetCustomerResponse$Outbound | undefined; UnexpectedErrorResponse?: | components.UnexpectedErrorResponse$Outbound | undefined; }; /** @internal */ export const AccountingCustomersOneResponse$outboundSchema: z.ZodType< AccountingCustomersOneResponse$Outbound, z.ZodTypeDef, AccountingCustomersOneResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, getCustomerResponse: components.GetCustomerResponse$outboundSchema.optional(), unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema .optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", getCustomerResponse: "GetCustomerResponse", 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 AccountingCustomersOneResponse$ { /** @deprecated use `AccountingCustomersOneResponse$inboundSchema` instead. */ export const inboundSchema = AccountingCustomersOneResponse$inboundSchema; /** @deprecated use `AccountingCustomersOneResponse$outboundSchema` instead. */ export const outboundSchema = AccountingCustomersOneResponse$outboundSchema; /** @deprecated use `AccountingCustomersOneResponse$Outbound` instead. */ export type Outbound = AccountingCustomersOneResponse$Outbound; } export function accountingCustomersOneResponseToJSON( accountingCustomersOneResponse: AccountingCustomersOneResponse, ): string { return JSON.stringify( AccountingCustomersOneResponse$outboundSchema.parse( accountingCustomersOneResponse, ), ); } export function accountingCustomersOneResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountingCustomersOneResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountingCustomersOneResponse' from JSON`, ); }