from __future__ import annotations

from collections.abc import Mapping
from typing import Any, TypeVar

from attrs import define as _attrs_define

T = TypeVar("T", bound="PuzzleResult")


@_attrs_define
class PuzzleResult:
    """Captcha Server
    No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

    The version of the OpenAPI document: 0.1


    NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
    https://openapi-generator.tech
    Do not edit the class manually.

        Attributes:
            time_ms (float):
            x (float):
    """

    time_ms: float
    x: float

    def to_dict(self) -> dict[str, Any]:
        time_ms = self.time_ms

        x = self.x

        field_dict: dict[str, Any] = {}

        field_dict.update(
            {
                "time_ms": time_ms,
                "x": x,
            }
        )

        return field_dict

    @classmethod
    def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
        d = dict(src_dict)
        time_ms = d.pop("time_ms")

        x = d.pop("x")

        puzzle_result = cls(
            time_ms=time_ms,
            x=x,
        )

        return puzzle_result
