# coding: utf-8

"""
    Selling Partner API for Merchant Fulfillment

    The Selling Partner API for Merchant Fulfillment helps you build applications that let sellers purchase shipping for non-Prime and Prime orders using Amazon’s Buy Shipping Services.  # noqa: E501

    OpenAPI spec version: v0
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


import pprint
import re  # noqa: F401

import six

from src.api_models.mfn_api.swagger_client.configuration import Configuration


class Shipment(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 = {
        'shipment_id': 'ShipmentId',
        'amazon_order_id': 'AmazonOrderId',
        'seller_order_id': 'SellerOrderId',
        'item_list': 'ItemList',
        'ship_from_address': 'Address',
        'ship_to_address': 'Address',
        'package_dimensions': 'PackageDimensions',
        'weight': 'Weight',
        'insurance': 'CurrencyAmount',
        'shipping_service': 'ShippingService',
        'label': 'Label',
        'status': 'ShipmentStatus',
        'tracking_id': 'TrackingId',
        'created_date': 'Timestamp',
        'last_updated_date': 'Timestamp'
    }

    attribute_map = {
        'shipment_id': 'ShipmentId',
        'amazon_order_id': 'AmazonOrderId',
        'seller_order_id': 'SellerOrderId',
        'item_list': 'ItemList',
        'ship_from_address': 'ShipFromAddress',
        'ship_to_address': 'ShipToAddress',
        'package_dimensions': 'PackageDimensions',
        'weight': 'Weight',
        'insurance': 'Insurance',
        'shipping_service': 'ShippingService',
        'label': 'Label',
        'status': 'Status',
        'tracking_id': 'TrackingId',
        'created_date': 'CreatedDate',
        'last_updated_date': 'LastUpdatedDate'
    }

    def __init__(self, shipment_id=None, amazon_order_id=None, seller_order_id=None, item_list=None, ship_from_address=None, ship_to_address=None, package_dimensions=None, weight=None, insurance=None, shipping_service=None, label=None, status=None, tracking_id=None, created_date=None, last_updated_date=None, _configuration=None):  # noqa: E501
        """Shipment - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._shipment_id = None
        self._amazon_order_id = None
        self._seller_order_id = None
        self._item_list = None
        self._ship_from_address = None
        self._ship_to_address = None
        self._package_dimensions = None
        self._weight = None
        self._insurance = None
        self._shipping_service = None
        self._label = None
        self._status = None
        self._tracking_id = None
        self._created_date = None
        self._last_updated_date = None
        self.discriminator = None

        self.shipment_id = shipment_id
        self.amazon_order_id = amazon_order_id
        if seller_order_id is not None:
            self.seller_order_id = seller_order_id
        self.item_list = item_list
        self.ship_from_address = ship_from_address
        self.ship_to_address = ship_to_address
        self.package_dimensions = package_dimensions
        self.weight = weight
        self.insurance = insurance
        self.shipping_service = shipping_service
        self.label = label
        self.status = status
        if tracking_id is not None:
            self.tracking_id = tracking_id
        self.created_date = created_date
        if last_updated_date is not None:
            self.last_updated_date = last_updated_date

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


        :return: The shipment_id of this Shipment.  # noqa: E501
        :rtype: ShipmentId
        """
        return self._shipment_id

    @shipment_id.setter
    def shipment_id(self, shipment_id):
        """Sets the shipment_id of this Shipment.


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

        self._shipment_id = shipment_id

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


        :return: The amazon_order_id of this Shipment.  # noqa: E501
        :rtype: AmazonOrderId
        """
        return self._amazon_order_id

    @amazon_order_id.setter
    def amazon_order_id(self, amazon_order_id):
        """Sets the amazon_order_id of this Shipment.


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

        self._amazon_order_id = amazon_order_id

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


        :return: The seller_order_id of this Shipment.  # noqa: E501
        :rtype: SellerOrderId
        """
        return self._seller_order_id

    @seller_order_id.setter
    def seller_order_id(self, seller_order_id):
        """Sets the seller_order_id of this Shipment.


        :param seller_order_id: The seller_order_id of this Shipment.  # noqa: E501
        :type: SellerOrderId
        """

        self._seller_order_id = seller_order_id

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


        :return: The item_list of this Shipment.  # noqa: E501
        :rtype: ItemList
        """
        return self._item_list

    @item_list.setter
    def item_list(self, item_list):
        """Sets the item_list of this Shipment.


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

        self._item_list = item_list

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

        The address of the sender.  # noqa: E501

        :return: The ship_from_address of this Shipment.  # noqa: E501
        :rtype: Address
        """
        return self._ship_from_address

    @ship_from_address.setter
    def ship_from_address(self, ship_from_address):
        """Sets the ship_from_address of this Shipment.

        The address of the sender.  # noqa: E501

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

        self._ship_from_address = ship_from_address

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

        The destination address for the shipment.  # noqa: E501

        :return: The ship_to_address of this Shipment.  # noqa: E501
        :rtype: Address
        """
        return self._ship_to_address

    @ship_to_address.setter
    def ship_to_address(self, ship_to_address):
        """Sets the ship_to_address of this Shipment.

        The destination address for the shipment.  # noqa: E501

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

        self._ship_to_address = ship_to_address

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


        :return: The package_dimensions of this Shipment.  # noqa: E501
        :rtype: PackageDimensions
        """
        return self._package_dimensions

    @package_dimensions.setter
    def package_dimensions(self, package_dimensions):
        """Sets the package_dimensions of this Shipment.


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

        self._package_dimensions = package_dimensions

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

        The package weight.  # noqa: E501

        :return: The weight of this Shipment.  # noqa: E501
        :rtype: Weight
        """
        return self._weight

    @weight.setter
    def weight(self, weight):
        """Sets the weight of this Shipment.

        The package weight.  # noqa: E501

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

        self._weight = weight

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

        If DeclaredValue was specified in a previous call to the createShipment operation, then Insurance indicates the amount that the carrier will use to insure the shipment. If DeclaredValue was not specified with a previous call to the createShipment operation, then the shipment will be insured for the carrier's minimum insurance amount, or the combined sale prices that the items are listed for in the shipment, whichever is less.  # noqa: E501

        :return: The insurance of this Shipment.  # noqa: E501
        :rtype: CurrencyAmount
        """
        return self._insurance

    @insurance.setter
    def insurance(self, insurance):
        """Sets the insurance of this Shipment.

        If DeclaredValue was specified in a previous call to the createShipment operation, then Insurance indicates the amount that the carrier will use to insure the shipment. If DeclaredValue was not specified with a previous call to the createShipment operation, then the shipment will be insured for the carrier's minimum insurance amount, or the combined sale prices that the items are listed for in the shipment, whichever is less.  # noqa: E501

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

        self._insurance = insurance

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


        :return: The shipping_service of this Shipment.  # noqa: E501
        :rtype: ShippingService
        """
        return self._shipping_service

    @shipping_service.setter
    def shipping_service(self, shipping_service):
        """Sets the shipping_service of this Shipment.


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

        self._shipping_service = shipping_service

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

        Data for creating a shipping label and dimensions for printing the label. If the shipment is canceled, an empty Label is returned.  # noqa: E501

        :return: The label of this Shipment.  # noqa: E501
        :rtype: Label
        """
        return self._label

    @label.setter
    def label(self, label):
        """Sets the label of this Shipment.

        Data for creating a shipping label and dimensions for printing the label. If the shipment is canceled, an empty Label is returned.  # noqa: E501

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

        self._label = label

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

        The shipment status.  # noqa: E501

        :return: The status of this Shipment.  # noqa: E501
        :rtype: ShipmentStatus
        """
        return self._status

    @status.setter
    def status(self, status):
        """Sets the status of this Shipment.

        The shipment status.  # noqa: E501

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

        self._status = status

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


        :return: The tracking_id of this Shipment.  # noqa: E501
        :rtype: TrackingId
        """
        return self._tracking_id

    @tracking_id.setter
    def tracking_id(self, tracking_id):
        """Sets the tracking_id of this Shipment.


        :param tracking_id: The tracking_id of this Shipment.  # noqa: E501
        :type: TrackingId
        """

        self._tracking_id = tracking_id

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

        The date and time the shipment was created.  # noqa: E501

        :return: The created_date of this Shipment.  # noqa: E501
        :rtype: Timestamp
        """
        return self._created_date

    @created_date.setter
    def created_date(self, created_date):
        """Sets the created_date of this Shipment.

        The date and time the shipment was created.  # noqa: E501

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

        self._created_date = created_date

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

        The date and time of the last update.  # noqa: E501

        :return: The last_updated_date of this Shipment.  # noqa: E501
        :rtype: Timestamp
        """
        return self._last_updated_date

    @last_updated_date.setter
    def last_updated_date(self, last_updated_date):
        """Sets the last_updated_date of this Shipment.

        The date and time of the last update.  # noqa: E501

        :param last_updated_date: The last_updated_date of this Shipment.  # noqa: E501
        :type: Timestamp
        """

        self._last_updated_date = last_updated_date

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

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