/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; 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"; /** * Available Restriction on an Account. */ export type AvailableRestriction = { /** * The description of the restriction. */ description?: string | undefined; /** * The human readable representation of the restriction code. */ displayName?: string | undefined; /** * The restriction code. */ restrictionCode?: string | undefined; }; /** @internal */ export const AvailableRestriction$inboundSchema: z.ZodType< AvailableRestriction, z.ZodTypeDef, unknown > = z.object({ description: z.string().optional(), display_name: z.string().optional(), restriction_code: z.string().optional(), }).transform((v) => { return remap$(v, { "display_name": "displayName", "restriction_code": "restrictionCode", }); }); /** @internal */ export type AvailableRestriction$Outbound = { description?: string | undefined; display_name?: string | undefined; restriction_code?: string | undefined; }; /** @internal */ export const AvailableRestriction$outboundSchema: z.ZodType< AvailableRestriction$Outbound, z.ZodTypeDef, AvailableRestriction > = z.object({ description: z.string().optional(), displayName: z.string().optional(), restrictionCode: z.string().optional(), }).transform((v) => { return remap$(v, { displayName: "display_name", restrictionCode: "restriction_code", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AvailableRestriction$ { /** @deprecated use `AvailableRestriction$inboundSchema` instead. */ export const inboundSchema = AvailableRestriction$inboundSchema; /** @deprecated use `AvailableRestriction$outboundSchema` instead. */ export const outboundSchema = AvailableRestriction$outboundSchema; /** @deprecated use `AvailableRestriction$Outbound` instead. */ export type Outbound = AvailableRestriction$Outbound; } export function availableRestrictionToJSON( availableRestriction: AvailableRestriction, ): string { return JSON.stringify( AvailableRestriction$outboundSchema.parse(availableRestriction), ); } export function availableRestrictionFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AvailableRestriction$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AvailableRestriction' from JSON`, ); }