# 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.generic_entity_status import GenericEntityStatus
from typing_extensions import Self

class AssetGroupUrlTarget(BaseModel):
    """
    AssetGroupUrlTarget
    """ # noqa: E501
    id: Optional[StrictStr] = Field(default=None, alias="Id")
    target_condition1: Optional[StrictStr] = Field(default=None, alias="TargetCondition1")
    target_condition_operator1: Optional[StrictStr] = Field(default=None, alias="TargetConditionOperator1")
    target_value1: Optional[StrictStr] = Field(default=None, alias="TargetValue1")
    target_condition2: Optional[StrictStr] = Field(default=None, alias="TargetCondition2")
    target_condition_operator2: Optional[StrictStr] = Field(default=None, alias="TargetConditionOperator2")
    target_value2: Optional[StrictStr] = Field(default=None, alias="TargetValue2")
    target_condition3: Optional[StrictStr] = Field(default=None, alias="TargetCondition3")
    target_condition_operator3: Optional[StrictStr] = Field(default=None, alias="TargetConditionOperator3")
    target_value3: Optional[StrictStr] = Field(default=None, alias="TargetValue3")
    status: Optional[GenericEntityStatus] = Field(default=None, alias="Status")
    __properties: ClassVar[List[str]] = ["Id", "TargetCondition1", "TargetConditionOperator1", "TargetValue1", "TargetCondition2", "TargetConditionOperator2", "TargetValue2", "TargetCondition3", "TargetConditionOperator3", "TargetValue3", "Status"]

    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,
        )
        # set to None if id (nullable) is None
        # and model_fields_set contains the field
        if self.id is None and "id" in self.model_fields_set:
            _dict['Id'] = None

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

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

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

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

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

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

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

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

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

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

        return _dict

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

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

        _obj = cls.model_validate({
            "Id": obj.get("Id") if obj.get("Id") is not None else None,
                        "TargetCondition1": obj.get("TargetCondition1") if obj.get("TargetCondition1") is not None else None,
                        "TargetConditionOperator1": obj.get("TargetConditionOperator1") if obj.get("TargetConditionOperator1") is not None else None,
                        "TargetValue1": obj.get("TargetValue1") if obj.get("TargetValue1") is not None else None,
                        "TargetCondition2": obj.get("TargetCondition2") if obj.get("TargetCondition2") is not None else None,
                        "TargetConditionOperator2": obj.get("TargetConditionOperator2") if obj.get("TargetConditionOperator2") is not None else None,
                        "TargetValue2": obj.get("TargetValue2") if obj.get("TargetValue2") is not None else None,
                        "TargetCondition3": obj.get("TargetCondition3") if obj.get("TargetCondition3") is not None else None,
                        "TargetConditionOperator3": obj.get("TargetConditionOperator3") if obj.get("TargetConditionOperator3") is not None else None,
                        "TargetValue3": obj.get("TargetValue3") if obj.get("TargetValue3") is not None else None,
                        "Status": obj.get("Status") if obj.get("Status") is not None else None
        })
        return _obj
