Source code for pyrogram.raw.types.business_weekly_open

#  Pyrogram - Telegram MTProto API Client Library for Python
#  Copyright (C) 2017-present Dan <https://github.com/delivrance>
#
#  This file is part of Pyrogram.
#
#  Pyrogram is free software: you can redistribute it and/or modify
#  it under the terms of the GNU Lesser General Public License as published
#  by the Free Software Foundation, either version 3 of the License, or
#  (at your option) any later version.
#
#  Pyrogram is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU Lesser General Public License for more details.
#
#  You should have received a copy of the GNU Lesser General Public License
#  along with Pyrogram.  If not, see <http://www.gnu.org/licenses/>.

from io import BytesIO

from pyrogram.raw.core.primitives import Int, Long, Int128, Int256, Bool, Bytes, String, Double, Vector
from pyrogram.raw.core import TLObject
from pyrogram import raw
from typing import List, Optional, Any

# # # # # # # # # # # # # # # # # # # # # # # #
#               !!! WARNING !!!               #
#          This is a generated file!          #
# All changes made in this file will be lost! #
# # # # # # # # # # # # # # # # # # # # # # # #


[docs] class BusinessWeeklyOpen(TLObject): # type: ignore """A time interval, indicating the opening hours of a business. Constructor of :obj:`~pyrogram.raw.base.BusinessWeeklyOpen`. Details: - Layer: ``229`` - ID: ``120B1AB9`` Parameters: start_minute (``int`` ``32-bit``): Start minute in minutes of the week, ``0`` to ``7*24*60`` inclusively. end_minute (``int`` ``32-bit``): End minute in minutes of the week, ``1`` to ``8*24*60`` inclusively ( ``8`` and not ``7`` because this allows to specify intervals that, for example, start on ``Sunday 21:00`` and end on ``Monday 04:00`` ( ``6*24*60+21*60`` to ``7*24*60+4*60`` ) without passing an invalid ``end_minute < start_minute`` ). See `here ยป <https://core.telegram.org/api/business#opening-hours>`_ for more info. """ __slots__: List[str] = ["start_minute", "end_minute"] ID = 0x120b1ab9 QUALNAME = "types.BusinessWeeklyOpen" def __init__(self, *, start_minute: int, end_minute: int) -> None: self.start_minute = start_minute # int self.end_minute = end_minute # int @staticmethod def read(b: BytesIO, *args: Any) -> "BusinessWeeklyOpen": # No flags start_minute = Int.read(b) end_minute = Int.read(b) return BusinessWeeklyOpen(start_minute=start_minute, end_minute=end_minute) def write(self, *args) -> bytes: b = BytesIO() b.write(Int(self.ID, False)) # No flags b.write(Int(self.start_minute)) b.write(Int(self.end_minute)) return b.getvalue()