/* * 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"; /** * The registered domain record. */ export type RegisteredDomain = { /** * The ID of the registered domain record. */ id: string; /** * The date the domain auto-renew is disabled. */ autoRenewalDisabledAt: string | null; /** * The date the domain was created. */ createdAt: string; /** * The date the domain expires. */ expiresAt: string; /** * The fee to renew the domain. */ renewalFee: number; }; export type DomainSchema = { /** * The unique identifier of the domain. */ id: string; /** * The domain name. */ slug: string; /** * Whether the domain is verified. */ verified: boolean; /** * Whether the domain is the primary domain for the workspace. */ primary: boolean; /** * Whether the domain is archived. */ archived: boolean; /** * Provide context to your teammates in the link creation modal by showing them an example of a link to be shortened. */ placeholder: string | null; /** * The URL to redirect to when a link under this domain has expired. */ expiredUrl: string | null; /** * The URL to redirect to when a link under this domain doesn't exist. */ notFoundUrl: string | null; /** * The logo of the domain. */ logo: string | null; /** * assetLinks.json configuration file (for deep link support on Android). */ assetLinks: string | null; /** * apple-app-site-association configuration file (for deep link support on iOS). */ appleAppSiteAssociation: string | null; /** * The date the domain was created. */ createdAt: string; /** * The date the domain was last updated. */ updatedAt: string; /** * The registered domain record. */ registeredDomain: RegisteredDomain | null; }; /** @internal */ export const RegisteredDomain$inboundSchema: z.ZodType< RegisteredDomain, z.ZodTypeDef, unknown > = z.object({ id: z.string(), autoRenewalDisabledAt: z.nullable(z.string()), createdAt: z.string(), expiresAt: z.string(), renewalFee: z.number(), }); export function registeredDomainFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => RegisteredDomain$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RegisteredDomain' from JSON`, ); } /** @internal */ export const DomainSchema$inboundSchema: z.ZodType< DomainSchema, z.ZodTypeDef, unknown > = z.object({ id: z.string(), slug: z.string(), verified: z.boolean().default(false), primary: z.boolean().default(false), archived: z.boolean().default(false), placeholder: z.nullable(z.string()), expiredUrl: z.nullable(z.string()), notFoundUrl: z.nullable(z.string()), logo: z.nullable(z.string()), assetLinks: z.nullable(z.string()).default(null), appleAppSiteAssociation: z.nullable(z.string()).default(null), createdAt: z.string(), updatedAt: z.string(), registeredDomain: z.nullable(z.lazy(() => RegisteredDomain$inboundSchema)), }); export function domainSchemaFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DomainSchema$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DomainSchema' from JSON`, ); }