module TD::Types
  # A chat.
  # (Can be a private chat, basic group, supergroup, or secret chat).
  #
  # @attr id [Integer] Chat unique identifier.
  # @attr type [TD::Types::ChatType] Type of the chat.
  # @attr title [TD::Types::String] Chat title.
  # @attr photo [TD::Types::ChatPhotoInfo, nil] Chat photo; may be null.
  # @attr permissions [TD::Types::ChatPermissions] Actions that non-administrator chat members are allowed to take in
  #   the chat.
  # @attr last_message [TD::Types::Message, nil] Last message in the chat; may be null.
  # @attr positions [Array<TD::Types::ChatPosition>] Positions of the chat in chat lists.
  # @attr message_sender_id [TD::Types::MessageSender, nil] Identifier of a user or chat that is selected to send
  #   messages in the chat; may be null if the user can't change message sender.
  # @attr has_protected_content [Boolean] True, if chat content can't be saved locally, forwarded, or copied.
  # @attr is_marked_as_unread [Boolean] True, if the chat is marked as unread.
  # @attr is_blocked [Boolean] True, if the chat is blocked by the current user and private messages from the chat
  #   can't be received.
  # @attr has_scheduled_messages [Boolean] True, if the chat has scheduled messages.
  # @attr can_be_deleted_only_for_self [Boolean] True, if the chat messages can be deleted only for the current user
  #   while other users will continue to see the messages.
  # @attr can_be_deleted_for_all_users [Boolean] True, if the chat messages can be deleted for all users.
  # @attr can_be_reported [Boolean] True, if the chat can be reported to Telegram moderators through reportChat or
  #   reportChatPhoto.
  # @attr default_disable_notification [Boolean] Default value of the disable_notification parameter, used when a
  #   message is sent to the chat.
  # @attr unread_count [Integer] Number of unread messages in the chat.
  # @attr last_read_inbox_message_id [Integer] Identifier of the last read incoming message.
  # @attr last_read_outbox_message_id [Integer] Identifier of the last read outgoing message.
  # @attr unread_mention_count [Integer] Number of unread messages with a mention/reply in the chat.
  # @attr unread_reaction_count [Integer] Number of messages with unread reactions in the chat.
  # @attr notification_settings [TD::Types::ChatNotificationSettings] Notification settings for the chat.
  # @attr available_reactions [Array<TD::Types::String>] List of reactions, available in the chat.
  # @attr message_ttl [Integer] Current message Time To Live setting (self-destruct timer) for the chat; 0 if not
  #   defined.
  #   TTL is counted from the time message or its content is viewed in secret chats and from the send date in other
  #   chats.
  # @attr theme_name [TD::Types::String] If non-empty, name of a theme, set for the chat.
  # @attr action_bar [TD::Types::ChatActionBar, nil] Information about actions which must be possible to do through the
  #   chat action bar; may be null.
  # @attr video_chat [TD::Types::VideoChat] Information about video chat of the chat.
  # @attr pending_join_requests [TD::Types::ChatJoinRequestsInfo, nil] Information about pending join requests; may be
  #   null.
  # @attr reply_markup_message_id [Integer] Identifier of the message from which reply markup needs to be used; 0 if
  #   there is no default custom reply markup in the chat.
  # @attr draft_message [TD::Types::DraftMessage, nil] A draft of a message in the chat; may be null.
  # @attr client_data [TD::Types::String] Application-specific data associated with the chat.
  #   (For example, the chat scroll position or local chat notification settings can be stored here.) Persistent if the
  #   message database is used.
  class Chat < Base
    attribute :id, TD::Types::Coercible::Integer
    attribute :type, TD::Types::ChatType
    attribute :title, TD::Types::String
    attribute :photo, TD::Types::ChatPhotoInfo.optional.default(nil)
    attribute :permissions, TD::Types::ChatPermissions
    attribute :last_message, TD::Types::Message.optional.default(nil)
    attribute :positions, TD::Types::Array.of(TD::Types::ChatPosition)
    attribute :message_sender_id, TD::Types::MessageSender.optional.default(nil)
    attribute :has_protected_content, TD::Types::Bool
    attribute :is_marked_as_unread, TD::Types::Bool
    attribute :is_blocked, TD::Types::Bool
    attribute :has_scheduled_messages, TD::Types::Bool
    attribute :can_be_deleted_only_for_self, TD::Types::Bool
    attribute :can_be_deleted_for_all_users, TD::Types::Bool
    attribute :can_be_reported, TD::Types::Bool
    attribute :default_disable_notification, TD::Types::Bool
    attribute :unread_count, TD::Types::Coercible::Integer
    attribute :last_read_inbox_message_id, TD::Types::Coercible::Integer
    attribute :last_read_outbox_message_id, TD::Types::Coercible::Integer
    attribute :unread_mention_count, TD::Types::Coercible::Integer
    attribute :unread_reaction_count, TD::Types::Coercible::Integer
    attribute :notification_settings, TD::Types::ChatNotificationSettings
    attribute :available_reactions, TD::Types::Array.of(TD::Types::String)
    attribute :message_ttl, TD::Types::Coercible::Integer
    attribute :theme_name, TD::Types::String
    attribute :action_bar, TD::Types::ChatActionBar.optional.default(nil)
    attribute :video_chat, TD::Types::VideoChat
    attribute :pending_join_requests, TD::Types::ChatJoinRequestsInfo.optional.default(nil)
    attribute :reply_markup_message_id, TD::Types::Coercible::Integer
    attribute :draft_message, TD::Types::DraftMessage.optional.default(nil)
    attribute :client_data, TD::Types::String
  end
end
