// Copyright 2026 Synnax Labs, Inc. // // Use of this software is governed by the Business Source License included in the file // licenses/BSL.txt. // // As of the Change Date specified in that file, in accordance with the Business Source // License, use of this software will be governed by the Apache License, Version 2.0, // included in the file licenses/APL.txt. // Code generated by Oracle. DO NOT EDIT. import { z } from "zod"; import { zod } from "@/zod"; export const authorityZ = zod.uint8; export type Authority = z.infer; export enum Concurrency { exclusive = 0, shared = 1, } export const concurrencyZ = z.enum(Concurrency); /** * Subject is an entity that can hold control authority over a resource. Typically * represents a user, process, or service. */ export const subjectZ = z.object({ /** key is a unique identifier for the subject. */ key: z.string(), /** name is a human-readable name for the subject. */ name: z.string(), /** * group optional identifier shared by subjects from the same logical group * (e.g.) all writers from the same Driver rack. */ group: z.uint32().optional(), }); export interface Subject extends z.infer {} export const stateZ = (r: R) => z.object({ subject: subjectZ, resource: r, authority: authorityZ, }); export interface State { subject: Subject; resource: z.infer; authority: Authority; }