2020-06-14 18:18:29 +03:00
from __future__ import annotations
2024-11-02 04:43:19 +02:00
from typing import TYPE_CHECKING , Any , Union
2019-11-03 22:14:41 +02:00
2023-07-17 00:10:47 +03:00
from . . types import (
PassportElementErrorDataField ,
PassportElementErrorFile ,
PassportElementErrorFiles ,
PassportElementErrorFrontSide ,
PassportElementErrorReverseSide ,
PassportElementErrorSelfie ,
PassportElementErrorTranslationFile ,
PassportElementErrorTranslationFiles ,
PassportElementErrorUnspecified ,
)
2023-03-11 20:46:36 +02:00
from . base import TelegramMethod
2020-06-14 18:18:29 +03:00
2019-11-03 22:14:41 +02:00
class SetPassportDataErrors ( TelegramMethod [ bool ] ) :
"""
2021-01-26 21:20:52 +02:00
Informs a user that some of the Telegram Passport elements they provided contains errors . The user will not be able to re - submit their Passport to you until the errors are fixed ( the contents of the field for which you returned the error must change ) . Returns : code : ` True ` on success .
Use this if the data submitted by the user doesn ' t satisfy the standards your service requires for any reason. For example, if a birthday date seems invalid, a submitted document is blurry, a scan shows evidence of tampering, etc. Supply some details in the error message to make sure the user knows how to correct the issues.
2019-11-03 22:14:41 +02:00
Source : https : / / core . telegram . org / bots / api #setpassportdataerrors
"""
__returning__ = bool
2023-03-11 20:46:36 +02:00
__api_method__ = " setPassportDataErrors "
2019-11-03 22:14:41 +02:00
user_id : int
""" User identifier """
2024-11-02 04:43:19 +02:00
errors : list [
2023-07-17 00:10:47 +03:00
Union [
PassportElementErrorDataField ,
PassportElementErrorFrontSide ,
PassportElementErrorReverseSide ,
PassportElementErrorSelfie ,
PassportElementErrorFile ,
PassportElementErrorFiles ,
PassportElementErrorTranslationFile ,
PassportElementErrorTranslationFiles ,
PassportElementErrorUnspecified ,
]
]
2019-11-03 22:14:41 +02:00
""" A JSON-serialized array describing the errors """
2023-08-04 00:30:27 +03:00
if TYPE_CHECKING :
# DO NOT EDIT MANUALLY!!!
# This section was auto-generated via `butcher`
def __init__ (
__pydantic__self__ ,
* ,
user_id : int ,
2024-11-02 04:43:19 +02:00
errors : list [
2023-08-04 00:30:27 +03:00
Union [
PassportElementErrorDataField ,
PassportElementErrorFrontSide ,
PassportElementErrorReverseSide ,
PassportElementErrorSelfie ,
PassportElementErrorFile ,
PassportElementErrorFiles ,
PassportElementErrorTranslationFile ,
PassportElementErrorTranslationFiles ,
PassportElementErrorUnspecified ,
]
] ,
* * __pydantic_kwargs : Any ,
) - > None :
# DO NOT EDIT MANUALLY!!!
# This method was auto-generated via `butcher`
# Is needed only for type checking and IDE support without any additional plugins
super ( ) . __init__ ( user_id = user_id , errors = errors , * * __pydantic_kwargs )