/* * 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 { MemberCounts, MemberCounts$inboundSchema } from "./membercounts.js"; import { OrganizationPreferences, OrganizationPreferences$inboundSchema, } from "./organizationpreferences.js"; export type OrganizationDetails = { /** * The date and time the organization was created. */ createdAt?: Date | undefined; memberCounts?: MemberCounts | undefined; /** * The name of the organization. */ name: string; preferences?: OrganizationPreferences | undefined; /** * The ID of a Censys organization. */ uid: string; }; /** @internal */ export const OrganizationDetails$inboundSchema: z.ZodType< OrganizationDetails, z.ZodTypeDef, unknown > = z.object({ created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)) .optional(), member_counts: MemberCounts$inboundSchema.optional(), name: z.string(), preferences: OrganizationPreferences$inboundSchema.optional(), uid: z.string(), }).transform((v) => { return remap$(v, { "created_at": "createdAt", "member_counts": "memberCounts", }); }); export function organizationDetailsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => OrganizationDetails$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OrganizationDetails' from JSON`, ); }