/* * 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"; export type CheckPermissionResponse = { /** * Whether the user has the specified permission */ allowed: boolean; }; /** @internal */ export const CheckPermissionResponse$inboundSchema: z.ZodType< CheckPermissionResponse, z.ZodTypeDef, unknown > = z.object({ allowed: z.boolean(), }); /** @internal */ export type CheckPermissionResponse$Outbound = { allowed: boolean; }; /** @internal */ export const CheckPermissionResponse$outboundSchema: z.ZodType< CheckPermissionResponse$Outbound, z.ZodTypeDef, CheckPermissionResponse > = z.object({ allowed: z.boolean(), }); export function checkPermissionResponseToJSON( checkPermissionResponse: CheckPermissionResponse, ): string { return JSON.stringify( CheckPermissionResponse$outboundSchema.parse(checkPermissionResponse), ); } export function checkPermissionResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CheckPermissionResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CheckPermissionResponse' from JSON`, ); }