/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { HTTPMetadata, HTTPMetadata$inboundSchema, } from "../components/httpmetadata.js"; import { Notification, Notification$inboundSchema, } from "../components/notification.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export const Status = { Open: "open", Expired: "expired", Resolved: "resolved", } as const; export type Status = ClosedEnum; /** * Determines the date-based API version associated with your API call. If none is provided, your application's [minimum API version](https://docs.gusto.com/embedded-payroll/docs/api-versioning#minimum-api-version) is used. */ export const GetCompanyNotificationsHeaderXGustoAPIVersion = { TwoThousandAndTwentyFiveMinus06Minus15: "2025-06-15", } as const; /** * Determines the date-based API version associated with your API call. If none is provided, your application's [minimum API version](https://docs.gusto.com/embedded-payroll/docs/api-versioning#minimum-api-version) is used. */ export type GetCompanyNotificationsHeaderXGustoAPIVersion = ClosedEnum< typeof GetCompanyNotificationsHeaderXGustoAPIVersion >; export type GetCompanyNotificationsRequest = { /** * The UUID of the company for which you would like to return notifications */ companyUuid: string; status?: Status | undefined; /** * Determines the date-based API version associated with your API call. If none is provided, your application's [minimum API version](https://docs.gusto.com/embedded-payroll/docs/api-versioning#minimum-api-version) is used. */ xGustoAPIVersion?: GetCompanyNotificationsHeaderXGustoAPIVersion | undefined; /** * The page that is requested. When unspecified, will load all objects unless endpoint forces pagination. */ page?: number | undefined; /** * Number of objects per page. For majority of endpoints will default to 25 */ per?: number | undefined; }; export type GetCompanyNotificationsResponse = { httpMeta: HTTPMetadata; /** * successful */ notificationsList?: Array | undefined; }; /** @internal */ export const Status$outboundSchema: z.ZodNativeEnum = z .nativeEnum(Status); /** @internal */ export const GetCompanyNotificationsHeaderXGustoAPIVersion$outboundSchema: z.ZodNativeEnum = z .nativeEnum(GetCompanyNotificationsHeaderXGustoAPIVersion); /** @internal */ export type GetCompanyNotificationsRequest$Outbound = { company_uuid: string; status?: string | undefined; "X-Gusto-API-Version": string; page?: number | undefined; per?: number | undefined; }; /** @internal */ export const GetCompanyNotificationsRequest$outboundSchema: z.ZodType< GetCompanyNotificationsRequest$Outbound, z.ZodTypeDef, GetCompanyNotificationsRequest > = z.object({ companyUuid: z.string(), status: Status$outboundSchema.optional(), xGustoAPIVersion: GetCompanyNotificationsHeaderXGustoAPIVersion$outboundSchema .default("2025-06-15"), page: z.number().int().optional(), per: z.number().int().optional(), }).transform((v) => { return remap$(v, { companyUuid: "company_uuid", xGustoAPIVersion: "X-Gusto-API-Version", }); }); export function getCompanyNotificationsRequestToJSON( getCompanyNotificationsRequest: GetCompanyNotificationsRequest, ): string { return JSON.stringify( GetCompanyNotificationsRequest$outboundSchema.parse( getCompanyNotificationsRequest, ), ); } /** @internal */ export const GetCompanyNotificationsResponse$inboundSchema: z.ZodType< GetCompanyNotificationsResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: HTTPMetadata$inboundSchema, "Notifications-List": z.array(Notification$inboundSchema).optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "Notifications-List": "notificationsList", }); }); export function getCompanyNotificationsResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetCompanyNotificationsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetCompanyNotificationsResponse' from JSON`, ); }