UNPKG

@vercel/sdk

Version:

<p align="center"> <a href="https://vercel.com"> <img src="https://assets.vercel.com/image/upload/v1588805858/repositories/vercel/logo.png" height="96"> <h3 align="center">Vercel</h3> </a> <p align="center">Develop. Preview. Ship.</p> </p>

100 lines 4.15 kB
/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../lib/schemas.js"; import * as types from "../types/primitives.js"; export const QueryParamSource = { Marketplace: "marketplace", DeployButton: "deploy-button", External: "external", V0: "v0", ResourceClaims: "resource-claims", Cli: "cli", Oauth: "oauth", Backoffice: "backoffice", }; export const GetBillingPlansType = { Prepayment: "prepayment", Subscription: "subscription", }; export const GetBillingPlansScope = { Installation: "installation", Resource: "resource", }; /** @internal */ export const QueryParamSource$outboundSchema = z.nativeEnum(QueryParamSource); /** @internal */ export const GetBillingPlansRequest$outboundSchema = z.object({ integrationIdOrSlug: z.string(), integrationConfigurationId: z.string().optional(), productIdOrSlug: z.string(), metadata: z.string().optional(), source: QueryParamSource$outboundSchema.optional(), teamId: z.string().optional(), slug: z.string().optional(), }); export function getBillingPlansRequestToJSON(getBillingPlansRequest) { return JSON.stringify(GetBillingPlansRequest$outboundSchema.parse(getBillingPlansRequest)); } /** @internal */ export const GetBillingPlansType$inboundSchema = z.nativeEnum(GetBillingPlansType); /** @internal */ export const GetBillingPlansScope$inboundSchema = z.nativeEnum(GetBillingPlansScope); /** @internal */ export const GetBillingPlansDetails$inboundSchema = z.object({ label: types.string(), value: types.optional(types.string()), }); export function getBillingPlansDetailsFromJSON(jsonString) { return safeParse(jsonString, (x) => GetBillingPlansDetails$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetBillingPlansDetails' from JSON`); } /** @internal */ export const GetBillingPlansHighlightedDetails$inboundSchema = z.object({ label: types.string(), value: types.optional(types.string()), }); export function getBillingPlansHighlightedDetailsFromJSON(jsonString) { return safeParse(jsonString, (x) => GetBillingPlansHighlightedDetails$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetBillingPlansHighlightedDetails' from JSON`); } /** @internal */ export const Quote$inboundSchema = z .object({ line: types.string(), amount: types.string(), }); export function quoteFromJSON(jsonString) { return safeParse(jsonString, (x) => Quote$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Quote' from JSON`); } /** @internal */ export const Plans$inboundSchema = z .object({ type: GetBillingPlansType$inboundSchema, id: types.string(), name: types.string(), scope: GetBillingPlansScope$inboundSchema, description: types.string(), paymentMethodRequired: types.boolean(), preauthorizationAmount: types.optional(types.number()), initialCharge: types.optional(types.string()), minimumAmount: types.optional(types.string()), maximumAmount: types.optional(types.string()), maximumAmountAutoPurchasePerPeriod: types.optional(types.string()), cost: types.optional(types.string()), details: types.optional(z.array(z.lazy(() => GetBillingPlansDetails$inboundSchema))), highlightedDetails: types.optional(z.array(z.lazy(() => GetBillingPlansHighlightedDetails$inboundSchema))), quote: types.optional(z.array(z.lazy(() => Quote$inboundSchema))), effectiveDate: types.optional(types.string()), disabled: types.optional(types.boolean()), }); export function plansFromJSON(jsonString) { return safeParse(jsonString, (x) => Plans$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Plans' from JSON`); } /** @internal */ export const GetBillingPlansResponseBody$inboundSchema = z.object({ plans: z.array(z.lazy(() => Plans$inboundSchema)), }); export function getBillingPlansResponseBodyFromJSON(jsonString) { return safeParse(jsonString, (x) => GetBillingPlansResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetBillingPlansResponseBody' from JSON`); } //# sourceMappingURL=getbillingplansop.js.map