/* * 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 AccountingCompanyInfoOneGlobals = { /** * 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 AccountingCompanyInfoOneRequest = { /** * 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; /** * 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 AccountingCompanyInfoOneResponse = { httpMeta: components.HTTPMetadata; /** * CompanyInfo */ getCompanyInfoResponse?: components.GetCompanyInfoResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export const AccountingCompanyInfoOneGlobals$inboundSchema: z.ZodType< AccountingCompanyInfoOneGlobals, z.ZodTypeDef, unknown > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** @internal */ export type AccountingCompanyInfoOneGlobals$Outbound = { consumerId?: string | undefined; appId?: string | undefined; }; /** @internal */ export const AccountingCompanyInfoOneGlobals$outboundSchema: z.ZodType< AccountingCompanyInfoOneGlobals$Outbound, z.ZodTypeDef, AccountingCompanyInfoOneGlobals > = 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 AccountingCompanyInfoOneGlobals$ { /** @deprecated use `AccountingCompanyInfoOneGlobals$inboundSchema` instead. */ export const inboundSchema = AccountingCompanyInfoOneGlobals$inboundSchema; /** @deprecated use `AccountingCompanyInfoOneGlobals$outboundSchema` instead. */ export const outboundSchema = AccountingCompanyInfoOneGlobals$outboundSchema; /** @deprecated use `AccountingCompanyInfoOneGlobals$Outbound` instead. */ export type Outbound = AccountingCompanyInfoOneGlobals$Outbound; } export function accountingCompanyInfoOneGlobalsToJSON( accountingCompanyInfoOneGlobals: AccountingCompanyInfoOneGlobals, ): string { return JSON.stringify( AccountingCompanyInfoOneGlobals$outboundSchema.parse( accountingCompanyInfoOneGlobals, ), ); } export function accountingCompanyInfoOneGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountingCompanyInfoOneGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountingCompanyInfoOneGlobals' from JSON`, ); } /** @internal */ export const AccountingCompanyInfoOneRequest$inboundSchema: z.ZodType< AccountingCompanyInfoOneRequest, z.ZodTypeDef, unknown > = z.object({ raw: z.boolean().default(false), serviceId: z.string().optional(), fields: z.nullable(z.string()).optional(), }); /** @internal */ export type AccountingCompanyInfoOneRequest$Outbound = { raw: boolean; serviceId?: string | undefined; fields?: string | null | undefined; }; /** @internal */ export const AccountingCompanyInfoOneRequest$outboundSchema: z.ZodType< AccountingCompanyInfoOneRequest$Outbound, z.ZodTypeDef, AccountingCompanyInfoOneRequest > = z.object({ raw: z.boolean().default(false), serviceId: z.string().optional(), 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 AccountingCompanyInfoOneRequest$ { /** @deprecated use `AccountingCompanyInfoOneRequest$inboundSchema` instead. */ export const inboundSchema = AccountingCompanyInfoOneRequest$inboundSchema; /** @deprecated use `AccountingCompanyInfoOneRequest$outboundSchema` instead. */ export const outboundSchema = AccountingCompanyInfoOneRequest$outboundSchema; /** @deprecated use `AccountingCompanyInfoOneRequest$Outbound` instead. */ export type Outbound = AccountingCompanyInfoOneRequest$Outbound; } export function accountingCompanyInfoOneRequestToJSON( accountingCompanyInfoOneRequest: AccountingCompanyInfoOneRequest, ): string { return JSON.stringify( AccountingCompanyInfoOneRequest$outboundSchema.parse( accountingCompanyInfoOneRequest, ), ); } export function accountingCompanyInfoOneRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountingCompanyInfoOneRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountingCompanyInfoOneRequest' from JSON`, ); } /** @internal */ export const AccountingCompanyInfoOneResponse$inboundSchema: z.ZodType< AccountingCompanyInfoOneResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, GetCompanyInfoResponse: components.GetCompanyInfoResponse$inboundSchema .optional(), UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "GetCompanyInfoResponse": "getCompanyInfoResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }); /** @internal */ export type AccountingCompanyInfoOneResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; GetCompanyInfoResponse?: | components.GetCompanyInfoResponse$Outbound | undefined; UnexpectedErrorResponse?: | components.UnexpectedErrorResponse$Outbound | undefined; }; /** @internal */ export const AccountingCompanyInfoOneResponse$outboundSchema: z.ZodType< AccountingCompanyInfoOneResponse$Outbound, z.ZodTypeDef, AccountingCompanyInfoOneResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, getCompanyInfoResponse: components.GetCompanyInfoResponse$outboundSchema .optional(), unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema .optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", getCompanyInfoResponse: "GetCompanyInfoResponse", 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 AccountingCompanyInfoOneResponse$ { /** @deprecated use `AccountingCompanyInfoOneResponse$inboundSchema` instead. */ export const inboundSchema = AccountingCompanyInfoOneResponse$inboundSchema; /** @deprecated use `AccountingCompanyInfoOneResponse$outboundSchema` instead. */ export const outboundSchema = AccountingCompanyInfoOneResponse$outboundSchema; /** @deprecated use `AccountingCompanyInfoOneResponse$Outbound` instead. */ export type Outbound = AccountingCompanyInfoOneResponse$Outbound; } export function accountingCompanyInfoOneResponseToJSON( accountingCompanyInfoOneResponse: AccountingCompanyInfoOneResponse, ): string { return JSON.stringify( AccountingCompanyInfoOneResponse$outboundSchema.parse( accountingCompanyInfoOneResponse, ), ); } export function accountingCompanyInfoOneResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountingCompanyInfoOneResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountingCompanyInfoOneResponse' from JSON`, ); }