# 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, StrictFloat, StrictInt, StrictStr, validator

class DepositDepositResponse(BaseModel):
    """
    DepositDepositResponse
    """
    token: Optional[StrictStr] = None
    amount: Optional[Union[StrictFloat, StrictInt]] = None
    type: Optional[StrictStr] = None
    state: Optional[StrictStr] = None
    settlement_date: Optional[datetime] = None
    state_reason: Optional[StrictStr] = None
    state_reason_code: Optional[StrictStr] = None
    direct_deposit_account_token: Optional[StrictStr] = None
    user_token: Optional[StrictStr] = None
    business_token: Optional[StrictStr] = None
    created_time: Optional[datetime] = None
    last_modified_time: Optional[datetime] = None
    standard_entry_class_code: Optional[StrictStr] = None
    company_name: Optional[StrictStr] = None
    company_discretionary_data: Optional[StrictStr] = None
    company_identification: Optional[StrictStr] = None
    company_entry_description: Optional[StrictStr] = None
    individual_identification_number: Optional[StrictStr] = None
    individual_name: Optional[StrictStr] = None
    __properties = ["token", "amount", "type", "state", "settlement_date", "state_reason", "state_reason_code", "direct_deposit_account_token", "user_token", "business_token", "created_time", "last_modified_time", "standard_entry_class_code", "company_name", "company_discretionary_data", "company_identification", "company_entry_description", "individual_identification_number", "individual_name"]

    @validator('type')
    def type_validate_enum(cls, v):
        if v is None:
            return v

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

    @validator('state')
    def state_validate_enum(cls, v):
        if v is None:
            return v

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

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

        _obj = DepositDepositResponse.parse_obj({
            "token": obj.get("token"),
            "amount": obj.get("amount"),
            "type": obj.get("type"),
            "state": obj.get("state"),
            "settlement_date": obj.get("settlement_date"),
            "state_reason": obj.get("state_reason"),
            "state_reason_code": obj.get("state_reason_code"),
            "direct_deposit_account_token": obj.get("direct_deposit_account_token"),
            "user_token": obj.get("user_token"),
            "business_token": obj.get("business_token"),
            "created_time": obj.get("created_time"),
            "last_modified_time": obj.get("last_modified_time"),
            "standard_entry_class_code": obj.get("standard_entry_class_code"),
            "company_name": obj.get("company_name"),
            "company_discretionary_data": obj.get("company_discretionary_data"),
            "company_identification": obj.get("company_identification"),
            "company_entry_description": obj.get("company_entry_description"),
            "individual_identification_number": obj.get("individual_identification_number"),
            "individual_name": obj.get("individual_name")
        })
        return _obj

