/* * 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 AtsApplicantsOneGlobals = { /** * 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 AtsApplicantsOneRequest = { /** * 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; }; export type AtsApplicantsOneResponse = { httpMeta: components.HTTPMetadata; /** * Applicants */ getApplicantResponse?: components.GetApplicantResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export const AtsApplicantsOneGlobals$inboundSchema: z.ZodType< AtsApplicantsOneGlobals, z.ZodTypeDef, unknown > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** @internal */ export type AtsApplicantsOneGlobals$Outbound = { consumerId?: string | undefined; appId?: string | undefined; }; /** @internal */ export const AtsApplicantsOneGlobals$outboundSchema: z.ZodType< AtsApplicantsOneGlobals$Outbound, z.ZodTypeDef, AtsApplicantsOneGlobals > = 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 AtsApplicantsOneGlobals$ { /** @deprecated use `AtsApplicantsOneGlobals$inboundSchema` instead. */ export const inboundSchema = AtsApplicantsOneGlobals$inboundSchema; /** @deprecated use `AtsApplicantsOneGlobals$outboundSchema` instead. */ export const outboundSchema = AtsApplicantsOneGlobals$outboundSchema; /** @deprecated use `AtsApplicantsOneGlobals$Outbound` instead. */ export type Outbound = AtsApplicantsOneGlobals$Outbound; } export function atsApplicantsOneGlobalsToJSON( atsApplicantsOneGlobals: AtsApplicantsOneGlobals, ): string { return JSON.stringify( AtsApplicantsOneGlobals$outboundSchema.parse(atsApplicantsOneGlobals), ); } export function atsApplicantsOneGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AtsApplicantsOneGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AtsApplicantsOneGlobals' from JSON`, ); } /** @internal */ export const AtsApplicantsOneRequest$inboundSchema: z.ZodType< AtsApplicantsOneRequest, z.ZodTypeDef, unknown > = z.object({ id: z.string(), serviceId: z.string().optional(), raw: z.boolean().default(false), fields: z.nullable(z.string()).optional(), }); /** @internal */ export type AtsApplicantsOneRequest$Outbound = { id: string; serviceId?: string | undefined; raw: boolean; fields?: string | null | undefined; }; /** @internal */ export const AtsApplicantsOneRequest$outboundSchema: z.ZodType< AtsApplicantsOneRequest$Outbound, z.ZodTypeDef, AtsApplicantsOneRequest > = z.object({ id: z.string(), serviceId: z.string().optional(), raw: z.boolean().default(false), fields: z.nullable(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 AtsApplicantsOneRequest$ { /** @deprecated use `AtsApplicantsOneRequest$inboundSchema` instead. */ export const inboundSchema = AtsApplicantsOneRequest$inboundSchema; /** @deprecated use `AtsApplicantsOneRequest$outboundSchema` instead. */ export const outboundSchema = AtsApplicantsOneRequest$outboundSchema; /** @deprecated use `AtsApplicantsOneRequest$Outbound` instead. */ export type Outbound = AtsApplicantsOneRequest$Outbound; } export function atsApplicantsOneRequestToJSON( atsApplicantsOneRequest: AtsApplicantsOneRequest, ): string { return JSON.stringify( AtsApplicantsOneRequest$outboundSchema.parse(atsApplicantsOneRequest), ); } export function atsApplicantsOneRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AtsApplicantsOneRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AtsApplicantsOneRequest' from JSON`, ); } /** @internal */ export const AtsApplicantsOneResponse$inboundSchema: z.ZodType< AtsApplicantsOneResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, GetApplicantResponse: components.GetApplicantResponse$inboundSchema .optional(), UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "GetApplicantResponse": "getApplicantResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }); /** @internal */ export type AtsApplicantsOneResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; GetApplicantResponse?: components.GetApplicantResponse$Outbound | undefined; UnexpectedErrorResponse?: | components.UnexpectedErrorResponse$Outbound | undefined; }; /** @internal */ export const AtsApplicantsOneResponse$outboundSchema: z.ZodType< AtsApplicantsOneResponse$Outbound, z.ZodTypeDef, AtsApplicantsOneResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, getApplicantResponse: components.GetApplicantResponse$outboundSchema .optional(), unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema .optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", getApplicantResponse: "GetApplicantResponse", 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 AtsApplicantsOneResponse$ { /** @deprecated use `AtsApplicantsOneResponse$inboundSchema` instead. */ export const inboundSchema = AtsApplicantsOneResponse$inboundSchema; /** @deprecated use `AtsApplicantsOneResponse$outboundSchema` instead. */ export const outboundSchema = AtsApplicantsOneResponse$outboundSchema; /** @deprecated use `AtsApplicantsOneResponse$Outbound` instead. */ export type Outbound = AtsApplicantsOneResponse$Outbound; } export function atsApplicantsOneResponseToJSON( atsApplicantsOneResponse: AtsApplicantsOneResponse, ): string { return JSON.stringify( AtsApplicantsOneResponse$outboundSchema.parse(atsApplicantsOneResponse), ); } export function atsApplicantsOneResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AtsApplicantsOneResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AtsApplicantsOneResponse' from JSON`, ); }