/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 973744f9c992 */ import * as z from "zod/v4"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type SyncRenewGlobals = { /** * Workspace name. Platform API keys already select a workspace; other authentication methods can configure it once on the SDK client. */ workspace?: string | undefined; }; export type Lease = { /** * Unique identifier for the deployment. */ deploymentId: string; /** * False when this session no longer holds a live lease. */ renewed: boolean; leaseExpiresAt: Date | null; }; /** * Renewal processed. Inspect `leases` for per-deployment outcomes; a lost lease is reported there rather than failing the whole batch. */ export type SyncRenewResponse = { /** * True when every requested deployment was renewed. */ success: boolean; /** * Per-deployment renewal outcome. */ leases: Array; }; /** @internal */ export const Lease$inboundSchema: z.ZodType = z.object({ deploymentId: z.string(), renewed: z.boolean(), leaseExpiresAt: z.nullable( z.iso.datetime({ offset: true }).transform(v => new Date(v)), ), }); export function leaseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Lease$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Lease' from JSON`, ); } /** @internal */ export const SyncRenewResponse$inboundSchema: z.ZodType< SyncRenewResponse, unknown > = z.object({ success: z.boolean(), leases: z.array(z.lazy(() => Lease$inboundSchema)), }); export function syncRenewResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => SyncRenewResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SyncRenewResponse' from JSON`, ); }