Module genshin.models.auth.verification

Email verification -related models

Classes

class ActionTicket (**data: Any)

Action ticket. Can be used to verify email addresses.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Expand source code
class ActionTicket(pydantic.BaseModel):
    """Action ticket. Can be used to verify email addresses."""

    risk_ticket: str
    verify_str: VerifyStrategy

    @pydantic.model_validator(mode="before")
    def __parse_data(cls, data: dict[str, typing.Any]) -> dict[str, typing.Any]:
        """Parse the data if it was provided in a raw format."""
        verify_str = data["verify_str"]
        if isinstance(verify_str, str):
            data["verify_str"] = json.loads(verify_str)

        return data

    def to_rpc_verify_header(self) -> str:
        """Convert the action ticket to `x-rpc-verify` header."""
        ticket = self.model_dump()
        ticket["verify_str"] = json.dumps(ticket["verify_str"])
        return json.dumps(ticket)

Ancestors

  • pydantic.main.BaseModel

Class variables

var model_computed_fields
var model_config
var model_fields
var risk_ticket : str
var verify_strVerifyStrategy

Methods

def to_rpc_verify_header(self) ‑> str

Convert the action ticket to x-rpc-verify header.

class VerifyStrategy (**data: Any)

Verification strategy.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Expand source code
class VerifyStrategy(pydantic.BaseModel):
    """Verification strategy."""

    ticket: str
    verify_type: str

Ancestors

  • pydantic.main.BaseModel

Class variables

var model_computed_fields
var model_config
var model_fields
var ticket : str
var verify_type : str