# 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, constr, validator

class OriginalCreditSenderData(BaseModel):
    """
    OriginalCreditSenderData
    """
    funding_source: StrictStr = ...
    sender_account_type: Optional[StrictStr] = None
    sender_name: Optional[StrictStr] = None
    sender_reference_number: Optional[StrictStr] = None
    sender_account_number: Optional[StrictStr] = None
    sender_address: Optional[StrictStr] = None
    sender_city: Optional[StrictStr] = None
    sender_state: Optional[StrictStr] = None
    sender_country: Optional[StrictStr] = None
    unique_transaction_reference_number: Optional[constr(strict=True, max_length=17, min_length=1)] = None
    transaction_purpose: Optional[StrictStr] = None
    visa_transaction_purpose: Optional[StrictStr] = None
    deferred_hold_by: Optional[StrictStr] = None
    __properties = ["funding_source", "sender_account_type", "sender_name", "sender_reference_number", "sender_account_number", "sender_address", "sender_city", "sender_state", "sender_country", "unique_transaction_reference_number", "transaction_purpose", "visa_transaction_purpose", "deferred_hold_by"]

    @validator('funding_source')
    def funding_source_validate_enum(cls, v):
        if v not in ('credit', 'debit', 'prepaid', 'deposit_account', 'cash', 'mobile_money_payment', 'non_visa_credit'):
            raise ValueError("must be one of enum values ('credit', 'debit', 'prepaid', 'deposit_account', 'cash', 'mobile_money_payment', '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_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_identification_code', 'wallet_id', 'social_network_id')")
        return v

    @validator('transaction_purpose')
    def transaction_purpose_validate_enum(cls, v):
        if v is None:
            return v

        if v not in ('family_support', 'labor_transfers', 'travel', 'education', 'medical_treatment', 'emergency_need', 'savings', 'gifts', 'other', 'salary', 'lending', 'crypto_currency'):
            raise ValueError("must be one of enum values ('family_support', 'labor_transfers', 'travel', 'education', 'medical_treatment', 'emergency_need', 'savings', 'gifts', 'other', 'salary', 'lending', 'crypto_currency')")
        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) -> OriginalCreditSenderData:
        """Create an instance of OriginalCreditSenderData 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) -> OriginalCreditSenderData:
        """Create an instance of OriginalCreditSenderData from a dict"""
        if obj is None:
            return None

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

        _obj = OriginalCreditSenderData.parse_obj({
            "funding_source": obj.get("funding_source"),
            "sender_account_type": obj.get("sender_account_type"),
            "sender_name": obj.get("sender_name"),
            "sender_reference_number": obj.get("sender_reference_number"),
            "sender_account_number": obj.get("sender_account_number"),
            "sender_address": obj.get("sender_address"),
            "sender_city": obj.get("sender_city"),
            "sender_state": obj.get("sender_state"),
            "sender_country": obj.get("sender_country"),
            "unique_transaction_reference_number": obj.get("unique_transaction_reference_number"),
            "transaction_purpose": obj.get("transaction_purpose"),
            "visa_transaction_purpose": obj.get("visa_transaction_purpose"),
            "deferred_hold_by": obj.get("deferred_hold_by")
        })
        return _obj

