# coding: utf-8

"""
    DUPR Backend APIs

    Internal RESTful APIs to access DUPR ratings, users and provide matches.

    The version of the OpenAPI document: v1.0.0
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""  # noqa: E501


from __future__ import annotations
import pprint
import re  # noqa: F401
import json

from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self

class VerifiedMatchRequest(BaseModel):
    """
    VerifiedMatchRequest
    """ # noqa: E501
    tournament_name: StrictStr = Field(alias="tournamentName")
    event_name: StrictStr = Field(alias="eventName")
    event_date: StrictStr = Field(alias="eventDate")
    venue: Optional[StrictStr] = None
    location: Optional[StrictStr] = None
    team_a_player1: Optional[StrictStr] = Field(default=None, alias="teamAPlayer1")
    team_a_player2: Optional[StrictStr] = Field(default=None, alias="teamAPlayer2")
    team_b_player1: Optional[StrictStr] = Field(default=None, alias="teamBPlayer1")
    team_b_player2: Optional[StrictStr] = Field(default=None, alias="teamBPlayer2")
    winning_team: StrictStr = Field(alias="winningTeam")
    team_a_points_game1: StrictInt = Field(alias="teamAPointsGame1")
    team_b_points_game1: StrictInt = Field(alias="teamBPointsGame1")
    team_a_points_game2: Optional[StrictInt] = Field(default=None, alias="teamAPointsGame2")
    team_b_points_game2: Optional[StrictInt] = Field(default=None, alias="teamBPointsGame2")
    team_a_points_game3: Optional[StrictInt] = Field(default=None, alias="teamAPointsGame3")
    team_b_points_game3: Optional[StrictInt] = Field(default=None, alias="teamBPointsGame3")
    team_a_points_game4: Optional[StrictInt] = Field(default=None, alias="teamAPointsGame4")
    team_b_points_game4: Optional[StrictInt] = Field(default=None, alias="teamBPointsGame4")
    team_a_points_game5: Optional[StrictInt] = Field(default=None, alias="teamAPointsGame5")
    team_b_points_game5: Optional[StrictInt] = Field(default=None, alias="teamBPointsGame5")
    team_a_player1_id: StrictStr = Field(alias="teamAPlayer1ID")
    team_a_player2_id: Optional[StrictStr] = Field(default=None, alias="teamAPlayer2ID")
    team_b_player1_id: StrictStr = Field(alias="teamBPlayer1ID")
    team_b_player2_id: Optional[StrictStr] = Field(default=None, alias="teamBPlayer2ID")
    club_id: Optional[StrictInt] = Field(default=None, alias="clubId")
    __properties: ClassVar[List[str]] = ["tournamentName", "eventName", "eventDate", "venue", "location", "teamAPlayer1", "teamAPlayer2", "teamBPlayer1", "teamBPlayer2", "winningTeam", "teamAPointsGame1", "teamBPointsGame1", "teamAPointsGame2", "teamBPointsGame2", "teamAPointsGame3", "teamBPointsGame3", "teamAPointsGame4", "teamBPointsGame4", "teamAPointsGame5", "teamBPointsGame5", "teamAPlayer1ID", "teamAPlayer2ID", "teamBPlayer1ID", "teamBPlayer2ID", "clubId"]

    model_config = ConfigDict(
        populate_by_name=True,
        validate_assignment=True,
        protected_namespaces=(),
    )


    def to_str(self) -> str:
        """Returns the string representation of the model using alias"""
        return pprint.pformat(self.model_dump(by_alias=True))

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
        return json.dumps(self.to_dict())

    @classmethod
    def from_json(cls, json_str: str) -> Optional[Self]:
        """Create an instance of VerifiedMatchRequest from a JSON string"""
        return cls.from_dict(json.loads(json_str))

    def to_dict(self) -> Dict[str, Any]:
        """Return the dictionary representation of the model using alias.

        This has the following differences from calling pydantic's
        `self.model_dump(by_alias=True)`:

        * `None` is only added to the output dict for nullable fields that
          were set at model initialization. Other fields with value `None`
          are ignored.
        """
        excluded_fields: Set[str] = set([
        ])

        _dict = self.model_dump(
            by_alias=True,
            exclude=excluded_fields,
            exclude_none=True,
        )
        return _dict

    @classmethod
    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
        """Create an instance of VerifiedMatchRequest from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return cls.model_validate(obj)

        _obj = cls.model_validate({
            "tournamentName": obj.get("tournamentName"),
            "eventName": obj.get("eventName"),
            "eventDate": obj.get("eventDate"),
            "venue": obj.get("venue"),
            "location": obj.get("location"),
            "teamAPlayer1": obj.get("teamAPlayer1"),
            "teamAPlayer2": obj.get("teamAPlayer2"),
            "teamBPlayer1": obj.get("teamBPlayer1"),
            "teamBPlayer2": obj.get("teamBPlayer2"),
            "winningTeam": obj.get("winningTeam"),
            "teamAPointsGame1": obj.get("teamAPointsGame1"),
            "teamBPointsGame1": obj.get("teamBPointsGame1"),
            "teamAPointsGame2": obj.get("teamAPointsGame2"),
            "teamBPointsGame2": obj.get("teamBPointsGame2"),
            "teamAPointsGame3": obj.get("teamAPointsGame3"),
            "teamBPointsGame3": obj.get("teamBPointsGame3"),
            "teamAPointsGame4": obj.get("teamAPointsGame4"),
            "teamBPointsGame4": obj.get("teamBPointsGame4"),
            "teamAPointsGame5": obj.get("teamAPointsGame5"),
            "teamBPointsGame5": obj.get("teamBPointsGame5"),
            "teamAPlayer1ID": obj.get("teamAPlayer1ID"),
            "teamAPlayer2ID": obj.get("teamAPlayer2ID"),
            "teamBPlayer1ID": obj.get("teamBPlayer1ID"),
            "teamBPlayer2ID": obj.get("teamBPlayer2ID"),
            "clubId": obj.get("clubId")
        })
        return _obj


