/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * Company logo reference (download URL), or null if no logo is uploaded. */ export type CompanyLogo = { /** * URL to download the company logo. */ url: string; }; /** * Organization information record returned by the auditor organization API. * * @remarks * * `id` and `displayName` are always present (primary fields). Other fields * are optional to support controlled audits where only approved columns are * returned. */ export type AuditOrganizationInformation = { /** * Business info document identifier. */ id: string; /** * Display name of the organization. */ displayName: string; /** * Legal name of the organization. */ legalName?: string | null | undefined; /** * Incorporation status. Returns "Incorporated in the United States" * * @remarks * when the organization is a US company, or null otherwise. */ incorporation?: string | null | undefined; /** * Organization URL. */ url?: string | null | undefined; /** * Mailing address of the organization. */ mailingAddress?: string | null | undefined; /** * Telephone number of the organization. */ telephone?: string | null | undefined; /** * Company logo reference (download URL), or null if no logo is uploaded. */ companyLogo?: CompanyLogo | null | undefined; }; /** @internal */ export const CompanyLogo$inboundSchema: z.ZodType< CompanyLogo, z.ZodTypeDef, unknown > = z.object({ url: z.string(), }); export function companyLogoFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CompanyLogo$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CompanyLogo' from JSON`, ); } /** @internal */ export const AuditOrganizationInformation$inboundSchema: z.ZodType< AuditOrganizationInformation, z.ZodTypeDef, unknown > = z.object({ id: z.string(), displayName: z.string(), legalName: z.nullable(z.string()).optional(), incorporation: z.nullable(z.string()).optional(), url: z.nullable(z.string()).optional(), mailingAddress: z.nullable(z.string()).optional(), telephone: z.nullable(z.string()).optional(), companyLogo: z.nullable(z.lazy(() => CompanyLogo$inboundSchema)).optional(), }); export function auditOrganizationInformationFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AuditOrganizationInformation$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AuditOrganizationInformation' from JSON`, ); }