/* * 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 { CompanySuspension, CompanySuspension$inboundSchema, } from "../components/companysuspension.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 PostCompaniesCompanyUuidSuspensionsHeaderXGustoAPIVersion = { 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 PostCompaniesCompanyUuidSuspensionsHeaderXGustoAPIVersion = ClosedEnum; /** * How Gusto will handle taxes already collected. */ export const ReconcileTaxMethod = { PayTaxes: "pay_taxes", RefundTaxes: "refund_taxes", } as const; /** * How Gusto will handle taxes already collected. */ export type ReconcileTaxMethod = ClosedEnum; /** * Explanation for why the company is suspending their account. * * @remarks * * > 🚧 FEIN or entity type changes require Customer Support * > If a company is switching FEIN or changing their entity type, this change must be performed by Gusto Customer Support and cannot be performed via the API at this time. */ export const Reason = { SwitchingProvider: "switching_provider", ShuttingDown: "shutting_down", Acquired: "acquired", NoMoreEmployees: "no_more_employees", ChangingEinOrEntityType: "changing_ein_or_entity_type", } as const; /** * Explanation for why the company is suspending their account. * * @remarks * * > 🚧 FEIN or entity type changes require Customer Support * > If a company is switching FEIN or changing their entity type, this change must be performed by Gusto Customer Support and cannot be performed via the API at this time. */ export type Reason = ClosedEnum; /** * The competitor the company is switching to. Required if `reason` is `'switching_provider'`. * * @remarks * * > 🚧 Switching to Gusto requires Customer Support * > If `'gusto_com'` is selected, this change must be completed by Gusto Customer Support and cannot be performed via the API. This endpoint will return a 422 error in that case. */ export const LeavingFor = { Accountant: "accountant", Adp: "adp", AdpTotalSource: "adp_total_source", BambooHr: "bamboo_hr", BankOrFinancialInstitution: "bank_or_financial_institution", Check: "check", Deel: "deel", GustoCom: "gusto_com", Homebase: "homebase", Insperity: "insperity", IntuitOrQuickbooks: "intuit_or_quickbooks", Justworks: "justworks", Manual: "manual", Namely: "namely", Onpay: "onpay", Other: "other", Oyster: "oyster", Patriot: "patriot", Paychex: "paychex", Paycom: "paycom", Paylocity: "paylocity", Remote: "remote", Rippling: "rippling", Square: "square", Surepayroll: "surepayroll", Trinet: "trinet", VelocityGlobal: "velocity_global", Zenefits: "zenefits", } as const; /** * The competitor the company is switching to. Required if `reason` is `'switching_provider'`. * * @remarks * * > 🚧 Switching to Gusto requires Customer Support * > If `'gusto_com'` is selected, this change must be completed by Gusto Customer Support and cannot be performed via the API. This endpoint will return a 422 error in that case. */ export type LeavingFor = ClosedEnum; export type PostCompaniesCompanyUuidSuspensionsRequestBody = { /** * Should Gusto file quarterly tax forms on behalf of the company? The correct answer can depend on why the company is suspending their account, and how taxes are being reconciled. */ fileQuarterlyForms: boolean; /** * Should Gusto file yearly tax forms on behalf of the company? The correct answer can depend on why the company is suspending their account, and how taxes are being reconciled. */ fileYearlyForms: boolean; /** * How Gusto will handle taxes already collected. */ reconcileTaxMethod: ReconcileTaxMethod; /** * User-supplied comments describing why they are suspending their account. Required if the user is leaving for another provider and selects "other" instead of a defined provider. */ comments?: string | undefined; /** * Explanation for why the company is suspending their account. * * @remarks * * > 🚧 FEIN or entity type changes require Customer Support * > If a company is switching FEIN or changing their entity type, this change must be performed by Gusto Customer Support and cannot be performed via the API at this time. */ reason: Reason; /** * The competitor the company is switching to. Required if `reason` is `'switching_provider'`. * * @remarks * * > 🚧 Switching to Gusto requires Customer Support * > If `'gusto_com'` is selected, this change must be completed by Gusto Customer Support and cannot be performed via the API. This endpoint will return a 422 error in that case. */ leavingFor?: LeavingFor | undefined; }; export type PostCompaniesCompanyUuidSuspensionsRequest = { /** * 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?: | PostCompaniesCompanyUuidSuspensionsHeaderXGustoAPIVersion | undefined; /** * The UUID of the company */ companyUuid: string; requestBody: PostCompaniesCompanyUuidSuspensionsRequestBody; }; export type PostCompaniesCompanyUuidSuspensionsResponse = { httpMeta: HTTPMetadata; /** * Successful response */ companySuspension?: CompanySuspension | undefined; }; /** @internal */ export const PostCompaniesCompanyUuidSuspensionsHeaderXGustoAPIVersion$outboundSchema: z.ZodNativeEnum< typeof PostCompaniesCompanyUuidSuspensionsHeaderXGustoAPIVersion > = z.nativeEnum(PostCompaniesCompanyUuidSuspensionsHeaderXGustoAPIVersion); /** @internal */ export const ReconcileTaxMethod$outboundSchema: z.ZodNativeEnum< typeof ReconcileTaxMethod > = z.nativeEnum(ReconcileTaxMethod); /** @internal */ export const Reason$outboundSchema: z.ZodNativeEnum = z .nativeEnum(Reason); /** @internal */ export const LeavingFor$outboundSchema: z.ZodNativeEnum = z .nativeEnum(LeavingFor); /** @internal */ export type PostCompaniesCompanyUuidSuspensionsRequestBody$Outbound = { file_quarterly_forms: boolean; file_yearly_forms: boolean; reconcile_tax_method: string; comments?: string | undefined; reason: string; leaving_for?: string | undefined; }; /** @internal */ export const PostCompaniesCompanyUuidSuspensionsRequestBody$outboundSchema: z.ZodType< PostCompaniesCompanyUuidSuspensionsRequestBody$Outbound, z.ZodTypeDef, PostCompaniesCompanyUuidSuspensionsRequestBody > = z.object({ fileQuarterlyForms: z.boolean(), fileYearlyForms: z.boolean(), reconcileTaxMethod: ReconcileTaxMethod$outboundSchema, comments: z.string().optional(), reason: Reason$outboundSchema, leavingFor: LeavingFor$outboundSchema.optional(), }).transform((v) => { return remap$(v, { fileQuarterlyForms: "file_quarterly_forms", fileYearlyForms: "file_yearly_forms", reconcileTaxMethod: "reconcile_tax_method", leavingFor: "leaving_for", }); }); export function postCompaniesCompanyUuidSuspensionsRequestBodyToJSON( postCompaniesCompanyUuidSuspensionsRequestBody: PostCompaniesCompanyUuidSuspensionsRequestBody, ): string { return JSON.stringify( PostCompaniesCompanyUuidSuspensionsRequestBody$outboundSchema.parse( postCompaniesCompanyUuidSuspensionsRequestBody, ), ); } /** @internal */ export type PostCompaniesCompanyUuidSuspensionsRequest$Outbound = { "X-Gusto-API-Version": string; company_uuid: string; RequestBody: PostCompaniesCompanyUuidSuspensionsRequestBody$Outbound; }; /** @internal */ export const PostCompaniesCompanyUuidSuspensionsRequest$outboundSchema: z.ZodType< PostCompaniesCompanyUuidSuspensionsRequest$Outbound, z.ZodTypeDef, PostCompaniesCompanyUuidSuspensionsRequest > = z.object({ xGustoAPIVersion: PostCompaniesCompanyUuidSuspensionsHeaderXGustoAPIVersion$outboundSchema .default("2025-06-15"), companyUuid: z.string(), requestBody: z.lazy(() => PostCompaniesCompanyUuidSuspensionsRequestBody$outboundSchema ), }).transform((v) => { return remap$(v, { xGustoAPIVersion: "X-Gusto-API-Version", companyUuid: "company_uuid", requestBody: "RequestBody", }); }); export function postCompaniesCompanyUuidSuspensionsRequestToJSON( postCompaniesCompanyUuidSuspensionsRequest: PostCompaniesCompanyUuidSuspensionsRequest, ): string { return JSON.stringify( PostCompaniesCompanyUuidSuspensionsRequest$outboundSchema.parse( postCompaniesCompanyUuidSuspensionsRequest, ), ); } /** @internal */ export const PostCompaniesCompanyUuidSuspensionsResponse$inboundSchema: z.ZodType< PostCompaniesCompanyUuidSuspensionsResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: HTTPMetadata$inboundSchema, "Company-Suspension": CompanySuspension$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "Company-Suspension": "companySuspension", }); }); export function postCompaniesCompanyUuidSuspensionsResponseFromJSON( jsonString: string, ): SafeParseResult< PostCompaniesCompanyUuidSuspensionsResponse, SDKValidationError > { return safeParse( jsonString, (x) => PostCompaniesCompanyUuidSuspensionsResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'PostCompaniesCompanyUuidSuspensionsResponse' from JSON`, ); }