/* * 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 DataScopes = { /** * Whether Data Scopes is enabled for this application */ enabled?: boolean | undefined; /** * ISO timestamp of when the Data Scopes configuration was last modified */ updatedAt?: string | undefined; /** * Data scopes resource configuration that can be either detailed field permissions or a wildcard */ resources?: DataScopesResources | undefined; }; /** @internal */ export const DataScopes$inboundSchema: z.ZodType< DataScopes, z.ZodTypeDef, unknown > = /* @__PURE__ */ lazySchema$(() => z.object({ enabled: types.optional(types.boolean()), updated_at: types.optional(types.string()), resources: types.optional(DataScopesResources$inboundSchema), }).transform((v) => { return remap$(v, { "updated_at": "updatedAt", }); }) ); export function dataScopesFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DataScopes$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DataScopes' from JSON`, ); }