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

class Pos(BaseModel):
    """
    Pos
    """
    pan_entry_mode: Optional[StrictStr] = None
    pin_entry_mode: Optional[StrictStr] = None
    terminal_id: Optional[StrictStr] = None
    terminal_attendance: Optional[StrictStr] = None
    terminal_location: Optional[StrictStr] = None
    card_holder_presence: Optional[StrictBool] = False
    cardholder_authentication_method: Optional[StrictStr] = None
    card_presence: Optional[StrictBool] = False
    pin_present: Optional[StrictBool] = False
    terminal_type: Optional[StrictStr] = None
    card_data_input_capability: Optional[StrictStr] = None
    country_code: Optional[StrictStr] = None
    zip: Optional[StrictStr] = None
    partial_approval_capable: Optional[StrictBool] = False
    purchase_amount_only: Optional[StrictBool] = False
    is_recurring: Optional[StrictBool] = False
    is_installment: Optional[StrictBool] = False
    __properties = ["pan_entry_mode", "pin_entry_mode", "terminal_id", "terminal_attendance", "terminal_location", "card_holder_presence", "cardholder_authentication_method", "card_presence", "pin_present", "terminal_type", "card_data_input_capability", "country_code", "zip", "partial_approval_capable", "purchase_amount_only", "is_recurring", "is_installment"]

    @validator('pan_entry_mode')
    def pan_entry_mode_validate_enum(cls, v):
        if v is None:
            return v

        if v not in ('UNKNOWN', 'MANUAL', 'MAG_STRIPE', 'MAG_STRIPE_CONTACTLESS', 'BAR_CODE', 'OCR', 'MICR', 'CHIP', 'CHIP_CONTACTLESS', 'CARD_ON_FILE', 'CHIP_FALLBACK', 'OTHER'):
            raise ValueError("must be one of enum values ('UNKNOWN', 'MANUAL', 'MAG_STRIPE', 'MAG_STRIPE_CONTACTLESS', 'BAR_CODE', 'OCR', 'MICR', 'CHIP', 'CHIP_CONTACTLESS', 'CARD_ON_FILE', 'CHIP_FALLBACK', 'OTHER')")
        return v

    @validator('pin_entry_mode')
    def pin_entry_mode_validate_enum(cls, v):
        if v is None:
            return v

        if v not in ('UNKNOWN', 'TRUE', 'FALSE', 'DEFECTIVE'):
            raise ValueError("must be one of enum values ('UNKNOWN', 'TRUE', 'FALSE', 'DEFECTIVE')")
        return v

    @validator('terminal_attendance')
    def terminal_attendance_validate_enum(cls, v):
        if v is None:
            return v

        if v not in ('UNSPECIFIED', 'ATTENDED', 'UNATTENDED', 'NO_TERMINAL'):
            raise ValueError("must be one of enum values ('UNSPECIFIED', 'ATTENDED', 'UNATTENDED', 'NO_TERMINAL')")
        return v

    @validator('terminal_location')
    def terminal_location_validate_enum(cls, v):
        if v is None:
            return v

        if v not in ('ON_PREMISE', 'OFF_PREMISE_MERCHANT', 'OFF_PREMISE_CARDHOLDER', 'NO_TERMINAL'):
            raise ValueError("must be one of enum values ('ON_PREMISE', 'OFF_PREMISE_MERCHANT', 'OFF_PREMISE_CARDHOLDER', 'NO_TERMINAL')")
        return v

    @validator('cardholder_authentication_method')
    def cardholder_authentication_method_validate_enum(cls, v):
        if v is None:
            return v

        if v not in ('UNSPECIFIED', 'NON_AUTHENTICATED', 'SIGNATURE', 'PIN', 'ID_VERIFIED'):
            raise ValueError("must be one of enum values ('UNSPECIFIED', 'NON_AUTHENTICATED', 'SIGNATURE', 'PIN', 'ID_VERIFIED')")
        return v

    @validator('terminal_type')
    def terminal_type_validate_enum(cls, v):
        if v is None:
            return v

        if v not in ('AUTO_DISPENSER_WITH_PIN', 'SELF_SERVICE', 'LIMITED_AMOUNT', 'IN_FLIGHT', 'ECOMMERCE', 'TRANSPONDER'):
            raise ValueError("must be one of enum values ('AUTO_DISPENSER_WITH_PIN', 'SELF_SERVICE', 'LIMITED_AMOUNT', 'IN_FLIGHT', 'ECOMMERCE', 'TRANSPONDER')")
        return v

    @validator('card_data_input_capability')
    def card_data_input_capability_validate_enum(cls, v):
        if v is None:
            return v

        if v not in ('UNKNOWN', 'NO_TERMINAL', 'MAG_STRIPE', 'MAG_STRIPE_CONTACTLESS', 'MAG_STRIPE_KEY_ENTRY', 'CHIP', 'CHIP_CONTACTLESS', 'CHIP_MAG_STRIPE', 'CHIP_MAG_STRIPE_KEY_ENTRY', 'KEY_ENTRY', 'OCR', 'MICR', 'BAR_CODE'):
            raise ValueError("must be one of enum values ('UNKNOWN', 'NO_TERMINAL', 'MAG_STRIPE', 'MAG_STRIPE_CONTACTLESS', 'MAG_STRIPE_KEY_ENTRY', 'CHIP', 'CHIP_CONTACTLESS', 'CHIP_MAG_STRIPE', 'CHIP_MAG_STRIPE_KEY_ENTRY', 'KEY_ENTRY', 'OCR', 'MICR', 'BAR_CODE')")
        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) -> Pos:
        """Create an instance of Pos 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) -> Pos:
        """Create an instance of Pos from a dict"""
        if obj is None:
            return None

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

        _obj = Pos.parse_obj({
            "pan_entry_mode": obj.get("pan_entry_mode"),
            "pin_entry_mode": obj.get("pin_entry_mode"),
            "terminal_id": obj.get("terminal_id"),
            "terminal_attendance": obj.get("terminal_attendance"),
            "terminal_location": obj.get("terminal_location"),
            "card_holder_presence": obj.get("card_holder_presence") if obj.get("card_holder_presence") is not None else False,
            "cardholder_authentication_method": obj.get("cardholder_authentication_method"),
            "card_presence": obj.get("card_presence") if obj.get("card_presence") is not None else False,
            "pin_present": obj.get("pin_present") if obj.get("pin_present") is not None else False,
            "terminal_type": obj.get("terminal_type"),
            "card_data_input_capability": obj.get("card_data_input_capability"),
            "country_code": obj.get("country_code"),
            "zip": obj.get("zip"),
            "partial_approval_capable": obj.get("partial_approval_capable") if obj.get("partial_approval_capable") is not None else False,
            "purchase_amount_only": obj.get("purchase_amount_only") if obj.get("purchase_amount_only") is not None else False,
            "is_recurring": obj.get("is_recurring") if obj.get("is_recurring") is not None else False,
            "is_installment": obj.get("is_installment") if obj.get("is_installment") is not None else False
        })
        return _obj

