export interface RpcError {
  type: 'UNAUTHORIZED' | 'VALIDATION_ERROR' | 'NOT_FOUND' | 'INTERNAL_ERROR' | 'FORBIDDEN' | 'RATE_LIMITED' | string;
  message: string;
  code?: number;
}

export interface RpcResponse<T = unknown, Extensions = unknown> {
  datetime: number;
  success: boolean;
  result: T | null;
  extensions: Extensions | null;
  error: RpcError | null;
}

export type ActionNSTVType = {
  name?: /** Имя действия */ string,
  type?: /** Тип */ string,
  value?: /** Значение */ string,
  text?: /** Текст кнопки */ string,
  style?: /** Стиль */ StyleDPEnum,
  uuid?: string
};
export type ArgsAuthInput = {
  withEmailCode?: boolean,
  code?: number,
  login: string,
  password?: string,
  deviceInfo?: DeviceInfoMNPUInput
};
export type ArgsChannelCloseInput = {
  channel?: string
};
export type ArgsChannelDeleteMessageInput = {
  channel?: string,
  message?: string
};
export type ArgsChannelInfoInput = {
  channel?: string
};
export type ArgsChannelListInput = {
  limit?: /** Количество сообщений */ number,
  offset?: /** Смещение */ number,
  onlyHash?: /** Только хэш */ boolean
};
export type ArgsChannelMarkReadInput = {
  channel: string,
  lastReadMessageId?: string
};
export type ArgsChannelMessagesInput = {
  channel?: string,
  limit?: /** Количество сообщений */ number,
  offset?: /** Смещение */ number,
  onlyHash?: /** Только хэш */ boolean
};
export type ArgsChannelReactionInput = {
  message?: string,
  channel?: string,
  reaction?: ReactionACFHLPSWEnum
};
export type ArgsChannelSendMessageInput = {
  clientMessageId?: string,
  channel: string,
  reply?: string,
  text?: /** Текст сообщения */ string,
  attachments?: /** Вложения */ FileDocumentFileInput[],
  voice?: FileAudioFileInput,
  payload?: PayloadMInput
};
export type ArgsClosedChannelListInput = {
  limit?: /** Количество сообщений */ number,
  offset?: /** Смещение */ number,
  onlyHash?: /** Только хэш */ boolean
};
export type ArgsJoinChannelInput = {
  channel: string
};
export type ArgsJoinChannelListInput = {
  limit?: /** Количество сообщений */ number,
  offset?: /** Смещение */ number,
  onlyHash?: /** Только хэш */ boolean
};
export type ArgsMFastAnswersInput = {
  id?: string,
  delete?: /** Удалить */ boolean,
  name?: /** Название */ string,
  text?: /** Текст */ string
};
export type ArgsPinnedMessageInput = {
  message?: string
};
export type ChannelListDHType = {
  data?: ShmChannelType[],
  hash?: string
};
export type ChannelMessageDHType = {
  data?: ShmChannelMessageType[],
  hash?: string
};
export type ClosedChannelListDHType = {
  data?: ShmChannelType[],
  hash?: string
};
export type DeviceInfoMNPUInput = {
  name?: string,
  model?: string,
  platform?: string,
  uuid?: string
};
export type FileAudioFileInput = {
  _id?: string
};
export type FileAudioFileType = {
  _id?: string,
  fileType?: string,
  name?: string,
  url?: string,
  duration?: number,
  type?: string,
  created_at?: string
};
export type FileDocumentFileInput = {
  _id?: string
};
export type FileDocumentFileType = {
  _id?: string,
  fileType?: string,
  name?: string,
  url?: string,
  type?: string,
  created_at?: string
};
export type JoinChannelListDHType = {
  data?: ShmChannelType[],
  hash?: string
};
export type JoinableMemberIOUType = {
  owner?: string,
  ownerCollection?: string,
  isAdmin?: boolean,
  uuid?: string
};
export type MemberIOUType = {
  owner?: string,
  ownerCollection?: string,
  isAdmin?: boolean,
  uuid?: string
};
export type PayloadMInput = {
  [key: string]: any
};
export type PayloadMType = {
  [key: string]: any
};
export type PinnedETUType = {
  enabled?: /** Закреплено */ boolean,
  user?: /** Кто закрепил */ string,
  timestamp?: /** Когда закреплено */ number
};
export type ProfileInfoAPType = {
  profileID?: string,
  authEnabled?: boolean
};
export type ReactionACFHLPSWEnum = "heart" | "like" | "laugh" | "wow" | "sad" | "angry" | "clap" | "party" | "poop" | "fire";
export type ReactionCTUType = {
  user?: string,
  type?: TypeACFHLPSWEnum,
  created_at?: /** Когда поставлена */ number,
  uuid?: string
};
export type ReferenceDUType = {
  documentId?: string,
  documentCollection?: string,
  uuid?: string
};
export type ShmChannelMessageType = {
  channel?: string,
  clientMessageId?: string,
  owner?: string,
  ownerCollection?: string,
  text?: /** Текст сообщения */ string,
  type?: /** Тип сообщения */ TypeRSEnum,
  attachments?: /** Вложения */ FileDocumentFileType[],
  reply?: string,
  voice?: FileAudioFileType,
  actions?: /** Кнопки */ ActionNSTVType[],
  reactions?: /** Реакции */ ReactionCTUType[],
  pinned?: PinnedETUType,
  payload?: PayloadMType,
  viewed?: /** Прочитано */ boolean,
  deleted?: /** Кто удалил */ string,
  _id?: string,
  created_at?: number,
  updated_at?: number
};
export type ShmChannelType = {
  space?: string,
  name?: string,
  lastMessage?: string,
  payload?: PayloadMType,
  reference?: ReferenceDUType[],
  members?: MemberIOUType[],
  joinableMembers?: JoinableMemberIOUType[],
  closed?: boolean,
  unreadCounts?: UnreadCountMType,
  pinnedMessageId?: string,
  _id?: string,
  created_at?: number,
  updated_at?: number
};
export type ShmFastAnswerType = {
  owner?: string,
  ownerCollection?: string,
  name?: /** Название */ string,
  text?: /** Текст */ string,
  _id?: string,
  created_at?: number,
  updated_at?: number
};
export type StyleDPEnum = "default" | "primary" | "danger";
export type TypeACFHLPSWEnum = "heart" | "like" | "laugh" | "wow" | "sad" | "angry" | "clap" | "party" | "poop" | "fire";
export type TypeRSEnum = "regular" | "system";
export type UnreadCountMType = {
  [key: string]: number
};