# coding: utf-8

"""
    Kubernetes

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

    The version of the OpenAPI document: release-1.29
    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 typing import Optional
from pydantic import BaseModel, Field, StrictBool, StrictStr

class V1SubjectAccessReviewStatus(BaseModel):
    """
    SubjectAccessReviewStatus  # noqa: E501
    """
    allowed: StrictBool = Field(..., description="Allowed is required. True if the action would be allowed, false otherwise.")
    denied: Optional[StrictBool] = Field(None, description="Denied is optional. True if the action would be denied, otherwise false. If both allowed is false and denied is false, then the authorizer has no opinion on whether to authorize the action. Denied may not be true if Allowed is true.")
    evaluation_error: Optional[StrictStr] = Field(None, alias="evaluationError", description="EvaluationError is an indication that some error occurred during the authorization check. It is entirely possible to get an error and be able to continue determine authorization status in spite of it. For instance, RBAC can be missing a role, but enough roles are still present and bound to reason about the request.")
    reason: Optional[StrictStr] = Field(None, description="Reason is optional.  It indicates why a request was allowed or denied.")
    __properties = ["allowed", "denied", "evaluationError", "reason"]

    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) -> V1SubjectAccessReviewStatus:
        """Create an instance of V1SubjectAccessReviewStatus 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) -> V1SubjectAccessReviewStatus:
        """Create an instance of V1SubjectAccessReviewStatus from a dict"""
        if obj is None:
            return None

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

        _obj = V1SubjectAccessReviewStatus.parse_obj({
            "allowed": obj.get("allowed"),
            "denied": obj.get("denied"),
            "evaluation_error": obj.get("evaluationError"),
            "reason": obj.get("reason")
        })
        return _obj


