/* * 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 HrisCompaniesUpdateGlobals = { /** * 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 HrisCompaniesUpdateRequest = { /** * 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; hrisCompany: components.HrisCompanyInput; }; export type HrisCompaniesUpdateResponse = { httpMeta: components.HTTPMetadata; /** * Companies */ updateHrisCompanyResponse?: components.UpdateHrisCompanyResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export const HrisCompaniesUpdateGlobals$inboundSchema: z.ZodType< HrisCompaniesUpdateGlobals, z.ZodTypeDef, unknown > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** @internal */ export type HrisCompaniesUpdateGlobals$Outbound = { consumerId?: string | undefined; appId?: string | undefined; }; /** @internal */ export const HrisCompaniesUpdateGlobals$outboundSchema: z.ZodType< HrisCompaniesUpdateGlobals$Outbound, z.ZodTypeDef, HrisCompaniesUpdateGlobals > = 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 HrisCompaniesUpdateGlobals$ { /** @deprecated use `HrisCompaniesUpdateGlobals$inboundSchema` instead. */ export const inboundSchema = HrisCompaniesUpdateGlobals$inboundSchema; /** @deprecated use `HrisCompaniesUpdateGlobals$outboundSchema` instead. */ export const outboundSchema = HrisCompaniesUpdateGlobals$outboundSchema; /** @deprecated use `HrisCompaniesUpdateGlobals$Outbound` instead. */ export type Outbound = HrisCompaniesUpdateGlobals$Outbound; } export function hrisCompaniesUpdateGlobalsToJSON( hrisCompaniesUpdateGlobals: HrisCompaniesUpdateGlobals, ): string { return JSON.stringify( HrisCompaniesUpdateGlobals$outboundSchema.parse(hrisCompaniesUpdateGlobals), ); } export function hrisCompaniesUpdateGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => HrisCompaniesUpdateGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'HrisCompaniesUpdateGlobals' from JSON`, ); } /** @internal */ export const HrisCompaniesUpdateRequest$inboundSchema: z.ZodType< HrisCompaniesUpdateRequest, z.ZodTypeDef, unknown > = z.object({ id: z.string(), serviceId: z.string().optional(), raw: z.boolean().default(false), HrisCompany: components.HrisCompanyInput$inboundSchema, }).transform((v) => { return remap$(v, { "HrisCompany": "hrisCompany", }); }); /** @internal */ export type HrisCompaniesUpdateRequest$Outbound = { id: string; serviceId?: string | undefined; raw: boolean; HrisCompany: components.HrisCompanyInput$Outbound; }; /** @internal */ export const HrisCompaniesUpdateRequest$outboundSchema: z.ZodType< HrisCompaniesUpdateRequest$Outbound, z.ZodTypeDef, HrisCompaniesUpdateRequest > = z.object({ id: z.string(), serviceId: z.string().optional(), raw: z.boolean().default(false), 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 HrisCompaniesUpdateRequest$ { /** @deprecated use `HrisCompaniesUpdateRequest$inboundSchema` instead. */ export const inboundSchema = HrisCompaniesUpdateRequest$inboundSchema; /** @deprecated use `HrisCompaniesUpdateRequest$outboundSchema` instead. */ export const outboundSchema = HrisCompaniesUpdateRequest$outboundSchema; /** @deprecated use `HrisCompaniesUpdateRequest$Outbound` instead. */ export type Outbound = HrisCompaniesUpdateRequest$Outbound; } export function hrisCompaniesUpdateRequestToJSON( hrisCompaniesUpdateRequest: HrisCompaniesUpdateRequest, ): string { return JSON.stringify( HrisCompaniesUpdateRequest$outboundSchema.parse(hrisCompaniesUpdateRequest), ); } export function hrisCompaniesUpdateRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => HrisCompaniesUpdateRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'HrisCompaniesUpdateRequest' from JSON`, ); } /** @internal */ export const HrisCompaniesUpdateResponse$inboundSchema: z.ZodType< HrisCompaniesUpdateResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, UpdateHrisCompanyResponse: components.UpdateHrisCompanyResponse$inboundSchema .optional(), UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "UpdateHrisCompanyResponse": "updateHrisCompanyResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }); /** @internal */ export type HrisCompaniesUpdateResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; UpdateHrisCompanyResponse?: | components.UpdateHrisCompanyResponse$Outbound | undefined; UnexpectedErrorResponse?: | components.UnexpectedErrorResponse$Outbound | undefined; }; /** @internal */ export const HrisCompaniesUpdateResponse$outboundSchema: z.ZodType< HrisCompaniesUpdateResponse$Outbound, z.ZodTypeDef, HrisCompaniesUpdateResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, updateHrisCompanyResponse: components.UpdateHrisCompanyResponse$outboundSchema .optional(), unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema .optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", updateHrisCompanyResponse: "UpdateHrisCompanyResponse", 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 HrisCompaniesUpdateResponse$ { /** @deprecated use `HrisCompaniesUpdateResponse$inboundSchema` instead. */ export const inboundSchema = HrisCompaniesUpdateResponse$inboundSchema; /** @deprecated use `HrisCompaniesUpdateResponse$outboundSchema` instead. */ export const outboundSchema = HrisCompaniesUpdateResponse$outboundSchema; /** @deprecated use `HrisCompaniesUpdateResponse$Outbound` instead. */ export type Outbound = HrisCompaniesUpdateResponse$Outbound; } export function hrisCompaniesUpdateResponseToJSON( hrisCompaniesUpdateResponse: HrisCompaniesUpdateResponse, ): string { return JSON.stringify( HrisCompaniesUpdateResponse$outboundSchema.parse( hrisCompaniesUpdateResponse, ), ); } export function hrisCompaniesUpdateResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => HrisCompaniesUpdateResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'HrisCompaniesUpdateResponse' from JSON`, ); }