# 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 openapi_client.models.adinsight.currency import Currency
from openapi_client.models.adinsight.decimal_rounded_result import DecimalRoundedResult
from openapi_client.models.adinsight.range_result_of_decimal_rounded_result import RangeResultOfDecimalRoundedResult
from openapi_client.models.adinsight.range_result_ofdouble import RangeResultOfdouble
from typing_extensions import Self

class GetAudienceFullEstimationResponse(BaseModel):
    """
    GetAudienceFullEstimationResponse
    """ # noqa: E501
    est_impression: Optional[RangeResultOfDecimalRoundedResult] = Field(default=None, alias="EstImpression")
    est_audience_size: Optional[RangeResultOfDecimalRoundedResult] = Field(default=None, alias="EstAudienceSize")
    est_click: Optional[RangeResultOfDecimalRoundedResult] = Field(default=None, alias="EstClick")
    est_spend: Optional[RangeResultOfDecimalRoundedResult] = Field(default=None, alias="EstSpend")
    est_cost_per_event: Optional[RangeResultOfDecimalRoundedResult] = Field(default=None, alias="EstCostPerEvent")
    est_ctr: Optional[RangeResultOfdouble] = Field(default=None, alias="EstCTR")
    suggested_bid: Optional[StrictFloat] = Field(default=None, alias="SuggestedBid")
    suggested_budget: Optional[StrictFloat] = Field(default=None, alias="SuggestedBudget")
    events_lost_to_bid: Optional[StrictInt] = Field(default=None, alias="EventsLostToBid")
    events_lost_to_budget: Optional[StrictInt] = Field(default=None, alias="EventsLostToBudget")
    est_reach_audience_size: Optional[DecimalRoundedResult] = Field(default=None, alias="EstReachAudienceSize")
    est_reach_impression: Optional[DecimalRoundedResult] = Field(default=None, alias="EstReachImpression")
    currency: Optional[Currency] = Field(default=None, alias="Currency")
    __properties: ClassVar[List[str]] = ["EstImpression", "EstAudienceSize", "EstClick", "EstSpend", "EstCostPerEvent", "EstCTR", "SuggestedBid", "SuggestedBudget", "EventsLostToBid", "EventsLostToBudget", "EstReachAudienceSize", "EstReachImpression", "Currency"]

    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,
        )
        # override the default output from pydantic by calling `to_dict()` of est_impression
        if self.est_impression:
            _dict['EstImpression'] = self.est_impression.to_dict()
        # override the default output from pydantic by calling `to_dict()` of est_audience_size
        if self.est_audience_size:
            _dict['EstAudienceSize'] = self.est_audience_size.to_dict()
        # override the default output from pydantic by calling `to_dict()` of est_click
        if self.est_click:
            _dict['EstClick'] = self.est_click.to_dict()
        # override the default output from pydantic by calling `to_dict()` of est_spend
        if self.est_spend:
            _dict['EstSpend'] = self.est_spend.to_dict()
        # override the default output from pydantic by calling `to_dict()` of est_cost_per_event
        if self.est_cost_per_event:
            _dict['EstCostPerEvent'] = self.est_cost_per_event.to_dict()
        # override the default output from pydantic by calling `to_dict()` of est_ctr
        if self.est_ctr:
            _dict['EstCTR'] = self.est_ctr.to_dict()
        # override the default output from pydantic by calling `to_dict()` of est_reach_audience_size
        if self.est_reach_audience_size:
            _dict['EstReachAudienceSize'] = self.est_reach_audience_size.to_dict()
        # override the default output from pydantic by calling `to_dict()` of est_reach_impression
        if self.est_reach_impression:
            _dict['EstReachImpression'] = self.est_reach_impression.to_dict()
        # set to None if est_impression (nullable) is None
        # and model_fields_set contains the field
        if self.est_impression is None and "est_impression" in self.model_fields_set:
            _dict['EstImpression'] = None

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

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

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

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

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

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

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

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

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

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

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

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

        return _dict

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

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

        _obj = cls.model_validate({
            "EstImpression": RangeResultOfDecimalRoundedResult.from_dict(obj["EstImpression"]) if obj.get("EstImpression") is not None else None,
                        "EstAudienceSize": RangeResultOfDecimalRoundedResult.from_dict(obj["EstAudienceSize"]) if obj.get("EstAudienceSize") is not None else None,
                        "EstClick": RangeResultOfDecimalRoundedResult.from_dict(obj["EstClick"]) if obj.get("EstClick") is not None else None,
                        "EstSpend": RangeResultOfDecimalRoundedResult.from_dict(obj["EstSpend"]) if obj.get("EstSpend") is not None else None,
                        "EstCostPerEvent": RangeResultOfDecimalRoundedResult.from_dict(obj["EstCostPerEvent"]) if obj.get("EstCostPerEvent") is not None else None,
                        "EstCTR": RangeResultOfdouble.from_dict(obj["EstCTR"]) if obj.get("EstCTR") is not None else None,
                        "SuggestedBid": obj.get("SuggestedBid") if obj.get("SuggestedBid") is not None else None,
                        "SuggestedBudget": obj.get("SuggestedBudget") if obj.get("SuggestedBudget") is not None else None,
                        "EventsLostToBid": obj.get("EventsLostToBid") if obj.get("EventsLostToBid") is not None else None,
                        "EventsLostToBudget": obj.get("EventsLostToBudget") if obj.get("EventsLostToBudget") is not None else None,
                        "EstReachAudienceSize": DecimalRoundedResult.from_dict(obj["EstReachAudienceSize"]) if obj.get("EstReachAudienceSize") is not None else None,
                        "EstReachImpression": DecimalRoundedResult.from_dict(obj["EstReachImpression"]) if obj.get("EstReachImpression") is not None else None,
                        "Currency": obj.get("Currency") if obj.get("Currency") is not None else None
        })
        return _obj
