# 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_group_status_report_filter import AdGroupStatusReportFilter
from openapi_client.models.reporting.ad_status_report_filter import AdStatusReportFilter
from openapi_client.models.reporting.ad_type_report_filter import AdTypeReportFilter
from openapi_client.models.reporting.asset_group_status_report_filter import AssetGroupStatusReportFilter
from openapi_client.models.reporting.campaign_status_report_filter import CampaignStatusReportFilter
from openapi_client.models.reporting.language_report_filter import LanguageReportFilter
from typing_extensions import Self

class ProductSearchQueryPerformanceReportFilter(BaseModel):
    """
    ProductSearchQueryPerformanceReportFilter
    """ # noqa: E501
    account_status: Optional[AccountStatusReportFilter] = Field(default=None, alias="AccountStatus")
    ad_status: Optional[AdStatusReportFilter] = Field(default=None, alias="AdStatus")
    ad_type: Optional[AdTypeReportFilter] = Field(default=None, alias="AdType")
    campaign_status: Optional[CampaignStatusReportFilter] = Field(default=None, alias="CampaignStatus")
    exclude_zero_clicks: Optional[StrictBool] = Field(default=None, alias="ExcludeZeroClicks")
    language: Optional[LanguageReportFilter] = Field(default=None, alias="Language")
    search_queries: Optional[List[StrictStr]] = Field(default=None, alias="SearchQueries")
    ad_group_status: Optional[AdGroupStatusReportFilter] = Field(default=None, alias="AdGroupStatus")
    asset_group_status: Optional[AssetGroupStatusReportFilter] = Field(default=None, alias="AssetGroupStatus")
    __properties: ClassVar[List[str]] = ["AccountStatus", "AdStatus", "AdType", "CampaignStatus", "ExcludeZeroClicks", "Language", "SearchQueries", "AdGroupStatus", "AssetGroupStatus"]

    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 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 ad_status (nullable) is None
        # and model_fields_set contains the field
        if self.ad_status is None and "ad_status" in self.model_fields_set:
            _dict['AdStatus'] = 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 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 exclude_zero_clicks (nullable) is None
        # and model_fields_set contains the field
        if self.exclude_zero_clicks is None and "exclude_zero_clicks" in self.model_fields_set:
            _dict['ExcludeZeroClicks'] = 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 search_queries (nullable) is None
        # and model_fields_set contains the field
        if self.search_queries is None and "search_queries" in self.model_fields_set:
            _dict['SearchQueries'] = 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 asset_group_status (nullable) is None
        # and model_fields_set contains the field
        if self.asset_group_status is None and "asset_group_status" in self.model_fields_set:
            _dict['AssetGroupStatus'] = None

        return _dict

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

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

        _obj = cls.model_validate({
            "AccountStatus": obj.get("AccountStatus") if obj.get("AccountStatus") is not None else None,
                        "AdStatus": obj.get("AdStatus") if obj.get("AdStatus") is not None else None,
                        "AdType": obj.get("AdType") if obj.get("AdType") is not None else None,
                        "CampaignStatus": obj.get("CampaignStatus") if obj.get("CampaignStatus") is not None else None,
                        "ExcludeZeroClicks": obj.get("ExcludeZeroClicks") if obj.get("ExcludeZeroClicks") is not None else None,
                        "Language": obj.get("Language") if obj.get("Language") is not None else None,
                        "SearchQueries": obj.get("SearchQueries"),
                        "AdGroupStatus": obj.get("AdGroupStatus") if obj.get("AdGroupStatus") is not None else None,
                        "AssetGroupStatus": obj.get("AssetGroupStatus") if obj.get("AssetGroupStatus") is not None else None
        })
        return _obj
