/*
* 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 HrisPayrollsOneGlobals = {
/**
* 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 HrisPayrollsOneRequest = {
/**
* ID of the payroll you are acting upon.
*/
payrollId: string;
/**
* Include raw response. Mostly used for debugging purposes
*/
raw?: boolean | undefined;
/**
* 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;
/**
* 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 HrisPayrollsOneResponse = {
httpMeta: components.HTTPMetadata;
/**
* Payrolls
*/
getPayrollResponse?: components.GetPayrollResponse | undefined;
/**
* Unexpected error
*/
unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined;
};
/** @internal */
export const HrisPayrollsOneGlobals$inboundSchema: z.ZodType<
HrisPayrollsOneGlobals,
z.ZodTypeDef,
unknown
> = z.object({
consumerId: z.string().optional(),
appId: z.string().optional(),
});
/** @internal */
export type HrisPayrollsOneGlobals$Outbound = {
consumerId?: string | undefined;
appId?: string | undefined;
};
/** @internal */
export const HrisPayrollsOneGlobals$outboundSchema: z.ZodType<
HrisPayrollsOneGlobals$Outbound,
z.ZodTypeDef,
HrisPayrollsOneGlobals
> = 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 HrisPayrollsOneGlobals$ {
/** @deprecated use `HrisPayrollsOneGlobals$inboundSchema` instead. */
export const inboundSchema = HrisPayrollsOneGlobals$inboundSchema;
/** @deprecated use `HrisPayrollsOneGlobals$outboundSchema` instead. */
export const outboundSchema = HrisPayrollsOneGlobals$outboundSchema;
/** @deprecated use `HrisPayrollsOneGlobals$Outbound` instead. */
export type Outbound = HrisPayrollsOneGlobals$Outbound;
}
export function hrisPayrollsOneGlobalsToJSON(
hrisPayrollsOneGlobals: HrisPayrollsOneGlobals,
): string {
return JSON.stringify(
HrisPayrollsOneGlobals$outboundSchema.parse(hrisPayrollsOneGlobals),
);
}
export function hrisPayrollsOneGlobalsFromJSON(
jsonString: string,
): SafeParseResult {
return safeParse(
jsonString,
(x) => HrisPayrollsOneGlobals$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'HrisPayrollsOneGlobals' from JSON`,
);
}
/** @internal */
export const HrisPayrollsOneRequest$inboundSchema: z.ZodType<
HrisPayrollsOneRequest,
z.ZodTypeDef,
unknown
> = z.object({
payroll_id: z.string(),
raw: z.boolean().default(false),
serviceId: z.string().optional(),
fields: z.nullable(z.string()).optional(),
}).transform((v) => {
return remap$(v, {
"payroll_id": "payrollId",
});
});
/** @internal */
export type HrisPayrollsOneRequest$Outbound = {
payroll_id: string;
raw: boolean;
serviceId?: string | undefined;
fields?: string | null | undefined;
};
/** @internal */
export const HrisPayrollsOneRequest$outboundSchema: z.ZodType<
HrisPayrollsOneRequest$Outbound,
z.ZodTypeDef,
HrisPayrollsOneRequest
> = z.object({
payrollId: z.string(),
raw: z.boolean().default(false),
serviceId: z.string().optional(),
fields: z.nullable(z.string()).optional(),
}).transform((v) => {
return remap$(v, {
payrollId: "payroll_id",
});
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace HrisPayrollsOneRequest$ {
/** @deprecated use `HrisPayrollsOneRequest$inboundSchema` instead. */
export const inboundSchema = HrisPayrollsOneRequest$inboundSchema;
/** @deprecated use `HrisPayrollsOneRequest$outboundSchema` instead. */
export const outboundSchema = HrisPayrollsOneRequest$outboundSchema;
/** @deprecated use `HrisPayrollsOneRequest$Outbound` instead. */
export type Outbound = HrisPayrollsOneRequest$Outbound;
}
export function hrisPayrollsOneRequestToJSON(
hrisPayrollsOneRequest: HrisPayrollsOneRequest,
): string {
return JSON.stringify(
HrisPayrollsOneRequest$outboundSchema.parse(hrisPayrollsOneRequest),
);
}
export function hrisPayrollsOneRequestFromJSON(
jsonString: string,
): SafeParseResult {
return safeParse(
jsonString,
(x) => HrisPayrollsOneRequest$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'HrisPayrollsOneRequest' from JSON`,
);
}
/** @internal */
export const HrisPayrollsOneResponse$inboundSchema: z.ZodType<
HrisPayrollsOneResponse,
z.ZodTypeDef,
unknown
> = z.object({
HttpMeta: components.HTTPMetadata$inboundSchema,
GetPayrollResponse: components.GetPayrollResponse$inboundSchema.optional(),
UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema
.optional(),
}).transform((v) => {
return remap$(v, {
"HttpMeta": "httpMeta",
"GetPayrollResponse": "getPayrollResponse",
"UnexpectedErrorResponse": "unexpectedErrorResponse",
});
});
/** @internal */
export type HrisPayrollsOneResponse$Outbound = {
HttpMeta: components.HTTPMetadata$Outbound;
GetPayrollResponse?: components.GetPayrollResponse$Outbound | undefined;
UnexpectedErrorResponse?:
| components.UnexpectedErrorResponse$Outbound
| undefined;
};
/** @internal */
export const HrisPayrollsOneResponse$outboundSchema: z.ZodType<
HrisPayrollsOneResponse$Outbound,
z.ZodTypeDef,
HrisPayrollsOneResponse
> = z.object({
httpMeta: components.HTTPMetadata$outboundSchema,
getPayrollResponse: components.GetPayrollResponse$outboundSchema.optional(),
unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema
.optional(),
}).transform((v) => {
return remap$(v, {
httpMeta: "HttpMeta",
getPayrollResponse: "GetPayrollResponse",
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 HrisPayrollsOneResponse$ {
/** @deprecated use `HrisPayrollsOneResponse$inboundSchema` instead. */
export const inboundSchema = HrisPayrollsOneResponse$inboundSchema;
/** @deprecated use `HrisPayrollsOneResponse$outboundSchema` instead. */
export const outboundSchema = HrisPayrollsOneResponse$outboundSchema;
/** @deprecated use `HrisPayrollsOneResponse$Outbound` instead. */
export type Outbound = HrisPayrollsOneResponse$Outbound;
}
export function hrisPayrollsOneResponseToJSON(
hrisPayrollsOneResponse: HrisPayrollsOneResponse,
): string {
return JSON.stringify(
HrisPayrollsOneResponse$outboundSchema.parse(hrisPayrollsOneResponse),
);
}
export function hrisPayrollsOneResponseFromJSON(
jsonString: string,
): SafeParseResult {
return safeParse(
jsonString,
(x) => HrisPayrollsOneResponse$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'HrisPayrollsOneResponse' from JSON`,
);
}