# coding: utf-8

"""
    Marqeta Core API

    Simplified management of your payment programs  # noqa: E501

    The version of the OpenAPI document: 3.0.0
    Contact: dev@swadesh.co
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""


from __future__ import annotations
from inspect import getfullargspec
import pprint
import re  # noqa: F401
import json


from typing import Optional
from pydantic import BaseModel, StrictBool
from marqeta_client.models.in_app_provisioning import InAppProvisioning
from marqeta_client.models.manual_entry import ManualEntry
from marqeta_client.models.wallet_provider_card_on_file import WalletProviderCardOnFile
from marqeta_client.models.web_push_provisioning import WebPushProvisioning

class ProvisioningControls(BaseModel):
    """
    ProvisioningControls
    """
    manual_entry: Optional[ManualEntry] = None
    wallet_provider_card_on_file: Optional[WalletProviderCardOnFile] = None
    in_app_provisioning: Optional[InAppProvisioning] = None
    web_push_provisioning: Optional[WebPushProvisioning] = None
    force_yellow_path_for_card_product: Optional[StrictBool] = None
    __properties = ["manual_entry", "wallet_provider_card_on_file", "in_app_provisioning", "web_push_provisioning", "force_yellow_path_for_card_product"]

    class Config:
        allow_population_by_field_name = True
        validate_assignment = True

    def to_str(self) -> str:
        """Returns the string representation of the model using alias"""
        return pprint.pformat(self.dict(by_alias=True))

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        return json.dumps(self.to_dict())

    @classmethod
    def from_json(cls, json_str: str) -> ProvisioningControls:
        """Create an instance of ProvisioningControls from a JSON string"""
        return cls.from_dict(json.loads(json_str))

    def to_dict(self):
        """Returns the dictionary representation of the model using alias"""
        _dict = self.dict(by_alias=True,
                          exclude={
                          },
                          exclude_none=True)
        # override the default output from pydantic by calling `to_dict()` of manual_entry
        if self.manual_entry:
            _dict['manual_entry'] = self.manual_entry.to_dict()
        # override the default output from pydantic by calling `to_dict()` of wallet_provider_card_on_file
        if self.wallet_provider_card_on_file:
            _dict['wallet_provider_card_on_file'] = self.wallet_provider_card_on_file.to_dict()
        # override the default output from pydantic by calling `to_dict()` of in_app_provisioning
        if self.in_app_provisioning:
            _dict['in_app_provisioning'] = self.in_app_provisioning.to_dict()
        # override the default output from pydantic by calling `to_dict()` of web_push_provisioning
        if self.web_push_provisioning:
            _dict['web_push_provisioning'] = self.web_push_provisioning.to_dict()
        return _dict

    @classmethod
    def from_dict(cls, obj: dict) -> ProvisioningControls:
        """Create an instance of ProvisioningControls from a dict"""
        if obj is None:
            return None

        if type(obj) is not dict:
            return ProvisioningControls.parse_obj(obj)

        _obj = ProvisioningControls.parse_obj({
            "manual_entry": ManualEntry.from_dict(obj.get("manual_entry")) if obj.get("manual_entry") is not None else None,
            "wallet_provider_card_on_file": WalletProviderCardOnFile.from_dict(obj.get("wallet_provider_card_on_file")) if obj.get("wallet_provider_card_on_file") is not None else None,
            "in_app_provisioning": InAppProvisioning.from_dict(obj.get("in_app_provisioning")) if obj.get("in_app_provisioning") is not None else None,
            "web_push_provisioning": WebPushProvisioning.from_dict(obj.get("web_push_provisioning")) if obj.get("web_push_provisioning") is not None else None,
            "force_yellow_path_for_card_product": obj.get("force_yellow_path_for_card_product")
        })
        return _obj

