# coding: utf-8

"""
    

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

    The version of the OpenAPI document: 
    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, Field, StrictBool, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self

class SystemInfoResponse(BaseModel):
    """
    SystemInfoResponse
    """ # noqa: E501
    version: Optional[StrictStr] = Field(default=None, description="Semantic version string advertised by the running server.")
    major: StrictInt = Field(description="Major version component parsed from the advertised semantic version.")
    minor: StrictInt = Field(description="Minor version component parsed from the advertised semantic version.")
    patch: StrictInt = Field(description="Patch version component parsed from the advertised semantic version.")
    dirty: StrictBool = Field(description="Whether the running build reports uncommitted workspace changes.")
    git_commit: Optional[StrictStr] = Field(default=None, description="Git commit SHA baked into the build, when available.", alias="gitCommit")
    git_describe: Optional[StrictStr] = Field(default=None, description="Git describe output baked into the build, when available.", alias="gitDescribe")
    build_time: Optional[datetime] = Field(default=None, description="Build timestamp recorded for this server binary, when available.", alias="buildTime")
    capabilities: Optional[Dict[str, StrictStr]] = Field(default=None, description="Optional capability flags or metadata advertised by the running server.")
    __properties: ClassVar[List[str]] = ["version", "major", "minor", "patch", "dirty", "gitCommit", "gitDescribe", "buildTime", "capabilities"]

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

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

        _obj = cls.model_validate({
            "version": obj.get("version"),
            "major": obj.get("major"),
            "minor": obj.get("minor"),
            "patch": obj.get("patch"),
            "dirty": obj.get("dirty"),
            "gitCommit": obj.get("gitCommit"),
            "gitDescribe": obj.get("gitDescribe"),
            "buildTime": obj.get("buildTime"),
            "capabilities": obj.get("capabilities")
        })
        return _obj


