From a7ac4ac12cd0dc67bc11ac595c36638eff4a6c23 Mon Sep 17 00:00:00 2001 From: Lovisa Svallingson Date: Thu, 4 Feb 2021 18:19:10 -0700 Subject: [PATCH 1/5] Add tests and code for Flight estimate --- Makefile | 4 +- patch_api/api/estimates_api.py | 163 ++++++++++++++++++++++++++++++- patch_api/api/orders_api.py | 31 +++++- patch_api/api/preferences_api.py | 27 ++++- patch_api/api/projects_api.py | 19 +++- patch_api/models/estimate.py | 39 +++++++- requirements.txt | 2 +- setup.py | 10 +- test/test_estimates_api.py | 13 +++ test/test_projects_api.py | 2 +- 10 files changed, 295 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index fc29b0b..1cebf71 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ SHELL = /bin/bash build: - pip install -r requirements.txt \ + pip install -r requirements.txt && \ python setup.py install lint: @@ -12,4 +12,4 @@ test: pip install -r requirements.txt && \ python -m unittest discover test/ -.PHONY: build test lint publish +.PHONY: build lint test diff --git a/patch_api/api/estimates_api.py b/patch_api/api/estimates_api.py index 07f42ac..e17c204 100644 --- a/patch_api/api/estimates_api.py +++ b/patch_api/api/estimates_api.py @@ -28,11 +28,160 @@ class EstimatesApi(object): Do not edit the class manually. """ - ALLOWED_QUERY_PARAMS = ["mass_g", "price_cents_usd", "project_id", "page"] + ALLOWED_QUERY_PARAMS = [ + "mass_g", + "price_cents_usd", + "project_id", + "page", + "distance_m", + "transportation_method", + "package_weight_g", + "create_order", + ] def __init__(self, api_client=None): self.api_client = api_client + def create_flight_estimate( + self, create_flight_estimate_request={}, **kwargs + ): # noqa: E501 + """Create a flight estimate given the distance traveled in meters # noqa: E501 + + Creates a flight estimate for the amount of CO2 to be compensated. An order in the `draft` state may be created based on the parameters, linked to the estimate. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_flight_estimate(create_flight_estimate_request, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param CreateFlightEstimateRequest create_flight_estimate_request: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: EstimateResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs["_return_http_data_only"] = True + return self.create_flight_estimate_with_http_info( + create_flight_estimate_request, **kwargs + ) # noqa: E501 + + def create_flight_estimate_with_http_info( + self, create_flight_estimate_request, **kwargs + ): # noqa: E501 + """Create a flight estimate given the distance traveled in meters # noqa: E501 + + Creates a flight estimate for the amount of CO2 to be compensated. An order in the `draft` state may be created based on the parameters, linked to the estimate. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_flight_estimate_with_http_info(create_flight_estimate_request, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param CreateFlightEstimateRequest create_flight_estimate_request: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: tuple(EstimateResponse, status_code(int), headers(HTTPHeaderDict)) + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ["create_flight_estimate_request"] # noqa: E501 + all_params.append("async_req") + all_params.append("_return_http_data_only") + all_params.append("_preload_content") + all_params.append("_request_timeout") + all_params.append("mass_g") + all_params.append("price_cents_usd") + all_params.append("project_id") + all_params.append("metadata") + all_params.append("distance_m") + all_params.append("transportation_method") + all_params.append("package_weight_g") + all_params.append("create_order") + + for key, val in six.iteritems(local_var_params["kwargs"]): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_flight_estimate" % key + ) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'create_flight_estimate_request' is set + if ( + "create_flight_estimate_request" not in local_var_params + or local_var_params["create_flight_estimate_request"] is None + ): + raise ApiValueError( + "Missing the required parameter `create_flight_estimate_request` when calling `create_flight_estimate`" + ) # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + for key in kwargs: + query_params.append([key, kwargs.get(key)]) + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if "create_flight_estimate_request" in local_var_params: + body_params = local_var_params["create_flight_estimate_request"] + # HTTP header `Accept` + header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # noqa: E501 + + # HTTP header `Content-Type` + header_params[ + "Content-Type" + ] = self.api_client.select_header_content_type( # noqa: E501 + ["application/json"] + ) # noqa: E501 + + # Authentication setting + auth_settings = ["bearer_auth"] # noqa: E501 + + return self.api_client.call_api( + "/v1/estimates/flight", + "POST", + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type="EstimateResponse", # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get("async_req"), + _return_http_data_only=local_var_params.get( + "_return_http_data_only" + ), # noqa: E501 + _preload_content=local_var_params.get("_preload_content", True), + _request_timeout=local_var_params.get("_request_timeout"), + collection_formats=collection_formats, + ) + def create_mass_estimate( self, create_mass_estimate_request={}, **kwargs ): # noqa: E501 @@ -100,6 +249,10 @@ def create_mass_estimate_with_http_info( all_params.append("price_cents_usd") all_params.append("project_id") all_params.append("metadata") + all_params.append("distance_m") + all_params.append("transportation_method") + all_params.append("package_weight_g") + all_params.append("create_order") for key, val in six.iteritems(local_var_params["kwargs"]): if key not in all_params: @@ -230,6 +383,10 @@ def retrieve_estimate_with_http_info(self, id, **kwargs): # noqa: E501 all_params.append("price_cents_usd") all_params.append("project_id") all_params.append("metadata") + all_params.append("distance_m") + all_params.append("transportation_method") + all_params.append("package_weight_g") + all_params.append("create_order") for key, val in six.iteritems(local_var_params["kwargs"]): if key not in all_params: @@ -350,6 +507,10 @@ def retrieve_estimates_with_http_info(self, **kwargs): # noqa: E501 all_params.append("price_cents_usd") all_params.append("project_id") all_params.append("metadata") + all_params.append("distance_m") + all_params.append("transportation_method") + all_params.append("package_weight_g") + all_params.append("create_order") for key, val in six.iteritems(local_var_params["kwargs"]): if key not in all_params: diff --git a/patch_api/api/orders_api.py b/patch_api/api/orders_api.py index 6e22be6..ae76ec2 100644 --- a/patch_api/api/orders_api.py +++ b/patch_api/api/orders_api.py @@ -28,7 +28,16 @@ class OrdersApi(object): Do not edit the class manually. """ - ALLOWED_QUERY_PARAMS = ["mass_g", "price_cents_usd", "project_id", "page"] + ALLOWED_QUERY_PARAMS = [ + "mass_g", + "price_cents_usd", + "project_id", + "page", + "distance_m", + "transportation_method", + "package_weight_g", + "create_order", + ] def __init__(self, api_client=None): self.api_client = api_client @@ -94,6 +103,10 @@ def cancel_order_with_http_info(self, id, **kwargs): # noqa: E501 all_params.append("price_cents_usd") all_params.append("project_id") all_params.append("metadata") + all_params.append("distance_m") + all_params.append("transportation_method") + all_params.append("package_weight_g") + all_params.append("create_order") for key, val in six.iteritems(local_var_params["kwargs"]): if key not in all_params: @@ -216,6 +229,10 @@ def create_order_with_http_info(self, create_order_request, **kwargs): # noqa: all_params.append("price_cents_usd") all_params.append("project_id") all_params.append("metadata") + all_params.append("distance_m") + all_params.append("transportation_method") + all_params.append("package_weight_g") + all_params.append("create_order") for key, val in six.iteritems(local_var_params["kwargs"]): if key not in all_params: @@ -346,6 +363,10 @@ def place_order_with_http_info(self, id, **kwargs): # noqa: E501 all_params.append("price_cents_usd") all_params.append("project_id") all_params.append("metadata") + all_params.append("distance_m") + all_params.append("transportation_method") + all_params.append("package_weight_g") + all_params.append("create_order") for key, val in six.iteritems(local_var_params["kwargs"]): if key not in all_params: @@ -466,6 +487,10 @@ def retrieve_order_with_http_info(self, id, **kwargs): # noqa: E501 all_params.append("price_cents_usd") all_params.append("project_id") all_params.append("metadata") + all_params.append("distance_m") + all_params.append("transportation_method") + all_params.append("package_weight_g") + all_params.append("create_order") for key, val in six.iteritems(local_var_params["kwargs"]): if key not in all_params: @@ -586,6 +611,10 @@ def retrieve_orders_with_http_info(self, **kwargs): # noqa: E501 all_params.append("price_cents_usd") all_params.append("project_id") all_params.append("metadata") + all_params.append("distance_m") + all_params.append("transportation_method") + all_params.append("package_weight_g") + all_params.append("create_order") for key, val in six.iteritems(local_var_params["kwargs"]): if key not in all_params: diff --git a/patch_api/api/preferences_api.py b/patch_api/api/preferences_api.py index 5efddc3..b1ca855 100644 --- a/patch_api/api/preferences_api.py +++ b/patch_api/api/preferences_api.py @@ -28,7 +28,16 @@ class PreferencesApi(object): Do not edit the class manually. """ - ALLOWED_QUERY_PARAMS = ["mass_g", "price_cents_usd", "project_id", "page"] + ALLOWED_QUERY_PARAMS = [ + "mass_g", + "price_cents_usd", + "project_id", + "page", + "distance_m", + "transportation_method", + "package_weight_g", + "create_order", + ] def __init__(self, api_client=None): self.api_client = api_client @@ -98,6 +107,10 @@ def create_preference_with_http_info( all_params.append("price_cents_usd") all_params.append("project_id") all_params.append("metadata") + all_params.append("distance_m") + all_params.append("transportation_method") + all_params.append("package_weight_g") + all_params.append("create_order") for key, val in six.iteritems(local_var_params["kwargs"]): if key not in all_params: @@ -228,6 +241,10 @@ def delete_preference_with_http_info(self, id, **kwargs): # noqa: E501 all_params.append("price_cents_usd") all_params.append("project_id") all_params.append("metadata") + all_params.append("distance_m") + all_params.append("transportation_method") + all_params.append("package_weight_g") + all_params.append("create_order") for key, val in six.iteritems(local_var_params["kwargs"]): if key not in all_params: @@ -348,6 +365,10 @@ def retrieve_preference_with_http_info(self, id, **kwargs): # noqa: E501 all_params.append("price_cents_usd") all_params.append("project_id") all_params.append("metadata") + all_params.append("distance_m") + all_params.append("transportation_method") + all_params.append("package_weight_g") + all_params.append("create_order") for key, val in six.iteritems(local_var_params["kwargs"]): if key not in all_params: @@ -468,6 +489,10 @@ def retrieve_preferences_with_http_info(self, **kwargs): # noqa: E501 all_params.append("price_cents_usd") all_params.append("project_id") all_params.append("metadata") + all_params.append("distance_m") + all_params.append("transportation_method") + all_params.append("package_weight_g") + all_params.append("create_order") for key, val in six.iteritems(local_var_params["kwargs"]): if key not in all_params: diff --git a/patch_api/api/projects_api.py b/patch_api/api/projects_api.py index 4a6e3fe..68d4bec 100644 --- a/patch_api/api/projects_api.py +++ b/patch_api/api/projects_api.py @@ -28,7 +28,16 @@ class ProjectsApi(object): Do not edit the class manually. """ - ALLOWED_QUERY_PARAMS = ["mass_g", "price_cents_usd", "project_id", "page"] + ALLOWED_QUERY_PARAMS = [ + "mass_g", + "price_cents_usd", + "project_id", + "page", + "distance_m", + "transportation_method", + "package_weight_g", + "create_order", + ] def __init__(self, api_client=None): self.api_client = api_client @@ -94,6 +103,10 @@ def retrieve_project_with_http_info(self, id, **kwargs): # noqa: E501 all_params.append("price_cents_usd") all_params.append("project_id") all_params.append("metadata") + all_params.append("distance_m") + all_params.append("transportation_method") + all_params.append("package_weight_g") + all_params.append("create_order") for key, val in six.iteritems(local_var_params["kwargs"]): if key not in all_params: @@ -214,6 +227,10 @@ def retrieve_projects_with_http_info(self, **kwargs): # noqa: E501 all_params.append("price_cents_usd") all_params.append("project_id") all_params.append("metadata") + all_params.append("distance_m") + all_params.append("transportation_method") + all_params.append("package_weight_g") + all_params.append("create_order") for key, val in six.iteritems(local_var_params["kwargs"]): if key not in all_params: diff --git a/patch_api/models/estimate.py b/patch_api/models/estimate.py index b64185f..906aba7 100644 --- a/patch_api/models/estimate.py +++ b/patch_api/models/estimate.py @@ -33,12 +33,19 @@ class Estimate(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {"id": "str", "production": "bool", "type": "str", "order": "Order"} + openapi_types = { + "id": "str", + "production": "bool", + "type": "str", + "mass_g": "int", + "order": "Order", + } attribute_map = { "id": "id", "production": "production", "type": "type", + "mass_g": "mass_g", "order": "order", } @@ -47,6 +54,7 @@ def __init__( id=None, production=None, type=None, + mass_g=None, order=None, local_vars_configuration=None, ): # noqa: E501 @@ -58,12 +66,14 @@ def __init__( self._id = None self._production = None self._type = None + self._mass_g = None self._order = None self.discriminator = None self.id = id self.production = production self.type = type + self.mass_g = mass_g self.order = order @property @@ -126,7 +136,7 @@ def production(self, production): def type(self): """Gets the type of this Estimate. # noqa: E501 - The type of estimate. Currently mass is the only supported value. # noqa: E501 + The type of estimate. Available types are mass, flight, shipping, and vehicle. # noqa: E501 :return: The type of this Estimate. # noqa: E501 :rtype: str @@ -137,7 +147,7 @@ def type(self): def type(self, type): """Sets the type of this Estimate. - The type of estimate. Currently mass is the only supported value. # noqa: E501 + The type of estimate. Available types are mass, flight, shipping, and vehicle. # noqa: E501 :param type: The type of this Estimate. # noqa: E501 :type: str @@ -151,6 +161,29 @@ def type(self, type): self._type = type + @property + def mass_g(self): + """Gets the mass_g of this Estimate. # noqa: E501 + + The estimated mass in grams for this estimate. # noqa: E501 + + :return: The mass_g of this Estimate. # noqa: E501 + :rtype: int + """ + return self._mass_g + + @mass_g.setter + def mass_g(self, mass_g): + """Sets the mass_g of this Estimate. + + The estimated mass in grams for this estimate. # noqa: E501 + + :param mass_g: The mass_g of this Estimate. # noqa: E501 + :type: int + """ + + self._mass_g = mass_g + @property def order(self): """Gets the order of this Estimate. # noqa: E501 diff --git a/requirements.txt b/requirements.txt index 26e1a7b..186bea6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,4 +3,4 @@ six >= 1.10 python_dateutil >= 2.5.3 setuptools >= 21.0.0 urllib3 >= 1.15.1 -pre-commit >= 2.9.3 +pre-commit >= 2.10.0 diff --git a/setup.py b/setup.py index cff5def..5702b6d 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ from setuptools import setup, find_packages # noqa: H301 NAME = "patch-api" -VERSION = "1.0.1" +VERSION = "1.0.0" # To install the library, run the following # # python setup.py install @@ -20,7 +20,10 @@ # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools -REQUIRES = ["urllib3 >= 1.25.3", "python-dateutil", "certifi"] +REQUIRES = [ + "urllib3 >= 1.25.3", + "python-dateutil", +] setup( name=NAME, @@ -35,7 +38,6 @@ packages=find_packages(exclude=["test", "tests"]), include_package_data=True, long_description="""\ - The core API used to integrate with Patch's service. + The core API used to integrate with Patch's service # noqa: E501 """, - long_description_content_type="text/x-rst", ) diff --git a/test/test_estimates_api.py b/test/test_estimates_api.py index 9e5ffe3..11ca2d2 100644 --- a/test/test_estimates_api.py +++ b/test/test_estimates_api.py @@ -43,6 +43,19 @@ def test_create_and_retrieve_mass_estimate(self): retrieved_estimate = self.api.retrieve_estimate(id=estimate.data.id) self.assertTrue(retrieved_estimate) + def test_create_and_retrieve_flight_estimate(self): + """Test case for create_mass_estimate + + Create an estimate based on mass of CO2 # noqa: E501 + """ + distance_m = 100 + estimate = self.api.create_mass_estimate(distance_m=distance_m) + self.assertTrue(estimate) + self.assertEqual(estimate.data.order.distance_m, distance_m) + + retrieved_estimate = self.api.retrieve_estimate(id=estimate.data.id) + self.assertTrue(retrieved_estimate) + if __name__ == "__main__": unittest.main() diff --git a/test/test_projects_api.py b/test/test_projects_api.py index 4be6581..f4b4379 100644 --- a/test/test_projects_api.py +++ b/test/test_projects_api.py @@ -59,7 +59,7 @@ def test_retrieve_projects(self): self.assertTrue(project.description) self.assertEqual(project.country, "US") self.assertEqual(project.type, "biomass") - self.assertEqual(project.developer, "Carbo Culture Biochar") + self.assertEqual(project.developer, "Carbo Culture") self.assertTrue(isinstance(project.photos, list)) From 0fee7916bc05701d1d77dcb2a96ee9fc7c270df9 Mon Sep 17 00:00:00 2001 From: Lovisa Svallingson Date: Mon, 8 Feb 2021 15:08:54 -0700 Subject: [PATCH 2/5] Add support for Flight/Vehicle/Shipping estimates --- CHANGELOG.md | 7 + README.md | 2 +- patch_api/__init__.py | 2 +- patch_api/api/estimates_api.py | 311 ++++++++++++++++++++++++++++++- patch_api/api/orders_api.py | 30 ++- patch_api/api/preferences_api.py | 25 ++- patch_api/api/projects_api.py | 15 +- patch_api/api_client.py | 2 +- patch_api/configuration.py | 2 +- patch_api/models/estimate.py | 3 +- setup.py | 2 +- test/test_estimates_api.py | 54 +++++- 12 files changed, 424 insertions(+), 31 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b5662c..4c223bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ 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). +## [1.3.5] - 2021-02-08 + +### Added + +- Adds support for creating Shipping/Flight/Vehicle estimates. +- Sets the librayr version to 1.3.5 to track the [Patch Ruby SDK](https://github.com/patch-technology/patch-ruby) and [Patch Node SDK](https://github.com/patch-technology/patch-node). + ## [1.0.1] - 2021-01-22 ### Added diff --git a/README.md b/README.md index bdee7fc..4c41ee4 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ For a complete API reference, check out [Patch's API Reference.](https://docs.us Add the library to your `requirements.txt` file: ```txt -patch_api >= 1.0.1 +patch_api >= 1.3.5 ``` Then run: diff --git a/patch_api/__init__.py b/patch_api/__init__.py index 5cb843d..7bad883 100644 --- a/patch_api/__init__.py +++ b/patch_api/__init__.py @@ -15,7 +15,7 @@ from __future__ import absolute_import -__version__ = "1.0.0" +__version__ = "1.3.5" # import ApiClient from patch_api.api_client import ApiClient diff --git a/patch_api/api/estimates_api.py b/patch_api/api/estimates_api.py index e17c204..2ac3624 100644 --- a/patch_api/api/estimates_api.py +++ b/patch_api/api/estimates_api.py @@ -35,8 +35,11 @@ class EstimatesApi(object): "page", "distance_m", "transportation_method", - "package_weight_g", + "package_mass_g", "create_order", + "model", + "make", + "year", ] def __init__(self, api_client=None): @@ -111,8 +114,11 @@ def create_flight_estimate_with_http_info( all_params.append("metadata") all_params.append("distance_m") all_params.append("transportation_method") - all_params.append("package_weight_g") + all_params.append("package_mass_g") all_params.append("create_order") + all_params.append("make") + all_params.append("model") + all_params.append("year") for key, val in six.iteritems(local_var_params["kwargs"]): if key not in all_params: @@ -251,8 +257,11 @@ def create_mass_estimate_with_http_info( all_params.append("metadata") all_params.append("distance_m") all_params.append("transportation_method") - all_params.append("package_weight_g") + all_params.append("package_mass_g") all_params.append("create_order") + all_params.append("make") + all_params.append("model") + all_params.append("year") for key, val in six.iteritems(local_var_params["kwargs"]): if key not in all_params: @@ -322,6 +331,292 @@ def create_mass_estimate_with_http_info( collection_formats=collection_formats, ) + def create_shipping_estimate( + self, create_shipping_estimate_request={}, **kwargs + ): # noqa: E501 + """Create a shipping estimate given the distance traveled in meters, package weight, and transportation method. # noqa: E501 + + Creates a shipping estimate for the amount of CO2 to be compensated. An order in the `draft` state may be created based on the parameters. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_shipping_estimate(create_shipping_estimate_request, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param CreateShippingEstimateRequest create_shipping_estimate_request: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: EstimateResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs["_return_http_data_only"] = True + return self.create_shipping_estimate_with_http_info( + create_shipping_estimate_request, **kwargs + ) # noqa: E501 + + def create_shipping_estimate_with_http_info( + self, create_shipping_estimate_request, **kwargs + ): # noqa: E501 + """Create a shipping estimate given the distance traveled in meters, package weight, and transportation method. # noqa: E501 + + Creates a shipping estimate for the amount of CO2 to be compensated. An order in the `draft` state may be created based on the parameters. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_shipping_estimate_with_http_info(create_shipping_estimate_request, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param CreateShippingEstimateRequest create_shipping_estimate_request: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: tuple(EstimateResponse, status_code(int), headers(HTTPHeaderDict)) + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ["create_shipping_estimate_request"] # noqa: E501 + all_params.append("async_req") + all_params.append("_return_http_data_only") + all_params.append("_preload_content") + all_params.append("_request_timeout") + all_params.append("mass_g") + all_params.append("price_cents_usd") + all_params.append("project_id") + all_params.append("metadata") + all_params.append("distance_m") + all_params.append("transportation_method") + all_params.append("package_mass_g") + all_params.append("create_order") + all_params.append("make") + all_params.append("model") + all_params.append("year") + + for key, val in six.iteritems(local_var_params["kwargs"]): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_shipping_estimate" % key + ) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'create_shipping_estimate_request' is set + if ( + "create_shipping_estimate_request" not in local_var_params + or local_var_params["create_shipping_estimate_request"] is None + ): + raise ApiValueError( + "Missing the required parameter `create_shipping_estimate_request` when calling `create_shipping_estimate`" + ) # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + for key in kwargs: + query_params.append([key, kwargs.get(key)]) + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if "create_shipping_estimate_request" in local_var_params: + body_params = local_var_params["create_shipping_estimate_request"] + # HTTP header `Accept` + header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # noqa: E501 + + # HTTP header `Content-Type` + header_params[ + "Content-Type" + ] = self.api_client.select_header_content_type( # noqa: E501 + ["application/json"] + ) # noqa: E501 + + # Authentication setting + auth_settings = ["bearer_auth"] # noqa: E501 + + return self.api_client.call_api( + "/v1/estimates/shipping", + "POST", + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type="EstimateResponse", # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get("async_req"), + _return_http_data_only=local_var_params.get( + "_return_http_data_only" + ), # noqa: E501 + _preload_content=local_var_params.get("_preload_content", True), + _request_timeout=local_var_params.get("_request_timeout"), + collection_formats=collection_formats, + ) + + def create_vehicle_estimate( + self, create_vehicle_estimate_request={}, **kwargs + ): # noqa: E501 + """Create a vehicle estimate given the distance traveled in meters and the type of vehicle # noqa: E501 + + Creates an estimate and calculates the amount of CO2 to be compensated depending on the distance and the vehicle. An order in the `draft` state may be created based on the parameters, linked to the estimate. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_vehicle_estimate(create_vehicle_estimate_request, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param CreateVehicleEstimateRequest create_vehicle_estimate_request: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: EstimateResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs["_return_http_data_only"] = True + return self.create_vehicle_estimate_with_http_info( + create_vehicle_estimate_request, **kwargs + ) # noqa: E501 + + def create_vehicle_estimate_with_http_info( + self, create_vehicle_estimate_request, **kwargs + ): # noqa: E501 + """Create a vehicle estimate given the distance traveled in meters and the type of vehicle # noqa: E501 + + Creates an estimate and calculates the amount of CO2 to be compensated depending on the distance and the vehicle. An order in the `draft` state may be created based on the parameters, linked to the estimate. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_vehicle_estimate_with_http_info(create_vehicle_estimate_request, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param CreateVehicleEstimateRequest create_vehicle_estimate_request: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: tuple(EstimateResponse, status_code(int), headers(HTTPHeaderDict)) + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ["create_vehicle_estimate_request"] # noqa: E501 + all_params.append("async_req") + all_params.append("_return_http_data_only") + all_params.append("_preload_content") + all_params.append("_request_timeout") + all_params.append("mass_g") + all_params.append("price_cents_usd") + all_params.append("project_id") + all_params.append("metadata") + all_params.append("distance_m") + all_params.append("transportation_method") + all_params.append("package_mass_g") + all_params.append("create_order") + all_params.append("make") + all_params.append("model") + all_params.append("year") + + for key, val in six.iteritems(local_var_params["kwargs"]): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_vehicle_estimate" % key + ) + local_var_params[key] = val + del local_var_params["kwargs"] + # verify the required parameter 'create_vehicle_estimate_request' is set + if ( + "create_vehicle_estimate_request" not in local_var_params + or local_var_params["create_vehicle_estimate_request"] is None + ): + raise ApiValueError( + "Missing the required parameter `create_vehicle_estimate_request` when calling `create_vehicle_estimate`" + ) # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + for key in kwargs: + query_params.append([key, kwargs.get(key)]) + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if "create_vehicle_estimate_request" in local_var_params: + body_params = local_var_params["create_vehicle_estimate_request"] + # HTTP header `Accept` + header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # noqa: E501 + + # HTTP header `Content-Type` + header_params[ + "Content-Type" + ] = self.api_client.select_header_content_type( # noqa: E501 + ["application/json"] + ) # noqa: E501 + + # Authentication setting + auth_settings = ["bearer_auth"] # noqa: E501 + + return self.api_client.call_api( + "/v1/estimates/vehicle", + "POST", + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type="EstimateResponse", # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get("async_req"), + _return_http_data_only=local_var_params.get( + "_return_http_data_only" + ), # noqa: E501 + _preload_content=local_var_params.get("_preload_content", True), + _request_timeout=local_var_params.get("_request_timeout"), + collection_formats=collection_formats, + ) + def retrieve_estimate(self, id={}, **kwargs): # noqa: E501 """Retrieves an estimate # noqa: E501 @@ -385,8 +680,11 @@ def retrieve_estimate_with_http_info(self, id, **kwargs): # noqa: E501 all_params.append("metadata") all_params.append("distance_m") all_params.append("transportation_method") - all_params.append("package_weight_g") + all_params.append("package_mass_g") all_params.append("create_order") + all_params.append("make") + all_params.append("model") + all_params.append("year") for key, val in six.iteritems(local_var_params["kwargs"]): if key not in all_params: @@ -509,8 +807,11 @@ def retrieve_estimates_with_http_info(self, **kwargs): # noqa: E501 all_params.append("metadata") all_params.append("distance_m") all_params.append("transportation_method") - all_params.append("package_weight_g") + all_params.append("package_mass_g") all_params.append("create_order") + all_params.append("make") + all_params.append("model") + all_params.append("year") for key, val in six.iteritems(local_var_params["kwargs"]): if key not in all_params: diff --git a/patch_api/api/orders_api.py b/patch_api/api/orders_api.py index ae76ec2..015c140 100644 --- a/patch_api/api/orders_api.py +++ b/patch_api/api/orders_api.py @@ -35,8 +35,11 @@ class OrdersApi(object): "page", "distance_m", "transportation_method", - "package_weight_g", + "package_mass_g", "create_order", + "model", + "make", + "year", ] def __init__(self, api_client=None): @@ -105,8 +108,11 @@ def cancel_order_with_http_info(self, id, **kwargs): # noqa: E501 all_params.append("metadata") all_params.append("distance_m") all_params.append("transportation_method") - all_params.append("package_weight_g") + all_params.append("package_mass_g") all_params.append("create_order") + all_params.append("make") + all_params.append("model") + all_params.append("year") for key, val in six.iteritems(local_var_params["kwargs"]): if key not in all_params: @@ -231,8 +237,11 @@ def create_order_with_http_info(self, create_order_request, **kwargs): # noqa: all_params.append("metadata") all_params.append("distance_m") all_params.append("transportation_method") - all_params.append("package_weight_g") + all_params.append("package_mass_g") all_params.append("create_order") + all_params.append("make") + all_params.append("model") + all_params.append("year") for key, val in six.iteritems(local_var_params["kwargs"]): if key not in all_params: @@ -365,8 +374,11 @@ def place_order_with_http_info(self, id, **kwargs): # noqa: E501 all_params.append("metadata") all_params.append("distance_m") all_params.append("transportation_method") - all_params.append("package_weight_g") + all_params.append("package_mass_g") all_params.append("create_order") + all_params.append("make") + all_params.append("model") + all_params.append("year") for key, val in six.iteritems(local_var_params["kwargs"]): if key not in all_params: @@ -489,8 +501,11 @@ def retrieve_order_with_http_info(self, id, **kwargs): # noqa: E501 all_params.append("metadata") all_params.append("distance_m") all_params.append("transportation_method") - all_params.append("package_weight_g") + all_params.append("package_mass_g") all_params.append("create_order") + all_params.append("make") + all_params.append("model") + all_params.append("year") for key, val in six.iteritems(local_var_params["kwargs"]): if key not in all_params: @@ -613,8 +628,11 @@ def retrieve_orders_with_http_info(self, **kwargs): # noqa: E501 all_params.append("metadata") all_params.append("distance_m") all_params.append("transportation_method") - all_params.append("package_weight_g") + all_params.append("package_mass_g") all_params.append("create_order") + all_params.append("make") + all_params.append("model") + all_params.append("year") for key, val in six.iteritems(local_var_params["kwargs"]): if key not in all_params: diff --git a/patch_api/api/preferences_api.py b/patch_api/api/preferences_api.py index b1ca855..fbd78ae 100644 --- a/patch_api/api/preferences_api.py +++ b/patch_api/api/preferences_api.py @@ -35,8 +35,11 @@ class PreferencesApi(object): "page", "distance_m", "transportation_method", - "package_weight_g", + "package_mass_g", "create_order", + "model", + "make", + "year", ] def __init__(self, api_client=None): @@ -109,8 +112,11 @@ def create_preference_with_http_info( all_params.append("metadata") all_params.append("distance_m") all_params.append("transportation_method") - all_params.append("package_weight_g") + all_params.append("package_mass_g") all_params.append("create_order") + all_params.append("make") + all_params.append("model") + all_params.append("year") for key, val in six.iteritems(local_var_params["kwargs"]): if key not in all_params: @@ -243,8 +249,11 @@ def delete_preference_with_http_info(self, id, **kwargs): # noqa: E501 all_params.append("metadata") all_params.append("distance_m") all_params.append("transportation_method") - all_params.append("package_weight_g") + all_params.append("package_mass_g") all_params.append("create_order") + all_params.append("make") + all_params.append("model") + all_params.append("year") for key, val in six.iteritems(local_var_params["kwargs"]): if key not in all_params: @@ -367,8 +376,11 @@ def retrieve_preference_with_http_info(self, id, **kwargs): # noqa: E501 all_params.append("metadata") all_params.append("distance_m") all_params.append("transportation_method") - all_params.append("package_weight_g") + all_params.append("package_mass_g") all_params.append("create_order") + all_params.append("make") + all_params.append("model") + all_params.append("year") for key, val in six.iteritems(local_var_params["kwargs"]): if key not in all_params: @@ -491,8 +503,11 @@ def retrieve_preferences_with_http_info(self, **kwargs): # noqa: E501 all_params.append("metadata") all_params.append("distance_m") all_params.append("transportation_method") - all_params.append("package_weight_g") + all_params.append("package_mass_g") all_params.append("create_order") + all_params.append("make") + all_params.append("model") + all_params.append("year") for key, val in six.iteritems(local_var_params["kwargs"]): if key not in all_params: diff --git a/patch_api/api/projects_api.py b/patch_api/api/projects_api.py index 68d4bec..9497918 100644 --- a/patch_api/api/projects_api.py +++ b/patch_api/api/projects_api.py @@ -35,8 +35,11 @@ class ProjectsApi(object): "page", "distance_m", "transportation_method", - "package_weight_g", + "package_mass_g", "create_order", + "model", + "make", + "year", ] def __init__(self, api_client=None): @@ -105,8 +108,11 @@ def retrieve_project_with_http_info(self, id, **kwargs): # noqa: E501 all_params.append("metadata") all_params.append("distance_m") all_params.append("transportation_method") - all_params.append("package_weight_g") + all_params.append("package_mass_g") all_params.append("create_order") + all_params.append("make") + all_params.append("model") + all_params.append("year") for key, val in six.iteritems(local_var_params["kwargs"]): if key not in all_params: @@ -229,8 +235,11 @@ def retrieve_projects_with_http_info(self, **kwargs): # noqa: E501 all_params.append("metadata") all_params.append("distance_m") all_params.append("transportation_method") - all_params.append("package_weight_g") + all_params.append("package_mass_g") all_params.append("create_order") + all_params.append("make") + all_params.append("model") + all_params.append("year") for key, val in six.iteritems(local_var_params["kwargs"]): if key not in all_params: diff --git a/patch_api/api_client.py b/patch_api/api_client.py index d57c691..6018db5 100644 --- a/patch_api/api_client.py +++ b/patch_api/api_client.py @@ -91,7 +91,7 @@ def __init__( self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = "OpenAPI-Generator/1.0.0/python" + self.user_agent = "OpenAPI-Generator/1.3.5/python" def __del__(self): if self._pool: diff --git a/patch_api/configuration.py b/patch_api/configuration.py index 4da45bf..165441f 100644 --- a/patch_api/configuration.py +++ b/patch_api/configuration.py @@ -341,7 +341,7 @@ def to_debug_report(self): "OS: {env}\n" "Python Version: {pyversion}\n" "Version of the API: v1\n" - "SDK Package Version: 1.0.0".format(env=sys.platform, pyversion=sys.version) + "SDK Package Version: 1.3.5".format(env=sys.platform, pyversion=sys.version) ) def get_host_settings(self): diff --git a/patch_api/models/estimate.py b/patch_api/models/estimate.py index 906aba7..e767292 100644 --- a/patch_api/models/estimate.py +++ b/patch_api/models/estimate.py @@ -73,7 +73,8 @@ def __init__( self.id = id self.production = production self.type = type - self.mass_g = mass_g + if mass_g is not None: + self.mass_g = mass_g self.order = order @property diff --git a/setup.py b/setup.py index 5702b6d..2a5bd4f 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ from setuptools import setup, find_packages # noqa: H301 NAME = "patch-api" -VERSION = "1.0.0" +VERSION = "1.3.5" # To install the library, run the following # # python setup.py install diff --git a/test/test_estimates_api.py b/test/test_estimates_api.py index 11ca2d2..1480c64 100644 --- a/test/test_estimates_api.py +++ b/test/test_estimates_api.py @@ -44,14 +44,56 @@ def test_create_and_retrieve_mass_estimate(self): self.assertTrue(retrieved_estimate) def test_create_and_retrieve_flight_estimate(self): - """Test case for create_mass_estimate + """Test case for create_flight_estimate - Create an estimate based on mass of CO2 # noqa: E501 + Create an estimate based on the distance in meters flown by an airplane # noqa: E501 """ - distance_m = 100 - estimate = self.api.create_mass_estimate(distance_m=distance_m) - self.assertTrue(estimate) - self.assertEqual(estimate.data.order.distance_m, distance_m) + distance_m = 10000000 + estimate = self.api.create_flight_estimate( + distance_m=distance_m, create_order=True + ) + self.assertEqual(estimate.data.type, "flight") + self.assertEqual(estimate.data.order.mass_g, 1032000) + self.assertEqual(estimate.data.mass_g, 1032000) + + retrieved_estimate = self.api.retrieve_estimate(id=estimate.data.id) + self.assertTrue(retrieved_estimate) + + def test_create_and_retrieve_shipping_estimate(self): + """Test case for create_shipping_estimate + + Create an estimate based on the shipping distance, transportation method, and package mass # noqa: E501 + """ + distance_m = 10000000 + package_mass_g = 1000 + transportation_method = "sea" + estimate = self.api.create_shipping_estimate( + distance_m=distance_m, + package_mass_g=package_mass_g, + transportation_method=transportation_method, + create_order=False, + ) + self.assertEqual(estimate.data.order, None) + self.assertEqual(estimate.data.type, "shipping") + self.assertEqual(estimate.data.mass_g, 373) + + retrieved_estimate = self.api.retrieve_estimate(id=estimate.data.id) + self.assertTrue(retrieved_estimate) + + def test_create_and_retrieve_vehicle_estimate(self): + """Test case for create_vehicle_estimate + + Create an estimate based on the vehicle distance, transportation method, and package mass # noqa: E501 + """ + distance_m = 10000000 + make = "Toyota" + model = "Corolla" + year = 1995 + estimate = self.api.create_vehicle_estimate( + distance_m=distance_m, model=model, make=make, year=year + ) + self.assertEqual(estimate.data.type, "vehicle") + self.assertEqual(estimate.data.mass_g, 5719674) retrieved_estimate = self.api.retrieve_estimate(id=estimate.data.id) self.assertTrue(retrieved_estimate) From c6d8ba8d0d4ef376a5dd3cb6682ed1892ec4317e Mon Sep 17 00:00:00 2001 From: Lovisa Svallingson Date: Mon, 8 Feb 2021 15:21:38 -0700 Subject: [PATCH 3/5] Add readme examples --- README.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4c41ee4..13b1cc2 100644 --- a/README.md +++ b/README.md @@ -105,7 +105,6 @@ import patch_api patch = patch_api.ApiClient(api_key=os.environ.get('SANDBOX_API_KEY')) # Create an estimate - mass_g = 1_000_000 # Pass in the mass in grams (i.e. 1 metric tonne) patch.estimates.create_estimate(mass_g=mass_g) @@ -113,6 +112,23 @@ patch.estimates.create_estimate(mass_g=mass_g) project_id = 'pro_test_1234' # Pass in the project's ID patch.estimates.create_estimate(mass_g=mass_g, project_id=project_id) +# Create a flight estimate +distance_m = 1_000_000 # Pass in the distance traveled in meters +patch.estimates.create_estimate(distance_m=distance_m) + +# Create a shipping estimate +distance_m = 1_000_000 # Pass in the distance traveled in meters +transportation_method = "rail" +package_mass_g = 5000 +patch.estimates.create_estimate(distance_m=distance_m, transportation_method=transportation_method, package_mass_g=package_mass_g) + +# Create a vehicle estimate +distance_m = 1_000_000 # Pass in the distance traveled in meters +make = "Toyota" +model = "Corolla" +year = 1995 +patch.estimates.create_estimate(distance_m=distance_m, make=make, model=model, year=year) + # Retrieve an estimate estimate_id = 'est_test_1234' patch.estimates.retrieve_estimate(id=estimate_id) From 250ca2a41cd0604c408c448ec6d78228e88f2721 Mon Sep 17 00:00:00 2001 From: Lovisa Svallingson Date: Mon, 8 Feb 2021 15:53:55 -0700 Subject: [PATCH 4/5] 1.3.0 --- CHANGELOG.md | 2 +- README.md | 2 +- patch_api/__init__.py | 2 +- patch_api/api_client.py | 2 +- patch_api/configuration.py | 2 +- setup.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c223bc..3df2dd3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ 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). -## [1.3.5] - 2021-02-08 +## [1.3.0] - 2021-02-08 ### Added diff --git a/README.md b/README.md index 13b1cc2..f5c31b7 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ For a complete API reference, check out [Patch's API Reference.](https://docs.us Add the library to your `requirements.txt` file: ```txt -patch_api >= 1.3.5 +patch_api >= 1.3.0 ``` Then run: diff --git a/patch_api/__init__.py b/patch_api/__init__.py index 7bad883..186e10c 100644 --- a/patch_api/__init__.py +++ b/patch_api/__init__.py @@ -15,7 +15,7 @@ from __future__ import absolute_import -__version__ = "1.3.5" +__version__ = "1.3.0" # import ApiClient from patch_api.api_client import ApiClient diff --git a/patch_api/api_client.py b/patch_api/api_client.py index 6018db5..1fa730a 100644 --- a/patch_api/api_client.py +++ b/patch_api/api_client.py @@ -91,7 +91,7 @@ def __init__( self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = "OpenAPI-Generator/1.3.5/python" + self.user_agent = "OpenAPI-Generator/1.3.0/python" def __del__(self): if self._pool: diff --git a/patch_api/configuration.py b/patch_api/configuration.py index 165441f..8de8d55 100644 --- a/patch_api/configuration.py +++ b/patch_api/configuration.py @@ -341,7 +341,7 @@ def to_debug_report(self): "OS: {env}\n" "Python Version: {pyversion}\n" "Version of the API: v1\n" - "SDK Package Version: 1.3.5".format(env=sys.platform, pyversion=sys.version) + "SDK Package Version: 1.3.0".format(env=sys.platform, pyversion=sys.version) ) def get_host_settings(self): diff --git a/setup.py b/setup.py index 2a5bd4f..924139e 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ from setuptools import setup, find_packages # noqa: H301 NAME = "patch-api" -VERSION = "1.3.5" +VERSION = "1.3.0" # To install the library, run the following # # python setup.py install From 2b477de70e93f33a51db14ce2283292a0f9a6be1 Mon Sep 17 00:00:00 2001 From: Lovisa Svallingson Date: Tue, 9 Feb 2021 08:22:32 -0700 Subject: [PATCH 5/5] Update CHANGELOG.md Co-authored-by: Thiago Araujo --- CHANGELOG.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3df2dd3..397c077 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Adds support for creating Shipping/Flight/Vehicle estimates. -- Sets the librayr version to 1.3.5 to track the [Patch Ruby SDK](https://github.com/patch-technology/patch-ruby) and [Patch Node SDK](https://github.com/patch-technology/patch-node). +- Sets the library version to 1.3.0 to track the [Patch Ruby SDK](https://github.com/patch-technology/patch-ruby) and [Patch Node SDK](https://github.com/patch-technology/patch-node). ## [1.0.1] - 2021-01-22 @@ -18,4 +18,3 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Pre-release of v1 Library - Adds support for Orders, Estimates, Projects and Preferences -