# coding: utf-8

"""
    Gitea API.

    This documentation describes the Gitea API.  # noqa: E501

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

    Do not edit the class manually.
"""


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


from typing import Optional
from pydantic import BaseModel, StrictBool

class GeneralRepoSettings(BaseModel):
    """
    GeneralRepoSettings contains global repository settings exposed by API
    """
    http_git_disabled: Optional[StrictBool] = None
    lfs_disabled: Optional[StrictBool] = None
    migrations_disabled: Optional[StrictBool] = None
    mirrors_disabled: Optional[StrictBool] = None
    stars_disabled: Optional[StrictBool] = None
    time_tracking_disabled: Optional[StrictBool] = None
    __properties = ["http_git_disabled", "lfs_disabled", "migrations_disabled", "mirrors_disabled", "stars_disabled", "time_tracking_disabled"]

    class Config:
        """Pydantic configuration"""
        allow_population_by_field_name = True
        validate_assignment = True

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

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        return json.dumps(self.to_dict())

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

    def to_dict(self):
        """Returns the dictionary representation of the model using alias"""
        _dict = self.dict(by_alias=True,
                          exclude={
                          },
                          exclude_none=True)
        return _dict

    @classmethod
    def from_dict(cls, obj: dict) -> GeneralRepoSettings:
        """Create an instance of GeneralRepoSettings from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return GeneralRepoSettings.parse_obj(obj)

        _obj = GeneralRepoSettings.parse_obj({
            "http_git_disabled": obj.get("http_git_disabled"),
            "lfs_disabled": obj.get("lfs_disabled"),
            "migrations_disabled": obj.get("migrations_disabled"),
            "mirrors_disabled": obj.get("mirrors_disabled"),
            "stars_disabled": obj.get("stars_disabled"),
            "time_tracking_disabled": obj.get("time_tracking_disabled")
        })
        return _obj

