/* * 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 GetV1CompaniesAttachmentHeaderXGustoAPIVersion = { 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 GetV1CompaniesAttachmentHeaderXGustoAPIVersion = ClosedEnum< typeof GetV1CompaniesAttachmentHeaderXGustoAPIVersion >; export type GetV1CompaniesAttachmentRequest = { /** * 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?: GetV1CompaniesAttachmentHeaderXGustoAPIVersion | undefined; /** * The UUID of the company */ companyId: string; /** * The UUID of the company attachment */ companyAttachmentUuid: string; }; export type GetV1CompaniesAttachmentResponse = { httpMeta: HTTPMetadata; /** * Successful */ companyAttachment?: CompanyAttachment | undefined; }; /** @internal */ export const GetV1CompaniesAttachmentHeaderXGustoAPIVersion$outboundSchema: z.ZodNativeEnum = z .nativeEnum(GetV1CompaniesAttachmentHeaderXGustoAPIVersion); /** @internal */ export type GetV1CompaniesAttachmentRequest$Outbound = { "X-Gusto-API-Version": string; company_id: string; company_attachment_uuid: string; }; /** @internal */ export const GetV1CompaniesAttachmentRequest$outboundSchema: z.ZodType< GetV1CompaniesAttachmentRequest$Outbound, z.ZodTypeDef, GetV1CompaniesAttachmentRequest > = z.object({ xGustoAPIVersion: GetV1CompaniesAttachmentHeaderXGustoAPIVersion$outboundSchema.default( "2025-06-15", ), companyId: z.string(), companyAttachmentUuid: z.string(), }).transform((v) => { return remap$(v, { xGustoAPIVersion: "X-Gusto-API-Version", companyId: "company_id", companyAttachmentUuid: "company_attachment_uuid", }); }); export function getV1CompaniesAttachmentRequestToJSON( getV1CompaniesAttachmentRequest: GetV1CompaniesAttachmentRequest, ): string { return JSON.stringify( GetV1CompaniesAttachmentRequest$outboundSchema.parse( getV1CompaniesAttachmentRequest, ), ); } /** @internal */ export const GetV1CompaniesAttachmentResponse$inboundSchema: z.ZodType< GetV1CompaniesAttachmentResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: HTTPMetadata$inboundSchema, "Company-Attachment": CompanyAttachment$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "Company-Attachment": "companyAttachment", }); }); export function getV1CompaniesAttachmentResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetV1CompaniesAttachmentResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetV1CompaniesAttachmentResponse' from JSON`, ); }