/* * 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 AccountingTaxRatesUpdateGlobals = { /** * 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 AccountingTaxRatesUpdateRequest = { /** * 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; taxRate: components.TaxRateInput; }; export type AccountingTaxRatesUpdateResponse = { httpMeta: components.HTTPMetadata; /** * TaxRate updated */ updateTaxRateResponse?: components.UpdateTaxRateResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export const AccountingTaxRatesUpdateGlobals$inboundSchema: z.ZodType< AccountingTaxRatesUpdateGlobals, z.ZodTypeDef, unknown > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** @internal */ export type AccountingTaxRatesUpdateGlobals$Outbound = { consumerId?: string | undefined; appId?: string | undefined; }; /** @internal */ export const AccountingTaxRatesUpdateGlobals$outboundSchema: z.ZodType< AccountingTaxRatesUpdateGlobals$Outbound, z.ZodTypeDef, AccountingTaxRatesUpdateGlobals > = 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 AccountingTaxRatesUpdateGlobals$ { /** @deprecated use `AccountingTaxRatesUpdateGlobals$inboundSchema` instead. */ export const inboundSchema = AccountingTaxRatesUpdateGlobals$inboundSchema; /** @deprecated use `AccountingTaxRatesUpdateGlobals$outboundSchema` instead. */ export const outboundSchema = AccountingTaxRatesUpdateGlobals$outboundSchema; /** @deprecated use `AccountingTaxRatesUpdateGlobals$Outbound` instead. */ export type Outbound = AccountingTaxRatesUpdateGlobals$Outbound; } export function accountingTaxRatesUpdateGlobalsToJSON( accountingTaxRatesUpdateGlobals: AccountingTaxRatesUpdateGlobals, ): string { return JSON.stringify( AccountingTaxRatesUpdateGlobals$outboundSchema.parse( accountingTaxRatesUpdateGlobals, ), ); } export function accountingTaxRatesUpdateGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountingTaxRatesUpdateGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountingTaxRatesUpdateGlobals' from JSON`, ); } /** @internal */ export const AccountingTaxRatesUpdateRequest$inboundSchema: z.ZodType< AccountingTaxRatesUpdateRequest, z.ZodTypeDef, unknown > = z.object({ id: z.string(), serviceId: z.string().optional(), raw: z.boolean().default(false), TaxRate: components.TaxRateInput$inboundSchema, }).transform((v) => { return remap$(v, { "TaxRate": "taxRate", }); }); /** @internal */ export type AccountingTaxRatesUpdateRequest$Outbound = { id: string; serviceId?: string | undefined; raw: boolean; TaxRate: components.TaxRateInput$Outbound; }; /** @internal */ export const AccountingTaxRatesUpdateRequest$outboundSchema: z.ZodType< AccountingTaxRatesUpdateRequest$Outbound, z.ZodTypeDef, AccountingTaxRatesUpdateRequest > = z.object({ id: z.string(), serviceId: z.string().optional(), raw: z.boolean().default(false), taxRate: components.TaxRateInput$outboundSchema, }).transform((v) => { return remap$(v, { taxRate: "TaxRate", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AccountingTaxRatesUpdateRequest$ { /** @deprecated use `AccountingTaxRatesUpdateRequest$inboundSchema` instead. */ export const inboundSchema = AccountingTaxRatesUpdateRequest$inboundSchema; /** @deprecated use `AccountingTaxRatesUpdateRequest$outboundSchema` instead. */ export const outboundSchema = AccountingTaxRatesUpdateRequest$outboundSchema; /** @deprecated use `AccountingTaxRatesUpdateRequest$Outbound` instead. */ export type Outbound = AccountingTaxRatesUpdateRequest$Outbound; } export function accountingTaxRatesUpdateRequestToJSON( accountingTaxRatesUpdateRequest: AccountingTaxRatesUpdateRequest, ): string { return JSON.stringify( AccountingTaxRatesUpdateRequest$outboundSchema.parse( accountingTaxRatesUpdateRequest, ), ); } export function accountingTaxRatesUpdateRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountingTaxRatesUpdateRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountingTaxRatesUpdateRequest' from JSON`, ); } /** @internal */ export const AccountingTaxRatesUpdateResponse$inboundSchema: z.ZodType< AccountingTaxRatesUpdateResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, UpdateTaxRateResponse: components.UpdateTaxRateResponse$inboundSchema .optional(), UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "UpdateTaxRateResponse": "updateTaxRateResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }); /** @internal */ export type AccountingTaxRatesUpdateResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; UpdateTaxRateResponse?: components.UpdateTaxRateResponse$Outbound | undefined; UnexpectedErrorResponse?: | components.UnexpectedErrorResponse$Outbound | undefined; }; /** @internal */ export const AccountingTaxRatesUpdateResponse$outboundSchema: z.ZodType< AccountingTaxRatesUpdateResponse$Outbound, z.ZodTypeDef, AccountingTaxRatesUpdateResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, updateTaxRateResponse: components.UpdateTaxRateResponse$outboundSchema .optional(), unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema .optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", updateTaxRateResponse: "UpdateTaxRateResponse", 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 AccountingTaxRatesUpdateResponse$ { /** @deprecated use `AccountingTaxRatesUpdateResponse$inboundSchema` instead. */ export const inboundSchema = AccountingTaxRatesUpdateResponse$inboundSchema; /** @deprecated use `AccountingTaxRatesUpdateResponse$outboundSchema` instead. */ export const outboundSchema = AccountingTaxRatesUpdateResponse$outboundSchema; /** @deprecated use `AccountingTaxRatesUpdateResponse$Outbound` instead. */ export type Outbound = AccountingTaxRatesUpdateResponse$Outbound; } export function accountingTaxRatesUpdateResponseToJSON( accountingTaxRatesUpdateResponse: AccountingTaxRatesUpdateResponse, ): string { return JSON.stringify( AccountingTaxRatesUpdateResponse$outboundSchema.parse( accountingTaxRatesUpdateResponse, ), ); } export function accountingTaxRatesUpdateResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountingTaxRatesUpdateResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountingTaxRatesUpdateResponse' from JSON`, ); }