/* * 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 { SDKValidationError } from "./sdk-validation-error.js"; import { Status, Status$inboundSchema } from "./status.js"; export type SubscriptionPhaseResponse = { createdAt?: Date | undefined; createdBy?: string | undefined; /** * EndDate is when the phase ends (nil if phase is still active or indefinite) */ endDate?: Date | undefined; /** * EnvironmentID is the environment identifier for the phase */ environmentId?: string | undefined; /** * ID is the unique identifier for the subscription phase */ id?: string | undefined; metadata?: { [k: string]: string } | undefined; /** * StartDate is when the phase starts */ startDate?: 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 SubscriptionPhaseResponse$inboundSchema: z.ZodMiniType< SubscriptionPhaseResponse, unknown > = z.pipe( z.object({ created_at: types.optional(types.date()), created_by: types.optional(types.string()), end_date: types.optional(types.date()), environment_id: types.optional(types.string()), id: types.optional(types.string()), metadata: types.optional(z.record(z.string(), types.string())), start_date: 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", "end_date": "endDate", "environment_id": "environmentId", "start_date": "startDate", "subscription_id": "subscriptionId", "tenant_id": "tenantId", "updated_at": "updatedAt", "updated_by": "updatedBy", }); }), ); export function subscriptionPhaseResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => SubscriptionPhaseResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SubscriptionPhaseResponse' from JSON`, ); }