# coding: utf-8

"""
    Selling Partner API for Direct Fulfillment Shipping

    Use the Selling Partner API for Direct Fulfillment Shipping to access a direct fulfillment vendor's shipping data.

    The version of the OpenAPI document: 2021-12-28
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""  # noqa: E501


import pprint
import re  # noqa: F401

import six

from spapi.configuration import Configuration


class PackingSlip(object):
    """NOTE: This class is auto generated by the swagger code generator program.

    Do not edit the class manually.
    """

    """
    Attributes:
      swagger_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.
    """
    swagger_types = {
        'purchase_order_number': 'str',
        'content': 'str',
        'content_type': 'str',
    }

    attribute_map = {
        'purchase_order_number': 'purchaseOrderNumber',
        'content': 'content',
        'content_type': 'contentType',
    }

    def __init__(self, purchase_order_number=None, content=None, content_type=None, _configuration=None):  # noqa: E501
        """PackingSlip - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._purchase_order_number = None
        self._content = None
        self._content_type = None
        self.discriminator = None

        self.purchase_order_number = purchase_order_number
        self.content = content
        if content_type is not None:
            self.content_type = content_type

    @property
    def purchase_order_number(self):
        """Gets the purchase_order_number of this PackingSlip.  # noqa: E501

        Purchase order number of the shipment that the packing slip is for.  # noqa: E501

        :return: The purchase_order_number of this PackingSlip.  # noqa: E501
        :rtype: str
        """
        return self._purchase_order_number

    @purchase_order_number.setter
    def purchase_order_number(self, purchase_order_number):
        """Sets the purchase_order_number of this PackingSlip.

        Purchase order number of the shipment that the packing slip is for.  # noqa: E501

        :param purchase_order_number: The purchase_order_number of this PackingSlip.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and purchase_order_number is None:
            raise ValueError("Invalid value for `purchase_order_number`, must not be `None`")  # noqa: E501
        if (self._configuration.client_side_validation and
                purchase_order_number is not None and not re.search(r'^[a-zA-Z0-9]+$', purchase_order_number)):  # noqa: E501
            raise ValueError(r"Invalid value for `purchase_order_number`, must be a follow pattern or equal to `/^[a-zA-Z0-9]+$/`")  # noqa: E501

        self._purchase_order_number = purchase_order_number

    @property
    def content(self):
        """Gets the content of this PackingSlip.  # noqa: E501

        A Base64 string of the packing slip PDF.  # noqa: E501

        :return: The content of this PackingSlip.  # noqa: E501
        :rtype: str
        """
        return self._content

    @content.setter
    def content(self, content):
        """Sets the content of this PackingSlip.

        A Base64 string of the packing slip PDF.  # noqa: E501

        :param content: The content of this PackingSlip.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and content is None:
            raise ValueError("Invalid value for `content`, must not be `None`")  # noqa: E501

        self._content = content

    @property
    def content_type(self):
        """Gets the content_type of this PackingSlip.  # noqa: E501

        The format of the file such as PDF, JPEG etc.  # noqa: E501

        :return: The content_type of this PackingSlip.  # noqa: E501
        :rtype: str
        """
        return self._content_type

    @content_type.setter
    def content_type(self, content_type):
        """Sets the content_type of this PackingSlip.

        The format of the file such as PDF, JPEG etc.  # noqa: E501

        :param content_type: The content_type of this PackingSlip.  # noqa: E501
        :type: str
        """
        allowed_values = ["application/pdf"]  # noqa: E501
        if (self._configuration.client_side_validation and
                content_type not in allowed_values):
            raise ValueError(
                "Invalid value for `content_type` ({0}), must be one of {1}"  # noqa: E501
                .format(content_type, allowed_values)
            )

        self._content_type = content_type

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

        for attr, _ in six.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
        if issubclass(PackingSlip, dict):
            for key, value in self.items():
                result[key] = value

        return result

    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, PackingSlip):
            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, PackingSlip):
            return True

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