Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

Commit

Permalink
Merge pull request #4 from PurplShip/client-update-for-purplship-serv…
Browse files Browse the repository at this point in the history
…er-2020.7.0

Update Rate model and version for purplship-server 2020.7.0
  • Loading branch information
danh91 committed Jul 14, 2020
2 parents 19c5bee + 2107f00 commit ff72a9a
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 29 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# purplship
PurplShip is a Multi-carrier Shipping API that simplifies the integration of logistic carrier services

PurplShip is a Multi-carrier Shipping API that simplifies the integration of logistic carrier services.

Visit [purplship.com](https://purplship.com) to deploy your private cloud multi-carrier shipping API instance.

## Requirements.

Expand Down
2 changes: 1 addition & 1 deletion docs/Rate.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Name | Type | Description | Notes
**base_charge** | **float** | The rate's monetary amount of the base charge. This is the net amount of the rate before additional charges | [optional]
**total_charge** | **float** | The rate's monetary amount of the total charge. This is the gross amount of the rate after adding the additional charges | [optional]
**duties_and_taxes** | **float** | The monetary amount of the duties and taxes if applied | [optional]
**estimated_delivery** | **str** | The estimated delivery date | [optional]
**transit_days** | **int** | The estimated delivery transit days | [optional]
**extra_charges** | [**list[Charge]**](Charge.md) | list of the rate's additional charges | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
Expand Down
2 changes: 1 addition & 1 deletion docs/RateApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ from pprint import pprint
purplship.api_key = 'YOUR_API_KEY'
purplship.host = 'https://instance.purplship.api/v1'

data = purplship.models.RateRequest()
data = purplship.RateRequest()

try:
api_response = purplship.Rate.fetch(data)
Expand Down
2 changes: 1 addition & 1 deletion docs/ShipmentApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ from pprint import pprint
purplship.api_key = 'YOUR_API_KEY'
purplship.host = 'https://instance.purplship.api/v1'

data = purplship.models.ShipmentRequest()
data = purplship.ShipmentRequest()

try:
api_response = purplship.Shipment.create(data)
Expand Down
17 changes: 16 additions & 1 deletion purplship/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,22 @@
from purplship.configuration import Configuration

# import models into sdk package
import purplship.models as models
from purplship.models.address import Address
from purplship.models.card import Card
from purplship.models.carrier_settings import CarrierSettings
from purplship.models.charge import Charge
from purplship.models.commodity import Commodity
from purplship.models.customs import Customs
from purplship.models.doc import Doc
from purplship.models.invoice import Invoice
from purplship.models.label_printing_request import LabelPrintingRequest
from purplship.models.message import Message
from purplship.models.options import Options
from purplship.models.parcel import Parcel
from purplship.models.payment import Payment
from purplship.models.rate_request import RateRequest
from purplship.models.references import References
from purplship.models.shipment_request import ShipmentRequest


api_key = None
Expand Down
44 changes: 20 additions & 24 deletions purplship/models/rate.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

"""
PurplShip Multi-carrier API
PurplShip is a Multi-carrier Shipping API that simplifies the integration of logistic carrier services # noqa: E501
OpenAPI spec version: v1
Contact: hello@purplship.com
Generated by: https://github.com/PurplShip/purplship-python-client.git
Expand Down Expand Up @@ -40,7 +38,7 @@ class Rate(object):
'base_charge': 'float',
'total_charge': 'float',
'duties_and_taxes': 'float',
'estimated_delivery': 'str',
'transit_days': 'int',
'extra_charges': 'list[Charge]'
}

Expand All @@ -54,12 +52,12 @@ class Rate(object):
'base_charge': 'baseCharge',
'total_charge': 'totalCharge',
'duties_and_taxes': 'dutiesAndTaxes',
'estimated_delivery': 'estimatedDelivery',
'transit_days': 'transitDays',
'extra_charges': 'extraCharges'
}

def __init__(self, id=None, carrier_name=None, carrier_id=None, currency=None, service=None, discount=None, base_charge=None, total_charge=None, duties_and_taxes=None, estimated_delivery=None, extra_charges=None): # noqa: E501
"""Rate - a model defined in PurplShip""" # noqa: E501
def __init__(self, id=None, carrier_name=None, carrier_id=None, currency=None, service=None, discount=None, base_charge=None, total_charge=None, duties_and_taxes=None, transit_days=None, extra_charges=None): # noqa: E501
"""Rate - a model defined in Swagger""" # noqa: E501

self._id = None
self._carrier_name = None
Expand All @@ -70,7 +68,7 @@ def __init__(self, id=None, carrier_name=None, carrier_id=None, currency=None, s
self._base_charge = None
self._total_charge = None
self._duties_and_taxes = None
self._estimated_delivery = None
self._transit_days = None
self._extra_charges = None
self.discriminator = None

Expand All @@ -89,8 +87,8 @@ def __init__(self, id=None, carrier_name=None, carrier_id=None, currency=None, s
self.total_charge = total_charge
if duties_and_taxes is not None:
self.duties_and_taxes = duties_and_taxes
if estimated_delivery is not None:
self.estimated_delivery = estimated_delivery
if transit_days is not None:
self.transit_days = transit_days
if extra_charges is not None:
self.extra_charges = extra_charges

Expand Down Expand Up @@ -318,29 +316,27 @@ def duties_and_taxes(self, duties_and_taxes):
self._duties_and_taxes = duties_and_taxes

@property
def estimated_delivery(self):
"""Gets the estimated_delivery of this Rate. # noqa: E501
def transit_days(self):
"""Gets the transit_days of this Rate. # noqa: E501
The estimated delivery date # noqa: E501
The estimated delivery transit days # noqa: E501
:return: The estimated_delivery of this Rate. # noqa: E501
:rtype: str
:return: The transit_days of this Rate. # noqa: E501
:rtype: int
"""
return self._estimated_delivery
return self._transit_days

@estimated_delivery.setter
def estimated_delivery(self, estimated_delivery):
"""Sets the estimated_delivery of this Rate.
@transit_days.setter
def transit_days(self, transit_days):
"""Sets the transit_days of this Rate.
The estimated delivery date # noqa: E501
The estimated delivery transit days # noqa: E501
:param estimated_delivery: The estimated_delivery of this Rate. # noqa: E501
:type: str
:param transit_days: The transit_days of this Rate. # noqa: E501
:type: int
"""
if estimated_delivery is not None and len(estimated_delivery) < 1:
raise ValueError("Invalid value for `estimated_delivery`, length must be greater than or equal to `1`") # noqa: E501

self._estimated_delivery = estimated_delivery
self._transit_days = transit_days

@property
def extra_charges(self):
Expand Down

0 comments on commit ff72a9a

Please sign in to comment.