From 2d8e47f8ba316d09fd55af9d3af6d027b1af9dd3 Mon Sep 17 00:00:00 2001 From: Paul Cothenet Date: Mon, 6 Dec 2021 16:02:30 -0800 Subject: [PATCH 1/6] Remove preferences --- .flake8 | 2 +- patch_api/__init__.py | 4 +- patch_api/api/__init__.py | 1 - patch_api/api/estimates_api.py | 2 +- patch_api/api/orders_api.py | 2 +- patch_api/api/projects_api.py | 2 +- patch_api/api/technology_types_api.py | 2 +- patch_api/api_client.py | 6 +- patch_api/configuration.py | 10 +-- patch_api/exceptions.py | 2 +- patch_api/models/__init__.py | 5 +- patch_api/models/allocation.py | 2 +- .../models/create_bitcoin_estimate_request.py | 2 +- .../create_ethereum_estimate_request.py | 2 +- .../models/create_flight_estimate_request.py | 2 +- .../models/create_mass_estimate_request.py | 6 +- patch_api/models/create_order_request.py | 6 +- .../create_shipping_estimate_request.py | 2 +- patch_api/models/create_success_response.py | 2 +- .../models/create_vehicle_estimate_request.py | 2 +- patch_api/models/error_response.py | 2 +- patch_api/models/estimate.py | 2 +- patch_api/models/estimate_list_response.py | 2 +- patch_api/models/estimate_response.py | 2 +- patch_api/models/highlight.py | 2 +- patch_api/models/meta_index_object.py | 2 +- patch_api/models/order.py | 6 +- patch_api/models/order_list_response.py | 2 +- patch_api/models/order_response.py | 2 +- patch_api/models/parent_technology_type.py | 2 +- patch_api/models/photo.py | 2 +- patch_api/models/preference.py | 2 +- patch_api/models/project.py | 14 ++-- patch_api/models/project_list_response.py | 2 +- patch_api/models/project_response.py | 2 +- patch_api/models/sdg.py | 2 +- patch_api/models/standard.py | 2 +- patch_api/models/technology_type.py | 2 +- .../models/technology_type_list_response.py | 2 +- patch_api/rest.py | 6 +- setup.py | 6 +- test/test_preferences_api.py | 65 ------------------- 42 files changed, 62 insertions(+), 133 deletions(-) delete mode 100644 test/test_preferences_api.py diff --git a/.flake8 b/.flake8 index c5d27cb..35423b0 100644 --- a/.flake8 +++ b/.flake8 @@ -3,4 +3,4 @@ # W504 is the "line break before binary operator" error and is disabled since we use # the black code formatter. # W503 is disabled by default, but must be disabled explicitly when using `ignore`. -ignore = E501, W503, W504 +ignore = E501, W503, W504, F401 diff --git a/patch_api/__init__.py b/patch_api/__init__.py index aa81188..b19ec24 100644 --- a/patch_api/__init__.py +++ b/patch_api/__init__.py @@ -8,14 +8,14 @@ The core API used to integrate with Patch's service # noqa: E501 The version of the OpenAPI document: v1 - Contact: developers@usepatch.com + Contact: engineering@usepatch.com Generated by: https://openapi-generator.tech """ from __future__ import absolute_import -__version__ = "1.15.2" +__version__ = "1.16.0" # import ApiClient from patch_api.api_client import ApiClient diff --git a/patch_api/api/__init__.py b/patch_api/api/__init__.py index 13a5780..0ceceec 100644 --- a/patch_api/api/__init__.py +++ b/patch_api/api/__init__.py @@ -5,6 +5,5 @@ # import apis into api package from patch_api.api.estimates_api import EstimatesApi from patch_api.api.orders_api import OrdersApi -from patch_api.api.preferences_api import PreferencesApi from patch_api.api.projects_api import ProjectsApi from patch_api.api.technology_types_api import TechnologyTypesApi diff --git a/patch_api/api/estimates_api.py b/patch_api/api/estimates_api.py index 8f42f75..d86a079 100644 --- a/patch_api/api/estimates_api.py +++ b/patch_api/api/estimates_api.py @@ -6,7 +6,7 @@ The core API used to integrate with Patch's service # noqa: E501 The version of the OpenAPI document: v1 - Contact: developers@usepatch.com + Contact: engineering@usepatch.com Generated by: https://openapi-generator.tech """ diff --git a/patch_api/api/orders_api.py b/patch_api/api/orders_api.py index ee20417..8f98721 100644 --- a/patch_api/api/orders_api.py +++ b/patch_api/api/orders_api.py @@ -6,7 +6,7 @@ The core API used to integrate with Patch's service # noqa: E501 The version of the OpenAPI document: v1 - Contact: developers@usepatch.com + Contact: engineering@usepatch.com Generated by: https://openapi-generator.tech """ diff --git a/patch_api/api/projects_api.py b/patch_api/api/projects_api.py index 560e45a..2c97cd8 100644 --- a/patch_api/api/projects_api.py +++ b/patch_api/api/projects_api.py @@ -6,7 +6,7 @@ The core API used to integrate with Patch's service # noqa: E501 The version of the OpenAPI document: v1 - Contact: developers@usepatch.com + Contact: engineering@usepatch.com Generated by: https://openapi-generator.tech """ diff --git a/patch_api/api/technology_types_api.py b/patch_api/api/technology_types_api.py index c34f141..d421cb3 100644 --- a/patch_api/api/technology_types_api.py +++ b/patch_api/api/technology_types_api.py @@ -6,7 +6,7 @@ The core API used to integrate with Patch's service # noqa: E501 The version of the OpenAPI document: v1 - Contact: developers@usepatch.com + Contact: engineering@usepatch.com Generated by: https://openapi-generator.tech """ diff --git a/patch_api/api_client.py b/patch_api/api_client.py index f9850af..900c835 100644 --- a/patch_api/api_client.py +++ b/patch_api/api_client.py @@ -5,7 +5,7 @@ The core API used to integrate with Patch's service # noqa: E501 The version of the OpenAPI document: v1 - Contact: developers@usepatch.com + Contact: engineering@usepatch.com Generated by: https://openapi-generator.tech """ @@ -27,7 +27,6 @@ import patch_api.models from patch_api.api.estimates_api import EstimatesApi from patch_api.api.orders_api import OrdersApi -from patch_api.api.preferences_api import PreferencesApi from patch_api.api.projects_api import ProjectsApi from patch_api.api.technology_types_api import TechnologyTypesApi @@ -92,7 +91,7 @@ def __init__( self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = "patch-python/1.15.2" + self.user_agent = "patch-python/1.16.0" def __del__(self): if self._pool: @@ -104,7 +103,6 @@ def __getattr__(self, method): resource = { "projects": ProjectsApi, "orders": OrdersApi, - "preferences": PreferencesApi, "estimates": EstimatesApi, "technology_types": TechnologyTypesApi, }[method] diff --git a/patch_api/configuration.py b/patch_api/configuration.py index b8f55a1..6f3fe3f 100644 --- a/patch_api/configuration.py +++ b/patch_api/configuration.py @@ -6,7 +6,7 @@ The core API used to integrate with Patch's service # noqa: E501 The version of the OpenAPI document: v1 - Contact: developers@usepatch.com + Contact: engineering@usepatch.com Generated by: https://openapi-generator.tech """ @@ -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.15.2".format( + "SDK Package Version: 1.16.0".format( env=sys.platform, pyversion=sys.version ) ) @@ -353,12 +353,12 @@ def get_host_settings(self): """ return [ { - "url": "https://{defaultHost}", + "url": "{defaultUrl}", "description": "No description provided", "variables": { - "defaultHost": { + "defaultUrl": { "description": "No description provided", - "default_value": "api.patch.io", + "default_value": "https://api.patch.io", } }, } diff --git a/patch_api/exceptions.py b/patch_api/exceptions.py index 64b8229..160fdd9 100644 --- a/patch_api/exceptions.py +++ b/patch_api/exceptions.py @@ -6,7 +6,7 @@ The core API used to integrate with Patch's service # noqa: E501 The version of the OpenAPI document: v1 - Contact: developers@usepatch.com + Contact: engineering@usepatch.com Generated by: https://openapi-generator.tech """ diff --git a/patch_api/models/__init__.py b/patch_api/models/__init__.py index 20091c3..bf6bc90 100644 --- a/patch_api/models/__init__.py +++ b/patch_api/models/__init__.py @@ -7,7 +7,7 @@ The core API used to integrate with Patch's service # noqa: E501 The version of the OpenAPI document: v1 - Contact: developers@usepatch.com + Contact: engineering@usepatch.com Generated by: https://openapi-generator.tech """ @@ -25,7 +25,6 @@ from patch_api.models.create_flight_estimate_request import CreateFlightEstimateRequest from patch_api.models.create_mass_estimate_request import CreateMassEstimateRequest from patch_api.models.create_order_request import CreateOrderRequest -from patch_api.models.create_preference_request import CreatePreferenceRequest from patch_api.models.create_shipping_estimate_request import ( CreateShippingEstimateRequest, ) @@ -45,8 +44,6 @@ from patch_api.models.parent_technology_type import ParentTechnologyType from patch_api.models.photo import Photo from patch_api.models.preference import Preference -from patch_api.models.preference_list_response import PreferenceListResponse -from patch_api.models.preference_response import PreferenceResponse from patch_api.models.project import Project from patch_api.models.project_list_response import ProjectListResponse from patch_api.models.project_response import ProjectResponse diff --git a/patch_api/models/allocation.py b/patch_api/models/allocation.py index b6629ae..dbb5a26 100644 --- a/patch_api/models/allocation.py +++ b/patch_api/models/allocation.py @@ -6,7 +6,7 @@ The core API used to integrate with Patch's service # noqa: E501 The version of the OpenAPI document: v1 - Contact: developers@usepatch.com + Contact: engineering@usepatch.com Generated by: https://openapi-generator.tech """ diff --git a/patch_api/models/create_bitcoin_estimate_request.py b/patch_api/models/create_bitcoin_estimate_request.py index 27e11c9..1ce3ce1 100644 --- a/patch_api/models/create_bitcoin_estimate_request.py +++ b/patch_api/models/create_bitcoin_estimate_request.py @@ -6,7 +6,7 @@ The core API used to integrate with Patch's service # noqa: E501 The version of the OpenAPI document: v1 - Contact: developers@usepatch.com + Contact: engineering@usepatch.com Generated by: https://openapi-generator.tech """ diff --git a/patch_api/models/create_ethereum_estimate_request.py b/patch_api/models/create_ethereum_estimate_request.py index 6405cb8..1743a91 100644 --- a/patch_api/models/create_ethereum_estimate_request.py +++ b/patch_api/models/create_ethereum_estimate_request.py @@ -6,7 +6,7 @@ The core API used to integrate with Patch's service # noqa: E501 The version of the OpenAPI document: v1 - Contact: developers@usepatch.com + Contact: engineering@usepatch.com Generated by: https://openapi-generator.tech """ diff --git a/patch_api/models/create_flight_estimate_request.py b/patch_api/models/create_flight_estimate_request.py index c1e051d..577b885 100644 --- a/patch_api/models/create_flight_estimate_request.py +++ b/patch_api/models/create_flight_estimate_request.py @@ -6,7 +6,7 @@ The core API used to integrate with Patch's service # noqa: E501 The version of the OpenAPI document: v1 - Contact: developers@usepatch.com + Contact: engineering@usepatch.com Generated by: https://openapi-generator.tech """ diff --git a/patch_api/models/create_mass_estimate_request.py b/patch_api/models/create_mass_estimate_request.py index 34c1190..dbc02f4 100644 --- a/patch_api/models/create_mass_estimate_request.py +++ b/patch_api/models/create_mass_estimate_request.py @@ -6,7 +6,7 @@ The core API used to integrate with Patch's service # noqa: E501 The version of the OpenAPI document: v1 - Contact: developers@usepatch.com + Contact: engineering@usepatch.com Generated by: https://openapi-generator.tech """ @@ -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 > 2000000000 + and mass_g > 100000000000 ): # noqa: E501 raise ValueError( - "Invalid value for `mass_g`, must be a value less than or equal to `2000000000`" + "Invalid value for `mass_g`, must be a value less than or equal to `100000000000`" ) # noqa: E501 if ( self.local_vars_configuration.client_side_validation diff --git a/patch_api/models/create_order_request.py b/patch_api/models/create_order_request.py index 098d6e7..1fdf951 100644 --- a/patch_api/models/create_order_request.py +++ b/patch_api/models/create_order_request.py @@ -6,7 +6,7 @@ The core API used to integrate with Patch's service # noqa: E501 The version of the OpenAPI document: v1 - Contact: developers@usepatch.com + Contact: engineering@usepatch.com Generated by: https://openapi-generator.tech """ @@ -96,10 +96,10 @@ def mass_g(self, mass_g): if ( self.local_vars_configuration.client_side_validation and mass_g is not None - and mass_g > 2000000000 + and mass_g > 100000000000 ): # noqa: E501 raise ValueError( - "Invalid value for `mass_g`, must be a value less than or equal to `2000000000`" + "Invalid value for `mass_g`, must be a value less than or equal to `100000000000`" ) # noqa: E501 if ( self.local_vars_configuration.client_side_validation diff --git a/patch_api/models/create_shipping_estimate_request.py b/patch_api/models/create_shipping_estimate_request.py index 818e3b7..3aa586e 100644 --- a/patch_api/models/create_shipping_estimate_request.py +++ b/patch_api/models/create_shipping_estimate_request.py @@ -6,7 +6,7 @@ The core API used to integrate with Patch's service # noqa: E501 The version of the OpenAPI document: v1 - Contact: developers@usepatch.com + Contact: engineering@usepatch.com Generated by: https://openapi-generator.tech """ diff --git a/patch_api/models/create_success_response.py b/patch_api/models/create_success_response.py index 5ba1d0f..088b73e 100644 --- a/patch_api/models/create_success_response.py +++ b/patch_api/models/create_success_response.py @@ -6,7 +6,7 @@ The core API used to integrate with Patch's service # noqa: E501 The version of the OpenAPI document: v1 - Contact: developers@usepatch.com + Contact: engineering@usepatch.com Generated by: https://openapi-generator.tech """ diff --git a/patch_api/models/create_vehicle_estimate_request.py b/patch_api/models/create_vehicle_estimate_request.py index baa2e5b..a2cae0e 100644 --- a/patch_api/models/create_vehicle_estimate_request.py +++ b/patch_api/models/create_vehicle_estimate_request.py @@ -6,7 +6,7 @@ The core API used to integrate with Patch's service # noqa: E501 The version of the OpenAPI document: v1 - Contact: developers@usepatch.com + Contact: engineering@usepatch.com Generated by: https://openapi-generator.tech """ diff --git a/patch_api/models/error_response.py b/patch_api/models/error_response.py index 8303054..15bccfc 100644 --- a/patch_api/models/error_response.py +++ b/patch_api/models/error_response.py @@ -6,7 +6,7 @@ The core API used to integrate with Patch's service # noqa: E501 The version of the OpenAPI document: v1 - Contact: developers@usepatch.com + Contact: engineering@usepatch.com Generated by: https://openapi-generator.tech """ diff --git a/patch_api/models/estimate.py b/patch_api/models/estimate.py index 3792db3..08ced62 100644 --- a/patch_api/models/estimate.py +++ b/patch_api/models/estimate.py @@ -6,7 +6,7 @@ The core API used to integrate with Patch's service # noqa: E501 The version of the OpenAPI document: v1 - Contact: developers@usepatch.com + Contact: engineering@usepatch.com Generated by: https://openapi-generator.tech """ diff --git a/patch_api/models/estimate_list_response.py b/patch_api/models/estimate_list_response.py index ccb0a68..8817c3e 100644 --- a/patch_api/models/estimate_list_response.py +++ b/patch_api/models/estimate_list_response.py @@ -6,7 +6,7 @@ The core API used to integrate with Patch's service # noqa: E501 The version of the OpenAPI document: v1 - Contact: developers@usepatch.com + Contact: engineering@usepatch.com Generated by: https://openapi-generator.tech """ diff --git a/patch_api/models/estimate_response.py b/patch_api/models/estimate_response.py index f15ac7c..a7ec676 100644 --- a/patch_api/models/estimate_response.py +++ b/patch_api/models/estimate_response.py @@ -6,7 +6,7 @@ The core API used to integrate with Patch's service # noqa: E501 The version of the OpenAPI document: v1 - Contact: developers@usepatch.com + Contact: engineering@usepatch.com Generated by: https://openapi-generator.tech """ diff --git a/patch_api/models/highlight.py b/patch_api/models/highlight.py index e4a801d..3d71fcf 100644 --- a/patch_api/models/highlight.py +++ b/patch_api/models/highlight.py @@ -6,7 +6,7 @@ The core API used to integrate with Patch's service # noqa: E501 The version of the OpenAPI document: v1 - Contact: developers@usepatch.com + Contact: engineering@usepatch.com Generated by: https://openapi-generator.tech """ diff --git a/patch_api/models/meta_index_object.py b/patch_api/models/meta_index_object.py index cbc5313..91dde6d 100644 --- a/patch_api/models/meta_index_object.py +++ b/patch_api/models/meta_index_object.py @@ -6,7 +6,7 @@ The core API used to integrate with Patch's service # noqa: E501 The version of the OpenAPI document: v1 - Contact: developers@usepatch.com + Contact: engineering@usepatch.com Generated by: https://openapi-generator.tech """ diff --git a/patch_api/models/order.py b/patch_api/models/order.py index fcf8ed5..6a60e77 100644 --- a/patch_api/models/order.py +++ b/patch_api/models/order.py @@ -6,7 +6,7 @@ The core API used to integrate with Patch's service # noqa: E501 The version of the OpenAPI document: v1 - Contact: developers@usepatch.com + Contact: engineering@usepatch.com Generated by: https://openapi-generator.tech """ @@ -187,10 +187,10 @@ def mass_g(self, mass_g): if ( self.local_vars_configuration.client_side_validation and mass_g is not None - and mass_g > 2000000000 + and mass_g > 100000000000 ): # noqa: E501 raise ValueError( - "Invalid value for `mass_g`, must be a value less than or equal to `2000000000`" + "Invalid value for `mass_g`, must be a value less than or equal to `100000000000`" ) # noqa: E501 if ( self.local_vars_configuration.client_side_validation diff --git a/patch_api/models/order_list_response.py b/patch_api/models/order_list_response.py index a558841..6830ac3 100644 --- a/patch_api/models/order_list_response.py +++ b/patch_api/models/order_list_response.py @@ -6,7 +6,7 @@ The core API used to integrate with Patch's service # noqa: E501 The version of the OpenAPI document: v1 - Contact: developers@usepatch.com + Contact: engineering@usepatch.com Generated by: https://openapi-generator.tech """ diff --git a/patch_api/models/order_response.py b/patch_api/models/order_response.py index 971e9a1..c2478a1 100644 --- a/patch_api/models/order_response.py +++ b/patch_api/models/order_response.py @@ -6,7 +6,7 @@ The core API used to integrate with Patch's service # noqa: E501 The version of the OpenAPI document: v1 - Contact: developers@usepatch.com + Contact: engineering@usepatch.com Generated by: https://openapi-generator.tech """ diff --git a/patch_api/models/parent_technology_type.py b/patch_api/models/parent_technology_type.py index 8b94940..7f049a7 100644 --- a/patch_api/models/parent_technology_type.py +++ b/patch_api/models/parent_technology_type.py @@ -6,7 +6,7 @@ The core API used to integrate with Patch's service # noqa: E501 The version of the OpenAPI document: v1 - Contact: developers@usepatch.com + Contact: engineering@usepatch.com Generated by: https://openapi-generator.tech """ diff --git a/patch_api/models/photo.py b/patch_api/models/photo.py index 65be8bc..f8e684c 100644 --- a/patch_api/models/photo.py +++ b/patch_api/models/photo.py @@ -6,7 +6,7 @@ The core API used to integrate with Patch's service # noqa: E501 The version of the OpenAPI document: v1 - Contact: developers@usepatch.com + Contact: engineering@usepatch.com Generated by: https://openapi-generator.tech """ diff --git a/patch_api/models/preference.py b/patch_api/models/preference.py index ad87aa0..cb158d3 100644 --- a/patch_api/models/preference.py +++ b/patch_api/models/preference.py @@ -6,7 +6,7 @@ The core API used to integrate with Patch's service # noqa: E501 The version of the OpenAPI document: v1 - Contact: developers@usepatch.com + Contact: engineering@usepatch.com Generated by: https://openapi-generator.tech """ diff --git a/patch_api/models/project.py b/patch_api/models/project.py index e1b8b2c..c283939 100644 --- a/patch_api/models/project.py +++ b/patch_api/models/project.py @@ -6,7 +6,7 @@ The core API used to integrate with Patch's service # noqa: E501 The version of the OpenAPI document: v1 - Contact: developers@usepatch.com + Contact: engineering@usepatch.com Generated by: https://openapi-generator.tech """ @@ -539,7 +539,7 @@ def remaining_mass_g(self, remaining_mass_g): def verifier(self): """Gets the verifier of this Project. # noqa: E501 - The name of the project verifier. A verifier is the organization that verifies the calculations of the actual amount of greenhouse gas emissions that have been avoided or sequestered through implementation of the project. # noqa: E501 + The name of the project verifier, when applicable. A verifier is the organization that verifies the calculations of the actual amount of greenhouse gas emissions that have been avoided or sequestered through implementation of the project. # noqa: E501 :return: The verifier of this Project. # noqa: E501 :rtype: str @@ -550,7 +550,7 @@ def verifier(self): def verifier(self, verifier): """Sets the verifier of this Project. - The name of the project verifier. A verifier is the organization that verifies the calculations of the actual amount of greenhouse gas emissions that have been avoided or sequestered through implementation of the project. # noqa: E501 + The name of the project verifier, when applicable. A verifier is the organization that verifies the calculations of the actual amount of greenhouse gas emissions that have been avoided or sequestered through implementation of the project. # noqa: E501 :param verifier: The verifier of this Project. # noqa: E501 :type: str @@ -562,7 +562,7 @@ def verifier(self, verifier): def standard(self): """Gets the standard of this Project. # noqa: E501 - An object returning the Standard associated with this project. Standards provide guidance on GHG quantification, monitoring, and reporting. Standards can include protocols/methodologies and guidance documents. # noqa: E501 + An object returning the Standard associated with this project, when applicable. Standards provide guidance on GHG quantification, monitoring, and reporting. Standards can include protocols/methodologies and guidance documents. # noqa: E501 :return: The standard of this Project. # noqa: E501 :rtype: Standard @@ -573,7 +573,7 @@ def standard(self): def standard(self, standard): """Sets the standard of this Project. - An object returning the Standard associated with this project. Standards provide guidance on GHG quantification, monitoring, and reporting. Standards can include protocols/methodologies and guidance documents. # noqa: E501 + An object returning the Standard associated with this project, when applicable. Standards provide guidance on GHG quantification, monitoring, and reporting. Standards can include protocols/methodologies and guidance documents. # noqa: E501 :param standard: The standard of this Project. # noqa: E501 :type: Standard @@ -659,7 +659,7 @@ def technology_type(self, technology_type): def highlights(self): """Gets the highlights of this Project. # noqa: E501 - An array of objects containing the highlight's slug and title. A highlight's title is a short string that spotlights a characteristic about the project. # noqa: E501 + An array of objects containing the highlight's slug, title, and a URL for the corresponding icon. A highlight's title is a short string that spotlights a characteristic about the project. # noqa: E501 :return: The highlights of this Project. # noqa: E501 :rtype: list[Highlight] @@ -670,7 +670,7 @@ def highlights(self): def highlights(self, highlights): """Sets the highlights of this Project. - An array of objects containing the highlight's slug and title. A highlight's title is a short string that spotlights a characteristic about the project. # noqa: E501 + An array of objects containing the highlight's slug, title, and a URL for the corresponding icon. A highlight's title is a short string that spotlights a characteristic about the project. # noqa: E501 :param highlights: The highlights of this Project. # noqa: E501 :type: list[Highlight] diff --git a/patch_api/models/project_list_response.py b/patch_api/models/project_list_response.py index 466d482..56f4f76 100644 --- a/patch_api/models/project_list_response.py +++ b/patch_api/models/project_list_response.py @@ -6,7 +6,7 @@ The core API used to integrate with Patch's service # noqa: E501 The version of the OpenAPI document: v1 - Contact: developers@usepatch.com + Contact: engineering@usepatch.com Generated by: https://openapi-generator.tech """ diff --git a/patch_api/models/project_response.py b/patch_api/models/project_response.py index 3de074c..f9a620b 100644 --- a/patch_api/models/project_response.py +++ b/patch_api/models/project_response.py @@ -6,7 +6,7 @@ The core API used to integrate with Patch's service # noqa: E501 The version of the OpenAPI document: v1 - Contact: developers@usepatch.com + Contact: engineering@usepatch.com Generated by: https://openapi-generator.tech """ diff --git a/patch_api/models/sdg.py b/patch_api/models/sdg.py index 9c3e143..8731197 100644 --- a/patch_api/models/sdg.py +++ b/patch_api/models/sdg.py @@ -6,7 +6,7 @@ The core API used to integrate with Patch's service # noqa: E501 The version of the OpenAPI document: v1 - Contact: developers@usepatch.com + Contact: engineering@usepatch.com Generated by: https://openapi-generator.tech """ diff --git a/patch_api/models/standard.py b/patch_api/models/standard.py index 40f18a1..33c1501 100644 --- a/patch_api/models/standard.py +++ b/patch_api/models/standard.py @@ -6,7 +6,7 @@ The core API used to integrate with Patch's service # noqa: E501 The version of the OpenAPI document: v1 - Contact: developers@usepatch.com + Contact: engineering@usepatch.com Generated by: https://openapi-generator.tech """ diff --git a/patch_api/models/technology_type.py b/patch_api/models/technology_type.py index 9f59dac..171a8a5 100644 --- a/patch_api/models/technology_type.py +++ b/patch_api/models/technology_type.py @@ -6,7 +6,7 @@ The core API used to integrate with Patch's service # noqa: E501 The version of the OpenAPI document: v1 - Contact: developers@usepatch.com + Contact: engineering@usepatch.com Generated by: https://openapi-generator.tech """ diff --git a/patch_api/models/technology_type_list_response.py b/patch_api/models/technology_type_list_response.py index a6d3d18..bc69867 100644 --- a/patch_api/models/technology_type_list_response.py +++ b/patch_api/models/technology_type_list_response.py @@ -6,7 +6,7 @@ The core API used to integrate with Patch's service # noqa: E501 The version of the OpenAPI document: v1 - Contact: developers@usepatch.com + Contact: engineering@usepatch.com Generated by: https://openapi-generator.tech """ diff --git a/patch_api/rest.py b/patch_api/rest.py index 20090ee..a01a155 100644 --- a/patch_api/rest.py +++ b/patch_api/rest.py @@ -6,7 +6,7 @@ The core API used to integrate with Patch's service # noqa: E501 The version of the OpenAPI document: v1 - Contact: developers@usepatch.com + Contact: engineering@usepatch.com Generated by: https://openapi-generator.tech """ @@ -208,8 +208,8 @@ def request( timeout = None if _request_timeout: if isinstance( - _request_timeout, (int,) if six.PY3 else (int, long) - ): # noqa: E501,F821 + _request_timeout, (int,) if six.PY3 else (int, int) + ): # noqa: E501 timeout = urllib3.Timeout(total=_request_timeout) elif isinstance(_request_timeout, tuple) and len(_request_timeout) == 2: timeout = urllib3.Timeout( diff --git a/setup.py b/setup.py index 016ea3e..5cfb5fd 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ The core API used to integrate with Patch's service # noqa: E501 The version of the OpenAPI document: v1 - Contact: developers@usepatch.com + Contact: engineering@usepatch.com Generated by: https://openapi-generator.tech """ @@ -12,7 +12,7 @@ from setuptools import setup, find_packages # noqa: H301 NAME = "patch-api" -VERSION = "1.15.2" +VERSION = "1.16.0" # To install the library, run the following # # python setup.py install @@ -31,7 +31,7 @@ version=VERSION, description="Patch API V1", author="Developer Support", - author_email="developers@usepatch.com", + author_email="engineering@usepatch.com", url="", keywords=["OpenAPI", "OpenAPI-Generator", "Patch API V1"], python_requires=">=3.6", diff --git a/test/test_preferences_api.py b/test/test_preferences_api.py deleted file mode 100644 index f7b8edf..0000000 --- a/test/test_preferences_api.py +++ /dev/null @@ -1,65 +0,0 @@ -# coding: utf-8 - -""" - Patch API V1 - - The core API used to integrate with Patch's service # noqa: E501 - - The version of the OpenAPI document: v1 - Contact: developers@usepatch.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import os - -from patch_api.api_client import ApiClient - - -class TestPreferencesApi(unittest.TestCase): - """PreferencesApi unit test stubs""" - - def setUp(self): - api_client = ApiClient(api_key=os.environ.get("SANDBOX_API_KEY")) - self.api = api_client.preferences # noqa: E501 - - def tearDown(self): - self.api = None - - def test_retrieve_preferences_and_preference(self): - """Test case for retrieve_preferences and retrieve_preference - - creates a project preference # noqa: E501 - """ - preferences = self.api.retrieve_preferences() - self.assertTrue(isinstance(preferences.data, list)) - - if len(preferences.data) > 0: - preference_id = preferences.data[0].id - preference = self.api.retrieve_preference(id=preference_id).data - - self.assertTrue(preference.allocation_percentage) - self.assertTrue(preference.id) - self.assertTrue(preference.project) - - def test_delete_and_create_preferences(self): - """Test case for create_preference and delete_preference""" - project_id = "pro_test_0de1a59eed9ff8474e09077ddb3714b2" - preferences = self.api.retrieve_preferences() - if len(preferences.data) > 0: - preference_id = preferences.data[0].id - deleted_preference = self.api.delete_preference(id=preference_id) - - self.assertTrue(deleted_preference) - - preference = self.api.create_preference(project_id=project_id).data - self.assertTrue(preference.allocation_percentage) - self.assertTrue(preference.id) - self.assertTrue(preference.project) - - -if __name__ == "__main__": - unittest.main() From 3015e1e29fc9253575e2787e7cc2ec9f7cf53af2 Mon Sep 17 00:00:00 2001 From: Paul Cothenet Date: Mon, 6 Dec 2021 16:56:45 -0800 Subject: [PATCH 2/6] Update changelog --- CHANGELOG.md | 6 + patch_api/models/preference.py | 197 ---------------- patch_api/models/preference_list_response.py | 222 ------------------- patch_api/models/preference_response.py | 178 --------------- 4 files changed, 6 insertions(+), 597 deletions(-) delete mode 100644 patch_api/models/preference.py delete mode 100644 patch_api/models/preference_list_response.py delete mode 100644 patch_api/models/preference_response.py diff --git a/CHANGELOG.md b/CHANGELOG.md index 755bfe0..f63dfe3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ 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.16.0] - 2021-12-07 + +### Removed + +- Removes the `preferences` endpoints (deprecated) + ## [1.15.2] - 2021-11-08 ### Added diff --git a/patch_api/models/preference.py b/patch_api/models/preference.py deleted file mode 100644 index cb158d3..0000000 --- a/patch_api/models/preference.py +++ /dev/null @@ -1,197 +0,0 @@ -# coding: utf-8 - -""" - Patch API V1 - - The core API used to integrate with Patch's service # noqa: E501 - - The version of the OpenAPI document: v1 - Contact: engineering@usepatch.com - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from patch_api.configuration import Configuration - - -class Preference(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_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. - """ - openapi_types = {"id": "str", "allocation_percentage": "int", "project": "Project"} - - attribute_map = { - "id": "id", - "allocation_percentage": "allocation_percentage", - "project": "project", - } - - def __init__( - self, - id=None, - allocation_percentage=None, - project=None, - local_vars_configuration=None, - ): # noqa: E501 - """Preference - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._id = None - self._allocation_percentage = None - self._project = None - self.discriminator = None - - self.id = id - self.allocation_percentage = allocation_percentage - self.project = project - - @property - def id(self): - """Gets the id of this Preference. # noqa: E501 - - A unique uid for the record. UIDs will be prepended by pre_prod or pre_test depending on the mode it was created in. # noqa: E501 - - :return: The id of this Preference. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this Preference. - - A unique uid for the record. UIDs will be prepended by pre_prod or pre_test depending on the mode it was created in. # noqa: E501 - - :param id: The id of this Preference. # noqa: E501 - :type: str - """ - if ( - self.local_vars_configuration.client_side_validation and id is None - ): # noqa: E501 - raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 - - self._id = id - - @property - def allocation_percentage(self): - """Gets the allocation_percentage of this Preference. # noqa: E501 - - Percentage of total purchased offsets that should go to a project. Default is 100%. # noqa: E501 - - :return: The allocation_percentage of this Preference. # noqa: E501 - :rtype: int - """ - return self._allocation_percentage - - @allocation_percentage.setter - def allocation_percentage(self, allocation_percentage): - """Sets the allocation_percentage of this Preference. - - Percentage of total purchased offsets that should go to a project. Default is 100%. # noqa: E501 - - :param allocation_percentage: The allocation_percentage of this Preference. # noqa: E501 - :type: int - """ - if ( - self.local_vars_configuration.client_side_validation - and allocation_percentage is None - ): # noqa: E501 - raise ValueError( - "Invalid value for `allocation_percentage`, must not be `None`" - ) # noqa: E501 - - self._allocation_percentage = allocation_percentage - - @property - def project(self): - """Gets the project of this Preference. # noqa: E501 - - An object returning the Project record this Preference is associated with. See the [Project section](/?id=projects) for the full schema. # noqa: E501 - - :return: The project of this Preference. # noqa: E501 - :rtype: Project - """ - return self._project - - @project.setter - def project(self, project): - """Sets the project of this Preference. - - An object returning the Project record this Preference is associated with. See the [Project section](/?id=projects) for the full schema. # noqa: E501 - - :param project: The project of this Preference. # noqa: E501 - :type: Project - """ - if ( - self.local_vars_configuration.client_side_validation and project is None - ): # noqa: E501 - raise ValueError( - "Invalid value for `project`, must not be `None`" - ) # noqa: E501 - - self._project = project - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, Preference): - 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, Preference): - return True - - return self.to_dict() != other.to_dict() diff --git a/patch_api/models/preference_list_response.py b/patch_api/models/preference_list_response.py deleted file mode 100644 index 0e06bef..0000000 --- a/patch_api/models/preference_list_response.py +++ /dev/null @@ -1,222 +0,0 @@ -# coding: utf-8 - -""" - Patch API V1 - - The core API used to integrate with Patch's service # noqa: E501 - - The version of the OpenAPI document: v1 - Contact: developers@usepatch.com - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from patch_api.configuration import Configuration - - -class PreferenceListResponse(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_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. - """ - openapi_types = { - "success": "bool", - "error": "object", - "data": "list[Preference]", - "meta": "MetaIndexObject", - } - - attribute_map = { - "success": "success", - "error": "error", - "data": "data", - "meta": "meta", - } - - def __init__( - self, - success=None, - error=None, - data=None, - meta=None, - local_vars_configuration=None, - ): # noqa: E501 - """PreferenceListResponse - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._success = None - self._error = None - self._data = None - self._meta = None - self.discriminator = None - - self.success = success - self.error = error - self.data = data - self.meta = meta - - @property - def success(self): - """Gets the success of this PreferenceListResponse. # noqa: E501 - - - :return: The success of this PreferenceListResponse. # noqa: E501 - :rtype: bool - """ - return self._success - - @success.setter - def success(self, success): - """Sets the success of this PreferenceListResponse. - - - :param success: The success of this PreferenceListResponse. # noqa: E501 - :type: bool - """ - if ( - self.local_vars_configuration.client_side_validation and success is None - ): # noqa: E501 - raise ValueError( - "Invalid value for `success`, must not be `None`" - ) # noqa: E501 - - self._success = success - - @property - def error(self): - """Gets the error of this PreferenceListResponse. # noqa: E501 - - - :return: The error of this PreferenceListResponse. # noqa: E501 - :rtype: object - """ - return self._error - - @error.setter - def error(self, error): - """Sets the error of this PreferenceListResponse. - - - :param error: The error of this PreferenceListResponse. # noqa: E501 - :type: object - """ - - self._error = error - - @property - def data(self): - """Gets the data of this PreferenceListResponse. # noqa: E501 - - - :return: The data of this PreferenceListResponse. # noqa: E501 - :rtype: list[Preference] - """ - return self._data - - @data.setter - def data(self, data): - """Sets the data of this PreferenceListResponse. - - - :param data: The data of this PreferenceListResponse. # noqa: E501 - :type: list[Preference] - """ - if ( - self.local_vars_configuration.client_side_validation and data is None - ): # noqa: E501 - raise ValueError( - "Invalid value for `data`, must not be `None`" - ) # noqa: E501 - - self._data = data - - @property - def meta(self): - """Gets the meta of this PreferenceListResponse. # noqa: E501 - - - :return: The meta of this PreferenceListResponse. # noqa: E501 - :rtype: MetaIndexObject - """ - return self._meta - - @meta.setter - def meta(self, meta): - """Sets the meta of this PreferenceListResponse. - - - :param meta: The meta of this PreferenceListResponse. # noqa: E501 - :type: MetaIndexObject - """ - if ( - self.local_vars_configuration.client_side_validation and meta is None - ): # noqa: E501 - raise ValueError( - "Invalid value for `meta`, must not be `None`" - ) # noqa: E501 - - self._meta = meta - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, PreferenceListResponse): - 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, PreferenceListResponse): - return True - - return self.to_dict() != other.to_dict() diff --git a/patch_api/models/preference_response.py b/patch_api/models/preference_response.py deleted file mode 100644 index 73d5fc4..0000000 --- a/patch_api/models/preference_response.py +++ /dev/null @@ -1,178 +0,0 @@ -# coding: utf-8 - -""" - Patch API V1 - - The core API used to integrate with Patch's service # noqa: E501 - - The version of the OpenAPI document: v1 - Contact: developers@usepatch.com - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from patch_api.configuration import Configuration - - -class PreferenceResponse(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_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. - """ - openapi_types = {"success": "bool", "error": "object", "data": "Preference"} - - attribute_map = {"success": "success", "error": "error", "data": "data"} - - def __init__( - self, success=None, error=None, data=None, local_vars_configuration=None - ): # noqa: E501 - """PreferenceResponse - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._success = None - self._error = None - self._data = None - self.discriminator = None - - self.success = success - self.error = error - self.data = data - - @property - def success(self): - """Gets the success of this PreferenceResponse. # noqa: E501 - - - :return: The success of this PreferenceResponse. # noqa: E501 - :rtype: bool - """ - return self._success - - @success.setter - def success(self, success): - """Sets the success of this PreferenceResponse. - - - :param success: The success of this PreferenceResponse. # noqa: E501 - :type: bool - """ - if ( - self.local_vars_configuration.client_side_validation and success is None - ): # noqa: E501 - raise ValueError( - "Invalid value for `success`, must not be `None`" - ) # noqa: E501 - - self._success = success - - @property - def error(self): - """Gets the error of this PreferenceResponse. # noqa: E501 - - - :return: The error of this PreferenceResponse. # noqa: E501 - :rtype: object - """ - return self._error - - @error.setter - def error(self, error): - """Sets the error of this PreferenceResponse. - - - :param error: The error of this PreferenceResponse. # noqa: E501 - :type: object - """ - - self._error = error - - @property - def data(self): - """Gets the data of this PreferenceResponse. # noqa: E501 - - - :return: The data of this PreferenceResponse. # noqa: E501 - :rtype: Preference - """ - return self._data - - @data.setter - def data(self, data): - """Sets the data of this PreferenceResponse. - - - :param data: The data of this PreferenceResponse. # noqa: E501 - :type: Preference - """ - if ( - self.local_vars_configuration.client_side_validation and data is None - ): # noqa: E501 - raise ValueError( - "Invalid value for `data`, must not be `None`" - ) # noqa: E501 - - self._data = data - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, PreferenceResponse): - 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, PreferenceResponse): - return True - - return self.to_dict() != other.to_dict() From 91e958b388fb5d27dd7bfab3b63447d1aab700fa Mon Sep 17 00:00:00 2001 From: Paul Cothenet Date: Mon, 6 Dec 2021 17:06:42 -0800 Subject: [PATCH 3/6] Update changelog --- .flake8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.flake8 b/.flake8 index 35423b0..c5d27cb 100644 --- a/.flake8 +++ b/.flake8 @@ -3,4 +3,4 @@ # W504 is the "line break before binary operator" error and is disabled since we use # the black code formatter. # W503 is disabled by default, but must be disabled explicitly when using `ignore`. -ignore = E501, W503, W504, F401 +ignore = E501, W503, W504 From 5a8834eb4e8b9e69b0178a3199ce75270d2f7f8e Mon Sep 17 00:00:00 2001 From: Paul Cothenet Date: Mon, 6 Dec 2021 17:07:10 -0800 Subject: [PATCH 4/6] Update changelog --- .flake8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.flake8 b/.flake8 index c5d27cb..35423b0 100644 --- a/.flake8 +++ b/.flake8 @@ -3,4 +3,4 @@ # W504 is the "line break before binary operator" error and is disabled since we use # the black code formatter. # W503 is disabled by default, but must be disabled explicitly when using `ignore`. -ignore = E501, W503, W504 +ignore = E501, W503, W504, F401 From 30c8116c0685ccaf88dc618c625d6aa31990c385 Mon Sep 17 00:00:00 2001 From: Paul Cothenet Date: Mon, 6 Dec 2021 17:24:25 -0800 Subject: [PATCH 5/6] Remove model --- patch_api/models/__init__.py | 1 - 1 file changed, 1 deletion(-) diff --git a/patch_api/models/__init__.py b/patch_api/models/__init__.py index bf6bc90..71a1fc4 100644 --- a/patch_api/models/__init__.py +++ b/patch_api/models/__init__.py @@ -43,7 +43,6 @@ from patch_api.models.order_response import OrderResponse from patch_api.models.parent_technology_type import ParentTechnologyType from patch_api.models.photo import Photo -from patch_api.models.preference import Preference from patch_api.models.project import Project from patch_api.models.project_list_response import ProjectListResponse from patch_api.models.project_response import ProjectResponse From 028ca95546ab4fd03ee01cf1359c53e8b201d431 Mon Sep 17 00:00:00 2001 From: Paul Cothenet Date: Mon, 6 Dec 2021 17:47:12 -0800 Subject: [PATCH 6/6] Update readme --- .flake8 | 1 + 1 file changed, 1 insertion(+) diff --git a/.flake8 b/.flake8 index 35423b0..81cdf2c 100644 --- a/.flake8 +++ b/.flake8 @@ -3,4 +3,5 @@ # W504 is the "line break before binary operator" error and is disabled since we use # the black code formatter. # W503 is disabled by default, but must be disabled explicitly when using `ignore`. +# F401 is "unused import", which is hard to fix without modifying the templates ignore = E501, W503, W504, F401