Source code for hydrogram.raw.functions.auth.request_firebase_sms
# Hydrogram - Telegram MTProto API Client Library for Python# Copyright (C) 2023-present Hydrogram <https://hydrogram.org>## This file is part of Hydrogram.## Hydrogram 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.## Hydrogram 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 Hydrogram. If not, see <http://www.gnu.org/licenses/>.fromioimportBytesIOfromhydrogram.raw.core.primitivesimportInt,Long,Int128,Int256,Bool,Bytes,String,Double,Vectorfromhydrogram.raw.coreimportTLObjectfromhydrogramimportrawfromtypingimportList,Optional,Any# # # # # # # # # # # # # # # # # # # # # # # ## !!! WARNING !!! ## This is a generated file! ## All changes made in this file will be lost! ## # # # # # # # # # # # # # # # # # # # # # # #
[docs]classRequestFirebaseSms(TLObject):# type: ignore"""Request an SMS code via Firebase. Details: - Layer: ``181`` - ID: ``8E39261E`` Parameters: phone_number (``str``): Phone number phone_code_hash (``str``): Phone code hash returned by auth.sendCode safety_net_token (``str``, *optional*): On Android, a JWS object obtained as described in the auth documentation » play_integrity_token (``str``, *optional*): ios_push_secret (``str``, *optional*): Secret token received via an apple push notification Returns: ``bool`` """__slots__:List[str]=["phone_number","phone_code_hash","safety_net_token","play_integrity_token","ios_push_secret"]ID=0x8e39261eQUALNAME="functions.auth.RequestFirebaseSms"def__init__(self,*,phone_number:str,phone_code_hash:str,safety_net_token:Optional[str]=None,play_integrity_token:Optional[str]=None,ios_push_secret:Optional[str]=None)->None:self.phone_number=phone_number# stringself.phone_code_hash=phone_code_hash# stringself.safety_net_token=safety_net_token# flags.0?stringself.play_integrity_token=play_integrity_token# flags.2?stringself.ios_push_secret=ios_push_secret# flags.1?string@staticmethoddefread(b:BytesIO,*args:Any)->"RequestFirebaseSms":flags=Int.read(b)phone_number=String.read(b)phone_code_hash=String.read(b)safety_net_token=String.read(b)ifflags&(1<<0)elseNoneplay_integrity_token=String.read(b)ifflags&(1<<2)elseNoneios_push_secret=String.read(b)ifflags&(1<<1)elseNonereturnRequestFirebaseSms(phone_number=phone_number,phone_code_hash=phone_code_hash,safety_net_token=safety_net_token,play_integrity_token=play_integrity_token,ios_push_secret=ios_push_secret)defwrite(self,*args)->bytes:b=BytesIO()b.write(Int(self.ID,False))flags=0flags|=(1<<0)ifself.safety_net_tokenisnotNoneelse0flags|=(1<<2)ifself.play_integrity_tokenisnotNoneelse0flags|=(1<<1)ifself.ios_push_secretisnotNoneelse0b.write(Int(flags))b.write(String(self.phone_number))b.write(String(self.phone_code_hash))ifself.safety_net_tokenisnotNone:b.write(String(self.safety_net_token))ifself.play_integrity_tokenisnotNone:b.write(String(self.play_integrity_token))ifself.ios_push_secretisnotNone:b.write(String(self.ios_push_secret))returnb.getvalue()