/* * 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 { CompanyAttachment, CompanyAttachment$inboundSchema, } from "../components/companyattachment.js"; import { HTTPMetadata, HTTPMetadata$inboundSchema, } from "../components/httpmetadata.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * 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 GetV1CompaniesAttachmentsHeaderXGustoAPIVersion = { 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 GetV1CompaniesAttachmentsHeaderXGustoAPIVersion = ClosedEnum< typeof GetV1CompaniesAttachmentsHeaderXGustoAPIVersion >; export type GetV1CompaniesAttachmentsRequest = { /** * 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?: | GetV1CompaniesAttachmentsHeaderXGustoAPIVersion | undefined; /** * The UUID of the company */ companyId: string; }; export type GetV1CompaniesAttachmentsResponse = { httpMeta: HTTPMetadata; /** * Successful */ companyAttachments?: Array | undefined; }; /** @internal */ export const GetV1CompaniesAttachmentsHeaderXGustoAPIVersion$outboundSchema: z.ZodNativeEnum = z .nativeEnum(GetV1CompaniesAttachmentsHeaderXGustoAPIVersion); /** @internal */ export type GetV1CompaniesAttachmentsRequest$Outbound = { "X-Gusto-API-Version": string; company_id: string; }; /** @internal */ export const GetV1CompaniesAttachmentsRequest$outboundSchema: z.ZodType< GetV1CompaniesAttachmentsRequest$Outbound, z.ZodTypeDef, GetV1CompaniesAttachmentsRequest > = z.object({ xGustoAPIVersion: GetV1CompaniesAttachmentsHeaderXGustoAPIVersion$outboundSchema.default( "2025-06-15", ), companyId: z.string(), }).transform((v) => { return remap$(v, { xGustoAPIVersion: "X-Gusto-API-Version", companyId: "company_id", }); }); export function getV1CompaniesAttachmentsRequestToJSON( getV1CompaniesAttachmentsRequest: GetV1CompaniesAttachmentsRequest, ): string { return JSON.stringify( GetV1CompaniesAttachmentsRequest$outboundSchema.parse( getV1CompaniesAttachmentsRequest, ), ); } /** @internal */ export const GetV1CompaniesAttachmentsResponse$inboundSchema: z.ZodType< GetV1CompaniesAttachmentsResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: HTTPMetadata$inboundSchema, "Company-Attachments": z.array(CompanyAttachment$inboundSchema).optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "Company-Attachments": "companyAttachments", }); }); export function getV1CompaniesAttachmentsResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetV1CompaniesAttachmentsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetV1CompaniesAttachmentsResponse' from JSON`, ); }