# coding: utf-8

"""
Copyright 2017 Square, Inc.

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
"""


from pprint import pformat
from six import iteritems
import re


class MeasurementUnit(object):
    """
    NOTE: This class is auto generated by the swagger code generator program.
    Do not edit the class manually.
    """
    def __init__(self, custom_unit=None, area_unit=None, length_unit=None, volume_unit=None, weight_unit=None, generic_unit=None):
        """
        MeasurementUnit - a model defined in Swagger

        :param dict swaggerTypes: The key is attribute name
                                  and the value is attribute type.
        :param dict attributeMap: The key is attribute name
                                  and the value is json key in definition.
        """
        self.swagger_types = {
            'custom_unit': 'MeasurementUnitCustom',
            'area_unit': 'str',
            'length_unit': 'str',
            'volume_unit': 'str',
            'weight_unit': 'str',
            'generic_unit': 'str'
        }

        self.attribute_map = {
            'custom_unit': 'custom_unit',
            'area_unit': 'area_unit',
            'length_unit': 'length_unit',
            'volume_unit': 'volume_unit',
            'weight_unit': 'weight_unit',
            'generic_unit': 'generic_unit'
        }

        self._custom_unit = custom_unit
        self._area_unit = area_unit
        self._length_unit = length_unit
        self._volume_unit = volume_unit
        self._weight_unit = weight_unit
        self._generic_unit = generic_unit

    @property
    def custom_unit(self):
        """
        Gets the custom_unit of this MeasurementUnit.
        A custom unit of measurement defined by the seller using the Point of Sale app or ad-hoc as an order line item.

        :return: The custom_unit of this MeasurementUnit.
        :rtype: MeasurementUnitCustom
        """
        return self._custom_unit

    @custom_unit.setter
    def custom_unit(self, custom_unit):
        """
        Sets the custom_unit of this MeasurementUnit.
        A custom unit of measurement defined by the seller using the Point of Sale app or ad-hoc as an order line item.

        :param custom_unit: The custom_unit of this MeasurementUnit.
        :type: MeasurementUnitCustom
        """

        self._custom_unit = custom_unit

    @property
    def area_unit(self):
        """
        Gets the area_unit of this MeasurementUnit.
        Represents a standard area unit. See [MeasurementUnitArea](#type-measurementunitarea) for possible values

        :return: The area_unit of this MeasurementUnit.
        :rtype: str
        """
        return self._area_unit

    @area_unit.setter
    def area_unit(self, area_unit):
        """
        Sets the area_unit of this MeasurementUnit.
        Represents a standard area unit. See [MeasurementUnitArea](#type-measurementunitarea) for possible values

        :param area_unit: The area_unit of this MeasurementUnit.
        :type: str
        """

        self._area_unit = area_unit

    @property
    def length_unit(self):
        """
        Gets the length_unit of this MeasurementUnit.
        Represents a standard length unit. See [MeasurementUnitLength](#type-measurementunitlength) for possible values

        :return: The length_unit of this MeasurementUnit.
        :rtype: str
        """
        return self._length_unit

    @length_unit.setter
    def length_unit(self, length_unit):
        """
        Sets the length_unit of this MeasurementUnit.
        Represents a standard length unit. See [MeasurementUnitLength](#type-measurementunitlength) for possible values

        :param length_unit: The length_unit of this MeasurementUnit.
        :type: str
        """

        self._length_unit = length_unit

    @property
    def volume_unit(self):
        """
        Gets the volume_unit of this MeasurementUnit.
        Represents a standard volume unit. See [MeasurementUnitVolume](#type-measurementunitvolume) for possible values

        :return: The volume_unit of this MeasurementUnit.
        :rtype: str
        """
        return self._volume_unit

    @volume_unit.setter
    def volume_unit(self, volume_unit):
        """
        Sets the volume_unit of this MeasurementUnit.
        Represents a standard volume unit. See [MeasurementUnitVolume](#type-measurementunitvolume) for possible values

        :param volume_unit: The volume_unit of this MeasurementUnit.
        :type: str
        """

        self._volume_unit = volume_unit

    @property
    def weight_unit(self):
        """
        Gets the weight_unit of this MeasurementUnit.
        Represents a standard unit of weight or mass. See [MeasurementUnitWeight](#type-measurementunitweight) for possible values

        :return: The weight_unit of this MeasurementUnit.
        :rtype: str
        """
        return self._weight_unit

    @weight_unit.setter
    def weight_unit(self, weight_unit):
        """
        Sets the weight_unit of this MeasurementUnit.
        Represents a standard unit of weight or mass. See [MeasurementUnitWeight](#type-measurementunitweight) for possible values

        :param weight_unit: The weight_unit of this MeasurementUnit.
        :type: str
        """

        self._weight_unit = weight_unit

    @property
    def generic_unit(self):
        """
        Gets the generic_unit of this MeasurementUnit.
        Reserved for API integrations that lack the ability to specify a real measurement unit See [MeasurementUnitGeneric](#type-measurementunitgeneric) for possible values

        :return: The generic_unit of this MeasurementUnit.
        :rtype: str
        """
        return self._generic_unit

    @generic_unit.setter
    def generic_unit(self, generic_unit):
        """
        Sets the generic_unit of this MeasurementUnit.
        Reserved for API integrations that lack the ability to specify a real measurement unit See [MeasurementUnitGeneric](#type-measurementunitgeneric) for possible values

        :param generic_unit: The generic_unit of this MeasurementUnit.
        :type: str
        """

        self._generic_unit = generic_unit

    def to_dict(self):
        """
        Returns the model properties as a dict
        """
        result = {}

        for attr, _ in iteritems(self.swagger_types):
            value = getattr(self, attr)
            if isinstance(value, list):
                result[attr] = list(map(
                    lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
                    value
                ))
            elif hasattr(value, "to_dict"):
                result[attr] = value.to_dict()
            elif isinstance(value, dict):
                result[attr] = dict(map(
                    lambda item: (item[0], item[1].to_dict())
                    if hasattr(item[1], "to_dict") else item,
                    value.items()
                ))
            else:
                result[attr] = value

        return result

    def to_str(self):
        """
        Returns the string representation of the model
        """
        return 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
        """
        return self.__dict__ == other.__dict__

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