# coding: utf-8

"""
    CampaignManagementService

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

    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 datetime import datetime
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional, Union, Set
from openapi_client.models.campaign.health_check_column_metadata import HealthCheckColumnMetadata
from typing_extensions import Self

class HealthCheckMetadata(BaseModel):
    """
    HealthCheckMetadata
    """ # noqa: E501
    health_check_name: Optional[StrictStr] = Field(default=None, alias="HealthCheckName")
    health_check_display_name: Optional[StrictStr] = Field(default=None, alias="HealthCheckDisplayName")
    health_check_description: Optional[StrictStr] = Field(default=None, alias="HealthCheckDescription")
    health_check_sub_type: Optional[StrictStr] = Field(default=None, alias="HealthCheckSubType")
    health_check_category: Optional[StrictStr] = Field(default=None, alias="HealthCheckCategory")
    health_check_severity: Optional[StrictStr] = Field(default=None, alias="HealthCheckSeverity")
    health_check_category_display_name: Optional[StrictStr] = Field(default=None, alias="HealthCheckCategoryDisplayName")
    health_check_columns_metadata: Optional[List[Optional[HealthCheckColumnMetadata]]] = Field(default=None, alias="HealthCheckColumnsMetadata")
    __properties: ClassVar[List[str]] = ["HealthCheckName", "HealthCheckDisplayName", "HealthCheckDescription", "HealthCheckSubType", "HealthCheckCategory", "HealthCheckSeverity", "HealthCheckCategoryDisplayName", "HealthCheckColumnsMetadata"]

    model_config = ConfigDict(
        populate_by_name=True,
        validate_assignment=True,
        protected_namespaces=(),
    )
	

    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,
        )
        # override the default output from pydantic by calling `to_dict()` of each item in health_check_columns_metadata (list)
        _items = []
        if self.health_check_columns_metadata:
            for _item_health_check_columns_metadata in self.health_check_columns_metadata:
                if _item_health_check_columns_metadata:
                    _items.append(_item_health_check_columns_metadata.to_dict())
            _dict['HealthCheckColumnsMetadata'] = _items
        # set to None if health_check_name (nullable) is None
        # and model_fields_set contains the field
        if self.health_check_name is None and "health_check_name" in self.model_fields_set:
            _dict['HealthCheckName'] = None

        # set to None if health_check_display_name (nullable) is None
        # and model_fields_set contains the field
        if self.health_check_display_name is None and "health_check_display_name" in self.model_fields_set:
            _dict['HealthCheckDisplayName'] = None

        # set to None if health_check_description (nullable) is None
        # and model_fields_set contains the field
        if self.health_check_description is None and "health_check_description" in self.model_fields_set:
            _dict['HealthCheckDescription'] = None

        # set to None if health_check_sub_type (nullable) is None
        # and model_fields_set contains the field
        if self.health_check_sub_type is None and "health_check_sub_type" in self.model_fields_set:
            _dict['HealthCheckSubType'] = None

        # set to None if health_check_category (nullable) is None
        # and model_fields_set contains the field
        if self.health_check_category is None and "health_check_category" in self.model_fields_set:
            _dict['HealthCheckCategory'] = None

        # set to None if health_check_severity (nullable) is None
        # and model_fields_set contains the field
        if self.health_check_severity is None and "health_check_severity" in self.model_fields_set:
            _dict['HealthCheckSeverity'] = None

        # set to None if health_check_category_display_name (nullable) is None
        # and model_fields_set contains the field
        if self.health_check_category_display_name is None and "health_check_category_display_name" in self.model_fields_set:
            _dict['HealthCheckCategoryDisplayName'] = None

        # set to None if health_check_columns_metadata (nullable) is None
        # and model_fields_set contains the field
        if self.health_check_columns_metadata is None and "health_check_columns_metadata" in self.model_fields_set:
            _dict['HealthCheckColumnsMetadata'] = None

        return _dict

    @classmethod
    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
        """Create an instance of HealthCheckMetadata from a dict"""
        if obj is None:
            return None

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

        _obj = cls.model_validate({
            "HealthCheckName": obj.get("HealthCheckName") if obj.get("HealthCheckName") is not None else None,
                        "HealthCheckDisplayName": obj.get("HealthCheckDisplayName") if obj.get("HealthCheckDisplayName") is not None else None,
                        "HealthCheckDescription": obj.get("HealthCheckDescription") if obj.get("HealthCheckDescription") is not None else None,
                        "HealthCheckSubType": obj.get("HealthCheckSubType") if obj.get("HealthCheckSubType") is not None else None,
                        "HealthCheckCategory": obj.get("HealthCheckCategory") if obj.get("HealthCheckCategory") is not None else None,
                        "HealthCheckSeverity": obj.get("HealthCheckSeverity") if obj.get("HealthCheckSeverity") is not None else None,
                        "HealthCheckCategoryDisplayName": obj.get("HealthCheckCategoryDisplayName") if obj.get("HealthCheckCategoryDisplayName") is not None else None,
                        "HealthCheckColumnsMetadata": [HealthCheckColumnMetadata.from_dict(_item) for _item in obj["HealthCheckColumnsMetadata"]] if obj.get("HealthCheckColumnsMetadata") is not None else None
        })
        return _obj
