# coding: utf-8

"""
    CustomerBillingService

    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 CouponInfoData(BaseModel):
    """
    CouponInfoData
    """ # noqa: E501
    account_id: Optional[StrictInt] = Field(default=None, alias="AccountId")
    coupon_id: Optional[StrictInt] = Field(default=None, alias="CouponId")
    claim_date: Optional[datetime] = Field(default=None, alias="ClaimDate")
    status: Optional[StrictInt] = Field(default=None, alias="Status")
    redemption_date: Optional[datetime] = Field(default=None, alias="RedemptionDate")
    expiration_date: Optional[datetime] = Field(default=None, alias="ExpirationDate")
    percent_off: Optional[StrictFloat] = Field(default=None, alias="PercentOff")
    coupon_value: Optional[StrictFloat] = Field(default=None, alias="CouponValue")
    upfront_spending: Optional[StrictFloat] = Field(default=None, alias="UpfrontSpending")
    __properties: ClassVar[List[str]] = ["AccountId", "CouponId", "ClaimDate", "Status", "RedemptionDate", "ExpirationDate", "PercentOff", "CouponValue", "UpfrontSpending"]

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

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

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

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

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

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

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

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

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

        return _dict

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

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

        _obj = cls.model_validate({
            "AccountId": obj.get("AccountId") if obj.get("AccountId") is not None else None,
                        "CouponId": obj.get("CouponId") if obj.get("CouponId") is not None else None,
                        "ClaimDate": obj.get("ClaimDate") if obj.get("ClaimDate") is not None else None,
                        "Status": obj.get("Status") if obj.get("Status") is not None else None,
                        "RedemptionDate": obj.get("RedemptionDate") if obj.get("RedemptionDate") is not None else None,
                        "ExpirationDate": obj.get("ExpirationDate") if obj.get("ExpirationDate") is not None else None,
                        "PercentOff": obj.get("PercentOff") if obj.get("PercentOff") is not None else None,
                        "CouponValue": obj.get("CouponValue") if obj.get("CouponValue") is not None else None,
                        "UpfrontSpending": obj.get("UpfrontSpending") if obj.get("UpfrontSpending") is not None else None
        })
        return _obj
