/* * 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 { BillingPeriodBehaviour, BillingPeriodBehaviour$inboundSchema, } from "./billing-period-behaviour.js"; import { SDKValidationError } from "./sdk-validation-error.js"; export type SubscriptionChangeBillingPeriodResult = { behaviour?: BillingPeriodBehaviour | undefined; billingAnchor?: Date | undefined; currentPeriodEnd?: Date | undefined; currentPeriodStart?: Date | undefined; }; /** @internal */ export const SubscriptionChangeBillingPeriodResult$inboundSchema: z.ZodMiniType< SubscriptionChangeBillingPeriodResult, unknown > = z.pipe( z.object({ behaviour: types.optional(BillingPeriodBehaviour$inboundSchema), billing_anchor: types.optional(types.date()), current_period_end: types.optional(types.date()), current_period_start: types.optional(types.date()), }), z.transform((v) => { return remap$(v, { "billing_anchor": "billingAnchor", "current_period_end": "currentPeriodEnd", "current_period_start": "currentPeriodStart", }); }), ); export function subscriptionChangeBillingPeriodResultFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => SubscriptionChangeBillingPeriodResult$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SubscriptionChangeBillingPeriodResult' from JSON`, ); }