/* * 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 AccountingSubsidiariesAddGlobals = { /** * 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 AccountingSubsidiariesAddRequest = { /** * 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; subsidiary: components.SubsidiaryInput; }; export type AccountingSubsidiariesAddResponse = { httpMeta: components.HTTPMetadata; /** * Subsidiaries */ createSubsidiaryResponse?: components.CreateSubsidiaryResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export const AccountingSubsidiariesAddGlobals$inboundSchema: z.ZodType< AccountingSubsidiariesAddGlobals, z.ZodTypeDef, unknown > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** @internal */ export type AccountingSubsidiariesAddGlobals$Outbound = { consumerId?: string | undefined; appId?: string | undefined; }; /** @internal */ export const AccountingSubsidiariesAddGlobals$outboundSchema: z.ZodType< AccountingSubsidiariesAddGlobals$Outbound, z.ZodTypeDef, AccountingSubsidiariesAddGlobals > = 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 AccountingSubsidiariesAddGlobals$ { /** @deprecated use `AccountingSubsidiariesAddGlobals$inboundSchema` instead. */ export const inboundSchema = AccountingSubsidiariesAddGlobals$inboundSchema; /** @deprecated use `AccountingSubsidiariesAddGlobals$outboundSchema` instead. */ export const outboundSchema = AccountingSubsidiariesAddGlobals$outboundSchema; /** @deprecated use `AccountingSubsidiariesAddGlobals$Outbound` instead. */ export type Outbound = AccountingSubsidiariesAddGlobals$Outbound; } export function accountingSubsidiariesAddGlobalsToJSON( accountingSubsidiariesAddGlobals: AccountingSubsidiariesAddGlobals, ): string { return JSON.stringify( AccountingSubsidiariesAddGlobals$outboundSchema.parse( accountingSubsidiariesAddGlobals, ), ); } export function accountingSubsidiariesAddGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountingSubsidiariesAddGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountingSubsidiariesAddGlobals' from JSON`, ); } /** @internal */ export const AccountingSubsidiariesAddRequest$inboundSchema: z.ZodType< AccountingSubsidiariesAddRequest, z.ZodTypeDef, unknown > = z.object({ raw: z.boolean().default(false), serviceId: z.string().optional(), Subsidiary: components.SubsidiaryInput$inboundSchema, }).transform((v) => { return remap$(v, { "Subsidiary": "subsidiary", }); }); /** @internal */ export type AccountingSubsidiariesAddRequest$Outbound = { raw: boolean; serviceId?: string | undefined; Subsidiary: components.SubsidiaryInput$Outbound; }; /** @internal */ export const AccountingSubsidiariesAddRequest$outboundSchema: z.ZodType< AccountingSubsidiariesAddRequest$Outbound, z.ZodTypeDef, AccountingSubsidiariesAddRequest > = z.object({ raw: z.boolean().default(false), serviceId: z.string().optional(), subsidiary: components.SubsidiaryInput$outboundSchema, }).transform((v) => { return remap$(v, { subsidiary: "Subsidiary", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AccountingSubsidiariesAddRequest$ { /** @deprecated use `AccountingSubsidiariesAddRequest$inboundSchema` instead. */ export const inboundSchema = AccountingSubsidiariesAddRequest$inboundSchema; /** @deprecated use `AccountingSubsidiariesAddRequest$outboundSchema` instead. */ export const outboundSchema = AccountingSubsidiariesAddRequest$outboundSchema; /** @deprecated use `AccountingSubsidiariesAddRequest$Outbound` instead. */ export type Outbound = AccountingSubsidiariesAddRequest$Outbound; } export function accountingSubsidiariesAddRequestToJSON( accountingSubsidiariesAddRequest: AccountingSubsidiariesAddRequest, ): string { return JSON.stringify( AccountingSubsidiariesAddRequest$outboundSchema.parse( accountingSubsidiariesAddRequest, ), ); } export function accountingSubsidiariesAddRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountingSubsidiariesAddRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountingSubsidiariesAddRequest' from JSON`, ); } /** @internal */ export const AccountingSubsidiariesAddResponse$inboundSchema: z.ZodType< AccountingSubsidiariesAddResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, CreateSubsidiaryResponse: components.CreateSubsidiaryResponse$inboundSchema .optional(), UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "CreateSubsidiaryResponse": "createSubsidiaryResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }); /** @internal */ export type AccountingSubsidiariesAddResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; CreateSubsidiaryResponse?: | components.CreateSubsidiaryResponse$Outbound | undefined; UnexpectedErrorResponse?: | components.UnexpectedErrorResponse$Outbound | undefined; }; /** @internal */ export const AccountingSubsidiariesAddResponse$outboundSchema: z.ZodType< AccountingSubsidiariesAddResponse$Outbound, z.ZodTypeDef, AccountingSubsidiariesAddResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, createSubsidiaryResponse: components.CreateSubsidiaryResponse$outboundSchema .optional(), unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema .optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", createSubsidiaryResponse: "CreateSubsidiaryResponse", 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 AccountingSubsidiariesAddResponse$ { /** @deprecated use `AccountingSubsidiariesAddResponse$inboundSchema` instead. */ export const inboundSchema = AccountingSubsidiariesAddResponse$inboundSchema; /** @deprecated use `AccountingSubsidiariesAddResponse$outboundSchema` instead. */ export const outboundSchema = AccountingSubsidiariesAddResponse$outboundSchema; /** @deprecated use `AccountingSubsidiariesAddResponse$Outbound` instead. */ export type Outbound = AccountingSubsidiariesAddResponse$Outbound; } export function accountingSubsidiariesAddResponseToJSON( accountingSubsidiariesAddResponse: AccountingSubsidiariesAddResponse, ): string { return JSON.stringify( AccountingSubsidiariesAddResponse$outboundSchema.parse( accountingSubsidiariesAddResponse, ), ); } export function accountingSubsidiariesAddResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountingSubsidiariesAddResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountingSubsidiariesAddResponse' from JSON`, ); }