/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as types from "../../types/primitives.js"; import { PauseMode, PauseMode$inboundSchema } from "./pause-mode.js"; import { PauseStatus, PauseStatus$inboundSchema } from "./pause-status.js"; import { ResumeMode, ResumeMode$inboundSchema } from "./resume-mode.js"; import { SDKValidationError } from "./sdk-validation-error.js"; import { Status, Status$inboundSchema } from "./status.js"; export type SubscriptionSubscriptionPause = { createdAt?: Date | undefined; createdBy?: string | undefined; /** * EnvironmentID is the environment identifier for the pause */ environmentId?: string | undefined; /** * ID is the unique identifier for the subscription pause */ id?: string | undefined; metadata?: { [k: string]: string } | undefined; /** * OriginalPeriodEnd is the end of the billing period when the pause was created */ originalPeriodEnd?: Date | undefined; /** * OriginalPeriodStart is the start of the billing period when the pause was created */ originalPeriodStart?: Date | undefined; /** * PauseEnd is when the pause will end (null for indefinite) */ pauseEnd?: Date | undefined; pauseMode?: PauseMode | undefined; /** * PauseStart is when the pause actually started */ pauseStart?: Date | undefined; pauseStatus?: PauseStatus | undefined; /** * Reason is the reason for pausing */ reason?: string | undefined; resumeMode?: ResumeMode | undefined; /** * ResumedAt is when the pause was actually ended (if manually resumed) */ resumedAt?: Date | undefined; status?: Status | undefined; /** * SubscriptionID is the identifier for the subscription */ subscriptionId?: string | undefined; tenantId?: string | undefined; updatedAt?: Date | undefined; updatedBy?: string | undefined; }; /** @internal */ export const SubscriptionSubscriptionPause$inboundSchema: z.ZodMiniType< SubscriptionSubscriptionPause, unknown > = z.pipe( z.object({ created_at: types.optional(types.date()), created_by: types.optional(types.string()), environment_id: types.optional(types.string()), id: types.optional(types.string()), metadata: types.optional(z.record(z.string(), types.string())), original_period_end: types.optional(types.date()), original_period_start: types.optional(types.date()), pause_end: types.optional(types.date()), pause_mode: types.optional(PauseMode$inboundSchema), pause_start: types.optional(types.date()), pause_status: types.optional(PauseStatus$inboundSchema), reason: types.optional(types.string()), resume_mode: types.optional(ResumeMode$inboundSchema), resumed_at: types.optional(types.date()), status: types.optional(Status$inboundSchema), subscription_id: types.optional(types.string()), tenant_id: types.optional(types.string()), updated_at: types.optional(types.date()), updated_by: types.optional(types.string()), }), z.transform((v) => { return remap$(v, { "created_at": "createdAt", "created_by": "createdBy", "environment_id": "environmentId", "original_period_end": "originalPeriodEnd", "original_period_start": "originalPeriodStart", "pause_end": "pauseEnd", "pause_mode": "pauseMode", "pause_start": "pauseStart", "pause_status": "pauseStatus", "resume_mode": "resumeMode", "resumed_at": "resumedAt", "subscription_id": "subscriptionId", "tenant_id": "tenantId", "updated_at": "updatedAt", "updated_by": "updatedBy", }); }), ); export function subscriptionSubscriptionPauseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => SubscriptionSubscriptionPause$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SubscriptionSubscriptionPause' from JSON`, ); }