# 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 SuggestedResponsiveSearchAd(BaseModel):
    """
    SuggestedResponsiveSearchAd
    """ # noqa: E501
    headlines: Optional[List[StrictStr]] = Field(default=None, alias="Headlines")
    descriptions: Optional[List[StrictStr]] = Field(default=None, alias="Descriptions")
    path1: Optional[StrictStr] = Field(default=None, alias="Path1")
    path2: Optional[StrictStr] = Field(default=None, alias="Path2")
    final_url: Optional[StrictStr] = Field(default=None, alias="FinalUrl")
    __properties: ClassVar[List[str]] = ["Headlines", "Descriptions", "Path1", "Path2", "FinalUrl"]

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

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

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

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

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

        return _dict

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

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

        _obj = cls.model_validate({
            "Headlines": obj.get("Headlines"),
                        "Descriptions": obj.get("Descriptions"),
                        "Path1": obj.get("Path1") if obj.get("Path1") is not None else None,
                        "Path2": obj.get("Path2") if obj.get("Path2") is not None else None,
                        "FinalUrl": obj.get("FinalUrl") if obj.get("FinalUrl") is not None else None
        })
        return _obj
