/* * 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 { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type OrganizationFeatureSettings = { /** * If this organization has issue funding enabled */ issueFundingEnabled?: boolean | undefined; /** * If this organization has seat-based pricing enabled */ seatBasedPricingEnabled?: boolean | undefined; /** * If this organization has Wallets enabled */ walletsEnabled?: boolean | undefined; /** * If this organization has the Member model enabled */ memberModelEnabled?: boolean | undefined; /** * If this organization has checkout localization enabled */ checkoutLocalizationEnabled?: boolean | undefined; /** * If this organization sees the new account review checklist UI. */ accountReviewV2Enabled?: boolean | undefined; /** * Ordered list of metric slugs shown on the dashboard overview. */ overviewMetrics?: Array | null | undefined; /** * If this organization has access to reset proration behavior. */ resetProrationBehaviorEnabled?: boolean | undefined; /** * If this organization can create and finalize draft orders via the API (off-session charges against a saved payment method). */ offSessionChargesEnabled?: boolean | undefined; /** * If this organization has billing enabled */ billingEnabled?: boolean | undefined; /** * Enables the slack shared channel benefit */ slackBenefitEnabled?: boolean | undefined; }; /** @internal */ export const OrganizationFeatureSettings$inboundSchema: z.ZodMiniType< OrganizationFeatureSettings, unknown > = z.pipe( z.object({ issue_funding_enabled: z._default(z.boolean(), false), seat_based_pricing_enabled: z._default(z.boolean(), false), wallets_enabled: z._default(z.boolean(), false), member_model_enabled: z._default(z.boolean(), false), checkout_localization_enabled: z._default(z.boolean(), false), account_review_v2_enabled: z._default(z.boolean(), false), overview_metrics: z.optional(z.nullable(z.array(z.string()))), reset_proration_behavior_enabled: z._default(z.boolean(), false), off_session_charges_enabled: z._default(z.boolean(), false), billing_enabled: z._default(z.boolean(), false), slack_benefit_enabled: z._default(z.boolean(), false), }), z.transform((v) => { return remap$(v, { "issue_funding_enabled": "issueFundingEnabled", "seat_based_pricing_enabled": "seatBasedPricingEnabled", "wallets_enabled": "walletsEnabled", "member_model_enabled": "memberModelEnabled", "checkout_localization_enabled": "checkoutLocalizationEnabled", "account_review_v2_enabled": "accountReviewV2Enabled", "overview_metrics": "overviewMetrics", "reset_proration_behavior_enabled": "resetProrationBehaviorEnabled", "off_session_charges_enabled": "offSessionChargesEnabled", "billing_enabled": "billingEnabled", "slack_benefit_enabled": "slackBenefitEnabled", }); }), ); /** @internal */ export type OrganizationFeatureSettings$Outbound = { issue_funding_enabled: boolean; seat_based_pricing_enabled: boolean; wallets_enabled: boolean; member_model_enabled: boolean; checkout_localization_enabled: boolean; account_review_v2_enabled: boolean; overview_metrics?: Array | null | undefined; reset_proration_behavior_enabled: boolean; off_session_charges_enabled: boolean; billing_enabled: boolean; slack_benefit_enabled: boolean; }; /** @internal */ export const OrganizationFeatureSettings$outboundSchema: z.ZodMiniType< OrganizationFeatureSettings$Outbound, OrganizationFeatureSettings > = z.pipe( z.object({ issueFundingEnabled: z._default(z.boolean(), false), seatBasedPricingEnabled: z._default(z.boolean(), false), walletsEnabled: z._default(z.boolean(), false), memberModelEnabled: z._default(z.boolean(), false), checkoutLocalizationEnabled: z._default(z.boolean(), false), accountReviewV2Enabled: z._default(z.boolean(), false), overviewMetrics: z.optional(z.nullable(z.array(z.string()))), resetProrationBehaviorEnabled: z._default(z.boolean(), false), offSessionChargesEnabled: z._default(z.boolean(), false), billingEnabled: z._default(z.boolean(), false), slackBenefitEnabled: z._default(z.boolean(), false), }), z.transform((v) => { return remap$(v, { issueFundingEnabled: "issue_funding_enabled", seatBasedPricingEnabled: "seat_based_pricing_enabled", walletsEnabled: "wallets_enabled", memberModelEnabled: "member_model_enabled", checkoutLocalizationEnabled: "checkout_localization_enabled", accountReviewV2Enabled: "account_review_v2_enabled", overviewMetrics: "overview_metrics", resetProrationBehaviorEnabled: "reset_proration_behavior_enabled", offSessionChargesEnabled: "off_session_charges_enabled", billingEnabled: "billing_enabled", slackBenefitEnabled: "slack_benefit_enabled", }); }), ); export function organizationFeatureSettingsToJSON( organizationFeatureSettings: OrganizationFeatureSettings, ): string { return JSON.stringify( OrganizationFeatureSettings$outboundSchema.parse( organizationFeatureSettings, ), ); } export function organizationFeatureSettingsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => OrganizationFeatureSettings$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OrganizationFeatureSettings' from JSON`, ); }