# 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 datetime import datetime
from typing import Optional, Union
from pydantic import BaseModel, StrictBool, StrictStr, confloat, conint, constr, validator

class BankTransferTransitionRequestModel(BaseModel):
    """
    BankTransferTransitionRequestModel
    """
    amount: Optional[Union[confloat(ge=0, strict=True), conint(ge=0, strict=True)]] = None
    token: Optional[constr(strict=True, max_length=36, min_length=0)] = None
    bank_transfer_token: constr(strict=True, max_length=36, min_length=0) = ...
    status: StrictStr = ...
    reason: Optional[StrictStr] = None
    channel: StrictStr = ...
    batch_number: Optional[StrictStr] = None
    program_reserve_token: Optional[constr(strict=True, max_length=36, min_length=0)] = None
    return_code: Optional[StrictStr] = None
    effective_date: Optional[datetime] = None
    reversal_after_45_days: Optional[StrictBool] = None
    __properties = ["amount", "token", "bank_transfer_token", "status", "reason", "channel", "batch_number", "program_reserve_token", "return_code", "effective_date", "reversal_after_45_days"]

    @validator('status')
    def status_validate_enum(cls, v):
        if v not in ('PENDING', 'PROCESSING', 'SUBMITTED', 'RETURNED', 'COMPLETED', 'CANCELLED', 'REVERSAL_PEND', 'REVERSAL_COMP'):
            raise ValueError("must be one of enum values ('PENDING', 'PROCESSING', 'SUBMITTED', 'RETURNED', 'COMPLETED', 'CANCELLED', 'REVERSAL_PEND', 'REVERSAL_COMP')")
        return v

    @validator('channel')
    def channel_validate_enum(cls, v):
        if v not in ('API', 'SYSTEM', 'ADMIN'):
            raise ValueError("must be one of enum values ('API', 'SYSTEM', 'ADMIN')")
        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) -> BankTransferTransitionRequestModel:
        """Create an instance of BankTransferTransitionRequestModel 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) -> BankTransferTransitionRequestModel:
        """Create an instance of BankTransferTransitionRequestModel from a dict"""
        if obj is None:
            return None

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

        _obj = BankTransferTransitionRequestModel.parse_obj({
            "amount": obj.get("amount"),
            "token": obj.get("token"),
            "bank_transfer_token": obj.get("bank_transfer_token"),
            "status": obj.get("status"),
            "reason": obj.get("reason"),
            "channel": obj.get("channel"),
            "batch_number": obj.get("batch_number"),
            "program_reserve_token": obj.get("program_reserve_token"),
            "return_code": obj.get("return_code"),
            "effective_date": obj.get("effective_date"),
            "reversal_after_45_days": obj.get("reversal_after_45_days")
        })
        return _obj

