Skip to content

Fix issue with total_price_cents_usd param in create_order #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Mar 30, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion patch_api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

from __future__ import absolute_import

__version__ = "1.5.1"
__version__ = "1.5.2"

# import ApiClient
from patch_api.api_client import ApiClient
Expand Down
2 changes: 1 addition & 1 deletion patch_api/api/estimates_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class EstimatesApi(object):

ALLOWED_QUERY_PARAMS = [
"mass_g",
"price_cents_usd",
"total_price_cents_usd",
"project_id",
"page",
"distance_m",
Expand Down
2 changes: 1 addition & 1 deletion patch_api/api/orders_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class OrdersApi(object):

ALLOWED_QUERY_PARAMS = [
"mass_g",
"price_cents_usd",
"total_price_cents_usd",
"project_id",
"page",
"distance_m",
Expand Down
2 changes: 1 addition & 1 deletion patch_api/api/preferences_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class PreferencesApi(object):

ALLOWED_QUERY_PARAMS = [
"mass_g",
"price_cents_usd",
"total_price_cents_usd",
"project_id",
"page",
"distance_m",
Expand Down
2 changes: 1 addition & 1 deletion patch_api/api/projects_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ProjectsApi(object):

ALLOWED_QUERY_PARAMS = [
"mass_g",
"price_cents_usd",
"total_price_cents_usd",
"project_id",
"page",
"distance_m",
Expand Down
2 changes: 1 addition & 1 deletion patch_api/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.5.1/python"
self.user_agent = "OpenAPI-Generator/1.5.2/python"

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

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

self._mass_g = mass_g
Expand Down
5 changes: 3 additions & 2 deletions patch_api/models/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ def description(self, description):
def type(self):
"""Gets the type of this Project. # noqa: E501

The type of carbon removal project, currently available project types are Biomass, Dac, Forestry, Mineralization, Ocean, Soil. # noqa: E501
The type of carbon removal project, currently available project types are Biomass, Dac, Forestry, Mineralization, Ocean, Renewables, Soil. # noqa: E501

:return: The type of this Project. # noqa: E501
:rtype: str
Expand All @@ -241,7 +241,7 @@ def type(self):
def type(self, type):
"""Sets the type of this Project.

The type of carbon removal project, currently available project types are Biomass, Dac, Forestry, Mineralization, Ocean, Soil. # noqa: E501
The type of carbon removal project, currently available project types are Biomass, Dac, Forestry, Mineralization, Ocean, Renewables, Soil. # noqa: E501

:param type: The type of this Project. # noqa: E501
:type: str
Expand All @@ -252,6 +252,7 @@ def type(self, type):
"forestry",
"mineralization",
"ocean",
"renewables",
"soil",
] # noqa: E501
if (
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from setuptools import setup, find_packages # noqa: H301

NAME = "patch-api"
VERSION = "1.5.1"
VERSION = "1.5.2"
# To install the library, run the following
#
# python setup.py install
Expand Down
4 changes: 2 additions & 2 deletions test/test_projects_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ def test_retrieve_projects(self):
project = projects[0]

self.assertEqual(project.production, False)
self.assertEqual(project.average_price_per_tonne_cents_usd, 0)
self.assertEqual(project.remaining_mass_g, 0)
self.assertGreater(project.average_price_per_tonne_cents_usd, 0)
self.assertGreater(project.remaining_mass_g, 0)
Comment on lines -55 to +56
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@biglovisa I had to relax this test because we added records to this project on the sandbox.
Generally, I wouldn't want those tests to be too locked in to a specific value.

self.assertEqual(project.standard, None)
self.assertEqual(project.name, "Carbo Culture Biochar")
self.assertTrue(project.description)
Expand Down