# coding: utf-8

"""
    TrueLayer Resource API

    No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)  # noqa: E501

    The version of the OpenAPI document: v1.0
    Contact: rienafairefr@gmail.com
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six

import marshmallow
from marshmallow import Schema, validates, ValidationError, post_load, missing

from truelayer import fields
from truelayer.configuration import Configuration



class AddressInfoSchema(Schema):
    """NOTE: This class is auto generated by OpenAPI Generator.
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """
    address = marshmallow.fields.String()

    city = marshmallow.fields.String()

    country = marshmallow.fields.String()

    state = marshmallow.fields.String()

    zip = marshmallow.fields.String()

    @validates("address")
    def validates_address(self, address):
        pass

    @validates("city")
    def validates_city(self, city):
        pass

    @validates("country")
    def validates_country(self, country):
        pass

    @validates("state")
    def validates_state(self, state):
        pass

    @validates("zip")
    def validates_zip(self, zip):
        pass

    @post_load
    def post_load(self, data, **kwargs):
        config = Configuration()
        config.client_side_validation = False
        return AddressInfo(local_vars_configuration=config, **data)


class AddressInfo(object):
    """NOTE: This class is auto generated by OpenAPI Generator.
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    """
    Attributes:
      openapi_types (dict): The key is attribute name
                            and the value is attribute type.
      attribute_map (dict): The key is attribute name
                            and the value is json key in definition.
    """
    openapi_types = {
        'address': 'str',
        'city': 'str',
        'country': 'str',
        'state': 'str',
        'zip': 'str'
    }

    attribute_map = {
        'address': 'address',
        'city': 'city',
        'country': 'country',
        'state': 'state',
        'zip': 'zip'
    }

    def __init__(self, address=missing, city=missing, country=missing, state=missing, zip=missing, local_vars_configuration=None):  # noqa: E501
        """AddressInfo - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self.discriminator = None
        if self.local_vars_configuration.client_side_validation:
            validated = AddressInfoSchema().load({
                'address': address,
                'city': city,
                'country': country,
                'state': state,
                'zip': zip
            })
            self.address = validated.address
            self.city = validated.city
            self.country = validated.country
            self.state = validated.state
            self.zip = validated.zip
        else:
            self.address = address
            self.city = city
            self.country = country
            self.state = state
            self.zip = zip

    def to_dict(self):
        """Returns the model properties as a dict"""
        return AddressInfoSchema().dump(self)

    def to_str(self):
        """Returns the string representation of the model"""
        return pprint.pformat(self.to_dict())

    def __repr__(self):
        """For `print` and `pprint`"""
        return self.to_str()

    def __eq__(self, other):
        """Returns true if both objects are equal"""
        if not isinstance(other, AddressInfo):
            return False

        return self.to_dict() == other.to_dict()

    def __ne__(self, other):
        """Returns true if both objects are not equal"""
        if not isinstance(other, AddressInfo):
            return True

        return self.to_dict() != other.to_dict()
