/* * 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 HrisCompaniesAddGlobals = { /** * 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 HrisCompaniesAddRequest = { /** * 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; hrisCompany: components.HrisCompanyInput; }; export type HrisCompaniesAddResponse = { httpMeta: components.HTTPMetadata; /** * Companies */ createHrisCompanyResponse?: components.CreateHrisCompanyResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export const HrisCompaniesAddGlobals$inboundSchema: z.ZodType< HrisCompaniesAddGlobals, z.ZodTypeDef, unknown > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** @internal */ export type HrisCompaniesAddGlobals$Outbound = { consumerId?: string | undefined; appId?: string | undefined; }; /** @internal */ export const HrisCompaniesAddGlobals$outboundSchema: z.ZodType< HrisCompaniesAddGlobals$Outbound, z.ZodTypeDef, HrisCompaniesAddGlobals > = 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 HrisCompaniesAddGlobals$ { /** @deprecated use `HrisCompaniesAddGlobals$inboundSchema` instead. */ export const inboundSchema = HrisCompaniesAddGlobals$inboundSchema; /** @deprecated use `HrisCompaniesAddGlobals$outboundSchema` instead. */ export const outboundSchema = HrisCompaniesAddGlobals$outboundSchema; /** @deprecated use `HrisCompaniesAddGlobals$Outbound` instead. */ export type Outbound = HrisCompaniesAddGlobals$Outbound; } export function hrisCompaniesAddGlobalsToJSON( hrisCompaniesAddGlobals: HrisCompaniesAddGlobals, ): string { return JSON.stringify( HrisCompaniesAddGlobals$outboundSchema.parse(hrisCompaniesAddGlobals), ); } export function hrisCompaniesAddGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => HrisCompaniesAddGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'HrisCompaniesAddGlobals' from JSON`, ); } /** @internal */ export const HrisCompaniesAddRequest$inboundSchema: z.ZodType< HrisCompaniesAddRequest, z.ZodTypeDef, unknown > = z.object({ raw: z.boolean().default(false), serviceId: z.string().optional(), HrisCompany: components.HrisCompanyInput$inboundSchema, }).transform((v) => { return remap$(v, { "HrisCompany": "hrisCompany", }); }); /** @internal */ export type HrisCompaniesAddRequest$Outbound = { raw: boolean; serviceId?: string | undefined; HrisCompany: components.HrisCompanyInput$Outbound; }; /** @internal */ export const HrisCompaniesAddRequest$outboundSchema: z.ZodType< HrisCompaniesAddRequest$Outbound, z.ZodTypeDef, HrisCompaniesAddRequest > = z.object({ raw: z.boolean().default(false), serviceId: z.string().optional(), hrisCompany: components.HrisCompanyInput$outboundSchema, }).transform((v) => { return remap$(v, { hrisCompany: "HrisCompany", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace HrisCompaniesAddRequest$ { /** @deprecated use `HrisCompaniesAddRequest$inboundSchema` instead. */ export const inboundSchema = HrisCompaniesAddRequest$inboundSchema; /** @deprecated use `HrisCompaniesAddRequest$outboundSchema` instead. */ export const outboundSchema = HrisCompaniesAddRequest$outboundSchema; /** @deprecated use `HrisCompaniesAddRequest$Outbound` instead. */ export type Outbound = HrisCompaniesAddRequest$Outbound; } export function hrisCompaniesAddRequestToJSON( hrisCompaniesAddRequest: HrisCompaniesAddRequest, ): string { return JSON.stringify( HrisCompaniesAddRequest$outboundSchema.parse(hrisCompaniesAddRequest), ); } export function hrisCompaniesAddRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => HrisCompaniesAddRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'HrisCompaniesAddRequest' from JSON`, ); } /** @internal */ export const HrisCompaniesAddResponse$inboundSchema: z.ZodType< HrisCompaniesAddResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, CreateHrisCompanyResponse: components.CreateHrisCompanyResponse$inboundSchema .optional(), UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "CreateHrisCompanyResponse": "createHrisCompanyResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }); /** @internal */ export type HrisCompaniesAddResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; CreateHrisCompanyResponse?: | components.CreateHrisCompanyResponse$Outbound | undefined; UnexpectedErrorResponse?: | components.UnexpectedErrorResponse$Outbound | undefined; }; /** @internal */ export const HrisCompaniesAddResponse$outboundSchema: z.ZodType< HrisCompaniesAddResponse$Outbound, z.ZodTypeDef, HrisCompaniesAddResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, createHrisCompanyResponse: components.CreateHrisCompanyResponse$outboundSchema .optional(), unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema .optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", createHrisCompanyResponse: "CreateHrisCompanyResponse", 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 HrisCompaniesAddResponse$ { /** @deprecated use `HrisCompaniesAddResponse$inboundSchema` instead. */ export const inboundSchema = HrisCompaniesAddResponse$inboundSchema; /** @deprecated use `HrisCompaniesAddResponse$outboundSchema` instead. */ export const outboundSchema = HrisCompaniesAddResponse$outboundSchema; /** @deprecated use `HrisCompaniesAddResponse$Outbound` instead. */ export type Outbound = HrisCompaniesAddResponse$Outbound; } export function hrisCompaniesAddResponseToJSON( hrisCompaniesAddResponse: HrisCompaniesAddResponse, ): string { return JSON.stringify( HrisCompaniesAddResponse$outboundSchema.parse(hrisCompaniesAddResponse), ); } export function hrisCompaniesAddResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => HrisCompaniesAddResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'HrisCompaniesAddResponse' from JSON`, ); }