# 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 List, Optional
from pydantic import BaseModel, StrictStr, conlist, constr, validator

class DigitalWalletTokenWalletProvider(BaseModel):
    """
    DigitalWalletTokenWalletProvider
    """
    wallet_provider_cardholder_wallet_account_id: Optional[constr(strict=True, max_length=100, min_length=0)] = None
    wallet_provider_risk_assessment: Optional[StrictStr] = None
    wallet_provider_risk_assessment_version: Optional[constr(strict=True, max_length=10, min_length=0)] = None
    wallet_provider_device_score: Optional[constr(strict=True, max_length=2, min_length=0)] = None
    wallet_provider_account_score: Optional[constr(strict=True, max_length=2, min_length=0)] = None
    wallet_provider_pan_source: Optional[StrictStr] = None
    wallet_provider_reason_code: Optional[StrictStr] = None
    recommendation_reasons: Optional[conlist(StrictStr)] = None
    cardholder_wallet_account_email: Optional[StrictStr] = None
    __properties = ["wallet_provider_cardholder_wallet_account_id", "wallet_provider_risk_assessment", "wallet_provider_risk_assessment_version", "wallet_provider_device_score", "wallet_provider_account_score", "wallet_provider_pan_source", "wallet_provider_reason_code", "recommendation_reasons", "cardholder_wallet_account_email"]

    @validator('wallet_provider_risk_assessment')
    def wallet_provider_risk_assessment_validate_enum(cls, v):
        if v is None:
            return v

        if v not in ('DECISION_GREEN', 'DECISION_YELLOW', 'DECISION_RED'):
            raise ValueError("must be one of enum values ('DECISION_GREEN', 'DECISION_YELLOW', 'DECISION_RED')")
        return v

    @validator('wallet_provider_pan_source')
    def wallet_provider_pan_source_validate_enum(cls, v):
        if v is None:
            return v

        if v not in ('ON_FILE', 'KEY_ENTERED', 'MOBILE_BANKING_APP'):
            raise ValueError("must be one of enum values ('ON_FILE', 'KEY_ENTERED', 'MOBILE_BANKING_APP')")
        return v

    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) -> DigitalWalletTokenWalletProvider:
        """Create an instance of DigitalWalletTokenWalletProvider 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)
        return _dict

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

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

        _obj = DigitalWalletTokenWalletProvider.parse_obj({
            "wallet_provider_cardholder_wallet_account_id": obj.get("wallet_provider_cardholder_wallet_account_id"),
            "wallet_provider_risk_assessment": obj.get("wallet_provider_risk_assessment"),
            "wallet_provider_risk_assessment_version": obj.get("wallet_provider_risk_assessment_version"),
            "wallet_provider_device_score": obj.get("wallet_provider_device_score"),
            "wallet_provider_account_score": obj.get("wallet_provider_account_score"),
            "wallet_provider_pan_source": obj.get("wallet_provider_pan_source"),
            "wallet_provider_reason_code": obj.get("wallet_provider_reason_code"),
            "recommendation_reasons": obj.get("recommendation_reasons"),
            "cardholder_wallet_account_email": obj.get("cardholder_wallet_account_email")
        })
        return _obj

