# coding: utf-8

"""
    Amazon Shipping API

    The Amazon Shipping API is designed to support outbound shipping use cases both for orders originating on Amazon-owned marketplaces as well as external channels/marketplaces. With these APIs, you can request shipping rates, create shipments, cancel shipments, and track shipments.

    The version of the OpenAPI document: v2
    Contact: swa-api-core@amazon.com
    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 DirectPurchaseRequest(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 = {
        'ship_to': 'Address',
        'ship_from': 'Address',
        'return_to': 'Address',
        'packages': 'List[Package]',
        'channel_details': 'ChannelDetails',
        'label_specifications': 'RequestedDocumentSpecification',
    }

    attribute_map = {
        'ship_to': 'shipTo',
        'ship_from': 'shipFrom',
        'return_to': 'returnTo',
        'packages': 'packages',
        'channel_details': 'channelDetails',
        'label_specifications': 'labelSpecifications',
    }

    def __init__(self, ship_to=None, ship_from=None, return_to=None, packages=None, channel_details=None, label_specifications=None, _configuration=None):  # noqa: E501
        """DirectPurchaseRequest - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._ship_to = None
        self._ship_from = None
        self._return_to = None
        self._packages = None
        self._channel_details = None
        self._label_specifications = None
        self.discriminator = None

        if ship_to is not None:
            self.ship_to = ship_to
        if ship_from is not None:
            self.ship_from = ship_from
        if return_to is not None:
            self.return_to = return_to
        if packages is not None:
            self.packages = packages
        self.channel_details = channel_details
        if label_specifications is not None:
            self.label_specifications = label_specifications

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


        :return: The ship_to of this DirectPurchaseRequest.  # noqa: E501
        :rtype: Address
        """
        return self._ship_to

    @ship_to.setter
    def ship_to(self, ship_to):
        """Sets the ship_to of this DirectPurchaseRequest.


        :param ship_to: The ship_to of this DirectPurchaseRequest.  # noqa: E501
        :type: Address
        """

        self._ship_to = ship_to

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


        :return: The ship_from of this DirectPurchaseRequest.  # noqa: E501
        :rtype: Address
        """
        return self._ship_from

    @ship_from.setter
    def ship_from(self, ship_from):
        """Sets the ship_from of this DirectPurchaseRequest.


        :param ship_from: The ship_from of this DirectPurchaseRequest.  # noqa: E501
        :type: Address
        """

        self._ship_from = ship_from

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


        :return: The return_to of this DirectPurchaseRequest.  # noqa: E501
        :rtype: Address
        """
        return self._return_to

    @return_to.setter
    def return_to(self, return_to):
        """Sets the return_to of this DirectPurchaseRequest.


        :param return_to: The return_to of this DirectPurchaseRequest.  # noqa: E501
        :type: Address
        """

        self._return_to = return_to

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

        A list of packages to be shipped through a shipping service offering.  # noqa: E501

        :return: The packages of this DirectPurchaseRequest.  # noqa: E501
        :rtype: List[Package]
        """
        return self._packages

    @packages.setter
    def packages(self, packages):
        """Sets the packages of this DirectPurchaseRequest.

        A list of packages to be shipped through a shipping service offering.  # noqa: E501

        :param packages: The packages of this DirectPurchaseRequest.  # noqa: E501
        :type: List[Package]
        """

        self._packages = packages

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


        :return: The channel_details of this DirectPurchaseRequest.  # noqa: E501
        :rtype: ChannelDetails
        """
        return self._channel_details

    @channel_details.setter
    def channel_details(self, channel_details):
        """Sets the channel_details of this DirectPurchaseRequest.


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

        self._channel_details = channel_details

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


        :return: The label_specifications of this DirectPurchaseRequest.  # noqa: E501
        :rtype: RequestedDocumentSpecification
        """
        return self._label_specifications

    @label_specifications.setter
    def label_specifications(self, label_specifications):
        """Sets the label_specifications of this DirectPurchaseRequest.


        :param label_specifications: The label_specifications of this DirectPurchaseRequest.  # noqa: E501
        :type: RequestedDocumentSpecification
        """

        self._label_specifications = label_specifications

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

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