# 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

class OriginalCredit(BaseModel):
    """
    OriginalCredit
    """
    transaction_type: Optional[StrictStr] = None
    funding_source: Optional[StrictStr] = None
    sender_account_type: Optional[StrictStr] = None
    sender_name: Optional[StrictStr] = None
    sender_address: Optional[StrictStr] = None
    sender_city: Optional[StrictStr] = None
    sender_state: Optional[StrictStr] = None
    sender_country: Optional[StrictStr] = None
    screening_score: Optional[StrictStr] = None
    transaction_purpose: Optional[StrictStr] = None
    deferred_hold_by: Optional[StrictStr] = None
    __properties = ["transaction_type", "funding_source", "sender_account_type", "sender_name", "sender_address", "sender_city", "sender_state", "sender_country", "screening_score", "transaction_purpose", "deferred_hold_by"]

    @validator('transaction_type')
    def transaction_type_validate_enum(cls, v):
        if v is None:
            return 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

    @validator('funding_source')
    def funding_source_validate_enum(cls, v):
        if v is None:
            return v

        if v not in ('CREDIT', 'DEBIT', 'PREPAID', 'DEPOSIT_ACCOUNT', 'CASH', 'MOBILE_MONEY_ACCOUNT', 'NON_VISA_CREDIT'):
            raise ValueError("must be one of enum values ('CREDIT', 'DEBIT', 'PREPAID', 'DEPOSIT_ACCOUNT', 'CASH', 'MOBILE_MONEY_ACCOUNT', 'NON_VISA_CREDIT')")
        return v

    @validator('sender_account_type')
    def sender_account_type_validate_enum(cls, v):
        if v is None:
            return v

        if v not in ('OTHER', 'RTN_BANK_ACCOUNT', 'IBAN', 'CARD_ACCOUNT', 'EMAIL', 'PHONE_NUMBER', 'BANK_ACCOUNT_NUMBER_AND_BANK_IDENTIFICATION_CODE', 'WALLET_ID', 'SOCIAL_NETWORK_ID'):
            raise ValueError("must be one of enum values ('OTHER', 'RTN_BANK_ACCOUNT', 'IBAN', 'CARD_ACCOUNT', 'EMAIL', 'PHONE_NUMBER', 'BANK_ACCOUNT_NUMBER_AND_BANK_IDENTIFICATION_CODE', 'WALLET_ID', 'SOCIAL_NETWORK_ID')")
        return v

    @validator('deferred_hold_by')
    def deferred_hold_by_validate_enum(cls, v):
        if v is None:
            return v

        if v not in ('absent', 'visa', 'originator'):
            raise ValueError("must be one of enum values ('absent', 'visa', 'originator')")
        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) -> OriginalCredit:
        """Create an instance of OriginalCredit 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) -> OriginalCredit:
        """Create an instance of OriginalCredit from a dict"""
        if obj is None:
            return None

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

        _obj = OriginalCredit.parse_obj({
            "transaction_type": obj.get("transaction_type"),
            "funding_source": obj.get("funding_source"),
            "sender_account_type": obj.get("sender_account_type"),
            "sender_name": obj.get("sender_name"),
            "sender_address": obj.get("sender_address"),
            "sender_city": obj.get("sender_city"),
            "sender_state": obj.get("sender_state"),
            "sender_country": obj.get("sender_country"),
            "screening_score": obj.get("screening_score"),
            "transaction_purpose": obj.get("transaction_purpose"),
            "deferred_hold_by": obj.get("deferred_hold_by")
        })
        return _obj

