# 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.price_qualifier import PriceQualifier
from openapi_client.models.campaign.price_unit import PriceUnit
from typing_extensions import Self

class PriceTableRow(BaseModel):
    """
    PriceTableRow
    """ # noqa: E501
    header: Optional[StrictStr] = Field(default=None, alias="Header")
    description: Optional[StrictStr] = Field(default=None, alias="Description")
    final_urls: Optional[List[StrictStr]] = Field(default=None, alias="FinalUrls")
    final_mobile_urls: Optional[List[StrictStr]] = Field(default=None, alias="FinalMobileUrls")
    price: Optional[StrictFloat] = Field(default=None, alias="Price")
    currency_code: Optional[StrictStr] = Field(default=None, alias="CurrencyCode")
    price_unit: Optional[PriceUnit] = Field(default=None, alias="PriceUnit")
    price_qualifier: Optional[PriceQualifier] = Field(default=None, alias="PriceQualifier")
    terms_and_conditions: Optional[StrictStr] = Field(default=None, alias="TermsAndConditions")
    terms_and_conditions_url: Optional[StrictStr] = Field(default=None, alias="TermsAndConditionsUrl")
    __properties: ClassVar[List[str]] = ["Header", "Description", "FinalUrls", "FinalMobileUrls", "Price", "CurrencyCode", "PriceUnit", "PriceQualifier", "TermsAndConditions", "TermsAndConditionsUrl"]

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

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

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

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

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

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

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

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

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

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

        return _dict

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

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

        _obj = cls.model_validate({
            "Header": obj.get("Header") if obj.get("Header") is not None else None,
                        "Description": obj.get("Description") if obj.get("Description") is not None else None,
                        "FinalUrls": obj.get("FinalUrls"),
                        "FinalMobileUrls": obj.get("FinalMobileUrls"),
                        "Price": obj.get("Price") if obj.get("Price") is not None else None,
                        "CurrencyCode": obj.get("CurrencyCode") if obj.get("CurrencyCode") is not None else None,
                        "PriceUnit": obj.get("PriceUnit") if obj.get("PriceUnit") is not None else None,
                        "PriceQualifier": obj.get("PriceQualifier") if obj.get("PriceQualifier") is not None else None,
                        "TermsAndConditions": obj.get("TermsAndConditions") if obj.get("TermsAndConditions") is not None else None,
                        "TermsAndConditionsUrl": obj.get("TermsAndConditionsUrl") if obj.get("TermsAndConditionsUrl") is not None else None
        })
        return _obj
