/**
 * This file was automatically generated by json-schema-to-typescript.
 * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
 * and run json-schema-to-typescript to regenerate this file.
 */

export type IWorkspaceParameters =
  | {
      CreateWorkspace: CreateWorkspace;
    }
  | {
      GetWorkspace: GetWorkspace;
    }
  | {
      GetWorkspaces: GetWorkspaces;
    }
  | {
      GetWorkspaceResult: GetWorkspaceResult;
    }
  | {
      GetWorkspacesResult: GetWorkspacesResult;
    }
  | {
      UpdateWorkspace: UpdateWorkspace;
    }
  | {
      CreateWorkspaceResult: CreateWorkspaceResult;
    };
export type WorkspaceType = 0 | 1;
export type PermissionType = 0 | 1 | 10 | 99;

export interface CreateWorkspace {
  /**
   * only set name, avatar is update in datacenter to yDoc directly
   */
  name: string;
  user_id: string;
  [k: string]: unknown;
}
export interface GetWorkspace {
  id: string;
  [k: string]: unknown;
}
export interface GetWorkspaces {
  user_id: string;
  [k: string]: unknown;
}
export interface GetWorkspaceResult {
  workspace: WorkspaceDetail;
  [k: string]: unknown;
}
export interface WorkspaceDetail {
  created_at: number;
  id: string;
  member_count: number;
  owner?: User | null;
  public: boolean;
  type: WorkspaceType;
  [k: string]: unknown;
}
export interface User {
  avatar_url?: string | null;
  created_at: number;
  email: string;
  id: string;
  name: string;
  [k: string]: unknown;
}
export interface GetWorkspacesResult {
  workspaces: WorkspaceWithPermission[];
  [k: string]: unknown;
}
export interface WorkspaceWithPermission {
  created_at: number;
  id: string;
  permission: PermissionType;
  public: boolean;
  type: WorkspaceType;
  [k: string]: unknown;
}
export interface UpdateWorkspace {
  id: number;
  public: boolean;
  [k: string]: unknown;
}
export interface CreateWorkspaceResult {
  id: string;
  name: string;
  [k: string]: unknown;
}
