# coding: utf-8

"""
    ReportingService

    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.reporting.account_status_report_filter import AccountStatusReportFilter
from openapi_client.models.reporting.ad_distribution_report_filter import AdDistributionReportFilter
from openapi_client.models.reporting.ad_group_status_report_filter import AdGroupStatusReportFilter
from openapi_client.models.reporting.ad_type_report_filter import AdTypeReportFilter
from openapi_client.models.reporting.bid_match_type_report_filter import BidMatchTypeReportFilter
from openapi_client.models.reporting.bid_strategy_type_report_filter import BidStrategyTypeReportFilter
from openapi_client.models.reporting.campaign_status_report_filter import CampaignStatusReportFilter
from openapi_client.models.reporting.delivered_match_type_report_filter import DeliveredMatchTypeReportFilter
from openapi_client.models.reporting.device_type_report_filter import DeviceTypeReportFilter
from openapi_client.models.reporting.keyword_status_report_filter import KeywordStatusReportFilter
from openapi_client.models.reporting.language_report_filter import LanguageReportFilter
from typing_extensions import Self

class KeywordPerformanceReportFilter(BaseModel):
    """
    KeywordPerformanceReportFilter
    """ # noqa: E501
    ad_distribution: Optional[AdDistributionReportFilter] = Field(default=None, alias="AdDistribution")
    delivered_match_type: Optional[DeliveredMatchTypeReportFilter] = Field(default=None, alias="DeliveredMatchType")
    keywords: Optional[List[StrictStr]] = Field(default=None, alias="Keywords")
    ad_type: Optional[AdTypeReportFilter] = Field(default=None, alias="AdType")
    bid_match_type: Optional[BidMatchTypeReportFilter] = Field(default=None, alias="BidMatchType")
    device_type: Optional[DeviceTypeReportFilter] = Field(default=None, alias="DeviceType")
    language: Optional[LanguageReportFilter] = Field(default=None, alias="Language")
    quality_score: Optional[List[StrictInt]] = Field(default=None, alias="QualityScore")
    expected_ctr: Optional[List[StrictInt]] = Field(default=None, alias="ExpectedCtr")
    ad_relevance: Optional[List[StrictInt]] = Field(default=None, alias="AdRelevance")
    landing_page_experience: Optional[List[StrictInt]] = Field(default=None, alias="LandingPageExperience")
    account_status: Optional[AccountStatusReportFilter] = Field(default=None, alias="AccountStatus")
    campaign_status: Optional[CampaignStatusReportFilter] = Field(default=None, alias="CampaignStatus")
    ad_group_status: Optional[AdGroupStatusReportFilter] = Field(default=None, alias="AdGroupStatus")
    keyword_status: Optional[KeywordStatusReportFilter] = Field(default=None, alias="KeywordStatus")
    bid_strategy_type: Optional[BidStrategyTypeReportFilter] = Field(default=None, alias="BidStrategyType")
    __properties: ClassVar[List[str]] = ["AdDistribution", "DeliveredMatchType", "Keywords", "AdType", "BidMatchType", "DeviceType", "Language", "QualityScore", "ExpectedCtr", "AdRelevance", "LandingPageExperience", "AccountStatus", "CampaignStatus", "AdGroupStatus", "KeywordStatus", "BidStrategyType"]

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        return _dict

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

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

        _obj = cls.model_validate({
            "AdDistribution": obj.get("AdDistribution") if obj.get("AdDistribution") is not None else None,
                        "DeliveredMatchType": obj.get("DeliveredMatchType") if obj.get("DeliveredMatchType") is not None else None,
                        "Keywords": obj.get("Keywords"),
                        "AdType": obj.get("AdType") if obj.get("AdType") is not None else None,
                        "BidMatchType": obj.get("BidMatchType") if obj.get("BidMatchType") is not None else None,
                        "DeviceType": obj.get("DeviceType") if obj.get("DeviceType") is not None else None,
                        "Language": obj.get("Language") if obj.get("Language") is not None else None,
                        "QualityScore": obj.get("QualityScore"),
                        "ExpectedCtr": obj.get("ExpectedCtr"),
                        "AdRelevance": obj.get("AdRelevance"),
                        "LandingPageExperience": obj.get("LandingPageExperience"),
                        "AccountStatus": obj.get("AccountStatus") if obj.get("AccountStatus") is not None else None,
                        "CampaignStatus": obj.get("CampaignStatus") if obj.get("CampaignStatus") is not None else None,
                        "AdGroupStatus": obj.get("AdGroupStatus") if obj.get("AdGroupStatus") is not None else None,
                        "KeywordStatus": obj.get("KeywordStatus") if obj.get("KeywordStatus") is not None else None,
                        "BidStrategyType": obj.get("BidStrategyType") if obj.get("BidStrategyType") is not None else None
        })
        return _obj
