# 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 List, Optional
from pydantic import BaseModel, StrictStr, conlist
from marqeta_client.models.terminal_model import TerminalModel

class TransactionCardAcceptor(BaseModel):
    """
    TransactionCardAcceptor
    """
    mid: Optional[StrictStr] = None
    mcc: Optional[StrictStr] = None
    network_mid: Optional[StrictStr] = None
    mcc_groups: Optional[conlist(StrictStr)] = None
    merchant_tax_id: Optional[StrictStr] = None
    name: Optional[StrictStr] = None
    address: Optional[StrictStr] = None
    city: Optional[StrictStr] = None
    state: Optional[StrictStr] = None
    postal_code: Optional[StrictStr] = None
    country_code: Optional[StrictStr] = None
    poi: Optional[TerminalModel] = None
    payment_facilitator_id: Optional[StrictStr] = None
    independent_sales_organization_id: Optional[StrictStr] = None
    sub_merchant_id: Optional[StrictStr] = None
    network_assigned_id: Optional[StrictStr] = None
    country_of_origin: Optional[StrictStr] = None
    transfer_service_provider_name: Optional[StrictStr] = None
    payment_facilitator_name: Optional[StrictStr] = None
    __properties = ["mid", "mcc", "network_mid", "mcc_groups", "merchant_tax_id", "name", "address", "city", "state", "postal_code", "country_code", "poi", "payment_facilitator_id", "independent_sales_organization_id", "sub_merchant_id", "network_assigned_id", "country_of_origin", "transfer_service_provider_name", "payment_facilitator_name"]

    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) -> TransactionCardAcceptor:
        """Create an instance of TransactionCardAcceptor 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 poi
        if self.poi:
            _dict['poi'] = self.poi.to_dict()
        return _dict

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

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

        _obj = TransactionCardAcceptor.parse_obj({
            "mid": obj.get("mid"),
            "mcc": obj.get("mcc"),
            "network_mid": obj.get("network_mid"),
            "mcc_groups": obj.get("mcc_groups"),
            "merchant_tax_id": obj.get("merchant_tax_id"),
            "name": obj.get("name"),
            "address": obj.get("address"),
            "city": obj.get("city"),
            "state": obj.get("state"),
            "postal_code": obj.get("postal_code"),
            "country_code": obj.get("country_code"),
            "poi": TerminalModel.from_dict(obj.get("poi")) if obj.get("poi") is not None else None,
            "payment_facilitator_id": obj.get("payment_facilitator_id"),
            "independent_sales_organization_id": obj.get("independent_sales_organization_id"),
            "sub_merchant_id": obj.get("sub_merchant_id"),
            "network_assigned_id": obj.get("network_assigned_id"),
            "country_of_origin": obj.get("country_of_origin"),
            "transfer_service_provider_name": obj.get("transfer_service_provider_name"),
            "payment_facilitator_name": obj.get("payment_facilitator_name")
        })
        return _obj

