# coding: utf-8

"""
    Intervals.icu API

    No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

    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 datetime import datetime
from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional, Union
from typing import Optional, Set
from typing_extensions import Self

class GearReminder(BaseModel):
    """
    GearReminder
    """ # noqa: E501
    id: Optional[StrictInt] = None
    gear_id: Optional[StrictStr] = None
    name: Optional[StrictStr] = None
    distance: Optional[Union[StrictFloat, StrictInt]] = None
    time: Optional[Union[StrictFloat, StrictInt]] = None
    activities: Optional[StrictInt] = None
    days: Optional[StrictInt] = None
    last_reset: Optional[datetime] = None
    starting_distance: Optional[Union[StrictFloat, StrictInt]] = None
    starting_time: Optional[Union[StrictFloat, StrictInt]] = None
    starting_activities: Optional[StrictInt] = None
    snoozed_until: Optional[datetime] = None
    percent_used: Optional[Union[StrictFloat, StrictInt]] = None
    distance_used: Optional[Union[StrictFloat, StrictInt]] = None
    time_used: Optional[Union[StrictFloat, StrictInt]] = None
    activities_used: Optional[StrictInt] = None
    days_used: Optional[StrictInt] = None
    __properties: ClassVar[List[str]] = ["id", "gear_id", "name", "distance", "time", "activities", "days", "last_reset", "starting_distance", "starting_time", "starting_activities", "snoozed_until", "percent_used", "distance_used", "time_used", "activities_used", "days_used"]

    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 GearReminder 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 GearReminder from a dict"""
        if obj is None:
            return None

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

        _obj = cls.model_validate({
            "id": obj.get("id"),
            "gear_id": obj.get("gear_id"),
            "name": obj.get("name"),
            "distance": obj.get("distance"),
            "time": obj.get("time"),
            "activities": obj.get("activities"),
            "days": obj.get("days"),
            "last_reset": obj.get("last_reset"),
            "starting_distance": obj.get("starting_distance"),
            "starting_time": obj.get("starting_time"),
            "starting_activities": obj.get("starting_activities"),
            "snoozed_until": obj.get("snoozed_until"),
            "percent_used": obj.get("percent_used"),
            "distance_used": obj.get("distance_used"),
            "time_used": obj.get("time_used"),
            "activities_used": obj.get("activities_used"),
            "days_used": obj.get("days_used")
        })
        return _obj


