/* * 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 CrmCompaniesOneGlobals = { /** * 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 CrmCompaniesOneRequest = { /** * ID of the record you are acting upon. */ id: string; /** * 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 CrmCompaniesOneResponse = { httpMeta: components.HTTPMetadata; /** * Company */ getCompanyResponse?: components.GetCompanyResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export const CrmCompaniesOneGlobals$inboundSchema: z.ZodType< CrmCompaniesOneGlobals, z.ZodTypeDef, unknown > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** @internal */ export type CrmCompaniesOneGlobals$Outbound = { consumerId?: string | undefined; appId?: string | undefined; }; /** @internal */ export const CrmCompaniesOneGlobals$outboundSchema: z.ZodType< CrmCompaniesOneGlobals$Outbound, z.ZodTypeDef, CrmCompaniesOneGlobals > = 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 CrmCompaniesOneGlobals$ { /** @deprecated use `CrmCompaniesOneGlobals$inboundSchema` instead. */ export const inboundSchema = CrmCompaniesOneGlobals$inboundSchema; /** @deprecated use `CrmCompaniesOneGlobals$outboundSchema` instead. */ export const outboundSchema = CrmCompaniesOneGlobals$outboundSchema; /** @deprecated use `CrmCompaniesOneGlobals$Outbound` instead. */ export type Outbound = CrmCompaniesOneGlobals$Outbound; } export function crmCompaniesOneGlobalsToJSON( crmCompaniesOneGlobals: CrmCompaniesOneGlobals, ): string { return JSON.stringify( CrmCompaniesOneGlobals$outboundSchema.parse(crmCompaniesOneGlobals), ); } export function crmCompaniesOneGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CrmCompaniesOneGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CrmCompaniesOneGlobals' from JSON`, ); } /** @internal */ export const CrmCompaniesOneRequest$inboundSchema: z.ZodType< CrmCompaniesOneRequest, z.ZodTypeDef, unknown > = z.object({ id: z.string(), raw: z.boolean().default(false), serviceId: z.string().optional(), fields: z.nullable(z.string()).optional(), }); /** @internal */ export type CrmCompaniesOneRequest$Outbound = { id: string; raw: boolean; serviceId?: string | undefined; fields?: string | null | undefined; }; /** @internal */ export const CrmCompaniesOneRequest$outboundSchema: z.ZodType< CrmCompaniesOneRequest$Outbound, z.ZodTypeDef, CrmCompaniesOneRequest > = z.object({ id: z.string(), 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 CrmCompaniesOneRequest$ { /** @deprecated use `CrmCompaniesOneRequest$inboundSchema` instead. */ export const inboundSchema = CrmCompaniesOneRequest$inboundSchema; /** @deprecated use `CrmCompaniesOneRequest$outboundSchema` instead. */ export const outboundSchema = CrmCompaniesOneRequest$outboundSchema; /** @deprecated use `CrmCompaniesOneRequest$Outbound` instead. */ export type Outbound = CrmCompaniesOneRequest$Outbound; } export function crmCompaniesOneRequestToJSON( crmCompaniesOneRequest: CrmCompaniesOneRequest, ): string { return JSON.stringify( CrmCompaniesOneRequest$outboundSchema.parse(crmCompaniesOneRequest), ); } export function crmCompaniesOneRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CrmCompaniesOneRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CrmCompaniesOneRequest' from JSON`, ); } /** @internal */ export const CrmCompaniesOneResponse$inboundSchema: z.ZodType< CrmCompaniesOneResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, GetCompanyResponse: components.GetCompanyResponse$inboundSchema.optional(), UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "GetCompanyResponse": "getCompanyResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }); /** @internal */ export type CrmCompaniesOneResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; GetCompanyResponse?: components.GetCompanyResponse$Outbound | undefined; UnexpectedErrorResponse?: | components.UnexpectedErrorResponse$Outbound | undefined; }; /** @internal */ export const CrmCompaniesOneResponse$outboundSchema: z.ZodType< CrmCompaniesOneResponse$Outbound, z.ZodTypeDef, CrmCompaniesOneResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, getCompanyResponse: components.GetCompanyResponse$outboundSchema.optional(), unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema .optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", getCompanyResponse: "GetCompanyResponse", 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 CrmCompaniesOneResponse$ { /** @deprecated use `CrmCompaniesOneResponse$inboundSchema` instead. */ export const inboundSchema = CrmCompaniesOneResponse$inboundSchema; /** @deprecated use `CrmCompaniesOneResponse$outboundSchema` instead. */ export const outboundSchema = CrmCompaniesOneResponse$outboundSchema; /** @deprecated use `CrmCompaniesOneResponse$Outbound` instead. */ export type Outbound = CrmCompaniesOneResponse$Outbound; } export function crmCompaniesOneResponseToJSON( crmCompaniesOneResponse: CrmCompaniesOneResponse, ): string { return JSON.stringify( CrmCompaniesOneResponse$outboundSchema.parse(crmCompaniesOneResponse), ); } export function crmCompaniesOneResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CrmCompaniesOneResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CrmCompaniesOneResponse' from JSON`, ); }