/*
* 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 HrisPayrollsAllGlobals = {
/**
* 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 HrisPayrollsAllRequest = {
/**
* 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;
/**
* Apply filters
*/
filter?: components.PayrollsFilter | 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;
/**
* 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 HrisPayrollsAllResponse = {
httpMeta: components.HTTPMetadata;
/**
* Payrolls
*/
getPayrollsResponse?: components.GetPayrollsResponse | undefined;
/**
* Unexpected error
*/
unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined;
};
/** @internal */
export const HrisPayrollsAllGlobals$inboundSchema: z.ZodType<
HrisPayrollsAllGlobals,
z.ZodTypeDef,
unknown
> = z.object({
consumerId: z.string().optional(),
appId: z.string().optional(),
});
/** @internal */
export type HrisPayrollsAllGlobals$Outbound = {
consumerId?: string | undefined;
appId?: string | undefined;
};
/** @internal */
export const HrisPayrollsAllGlobals$outboundSchema: z.ZodType<
HrisPayrollsAllGlobals$Outbound,
z.ZodTypeDef,
HrisPayrollsAllGlobals
> = 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 HrisPayrollsAllGlobals$ {
/** @deprecated use `HrisPayrollsAllGlobals$inboundSchema` instead. */
export const inboundSchema = HrisPayrollsAllGlobals$inboundSchema;
/** @deprecated use `HrisPayrollsAllGlobals$outboundSchema` instead. */
export const outboundSchema = HrisPayrollsAllGlobals$outboundSchema;
/** @deprecated use `HrisPayrollsAllGlobals$Outbound` instead. */
export type Outbound = HrisPayrollsAllGlobals$Outbound;
}
export function hrisPayrollsAllGlobalsToJSON(
hrisPayrollsAllGlobals: HrisPayrollsAllGlobals,
): string {
return JSON.stringify(
HrisPayrollsAllGlobals$outboundSchema.parse(hrisPayrollsAllGlobals),
);
}
export function hrisPayrollsAllGlobalsFromJSON(
jsonString: string,
): SafeParseResult {
return safeParse(
jsonString,
(x) => HrisPayrollsAllGlobals$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'HrisPayrollsAllGlobals' from JSON`,
);
}
/** @internal */
export const HrisPayrollsAllRequest$inboundSchema: z.ZodType<
HrisPayrollsAllRequest,
z.ZodTypeDef,
unknown
> = z.object({
raw: z.boolean().default(false),
serviceId: z.string().optional(),
filter: components.PayrollsFilter$inboundSchema.optional(),
pass_through: z.record(z.any()).optional(),
fields: z.nullable(z.string()).optional(),
}).transform((v) => {
return remap$(v, {
"pass_through": "passThrough",
});
});
/** @internal */
export type HrisPayrollsAllRequest$Outbound = {
raw: boolean;
serviceId?: string | undefined;
filter?: components.PayrollsFilter$Outbound | undefined;
pass_through?: { [k: string]: any } | undefined;
fields?: string | null | undefined;
};
/** @internal */
export const HrisPayrollsAllRequest$outboundSchema: z.ZodType<
HrisPayrollsAllRequest$Outbound,
z.ZodTypeDef,
HrisPayrollsAllRequest
> = z.object({
raw: z.boolean().default(false),
serviceId: z.string().optional(),
filter: components.PayrollsFilter$outboundSchema.optional(),
passThrough: z.record(z.any()).optional(),
fields: z.nullable(z.string()).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 HrisPayrollsAllRequest$ {
/** @deprecated use `HrisPayrollsAllRequest$inboundSchema` instead. */
export const inboundSchema = HrisPayrollsAllRequest$inboundSchema;
/** @deprecated use `HrisPayrollsAllRequest$outboundSchema` instead. */
export const outboundSchema = HrisPayrollsAllRequest$outboundSchema;
/** @deprecated use `HrisPayrollsAllRequest$Outbound` instead. */
export type Outbound = HrisPayrollsAllRequest$Outbound;
}
export function hrisPayrollsAllRequestToJSON(
hrisPayrollsAllRequest: HrisPayrollsAllRequest,
): string {
return JSON.stringify(
HrisPayrollsAllRequest$outboundSchema.parse(hrisPayrollsAllRequest),
);
}
export function hrisPayrollsAllRequestFromJSON(
jsonString: string,
): SafeParseResult {
return safeParse(
jsonString,
(x) => HrisPayrollsAllRequest$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'HrisPayrollsAllRequest' from JSON`,
);
}
/** @internal */
export const HrisPayrollsAllResponse$inboundSchema: z.ZodType<
HrisPayrollsAllResponse,
z.ZodTypeDef,
unknown
> = z.object({
HttpMeta: components.HTTPMetadata$inboundSchema,
GetPayrollsResponse: components.GetPayrollsResponse$inboundSchema.optional(),
UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema
.optional(),
}).transform((v) => {
return remap$(v, {
"HttpMeta": "httpMeta",
"GetPayrollsResponse": "getPayrollsResponse",
"UnexpectedErrorResponse": "unexpectedErrorResponse",
});
});
/** @internal */
export type HrisPayrollsAllResponse$Outbound = {
HttpMeta: components.HTTPMetadata$Outbound;
GetPayrollsResponse?: components.GetPayrollsResponse$Outbound | undefined;
UnexpectedErrorResponse?:
| components.UnexpectedErrorResponse$Outbound
| undefined;
};
/** @internal */
export const HrisPayrollsAllResponse$outboundSchema: z.ZodType<
HrisPayrollsAllResponse$Outbound,
z.ZodTypeDef,
HrisPayrollsAllResponse
> = z.object({
httpMeta: components.HTTPMetadata$outboundSchema,
getPayrollsResponse: components.GetPayrollsResponse$outboundSchema.optional(),
unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema
.optional(),
}).transform((v) => {
return remap$(v, {
httpMeta: "HttpMeta",
getPayrollsResponse: "GetPayrollsResponse",
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 HrisPayrollsAllResponse$ {
/** @deprecated use `HrisPayrollsAllResponse$inboundSchema` instead. */
export const inboundSchema = HrisPayrollsAllResponse$inboundSchema;
/** @deprecated use `HrisPayrollsAllResponse$outboundSchema` instead. */
export const outboundSchema = HrisPayrollsAllResponse$outboundSchema;
/** @deprecated use `HrisPayrollsAllResponse$Outbound` instead. */
export type Outbound = HrisPayrollsAllResponse$Outbound;
}
export function hrisPayrollsAllResponseToJSON(
hrisPayrollsAllResponse: HrisPayrollsAllResponse,
): string {
return JSON.stringify(
HrisPayrollsAllResponse$outboundSchema.parse(hrisPayrollsAllResponse),
);
}
export function hrisPayrollsAllResponseFromJSON(
jsonString: string,
): SafeParseResult {
return safeParse(
jsonString,
(x) => HrisPayrollsAllResponse$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'HrisPayrollsAllResponse' from JSON`,
);
}