/* * 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 AccountingLocationsAllGlobals = { /** * 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 AccountingLocationsAllRequest = { /** * Include raw response. Mostly used for debugging purposes */ raw?: boolean | undefined; /** * 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; /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ cursor?: string | null | undefined; /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ limit?: number | 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; /** * Apply filters */ filter?: components.AccountingLocationsFilter | undefined; }; export type AccountingLocationsAllResponse = { httpMeta: components.HTTPMetadata; /** * Locations */ getAccountingLocationsResponse?: | components.GetAccountingLocationsResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export const AccountingLocationsAllGlobals$inboundSchema: z.ZodType< AccountingLocationsAllGlobals, z.ZodTypeDef, unknown > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** @internal */ export type AccountingLocationsAllGlobals$Outbound = { consumerId?: string | undefined; appId?: string | undefined; }; /** @internal */ export const AccountingLocationsAllGlobals$outboundSchema: z.ZodType< AccountingLocationsAllGlobals$Outbound, z.ZodTypeDef, AccountingLocationsAllGlobals > = 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 AccountingLocationsAllGlobals$ { /** @deprecated use `AccountingLocationsAllGlobals$inboundSchema` instead. */ export const inboundSchema = AccountingLocationsAllGlobals$inboundSchema; /** @deprecated use `AccountingLocationsAllGlobals$outboundSchema` instead. */ export const outboundSchema = AccountingLocationsAllGlobals$outboundSchema; /** @deprecated use `AccountingLocationsAllGlobals$Outbound` instead. */ export type Outbound = AccountingLocationsAllGlobals$Outbound; } export function accountingLocationsAllGlobalsToJSON( accountingLocationsAllGlobals: AccountingLocationsAllGlobals, ): string { return JSON.stringify( AccountingLocationsAllGlobals$outboundSchema.parse( accountingLocationsAllGlobals, ), ); } export function accountingLocationsAllGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountingLocationsAllGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountingLocationsAllGlobals' from JSON`, ); } /** @internal */ export const AccountingLocationsAllRequest$inboundSchema: z.ZodType< AccountingLocationsAllRequest, z.ZodTypeDef, unknown > = z.object({ raw: z.boolean().default(false), serviceId: z.string().optional(), cursor: z.nullable(z.string()).optional(), limit: z.number().int().default(20), fields: z.nullable(z.string()).optional(), filter: components.AccountingLocationsFilter$inboundSchema.optional(), }); /** @internal */ export type AccountingLocationsAllRequest$Outbound = { raw: boolean; serviceId?: string | undefined; cursor?: string | null | undefined; limit: number; fields?: string | null | undefined; filter?: components.AccountingLocationsFilter$Outbound | undefined; }; /** @internal */ export const AccountingLocationsAllRequest$outboundSchema: z.ZodType< AccountingLocationsAllRequest$Outbound, z.ZodTypeDef, AccountingLocationsAllRequest > = z.object({ raw: z.boolean().default(false), serviceId: z.string().optional(), cursor: z.nullable(z.string()).optional(), limit: z.number().int().default(20), fields: z.nullable(z.string()).optional(), filter: components.AccountingLocationsFilter$outboundSchema.optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AccountingLocationsAllRequest$ { /** @deprecated use `AccountingLocationsAllRequest$inboundSchema` instead. */ export const inboundSchema = AccountingLocationsAllRequest$inboundSchema; /** @deprecated use `AccountingLocationsAllRequest$outboundSchema` instead. */ export const outboundSchema = AccountingLocationsAllRequest$outboundSchema; /** @deprecated use `AccountingLocationsAllRequest$Outbound` instead. */ export type Outbound = AccountingLocationsAllRequest$Outbound; } export function accountingLocationsAllRequestToJSON( accountingLocationsAllRequest: AccountingLocationsAllRequest, ): string { return JSON.stringify( AccountingLocationsAllRequest$outboundSchema.parse( accountingLocationsAllRequest, ), ); } export function accountingLocationsAllRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountingLocationsAllRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountingLocationsAllRequest' from JSON`, ); } /** @internal */ export const AccountingLocationsAllResponse$inboundSchema: z.ZodType< AccountingLocationsAllResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, GetAccountingLocationsResponse: components .GetAccountingLocationsResponse$inboundSchema.optional(), UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "GetAccountingLocationsResponse": "getAccountingLocationsResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }); /** @internal */ export type AccountingLocationsAllResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; GetAccountingLocationsResponse?: | components.GetAccountingLocationsResponse$Outbound | undefined; UnexpectedErrorResponse?: | components.UnexpectedErrorResponse$Outbound | undefined; }; /** @internal */ export const AccountingLocationsAllResponse$outboundSchema: z.ZodType< AccountingLocationsAllResponse$Outbound, z.ZodTypeDef, AccountingLocationsAllResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, getAccountingLocationsResponse: components .GetAccountingLocationsResponse$outboundSchema.optional(), unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema .optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", getAccountingLocationsResponse: "GetAccountingLocationsResponse", 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 AccountingLocationsAllResponse$ { /** @deprecated use `AccountingLocationsAllResponse$inboundSchema` instead. */ export const inboundSchema = AccountingLocationsAllResponse$inboundSchema; /** @deprecated use `AccountingLocationsAllResponse$outboundSchema` instead. */ export const outboundSchema = AccountingLocationsAllResponse$outboundSchema; /** @deprecated use `AccountingLocationsAllResponse$Outbound` instead. */ export type Outbound = AccountingLocationsAllResponse$Outbound; } export function accountingLocationsAllResponseToJSON( accountingLocationsAllResponse: AccountingLocationsAllResponse, ): string { return JSON.stringify( AccountingLocationsAllResponse$outboundSchema.parse( accountingLocationsAllResponse, ), ); } export function accountingLocationsAllResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountingLocationsAllResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountingLocationsAllResponse' from JSON`, ); }