# coding: utf-8

"""
    AdInsightService

    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 typing_extensions import Self

class SuggestKeywordsFromExistingKeywordsRequest(BaseModel):
    """
    SuggestKeywordsFromExistingKeywordsRequest
    """ # noqa: E501
    keywords: Optional[List[StrictStr]] = Field(default=None, alias="Keywords")
    language: Optional[StrictStr] = Field(default=None, alias="Language")
    publisher_countries: Optional[List[StrictStr]] = Field(default=None, alias="PublisherCountries")
    max_suggestions_per_keyword: Optional[StrictInt] = Field(default=None, alias="MaxSuggestionsPerKeyword")
    suggestion_type: Optional[StrictInt] = Field(default=None, alias="SuggestionType")
    remove_duplicates: Optional[StrictBool] = Field(default=None, alias="RemoveDuplicates")
    exclude_brand: Optional[StrictBool] = Field(default=None, alias="ExcludeBrand")
    ad_group_id: Optional[StrictStr] = Field(default=None, alias="AdGroupId")
    campaign_id: Optional[StrictStr] = Field(default=None, alias="CampaignId")
    __properties: ClassVar[List[str]] = ["Keywords", "Language", "PublisherCountries", "MaxSuggestionsPerKeyword", "SuggestionType", "RemoveDuplicates", "ExcludeBrand", "AdGroupId", "CampaignId"]

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

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

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

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

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

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

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

        return _dict

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

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

        _obj = cls.model_validate({
            "Keywords": obj.get("Keywords"),
                        "Language": obj.get("Language") if obj.get("Language") is not None else None,
                        "PublisherCountries": obj.get("PublisherCountries"),
                        "MaxSuggestionsPerKeyword": obj.get("MaxSuggestionsPerKeyword") if obj.get("MaxSuggestionsPerKeyword") is not None else None,
                        "SuggestionType": obj.get("SuggestionType") if obj.get("SuggestionType") is not None else None,
                        "RemoveDuplicates": obj.get("RemoveDuplicates") if obj.get("RemoveDuplicates") is not None else None,
                        "ExcludeBrand": obj.get("ExcludeBrand") if obj.get("ExcludeBrand") is not None else None,
                        "AdGroupId": obj.get("AdGroupId") if obj.get("AdGroupId") is not None else None,
                        "CampaignId": obj.get("CampaignId") if obj.get("CampaignId") is not None else None
        })
        return _obj
