/* * 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 HrisEmployeesOneGlobals = { /** * 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 HrisEmployeesOneRequest = { /** * 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; /** * 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; /** * Apply filters */ filter?: components.EmployeesOneFilter | undefined; /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ passThrough?: { [k: string]: any } | undefined; }; export type HrisEmployeesOneResponse = { httpMeta: components.HTTPMetadata; /** * Employees */ getEmployeeResponse?: components.GetEmployeeResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export const HrisEmployeesOneGlobals$inboundSchema: z.ZodType< HrisEmployeesOneGlobals, z.ZodTypeDef, unknown > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** @internal */ export type HrisEmployeesOneGlobals$Outbound = { consumerId?: string | undefined; appId?: string | undefined; }; /** @internal */ export const HrisEmployeesOneGlobals$outboundSchema: z.ZodType< HrisEmployeesOneGlobals$Outbound, z.ZodTypeDef, HrisEmployeesOneGlobals > = 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 HrisEmployeesOneGlobals$ { /** @deprecated use `HrisEmployeesOneGlobals$inboundSchema` instead. */ export const inboundSchema = HrisEmployeesOneGlobals$inboundSchema; /** @deprecated use `HrisEmployeesOneGlobals$outboundSchema` instead. */ export const outboundSchema = HrisEmployeesOneGlobals$outboundSchema; /** @deprecated use `HrisEmployeesOneGlobals$Outbound` instead. */ export type Outbound = HrisEmployeesOneGlobals$Outbound; } export function hrisEmployeesOneGlobalsToJSON( hrisEmployeesOneGlobals: HrisEmployeesOneGlobals, ): string { return JSON.stringify( HrisEmployeesOneGlobals$outboundSchema.parse(hrisEmployeesOneGlobals), ); } export function hrisEmployeesOneGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => HrisEmployeesOneGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'HrisEmployeesOneGlobals' from JSON`, ); } /** @internal */ export const HrisEmployeesOneRequest$inboundSchema: z.ZodType< HrisEmployeesOneRequest, z.ZodTypeDef, unknown > = z.object({ id: z.string(), serviceId: z.string().optional(), raw: z.boolean().default(false), fields: z.nullable(z.string()).optional(), filter: components.EmployeesOneFilter$inboundSchema.optional(), pass_through: z.record(z.any()).optional(), }).transform((v) => { return remap$(v, { "pass_through": "passThrough", }); }); /** @internal */ export type HrisEmployeesOneRequest$Outbound = { id: string; serviceId?: string | undefined; raw: boolean; fields?: string | null | undefined; filter?: components.EmployeesOneFilter$Outbound | undefined; pass_through?: { [k: string]: any } | undefined; }; /** @internal */ export const HrisEmployeesOneRequest$outboundSchema: z.ZodType< HrisEmployeesOneRequest$Outbound, z.ZodTypeDef, HrisEmployeesOneRequest > = z.object({ id: z.string(), serviceId: z.string().optional(), raw: z.boolean().default(false), fields: z.nullable(z.string()).optional(), filter: components.EmployeesOneFilter$outboundSchema.optional(), passThrough: z.record(z.any()).optional(), }).transform((v) => { return remap$(v, { passThrough: "pass_through", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace HrisEmployeesOneRequest$ { /** @deprecated use `HrisEmployeesOneRequest$inboundSchema` instead. */ export const inboundSchema = HrisEmployeesOneRequest$inboundSchema; /** @deprecated use `HrisEmployeesOneRequest$outboundSchema` instead. */ export const outboundSchema = HrisEmployeesOneRequest$outboundSchema; /** @deprecated use `HrisEmployeesOneRequest$Outbound` instead. */ export type Outbound = HrisEmployeesOneRequest$Outbound; } export function hrisEmployeesOneRequestToJSON( hrisEmployeesOneRequest: HrisEmployeesOneRequest, ): string { return JSON.stringify( HrisEmployeesOneRequest$outboundSchema.parse(hrisEmployeesOneRequest), ); } export function hrisEmployeesOneRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => HrisEmployeesOneRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'HrisEmployeesOneRequest' from JSON`, ); } /** @internal */ export const HrisEmployeesOneResponse$inboundSchema: z.ZodType< HrisEmployeesOneResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, GetEmployeeResponse: components.GetEmployeeResponse$inboundSchema.optional(), UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "GetEmployeeResponse": "getEmployeeResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }); /** @internal */ export type HrisEmployeesOneResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; GetEmployeeResponse?: components.GetEmployeeResponse$Outbound | undefined; UnexpectedErrorResponse?: | components.UnexpectedErrorResponse$Outbound | undefined; }; /** @internal */ export const HrisEmployeesOneResponse$outboundSchema: z.ZodType< HrisEmployeesOneResponse$Outbound, z.ZodTypeDef, HrisEmployeesOneResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, getEmployeeResponse: components.GetEmployeeResponse$outboundSchema.optional(), unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema .optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", getEmployeeResponse: "GetEmployeeResponse", 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 HrisEmployeesOneResponse$ { /** @deprecated use `HrisEmployeesOneResponse$inboundSchema` instead. */ export const inboundSchema = HrisEmployeesOneResponse$inboundSchema; /** @deprecated use `HrisEmployeesOneResponse$outboundSchema` instead. */ export const outboundSchema = HrisEmployeesOneResponse$outboundSchema; /** @deprecated use `HrisEmployeesOneResponse$Outbound` instead. */ export type Outbound = HrisEmployeesOneResponse$Outbound; } export function hrisEmployeesOneResponseToJSON( hrisEmployeesOneResponse: HrisEmployeesOneResponse, ): string { return JSON.stringify( HrisEmployeesOneResponse$outboundSchema.parse(hrisEmployeesOneResponse), ); } export function hrisEmployeesOneResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => HrisEmployeesOneResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'HrisEmployeesOneResponse' from JSON`, ); }