/* * 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 HrisDepartmentsDeleteGlobals = { /** * 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 HrisDepartmentsDeleteRequest = { /** * 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; }; export type HrisDepartmentsDeleteResponse = { httpMeta: components.HTTPMetadata; /** * Departments */ deleteDepartmentResponse?: components.DeleteDepartmentResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export const HrisDepartmentsDeleteGlobals$inboundSchema: z.ZodType< HrisDepartmentsDeleteGlobals, z.ZodTypeDef, unknown > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** @internal */ export type HrisDepartmentsDeleteGlobals$Outbound = { consumerId?: string | undefined; appId?: string | undefined; }; /** @internal */ export const HrisDepartmentsDeleteGlobals$outboundSchema: z.ZodType< HrisDepartmentsDeleteGlobals$Outbound, z.ZodTypeDef, HrisDepartmentsDeleteGlobals > = 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 HrisDepartmentsDeleteGlobals$ { /** @deprecated use `HrisDepartmentsDeleteGlobals$inboundSchema` instead. */ export const inboundSchema = HrisDepartmentsDeleteGlobals$inboundSchema; /** @deprecated use `HrisDepartmentsDeleteGlobals$outboundSchema` instead. */ export const outboundSchema = HrisDepartmentsDeleteGlobals$outboundSchema; /** @deprecated use `HrisDepartmentsDeleteGlobals$Outbound` instead. */ export type Outbound = HrisDepartmentsDeleteGlobals$Outbound; } export function hrisDepartmentsDeleteGlobalsToJSON( hrisDepartmentsDeleteGlobals: HrisDepartmentsDeleteGlobals, ): string { return JSON.stringify( HrisDepartmentsDeleteGlobals$outboundSchema.parse( hrisDepartmentsDeleteGlobals, ), ); } export function hrisDepartmentsDeleteGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => HrisDepartmentsDeleteGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'HrisDepartmentsDeleteGlobals' from JSON`, ); } /** @internal */ export const HrisDepartmentsDeleteRequest$inboundSchema: z.ZodType< HrisDepartmentsDeleteRequest, z.ZodTypeDef, unknown > = z.object({ id: z.string(), serviceId: z.string().optional(), raw: z.boolean().default(false), }); /** @internal */ export type HrisDepartmentsDeleteRequest$Outbound = { id: string; serviceId?: string | undefined; raw: boolean; }; /** @internal */ export const HrisDepartmentsDeleteRequest$outboundSchema: z.ZodType< HrisDepartmentsDeleteRequest$Outbound, z.ZodTypeDef, HrisDepartmentsDeleteRequest > = z.object({ id: z.string(), serviceId: z.string().optional(), raw: z.boolean().default(false), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace HrisDepartmentsDeleteRequest$ { /** @deprecated use `HrisDepartmentsDeleteRequest$inboundSchema` instead. */ export const inboundSchema = HrisDepartmentsDeleteRequest$inboundSchema; /** @deprecated use `HrisDepartmentsDeleteRequest$outboundSchema` instead. */ export const outboundSchema = HrisDepartmentsDeleteRequest$outboundSchema; /** @deprecated use `HrisDepartmentsDeleteRequest$Outbound` instead. */ export type Outbound = HrisDepartmentsDeleteRequest$Outbound; } export function hrisDepartmentsDeleteRequestToJSON( hrisDepartmentsDeleteRequest: HrisDepartmentsDeleteRequest, ): string { return JSON.stringify( HrisDepartmentsDeleteRequest$outboundSchema.parse( hrisDepartmentsDeleteRequest, ), ); } export function hrisDepartmentsDeleteRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => HrisDepartmentsDeleteRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'HrisDepartmentsDeleteRequest' from JSON`, ); } /** @internal */ export const HrisDepartmentsDeleteResponse$inboundSchema: z.ZodType< HrisDepartmentsDeleteResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, DeleteDepartmentResponse: components.DeleteDepartmentResponse$inboundSchema .optional(), UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "DeleteDepartmentResponse": "deleteDepartmentResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }); /** @internal */ export type HrisDepartmentsDeleteResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; DeleteDepartmentResponse?: | components.DeleteDepartmentResponse$Outbound | undefined; UnexpectedErrorResponse?: | components.UnexpectedErrorResponse$Outbound | undefined; }; /** @internal */ export const HrisDepartmentsDeleteResponse$outboundSchema: z.ZodType< HrisDepartmentsDeleteResponse$Outbound, z.ZodTypeDef, HrisDepartmentsDeleteResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, deleteDepartmentResponse: components.DeleteDepartmentResponse$outboundSchema .optional(), unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema .optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", deleteDepartmentResponse: "DeleteDepartmentResponse", 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 HrisDepartmentsDeleteResponse$ { /** @deprecated use `HrisDepartmentsDeleteResponse$inboundSchema` instead. */ export const inboundSchema = HrisDepartmentsDeleteResponse$inboundSchema; /** @deprecated use `HrisDepartmentsDeleteResponse$outboundSchema` instead. */ export const outboundSchema = HrisDepartmentsDeleteResponse$outboundSchema; /** @deprecated use `HrisDepartmentsDeleteResponse$Outbound` instead. */ export type Outbound = HrisDepartmentsDeleteResponse$Outbound; } export function hrisDepartmentsDeleteResponseToJSON( hrisDepartmentsDeleteResponse: HrisDepartmentsDeleteResponse, ): string { return JSON.stringify( HrisDepartmentsDeleteResponse$outboundSchema.parse( hrisDepartmentsDeleteResponse, ), ); } export function hrisDepartmentsDeleteResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => HrisDepartmentsDeleteResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'HrisDepartmentsDeleteResponse' from JSON`, ); }