# coding: utf-8

"""
    AI Stats Gateway API

    A gateway API for accessing various AI models with OpenAI-compatible endpoints.

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

class ModerationCategories(BaseModel):
    """
    ModerationCategories
    """ # noqa: E501
    hate: Optional[StrictBool] = None
    hate_threatening: Optional[StrictBool] = Field(default=None, alias="hate/threatening")
    harassment: Optional[StrictBool] = None
    harassment_threatening: Optional[StrictBool] = Field(default=None, alias="harassment/threatening")
    self_harm: Optional[StrictBool] = Field(default=None, alias="self-harm")
    self_harm_intent: Optional[StrictBool] = Field(default=None, alias="self-harm/intent")
    self_harm_instructions: Optional[StrictBool] = Field(default=None, alias="self-harm/instructions")
    sexual: Optional[StrictBool] = None
    sexual_minors: Optional[StrictBool] = Field(default=None, alias="sexual/minors")
    violence: Optional[StrictBool] = None
    violence_graphic: Optional[StrictBool] = Field(default=None, alias="violence/graphic")
    __properties: ClassVar[List[str]] = ["hate", "hate/threatening", "harassment", "harassment/threatening", "self-harm", "self-harm/intent", "self-harm/instructions", "sexual", "sexual/minors", "violence", "violence/graphic"]

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

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

        _obj = cls.model_validate({
            "hate": obj.get("hate"),
            "hate/threatening": obj.get("hate/threatening"),
            "harassment": obj.get("harassment"),
            "harassment/threatening": obj.get("harassment/threatening"),
            "self-harm": obj.get("self-harm"),
            "self-harm/intent": obj.get("self-harm/intent"),
            "self-harm/instructions": obj.get("self-harm/instructions"),
            "sexual": obj.get("sexual"),
            "sexual/minors": obj.get("sexual/minors"),
            "violence": obj.get("violence"),
            "violence/graphic": obj.get("violence/graphic")
        })
        return _obj


