# 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.budget_point_type import BudgetPointType
from typing_extensions import Self

class BudgetPoint(BaseModel):
    """
    BudgetPoint
    """ # noqa: E501
    budget_amount: Optional[StrictFloat] = Field(default=None, alias="BudgetAmount")
    budget_point_type: Optional[BudgetPointType] = Field(default=None, alias="BudgetPointType")
    estimated_weekly_clicks: Optional[StrictFloat] = Field(default=None, alias="EstimatedWeeklyClicks")
    estimated_weekly_cost: Optional[StrictFloat] = Field(default=None, alias="EstimatedWeeklyCost")
    estimated_weekly_impressions: Optional[StrictFloat] = Field(default=None, alias="EstimatedWeeklyImpressions")
    __properties: ClassVar[List[str]] = ["BudgetAmount", "BudgetPointType", "EstimatedWeeklyClicks", "EstimatedWeeklyCost", "EstimatedWeeklyImpressions"]

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

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

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

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

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

        return _dict

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

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

        _obj = cls.model_validate({
            "BudgetAmount": obj.get("BudgetAmount") if obj.get("BudgetAmount") is not None else None,
                        "BudgetPointType": obj.get("BudgetPointType") if obj.get("BudgetPointType") is not None else None,
                        "EstimatedWeeklyClicks": obj.get("EstimatedWeeklyClicks") if obj.get("EstimatedWeeklyClicks") is not None else None,
                        "EstimatedWeeklyCost": obj.get("EstimatedWeeklyCost") if obj.get("EstimatedWeeklyCost") is not None else None,
                        "EstimatedWeeklyImpressions": obj.get("EstimatedWeeklyImpressions") if obj.get("EstimatedWeeklyImpressions") is not None else None
        })
        return _obj
