/* * 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"; export type PostAllowedDomainsRequest = { /** * The domain name to add (www will be automatically stripped) */ domain: string; }; /** * An allowed domain represents a domain where a Wistia video can be embedded. Account * * @remarks * restrictions need to be enabled for an allowed domain to have an effect. See * our [Domain Restrictions](https://support.wistia.com/en/articles/9691672-domain-restrictions) * guide for more details. */ export type PostAllowedDomainsResponse = { /** * The allowed domain name. */ domain: string; /** * The date that the allowed domain was originally created. */ createdAt: Date; /** * A cursor for stable pagination based on current `sort_by` order. You can pass this to `cursor[before]` or `cursor[after]` as a parameter to fetch the records before or after this record in the same sort order. This is only populated if records were fetched with `cursor[enabled]`, or `cursor[before]` or `cursor[after]`. */ cursor?: string | null | undefined; }; /** @internal */ export type PostAllowedDomainsRequest$Outbound = { domain: string; }; /** @internal */ export const PostAllowedDomainsRequest$outboundSchema: z.ZodType< PostAllowedDomainsRequest$Outbound, z.ZodTypeDef, PostAllowedDomainsRequest > = z.object({ domain: z.string(), }); export function postAllowedDomainsRequestToJSON( postAllowedDomainsRequest: PostAllowedDomainsRequest, ): string { return JSON.stringify( PostAllowedDomainsRequest$outboundSchema.parse(postAllowedDomainsRequest), ); } /** @internal */ export const PostAllowedDomainsResponse$inboundSchema: z.ZodType< PostAllowedDomainsResponse, z.ZodTypeDef, unknown > = z.object({ domain: z.string(), created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)), cursor: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { "created_at": "createdAt", }); }); export function postAllowedDomainsResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PostAllowedDomainsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PostAllowedDomainsResponse' from JSON`, ); }