Skip to content

Commit

Permalink
API version 2.1.0 See https://docs.patch.io/#/changelog for changes (#72
Browse files Browse the repository at this point in the history
)

* API version 2.1.0 See https://docs.patch.io/#/changelog for changes

* Pin ubuntu image to be able to run python 3.6

* Use swagger version 2

* Update expected test results for estimates
  • Loading branch information
venalen authored Apr 4, 2023
1 parent 171cb92 commit cf49ec7
Show file tree
Hide file tree
Showing 23 changed files with 574 additions and 18 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,14 @@ on:

jobs:
publish:
# 03/27/23: it looks like there are issues with the tarballs for all python 3.6 versions
# that are on ubuntu-22.04 (ubuntu-latest at the time). To maintain python compatibility
# we're pinning ubuntu-20.04 so that we can properly run install python 3.6.
#
# As soon as this issue is addressed, we should put the image back to ubuntu-latest:
# https://github.com/actions/setup-python/issues/544
name: Publish
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
env:
TARGET_URL: https://pypi.org/project/patch-api/
steps:
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@ jobs:
- uses: psf/black@stable

build-and-test:
runs-on: ubuntu-latest
# 03/27/23: it looks like there are issues with the tarballs for all python 3.6 versions
# that are on ubuntu-22.04 (ubuntu-latest at the time). To maintain python compatibility
# we're pinning ubuntu-20.04 so that we can properly run install python 3.6.
#
# As soon as this issue is addressed, we should put the image back to ubuntu-latest:
# https://github.com/actions/setup-python/issues/544
runs-on: ubuntu-20.04
name: Python Library tests
steps:
- name: Check out code
Expand All @@ -24,6 +30,7 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: '3.6'

- name: Run tests
env:
SANDBOX_API_KEY: ${{ secrets.SANDBOX_API_KEY }}
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.1.0] - 2023-04-04

### Added

- Adds optional `vintage_start_year` and `vintage_end_year` fields to `order` creation
- Adds optional `vintage_start_year` and `vintage_end_year` fields to `order_line_item` create and update
- Adds optional `vintage_start_year` and `vintage_end_year` fields to `inventory` creation
- Adds `vintage_start_year` and `vintage_end_year` fields to `order` response
- Adds `vintage_start_year` and `vintage_end_year` fields to `order_line_item` response
- Adds optional `carrier_scac` field to `patch.estimates.create_road_shipping_estimate`
- Deprecates `create_shipping_estimate` in favor of `create_ecommerce_estimate`

## [1.24.2] - 2022-08-10

### Added
Expand Down
2 changes: 1 addition & 1 deletion patch_api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

from __future__ import absolute_import

__version__ = "2.0.0"
__version__ = "2.1.0"

# import ApiClient
from patch_api.api_client import ApiClient
Expand Down
30 changes: 30 additions & 0 deletions patch_api/api/estimates_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ class EstimatesApi(object):
"origin_postal_code",
"truck_weight_t",
"vessel_imo",
"vintage_start_year",
"vintage_end_year",
]

def __init__(self, api_client=None):
Expand Down Expand Up @@ -203,6 +205,8 @@ def create_air_shipping_estimate_with_http_info(
all_params.append("origin_postal_code")
all_params.append("truck_weight_t")
all_params.append("vessel_imo")
all_params.append("vintage_start_year")
all_params.append("vintage_end_year")

for key, val in six.iteritems(local_var_params["kwargs"]):
if key not in all_params:
Expand Down Expand Up @@ -399,6 +403,8 @@ def create_bitcoin_estimate_with_http_info(
all_params.append("origin_postal_code")
all_params.append("truck_weight_t")
all_params.append("vessel_imo")
all_params.append("vintage_start_year")
all_params.append("vintage_end_year")

for key, val in six.iteritems(local_var_params["kwargs"]):
if key not in all_params:
Expand Down Expand Up @@ -598,6 +604,8 @@ def create_ecommerce_estimate_with_http_info(
all_params.append("origin_postal_code")
all_params.append("truck_weight_t")
all_params.append("vessel_imo")
all_params.append("vintage_start_year")
all_params.append("vintage_end_year")

for key, val in six.iteritems(local_var_params["kwargs"]):
if key not in all_params:
Expand Down Expand Up @@ -794,6 +802,8 @@ def create_ethereum_estimate_with_http_info(
all_params.append("origin_postal_code")
all_params.append("truck_weight_t")
all_params.append("vessel_imo")
all_params.append("vintage_start_year")
all_params.append("vintage_end_year")

for key, val in six.iteritems(local_var_params["kwargs"]):
if key not in all_params:
Expand Down Expand Up @@ -990,6 +1000,8 @@ def create_flight_estimate_with_http_info(
all_params.append("origin_postal_code")
all_params.append("truck_weight_t")
all_params.append("vessel_imo")
all_params.append("vintage_start_year")
all_params.append("vintage_end_year")

for key, val in six.iteritems(local_var_params["kwargs"]):
if key not in all_params:
Expand Down Expand Up @@ -1186,6 +1198,8 @@ def create_hotel_estimate_with_http_info(
all_params.append("origin_postal_code")
all_params.append("truck_weight_t")
all_params.append("vessel_imo")
all_params.append("vintage_start_year")
all_params.append("vintage_end_year")

for key, val in six.iteritems(local_var_params["kwargs"]):
if key not in all_params:
Expand Down Expand Up @@ -1382,6 +1396,8 @@ def create_mass_estimate_with_http_info(
all_params.append("origin_postal_code")
all_params.append("truck_weight_t")
all_params.append("vessel_imo")
all_params.append("vintage_start_year")
all_params.append("vintage_end_year")

for key, val in six.iteritems(local_var_params["kwargs"]):
if key not in all_params:
Expand Down Expand Up @@ -1581,6 +1597,8 @@ def create_rail_shipping_estimate_with_http_info(
all_params.append("origin_postal_code")
all_params.append("truck_weight_t")
all_params.append("vessel_imo")
all_params.append("vintage_start_year")
all_params.append("vintage_end_year")

for key, val in six.iteritems(local_var_params["kwargs"]):
if key not in all_params:
Expand Down Expand Up @@ -1780,6 +1798,8 @@ def create_road_shipping_estimate_with_http_info(
all_params.append("origin_postal_code")
all_params.append("truck_weight_t")
all_params.append("vessel_imo")
all_params.append("vintage_start_year")
all_params.append("vintage_end_year")

for key, val in six.iteritems(local_var_params["kwargs"]):
if key not in all_params:
Expand Down Expand Up @@ -1979,6 +1999,8 @@ def create_sea_shipping_estimate_with_http_info(
all_params.append("origin_postal_code")
all_params.append("truck_weight_t")
all_params.append("vessel_imo")
all_params.append("vintage_start_year")
all_params.append("vintage_end_year")

for key, val in six.iteritems(local_var_params["kwargs"]):
if key not in all_params:
Expand Down Expand Up @@ -2175,6 +2197,8 @@ def create_shipping_estimate_with_http_info(
all_params.append("origin_postal_code")
all_params.append("truck_weight_t")
all_params.append("vessel_imo")
all_params.append("vintage_start_year")
all_params.append("vintage_end_year")

for key, val in six.iteritems(local_var_params["kwargs"]):
if key not in all_params:
Expand Down Expand Up @@ -2371,6 +2395,8 @@ def create_vehicle_estimate_with_http_info(
all_params.append("origin_postal_code")
all_params.append("truck_weight_t")
all_params.append("vessel_imo")
all_params.append("vintage_start_year")
all_params.append("vintage_end_year")

for key, val in six.iteritems(local_var_params["kwargs"]):
if key not in all_params:
Expand Down Expand Up @@ -2561,6 +2587,8 @@ def retrieve_estimate_with_http_info(self, id, **kwargs): # noqa: E501
all_params.append("origin_postal_code")
all_params.append("truck_weight_t")
all_params.append("vessel_imo")
all_params.append("vintage_start_year")
all_params.append("vintage_end_year")

for key, val in six.iteritems(local_var_params["kwargs"]):
if key not in all_params:
Expand Down Expand Up @@ -2741,6 +2769,8 @@ def retrieve_estimates_with_http_info(self, **kwargs): # noqa: E501
all_params.append("origin_postal_code")
all_params.append("truck_weight_t")
all_params.append("vessel_imo")
all_params.append("vintage_start_year")
all_params.append("vintage_end_year")

for key, val in six.iteritems(local_var_params["kwargs"]):
if key not in all_params:
Expand Down
8 changes: 8 additions & 0 deletions patch_api/api/order_line_items_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ class OrderLineItemsApi(object):
"origin_postal_code",
"truck_weight_t",
"vessel_imo",
"vintage_start_year",
"vintage_end_year",
]

def __init__(self, api_client=None):
Expand Down Expand Up @@ -206,6 +208,8 @@ def create_order_line_item_with_http_info(
all_params.append("origin_postal_code")
all_params.append("truck_weight_t")
all_params.append("vessel_imo")
all_params.append("vintage_start_year")
all_params.append("vintage_end_year")

for key, val in six.iteritems(local_var_params["kwargs"]):
if key not in all_params:
Expand Down Expand Up @@ -411,6 +415,8 @@ def delete_order_line_item_with_http_info(
all_params.append("origin_postal_code")
all_params.append("truck_weight_t")
all_params.append("vessel_imo")
all_params.append("vintage_start_year")
all_params.append("vintage_end_year")

for key, val in six.iteritems(local_var_params["kwargs"]):
if key not in all_params:
Expand Down Expand Up @@ -618,6 +624,8 @@ def update_order_line_item_with_http_info(
all_params.append("origin_postal_code")
all_params.append("truck_weight_t")
all_params.append("vessel_imo")
all_params.append("vintage_start_year")
all_params.append("vintage_end_year")

for key, val in six.iteritems(local_var_params["kwargs"]):
if key not in all_params:
Expand Down
14 changes: 14 additions & 0 deletions patch_api/api/orders_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ class OrdersApi(object):
"origin_postal_code",
"truck_weight_t",
"vessel_imo",
"vintage_start_year",
"vintage_end_year",
]

def __init__(self, api_client=None):
Expand Down Expand Up @@ -194,6 +196,8 @@ def cancel_order_with_http_info(self, id, **kwargs): # noqa: E501
all_params.append("origin_postal_code")
all_params.append("truck_weight_t")
all_params.append("vessel_imo")
all_params.append("vintage_start_year")
all_params.append("vintage_end_year")

for key, val in six.iteritems(local_var_params["kwargs"]):
if key not in all_params:
Expand Down Expand Up @@ -376,6 +380,8 @@ def create_order_with_http_info(self, create_order_request, **kwargs): # noqa:
all_params.append("origin_postal_code")
all_params.append("truck_weight_t")
all_params.append("vessel_imo")
all_params.append("vintage_start_year")
all_params.append("vintage_end_year")

for key, val in six.iteritems(local_var_params["kwargs"]):
if key not in all_params:
Expand Down Expand Up @@ -566,6 +572,8 @@ def delete_order_with_http_info(self, uid, **kwargs): # noqa: E501
all_params.append("origin_postal_code")
all_params.append("truck_weight_t")
all_params.append("vessel_imo")
all_params.append("vintage_start_year")
all_params.append("vintage_end_year")

for key, val in six.iteritems(local_var_params["kwargs"]):
if key not in all_params:
Expand Down Expand Up @@ -748,6 +756,8 @@ def place_order_with_http_info(self, id, **kwargs): # noqa: E501
all_params.append("origin_postal_code")
all_params.append("truck_weight_t")
all_params.append("vessel_imo")
all_params.append("vintage_start_year")
all_params.append("vintage_end_year")

for key, val in six.iteritems(local_var_params["kwargs"]):
if key not in all_params:
Expand Down Expand Up @@ -937,6 +947,8 @@ def retrieve_order_with_http_info(self, id, **kwargs): # noqa: E501
all_params.append("origin_postal_code")
all_params.append("truck_weight_t")
all_params.append("vessel_imo")
all_params.append("vintage_start_year")
all_params.append("vintage_end_year")

for key, val in six.iteritems(local_var_params["kwargs"]):
if key not in all_params:
Expand Down Expand Up @@ -1129,6 +1141,8 @@ def retrieve_orders_with_http_info(self, **kwargs): # noqa: E501
all_params.append("origin_postal_code")
all_params.append("truck_weight_t")
all_params.append("vessel_imo")
all_params.append("vintage_start_year")
all_params.append("vintage_end_year")

for key, val in six.iteritems(local_var_params["kwargs"]):
if key not in all_params:
Expand Down
6 changes: 6 additions & 0 deletions patch_api/api/projects_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ class ProjectsApi(object):
"origin_postal_code",
"truck_weight_t",
"vessel_imo",
"vintage_start_year",
"vintage_end_year",
]

def __init__(self, api_client=None):
Expand Down Expand Up @@ -196,6 +198,8 @@ def retrieve_project_with_http_info(self, id, **kwargs): # noqa: E501
all_params.append("origin_postal_code")
all_params.append("truck_weight_t")
all_params.append("vessel_imo")
all_params.append("vintage_start_year")
all_params.append("vintage_end_year")

for key, val in six.iteritems(local_var_params["kwargs"]):
if key not in all_params:
Expand Down Expand Up @@ -395,6 +399,8 @@ def retrieve_projects_with_http_info(self, **kwargs): # noqa: E501
all_params.append("origin_postal_code")
all_params.append("truck_weight_t")
all_params.append("vessel_imo")
all_params.append("vintage_start_year")
all_params.append("vintage_end_year")

for key, val in six.iteritems(local_var_params["kwargs"]):
if key not in all_params:
Expand Down
4 changes: 4 additions & 0 deletions patch_api/api/technology_types_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ class TechnologyTypesApi(object):
"origin_postal_code",
"truck_weight_t",
"vessel_imo",
"vintage_start_year",
"vintage_end_year",
]

def __init__(self, api_client=None):
Expand Down Expand Up @@ -192,6 +194,8 @@ def retrieve_technology_types_with_http_info(self, **kwargs): # noqa: E501
all_params.append("origin_postal_code")
all_params.append("truck_weight_t")
all_params.append("vessel_imo")
all_params.append("vintage_start_year")
all_params.append("vintage_end_year")

for key, val in six.iteritems(local_var_params["kwargs"]):
if key not in all_params:
Expand Down
3 changes: 1 addition & 2 deletions patch_api/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def __init__(
self.default_headers[header_name] = header_value
self.cookie = cookie
# Set default User-Agent.
self.user_agent = "patch-python/2.0.0"
self.user_agent = "patch-python/2.1.0"
# Set default Patch-Version
self.patch_version = 2

Expand Down Expand Up @@ -163,7 +163,6 @@ def __call_api(
_request_timeout=None,
_host=None,
):

config = self.configuration

# header parameters
Expand Down
2 changes: 1 addition & 1 deletion patch_api/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ def to_debug_report(self):
"OS: {env}\n"
"Python Version: {pyversion}\n"
"Version of the API: 2\n"
"SDK Package Version: 2.0.0".format(env=sys.platform, pyversion=sys.version)
"SDK Package Version: 2.1.0".format(env=sys.platform, pyversion=sys.version)
)

def get_host_settings(self):
Expand Down
4 changes: 2 additions & 2 deletions patch_api/models/create_mass_estimate_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ def mass_g(self, mass_g):
if (
self.local_vars_configuration.client_side_validation
and mass_g is not None
and mass_g > 100000000000
and mass_g > 100000000000000
): # noqa: E501
raise ValueError(
"Invalid value for `mass_g`, must be a value less than or equal to `100000000000`"
"Invalid value for `mass_g`, must be a value less than or equal to `100000000000000`"
) # noqa: E501
if (
self.local_vars_configuration.client_side_validation
Expand Down
Loading

0 comments on commit cf49ec7

Please sign in to comment.