/* * 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 { lazySchema as lazySchema$, safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as types from "../../types/primitives.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { DataScopesResources, DataScopesResources$inboundSchema, } from "./datascopesresources.js"; export type ConsentRecord = { /** * Unique identifier for this consent record */ id: string; /** * ISO timestamp when consent was recorded */ createdAt: string; /** * Whether consent was granted (true) or denied/revoked (false) */ granted: boolean; /** * Data scopes resource configuration that can be either detailed field permissions or a wildcard */ resources: DataScopesResources; }; /** @internal */ export const ConsentRecord$inboundSchema: z.ZodType< ConsentRecord, z.ZodTypeDef, unknown > = /* @__PURE__ */ lazySchema$(() => z.object({ id: types.string(), created_at: types.string(), granted: types.boolean(), resources: DataScopesResources$inboundSchema, }).transform((v) => { return remap$(v, { "created_at": "createdAt", }); }) ); export function consentRecordFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ConsentRecord$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ConsentRecord' from JSON`, ); }