/* * 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 { Bucket, Bucket$inboundSchema } from "./bucket.js"; import { CommitmentType, CommitmentType$inboundSchema, } from "./commitment-type.js"; import { SDKValidationError } from "./sdk-validation-error.js"; export type TimeOfDayBucket = { commitmentType?: CommitmentType | undefined; commitmentValue?: string | undefined; end?: Bucket | undefined; /** * ID is server-assigned. Stable for the lifetime of the line item; * * @remarks * invoice breakdown and analytics responses reference this ID. */ id?: string | undefined; overageFactor?: number | undefined; /** * PriceID is the SUBSCRIPTION-scoped price created at bucket-creation time. * * @remarks * Immutable post-create; changing pricing requires a successor line item. */ priceId?: string | undefined; start?: Bucket | undefined; trueUpEnabled?: boolean | undefined; }; /** @internal */ export const TimeOfDayBucket$inboundSchema: z.ZodMiniType< TimeOfDayBucket, unknown > = z.pipe( z.object({ commitment_type: types.optional(CommitmentType$inboundSchema), commitment_value: types.optional(types.string()), end: types.optional(Bucket$inboundSchema), id: types.optional(types.string()), overage_factor: types.optional(types.number()), price_id: types.optional(types.string()), start: types.optional(Bucket$inboundSchema), true_up_enabled: types.optional(types.boolean()), }), z.transform((v) => { return remap$(v, { "commitment_type": "commitmentType", "commitment_value": "commitmentValue", "overage_factor": "overageFactor", "price_id": "priceId", "true_up_enabled": "trueUpEnabled", }); }), ); export function timeOfDayBucketFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => TimeOfDayBucket$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TimeOfDayBucket' from JSON`, ); }