/* * 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 { CompanyAttachmentDownloadUrl, CompanyAttachmentDownloadUrl$inboundSchema, } from "../components/companyattachmentdownloadurl.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 GetV1CompaniesAttachmentUrlHeaderXGustoAPIVersion = { 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 GetV1CompaniesAttachmentUrlHeaderXGustoAPIVersion = ClosedEnum< typeof GetV1CompaniesAttachmentUrlHeaderXGustoAPIVersion >; export type GetV1CompaniesAttachmentUrlRequest = { /** * 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?: | GetV1CompaniesAttachmentUrlHeaderXGustoAPIVersion | undefined; /** * The UUID of the company */ companyId: string; /** * The UUID of the company attachment */ companyAttachmentUuid: string; }; export type GetV1CompaniesAttachmentUrlResponse = { httpMeta: HTTPMetadata; /** * Successful */ companyAttachmentDownloadUrl?: CompanyAttachmentDownloadUrl | undefined; }; /** @internal */ export const GetV1CompaniesAttachmentUrlHeaderXGustoAPIVersion$outboundSchema: z.ZodNativeEnum = z .nativeEnum(GetV1CompaniesAttachmentUrlHeaderXGustoAPIVersion); /** @internal */ export type GetV1CompaniesAttachmentUrlRequest$Outbound = { "X-Gusto-API-Version": string; company_id: string; company_attachment_uuid: string; }; /** @internal */ export const GetV1CompaniesAttachmentUrlRequest$outboundSchema: z.ZodType< GetV1CompaniesAttachmentUrlRequest$Outbound, z.ZodTypeDef, GetV1CompaniesAttachmentUrlRequest > = z.object({ xGustoAPIVersion: GetV1CompaniesAttachmentUrlHeaderXGustoAPIVersion$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 getV1CompaniesAttachmentUrlRequestToJSON( getV1CompaniesAttachmentUrlRequest: GetV1CompaniesAttachmentUrlRequest, ): string { return JSON.stringify( GetV1CompaniesAttachmentUrlRequest$outboundSchema.parse( getV1CompaniesAttachmentUrlRequest, ), ); } /** @internal */ export const GetV1CompaniesAttachmentUrlResponse$inboundSchema: z.ZodType< GetV1CompaniesAttachmentUrlResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: HTTPMetadata$inboundSchema, "Company-Attachment-Download-Url": CompanyAttachmentDownloadUrl$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "Company-Attachment-Download-Url": "companyAttachmentDownloadUrl", }); }); export function getV1CompaniesAttachmentUrlResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetV1CompaniesAttachmentUrlResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetV1CompaniesAttachmentUrlResponse' from JSON`, ); }