// Telegrammer - Telegram Bot Swift SDK.
// This file is autogenerated by API/generate_wrappers.rb script.

/**
 This object contains information about one member of a chat.

 SeeAlso Telegram Bot API Reference:
 [ChatMember](https://core.telegram.org/bots/api#chatmember)
 */
public final class ChatMember: Codable {

    /// Custom keys for coding/decoding `ChatMember` struct
    enum CodingKeys: String, CodingKey {
        case user = "user"
        case status = "status"
        case untilDate = "until_date"
        case canBeEdited = "can_be_edited"
        case canChangeInfo = "can_change_info"
        case canPostMessages = "can_post_messages"
        case canEditMessages = "can_edit_messages"
        case canDeleteMessages = "can_delete_messages"
        case canInviteUsers = "can_invite_users"
        case canRestrictMembers = "can_restrict_members"
        case canPinMessages = "can_pin_messages"
        case canPromoteMembers = "can_promote_members"
        case isMember = "is_member"
        case canSendMessages = "can_send_messages"
        case canSendMediaMessages = "can_send_media_messages"
        case canSendOtherMessages = "can_send_other_messages"
        case canAddWebPagePreviews = "can_add_web_page_previews"
    }

    /// Information about the user
    public var user: User

    /// The member's status in the chat. Can be “creator”, “administrator”, “member”, “restricted”, “left” or “kicked”
    public var status: String

    /// Optional. Restricted and kicked only. Date when restrictions will be lifted for this user, unix time
    public var untilDate: Int?

    /// Optional. Administrators only. True, if the bot is allowed to edit administrator privileges of that user
    public var canBeEdited: Bool?

    /// Optional. Administrators only. True, if the administrator can change the chat title, photo and other settings
    public var canChangeInfo: Bool?

    /// Optional. Administrators only. True, if the administrator can post in the channel, channels only
    public var canPostMessages: Bool?

    /// Optional. Administrators only. True, if the administrator can edit messages of other users and can pin messages, channels only
    public var canEditMessages: Bool?

    /// Optional. Administrators only. True, if the administrator can delete messages of other users
    public var canDeleteMessages: Bool?

    /// Optional. Administrators only. True, if the administrator can invite new users to the chat
    public var canInviteUsers: Bool?

    /// Optional. Administrators only. True, if the administrator can restrict, ban or unban chat members
    public var canRestrictMembers: Bool?

    /// Optional. Administrators only. True, if the administrator can pin messages, groups and supergroups only
    public var canPinMessages: Bool?

    /// Optional. Administrators only. True, if the administrator can add new administrators with a subset of his own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user)
    public var canPromoteMembers: Bool?

    /// Optional. Restricted only. True, if the user is a member of the chat at the moment of the request
    public var isMember: Bool?

    /// Optional. Restricted only. True, if the user can send text messages, contacts, locations and venues
    public var canSendMessages: Bool?

    /// Optional. Restricted only. True, if the user can send audios, documents, photos, videos, video notes and voice notes, implies can_send_messages
    public var canSendMediaMessages: Bool?

    /// Optional. Restricted only. True, if the user can send animations, games, stickers and use inline bots, implies can_send_media_messages
    public var canSendOtherMessages: Bool?

    /// Optional. Restricted only. True, if user may add web page previews to his messages, implies can_send_media_messages
    public var canAddWebPagePreviews: Bool?


    public init (user: User, status: String, untilDate: Int? = nil, canBeEdited: Bool? = nil, canChangeInfo: Bool? = nil, canPostMessages: Bool? = nil, canEditMessages: Bool? = nil, canDeleteMessages: Bool? = nil, canInviteUsers: Bool? = nil, canRestrictMembers: Bool? = nil, canPinMessages: Bool? = nil, canPromoteMembers: Bool? = nil, isMember: Bool? = nil, canSendMessages: Bool? = nil, canSendMediaMessages: Bool? = nil, canSendOtherMessages: Bool? = nil, canAddWebPagePreviews: Bool? = nil) {
        self.user = user
        self.status = status
        self.untilDate = untilDate
        self.canBeEdited = canBeEdited
        self.canChangeInfo = canChangeInfo
        self.canPostMessages = canPostMessages
        self.canEditMessages = canEditMessages
        self.canDeleteMessages = canDeleteMessages
        self.canInviteUsers = canInviteUsers
        self.canRestrictMembers = canRestrictMembers
        self.canPinMessages = canPinMessages
        self.canPromoteMembers = canPromoteMembers
        self.isMember = isMember
        self.canSendMessages = canSendMessages
        self.canSendMediaMessages = canSendMediaMessages
        self.canSendOtherMessages = canSendOtherMessages
        self.canAddWebPagePreviews = canAddWebPagePreviews
    }
}
