# 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, StrictStr, validator
from marqeta_client.models.account_funding_receiver_data import AccountFundingReceiverData

class AccountFundingRequest(BaseModel):
    """
    AccountFundingRequest
    """
    screening_score: Optional[StrictStr] = None
    transaction_type: StrictStr = ...
    receiver_data: AccountFundingReceiverData = ...
    transaction_purpose: Optional[StrictStr] = None
    __properties = ["screening_score", "transaction_type", "receiver_data", "transaction_purpose"]

    @validator('transaction_type')
    def transaction_type_validate_enum(cls, v):
        if v not in ('ACCOUNT_TO_ACCOUNT', 'PERSON_TO_PERSON', 'WALLET_TRANSFER', 'MONEY_TRANSFER_BY_BANK', 'BUSINESS_TO_BUSINESS', 'DISBURSEMENT', 'GOVERNMENT_DISBURSEMENT', 'GAMBLING_PAYOUT', 'LOYALTY', 'MERCHANT_DISBURSEMENT', 'ONLINE_GAMBLING_PAYOUT', 'PENSION_DISBURSEMENT', 'PREPAID_LOADS', 'CARD_BILL_PAYMENT', 'BILL_PAYMENT', 'CASH_CLAIM', 'CASH_IN', 'CASH_OUT', 'MOBILE_AIR_TIME_PAYMENT', 'MONEY_TRANSFER_BY_MERCHANT', 'FACE_TO_FACE_MERCHANT_PAYMENT', 'GOVERNMENT_PAYMENT', 'PAYMENTS_GOODS_SERVICES', 'FUNDS_TRANSFER', 'GENERAL_BUSINESS_TO_BUSINESS_TRANSFER', 'BUSINESS_TO_BUSINESS_TRANSFER', 'CASH_DEPOSIT'):
            raise ValueError("must be one of enum values ('ACCOUNT_TO_ACCOUNT', 'PERSON_TO_PERSON', 'WALLET_TRANSFER', 'MONEY_TRANSFER_BY_BANK', 'BUSINESS_TO_BUSINESS', 'DISBURSEMENT', 'GOVERNMENT_DISBURSEMENT', 'GAMBLING_PAYOUT', 'LOYALTY', 'MERCHANT_DISBURSEMENT', 'ONLINE_GAMBLING_PAYOUT', 'PENSION_DISBURSEMENT', 'PREPAID_LOADS', 'CARD_BILL_PAYMENT', 'BILL_PAYMENT', 'CASH_CLAIM', 'CASH_IN', 'CASH_OUT', 'MOBILE_AIR_TIME_PAYMENT', 'MONEY_TRANSFER_BY_MERCHANT', 'FACE_TO_FACE_MERCHANT_PAYMENT', 'GOVERNMENT_PAYMENT', 'PAYMENTS_GOODS_SERVICES', 'FUNDS_TRANSFER', 'GENERAL_BUSINESS_TO_BUSINESS_TRANSFER', 'BUSINESS_TO_BUSINESS_TRANSFER', 'CASH_DEPOSIT')")
        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) -> AccountFundingRequest:
        """Create an instance of AccountFundingRequest 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 receiver_data
        if self.receiver_data:
            _dict['receiver_data'] = self.receiver_data.to_dict()
        return _dict

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

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

        _obj = AccountFundingRequest.parse_obj({
            "screening_score": obj.get("screening_score"),
            "transaction_type": obj.get("transaction_type"),
            "receiver_data": AccountFundingReceiverData.from_dict(obj.get("receiver_data")) if obj.get("receiver_data") is not None else None,
            "transaction_purpose": obj.get("transaction_purpose")
        })
        return _obj

