# 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 pydantic import BaseModel, Field, StrictInt, StrictStr, validator

class SendingProvisioningDataToGooglePayBackendRequest(BaseModel):
    """
    SendingProvisioningDataToGooglePayBackendRequest
    """
    server_session_id: StrictStr = Field(..., description="A string that identifies the backend session. Provided by Google pay backend.")
    client_session_id: StrictStr = Field(..., description="A string that identifies the client session. Provided by Google pay backend.")
    token_setting: StrictInt = Field(..., description="1 => Tokenization will be attempted.; 0 =>Tokenization will not be attempted.")
    card_setting: StrictInt = Field(..., description="1 => FPAN save will be attempted.; 0 => FPAN save will not be attempted.")
    public_wallet_id: StrictStr = Field(..., description="String identifying the device-scoped Google Pay wallet that will receive the token. Provided by Google Pay backend.")
    public_device_id: StrictStr = Field(..., description="String identifying the Android device that will receive the token. Provided by Google Pay backend")
    card_token: StrictStr = Field(..., description="identifier for card issued by MQ")
    integrator_id: StrictStr = Field(..., description="A Google-assigned string that uniquely identifies both the integrator that is initiating the session and the issuer of the payment card.")
    __properties = ["server_session_id", "client_session_id", "token_setting", "card_setting", "public_wallet_id", "public_device_id", "card_token", "integrator_id"]

    @validator('token_setting')
    def token_setting_validate_enum(cls, v):
        if v not in (0, 1):
            raise ValueError("must be one of enum values (0, 1)")
        return v

    @validator('card_setting')
    def card_setting_validate_enum(cls, v):
        if v not in (0, 1):
            raise ValueError("must be one of enum values (0, 1)")
        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) -> SendingProvisioningDataToGooglePayBackendRequest:
        """Create an instance of SendingProvisioningDataToGooglePayBackendRequest 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) -> SendingProvisioningDataToGooglePayBackendRequest:
        """Create an instance of SendingProvisioningDataToGooglePayBackendRequest from a dict"""
        if obj is None:
            return None

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

        _obj = SendingProvisioningDataToGooglePayBackendRequest.parse_obj({
            "server_session_id": obj.get("server_session_id"),
            "client_session_id": obj.get("client_session_id"),
            "token_setting": obj.get("token_setting"),
            "card_setting": obj.get("card_setting"),
            "public_wallet_id": obj.get("public_wallet_id"),
            "public_device_id": obj.get("public_device_id"),
            "card_token": obj.get("card_token"),
            "integrator_id": obj.get("integrator_id")
        })
        return _obj

