/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; 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"; import { AutoReplenishConfig, AutoReplenishConfig$inboundSchema, } from "./autoreplenishconfig.js"; import { CreditExpiration, CreditExpiration$inboundSchema, } from "./creditexpiration.js"; export type OrganizationCredits = { autoReplenishConfig: AutoReplenishConfig; /** * The current credit balance for the organization. */ balance: number; /** * The credit expirations for the organization. */ creditExpirations: Array | null; /** * The ID of a Censys organization. */ uid: string; }; /** @internal */ export const OrganizationCredits$inboundSchema: z.ZodType< OrganizationCredits, z.ZodTypeDef, unknown > = z.object({ auto_replenish_config: AutoReplenishConfig$inboundSchema, balance: z.number().int(), credit_expirations: z.nullable(z.array(CreditExpiration$inboundSchema)), uid: z.string(), }).transform((v) => { return remap$(v, { "auto_replenish_config": "autoReplenishConfig", "credit_expirations": "creditExpirations", }); }); export function organizationCreditsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => OrganizationCredits$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OrganizationCredits' from JSON`, ); }