/* * 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 HrisTimeOffRequestsDeleteGlobals = { /** * 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 HrisTimeOffRequestsDeleteRequest = { /** * 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; /** * ID of the employee you are acting upon. */ employeeId: string; }; export type HrisTimeOffRequestsDeleteResponse = { httpMeta: components.HTTPMetadata; /** * TimeOffRequests */ deleteTimeOffRequestResponse?: | components.DeleteTimeOffRequestResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export const HrisTimeOffRequestsDeleteGlobals$inboundSchema: z.ZodType< HrisTimeOffRequestsDeleteGlobals, z.ZodTypeDef, unknown > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** @internal */ export type HrisTimeOffRequestsDeleteGlobals$Outbound = { consumerId?: string | undefined; appId?: string | undefined; }; /** @internal */ export const HrisTimeOffRequestsDeleteGlobals$outboundSchema: z.ZodType< HrisTimeOffRequestsDeleteGlobals$Outbound, z.ZodTypeDef, HrisTimeOffRequestsDeleteGlobals > = 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 HrisTimeOffRequestsDeleteGlobals$ { /** @deprecated use `HrisTimeOffRequestsDeleteGlobals$inboundSchema` instead. */ export const inboundSchema = HrisTimeOffRequestsDeleteGlobals$inboundSchema; /** @deprecated use `HrisTimeOffRequestsDeleteGlobals$outboundSchema` instead. */ export const outboundSchema = HrisTimeOffRequestsDeleteGlobals$outboundSchema; /** @deprecated use `HrisTimeOffRequestsDeleteGlobals$Outbound` instead. */ export type Outbound = HrisTimeOffRequestsDeleteGlobals$Outbound; } export function hrisTimeOffRequestsDeleteGlobalsToJSON( hrisTimeOffRequestsDeleteGlobals: HrisTimeOffRequestsDeleteGlobals, ): string { return JSON.stringify( HrisTimeOffRequestsDeleteGlobals$outboundSchema.parse( hrisTimeOffRequestsDeleteGlobals, ), ); } export function hrisTimeOffRequestsDeleteGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => HrisTimeOffRequestsDeleteGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'HrisTimeOffRequestsDeleteGlobals' from JSON`, ); } /** @internal */ export const HrisTimeOffRequestsDeleteRequest$inboundSchema: z.ZodType< HrisTimeOffRequestsDeleteRequest, z.ZodTypeDef, unknown > = z.object({ id: z.string(), serviceId: z.string().optional(), raw: z.boolean().default(false), employee_id: z.string(), }).transform((v) => { return remap$(v, { "employee_id": "employeeId", }); }); /** @internal */ export type HrisTimeOffRequestsDeleteRequest$Outbound = { id: string; serviceId?: string | undefined; raw: boolean; employee_id: string; }; /** @internal */ export const HrisTimeOffRequestsDeleteRequest$outboundSchema: z.ZodType< HrisTimeOffRequestsDeleteRequest$Outbound, z.ZodTypeDef, HrisTimeOffRequestsDeleteRequest > = z.object({ id: z.string(), serviceId: z.string().optional(), raw: z.boolean().default(false), employeeId: z.string(), }).transform((v) => { return remap$(v, { employeeId: "employee_id", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace HrisTimeOffRequestsDeleteRequest$ { /** @deprecated use `HrisTimeOffRequestsDeleteRequest$inboundSchema` instead. */ export const inboundSchema = HrisTimeOffRequestsDeleteRequest$inboundSchema; /** @deprecated use `HrisTimeOffRequestsDeleteRequest$outboundSchema` instead. */ export const outboundSchema = HrisTimeOffRequestsDeleteRequest$outboundSchema; /** @deprecated use `HrisTimeOffRequestsDeleteRequest$Outbound` instead. */ export type Outbound = HrisTimeOffRequestsDeleteRequest$Outbound; } export function hrisTimeOffRequestsDeleteRequestToJSON( hrisTimeOffRequestsDeleteRequest: HrisTimeOffRequestsDeleteRequest, ): string { return JSON.stringify( HrisTimeOffRequestsDeleteRequest$outboundSchema.parse( hrisTimeOffRequestsDeleteRequest, ), ); } export function hrisTimeOffRequestsDeleteRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => HrisTimeOffRequestsDeleteRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'HrisTimeOffRequestsDeleteRequest' from JSON`, ); } /** @internal */ export const HrisTimeOffRequestsDeleteResponse$inboundSchema: z.ZodType< HrisTimeOffRequestsDeleteResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, DeleteTimeOffRequestResponse: components .DeleteTimeOffRequestResponse$inboundSchema.optional(), UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "DeleteTimeOffRequestResponse": "deleteTimeOffRequestResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }); /** @internal */ export type HrisTimeOffRequestsDeleteResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; DeleteTimeOffRequestResponse?: | components.DeleteTimeOffRequestResponse$Outbound | undefined; UnexpectedErrorResponse?: | components.UnexpectedErrorResponse$Outbound | undefined; }; /** @internal */ export const HrisTimeOffRequestsDeleteResponse$outboundSchema: z.ZodType< HrisTimeOffRequestsDeleteResponse$Outbound, z.ZodTypeDef, HrisTimeOffRequestsDeleteResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, deleteTimeOffRequestResponse: components .DeleteTimeOffRequestResponse$outboundSchema.optional(), unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema .optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", deleteTimeOffRequestResponse: "DeleteTimeOffRequestResponse", 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 HrisTimeOffRequestsDeleteResponse$ { /** @deprecated use `HrisTimeOffRequestsDeleteResponse$inboundSchema` instead. */ export const inboundSchema = HrisTimeOffRequestsDeleteResponse$inboundSchema; /** @deprecated use `HrisTimeOffRequestsDeleteResponse$outboundSchema` instead. */ export const outboundSchema = HrisTimeOffRequestsDeleteResponse$outboundSchema; /** @deprecated use `HrisTimeOffRequestsDeleteResponse$Outbound` instead. */ export type Outbound = HrisTimeOffRequestsDeleteResponse$Outbound; } export function hrisTimeOffRequestsDeleteResponseToJSON( hrisTimeOffRequestsDeleteResponse: HrisTimeOffRequestsDeleteResponse, ): string { return JSON.stringify( HrisTimeOffRequestsDeleteResponse$outboundSchema.parse( hrisTimeOffRequestsDeleteResponse, ), ); } export function hrisTimeOffRequestsDeleteResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => HrisTimeOffRequestsDeleteResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'HrisTimeOffRequestsDeleteResponse' from JSON`, ); }