# 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 Rate(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 = {
        'rate_id': 'str',
        'carrier_id': 'str',
        'carrier_name': 'str',
        'service_id': 'str',
        'service_name': 'str',
        'billed_weight': 'Weight',
        'total_charge': 'Currency',
        'promise': 'Promise',
        'supported_document_specifications': 'List[SupportedDocumentSpecification]',
        'available_value_added_service_groups': 'List[AvailableValueAddedServiceGroup]',
        'requires_additional_inputs': 'bool',
        'rate_item_list': 'List[RateItem]',
        'payment_type': 'PaymentType',
        'benefits': 'Benefits',
    }

    attribute_map = {
        'rate_id': 'rateId',
        'carrier_id': 'carrierId',
        'carrier_name': 'carrierName',
        'service_id': 'serviceId',
        'service_name': 'serviceName',
        'billed_weight': 'billedWeight',
        'total_charge': 'totalCharge',
        'promise': 'promise',
        'supported_document_specifications': 'supportedDocumentSpecifications',
        'available_value_added_service_groups': 'availableValueAddedServiceGroups',
        'requires_additional_inputs': 'requiresAdditionalInputs',
        'rate_item_list': 'rateItemList',
        'payment_type': 'paymentType',
        'benefits': 'benefits',
    }

    def __init__(self, rate_id=None, carrier_id=None, carrier_name=None, service_id=None, service_name=None, billed_weight=None, total_charge=None, promise=None, supported_document_specifications=None, available_value_added_service_groups=None, requires_additional_inputs=None, rate_item_list=None, payment_type=None, benefits=None, _configuration=None):  # noqa: E501
        """Rate - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._rate_id = None
        self._carrier_id = None
        self._carrier_name = None
        self._service_id = None
        self._service_name = None
        self._billed_weight = None
        self._total_charge = None
        self._promise = None
        self._supported_document_specifications = None
        self._available_value_added_service_groups = None
        self._requires_additional_inputs = None
        self._rate_item_list = None
        self._payment_type = None
        self._benefits = None
        self.discriminator = None

        self.rate_id = rate_id
        self.carrier_id = carrier_id
        self.carrier_name = carrier_name
        self.service_id = service_id
        self.service_name = service_name
        if billed_weight is not None:
            self.billed_weight = billed_weight
        self.total_charge = total_charge
        self.promise = promise
        self.supported_document_specifications = supported_document_specifications
        if available_value_added_service_groups is not None:
            self.available_value_added_service_groups = available_value_added_service_groups
        self.requires_additional_inputs = requires_additional_inputs
        if rate_item_list is not None:
            self.rate_item_list = rate_item_list
        if payment_type is not None:
            self.payment_type = payment_type
        if benefits is not None:
            self.benefits = benefits

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

        An identifier for the rate (shipment offering) provided by a shipping service provider.  # noqa: E501

        :return: The rate_id of this Rate.  # noqa: E501
        :rtype: str
        """
        return self._rate_id

    @rate_id.setter
    def rate_id(self, rate_id):
        """Sets the rate_id of this Rate.

        An identifier for the rate (shipment offering) provided by a shipping service provider.  # noqa: E501

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

        self._rate_id = rate_id

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

        The carrier identifier for the offering, provided by the carrier.  # noqa: E501

        :return: The carrier_id of this Rate.  # noqa: E501
        :rtype: str
        """
        return self._carrier_id

    @carrier_id.setter
    def carrier_id(self, carrier_id):
        """Sets the carrier_id of this Rate.

        The carrier identifier for the offering, provided by the carrier.  # noqa: E501

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

        self._carrier_id = carrier_id

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

        The carrier name for the offering.  # noqa: E501

        :return: The carrier_name of this Rate.  # noqa: E501
        :rtype: str
        """
        return self._carrier_name

    @carrier_name.setter
    def carrier_name(self, carrier_name):
        """Sets the carrier_name of this Rate.

        The carrier name for the offering.  # noqa: E501

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

        self._carrier_name = carrier_name

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

        An identifier for the shipping service.  # noqa: E501

        :return: The service_id of this Rate.  # noqa: E501
        :rtype: str
        """
        return self._service_id

    @service_id.setter
    def service_id(self, service_id):
        """Sets the service_id of this Rate.

        An identifier for the shipping service.  # noqa: E501

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

        self._service_id = service_id

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

        The name of the shipping service.  # noqa: E501

        :return: The service_name of this Rate.  # noqa: E501
        :rtype: str
        """
        return self._service_name

    @service_name.setter
    def service_name(self, service_name):
        """Sets the service_name of this Rate.

        The name of the shipping service.  # noqa: E501

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

        self._service_name = service_name

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


        :return: The billed_weight of this Rate.  # noqa: E501
        :rtype: Weight
        """
        return self._billed_weight

    @billed_weight.setter
    def billed_weight(self, billed_weight):
        """Sets the billed_weight of this Rate.


        :param billed_weight: The billed_weight of this Rate.  # noqa: E501
        :type: Weight
        """

        self._billed_weight = billed_weight

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


        :return: The total_charge of this Rate.  # noqa: E501
        :rtype: Currency
        """
        return self._total_charge

    @total_charge.setter
    def total_charge(self, total_charge):
        """Sets the total_charge of this Rate.


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

        self._total_charge = total_charge

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


        :return: The promise of this Rate.  # noqa: E501
        :rtype: Promise
        """
        return self._promise

    @promise.setter
    def promise(self, promise):
        """Sets the promise of this Rate.


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

        self._promise = promise

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

        A list of the document specifications supported for a shipment service offering.  # noqa: E501

        :return: The supported_document_specifications of this Rate.  # noqa: E501
        :rtype: List[SupportedDocumentSpecification]
        """
        return self._supported_document_specifications

    @supported_document_specifications.setter
    def supported_document_specifications(self, supported_document_specifications):
        """Sets the supported_document_specifications of this Rate.

        A list of the document specifications supported for a shipment service offering.  # noqa: E501

        :param supported_document_specifications: The supported_document_specifications of this Rate.  # noqa: E501
        :type: List[SupportedDocumentSpecification]
        """
        if self._configuration.client_side_validation and supported_document_specifications is None:
            raise ValueError("Invalid value for `supported_document_specifications`, must not be `None`")  # noqa: E501

        self._supported_document_specifications = supported_document_specifications

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

        A list of value-added services available for a shipping service offering.  # noqa: E501

        :return: The available_value_added_service_groups of this Rate.  # noqa: E501
        :rtype: List[AvailableValueAddedServiceGroup]
        """
        return self._available_value_added_service_groups

    @available_value_added_service_groups.setter
    def available_value_added_service_groups(self, available_value_added_service_groups):
        """Sets the available_value_added_service_groups of this Rate.

        A list of value-added services available for a shipping service offering.  # noqa: E501

        :param available_value_added_service_groups: The available_value_added_service_groups of this Rate.  # noqa: E501
        :type: List[AvailableValueAddedServiceGroup]
        """

        self._available_value_added_service_groups = available_value_added_service_groups

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

        When true, indicates that additional inputs are required to purchase this shipment service. You must then call the getAdditionalInputs operation to return the JSON schema to use when providing the additional inputs to the purchaseShipment operation.  # noqa: E501

        :return: The requires_additional_inputs of this Rate.  # noqa: E501
        :rtype: bool
        """
        return self._requires_additional_inputs

    @requires_additional_inputs.setter
    def requires_additional_inputs(self, requires_additional_inputs):
        """Sets the requires_additional_inputs of this Rate.

        When true, indicates that additional inputs are required to purchase this shipment service. You must then call the getAdditionalInputs operation to return the JSON schema to use when providing the additional inputs to the purchaseShipment operation.  # noqa: E501

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

        self._requires_additional_inputs = requires_additional_inputs

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

        A list of RateItem  # noqa: E501

        :return: The rate_item_list of this Rate.  # noqa: E501
        :rtype: List[RateItem]
        """
        return self._rate_item_list

    @rate_item_list.setter
    def rate_item_list(self, rate_item_list):
        """Sets the rate_item_list of this Rate.

        A list of RateItem  # noqa: E501

        :param rate_item_list: The rate_item_list of this Rate.  # noqa: E501
        :type: List[RateItem]
        """

        self._rate_item_list = rate_item_list

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


        :return: The payment_type of this Rate.  # noqa: E501
        :rtype: PaymentType
        """
        return self._payment_type

    @payment_type.setter
    def payment_type(self, payment_type):
        """Sets the payment_type of this Rate.


        :param payment_type: The payment_type of this Rate.  # noqa: E501
        :type: PaymentType
        """

        self._payment_type = payment_type

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


        :return: The benefits of this Rate.  # noqa: E501
        :rtype: Benefits
        """
        return self._benefits

    @benefits.setter
    def benefits(self, benefits):
        """Sets the benefits of this Rate.


        :param benefits: The benefits of this Rate.  # noqa: E501
        :type: Benefits
        """

        self._benefits = benefits

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

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