# 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.bmc_store_sub_type import BMCStoreSubType
from typing_extensions import Self

class BMCStore(BaseModel):
    """
    BMCStore
    """ # noqa: E501
    id: Optional[StrictStr] = Field(default=None, alias="Id")
    name: Optional[StrictStr] = Field(default=None, alias="Name")
    is_active: Optional[StrictBool] = Field(default=None, alias="IsActive")
    is_product_ads_enabled: Optional[StrictBool] = Field(default=None, alias="IsProductAdsEnabled")
    has_catalog: Optional[StrictBool] = Field(default=None, alias="HasCatalog")
    sub_type: Optional[BMCStoreSubType] = Field(default=None, alias="SubType")
    store_url: Optional[StrictStr] = Field(default=None, alias="StoreUrl")
    __properties: ClassVar[List[str]] = ["Id", "Name", "IsActive", "IsProductAdsEnabled", "HasCatalog", "SubType", "StoreUrl"]

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

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

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

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

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

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

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

        return _dict

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

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

        _obj = cls.model_validate({
            "Id": obj.get("Id") if obj.get("Id") is not None else None,
                        "Name": obj.get("Name") if obj.get("Name") is not None else None,
                        "IsActive": obj.get("IsActive") if obj.get("IsActive") is not None else None,
                        "IsProductAdsEnabled": obj.get("IsProductAdsEnabled") if obj.get("IsProductAdsEnabled") is not None else None,
                        "HasCatalog": obj.get("HasCatalog") if obj.get("HasCatalog") is not None else None,
                        "SubType": obj.get("SubType") if obj.get("SubType") is not None else None,
                        "StoreUrl": obj.get("StoreUrl") if obj.get("StoreUrl") is not None else None
        })
        return _obj
