diff --git a/CHANGELOG.md b/CHANGELOG.md index eb62ffe..8caea8c 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.15.1] - 2021-11-04 + +### Added + +- Adds verifier to project responses + ## [1.15.0] - 2021-10-04 ### Added diff --git a/patch_api/__init__.py b/patch_api/__init__.py index f4495a4..8cf429c 100644 --- a/patch_api/__init__.py +++ b/patch_api/__init__.py @@ -15,7 +15,7 @@ from __future__ import absolute_import -__version__ = "1.15.0" +__version__ = "1.15.1" # import ApiClient from patch_api.api_client import ApiClient diff --git a/patch_api/api_client.py b/patch_api/api_client.py index 97c77f8..7607491 100644 --- a/patch_api/api_client.py +++ b/patch_api/api_client.py @@ -92,7 +92,7 @@ def __init__( self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = "patch-python/1.15.0" + self.user_agent = "patch-python/1.15.1" def __del__(self): if self._pool: diff --git a/patch_api/configuration.py b/patch_api/configuration.py index a8b0ed4..f5b53e0 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.15.0".format( + "SDK Package Version: 1.15.1".format( env=sys.platform, pyversion=sys.version ) ) diff --git a/patch_api/models/order.py b/patch_api/models/order.py index f58b162..fcf8ed5 100644 --- a/patch_api/models/order.py +++ b/patch_api/models/order.py @@ -281,7 +281,7 @@ def state(self, state): def allocation_state(self): """Gets the allocation_state of this Order. # noqa: E501 - The current state of the allocated carbon offsets of the order. # noqa: E501 + DEPRECATED. Indicates if the order has been fully allocated to projects. # noqa: E501 :return: The allocation_state of this Order. # noqa: E501 :rtype: str @@ -292,7 +292,7 @@ def allocation_state(self): def allocation_state(self, allocation_state): """Sets the allocation_state of this Order. - The current state of the allocated carbon offsets of the order. # noqa: E501 + DEPRECATED. Indicates if the order has been fully allocated to projects. # noqa: E501 :param allocation_state: The allocation_state of this Order. # noqa: E501 :type: str diff --git a/patch_api/models/project.py b/patch_api/models/project.py index 3a1e68f..eea2f86 100644 --- a/patch_api/models/project.py +++ b/patch_api/models/project.py @@ -48,6 +48,7 @@ class Project(object): "photos": "list[Photo]", "average_price_per_tonne_cents_usd": "int", "remaining_mass_g": "int", + "verifier": "str", "standard": "Standard", "sdgs": "list[Sdg]", "tagline": "str", @@ -69,6 +70,7 @@ class Project(object): "photos": "photos", "average_price_per_tonne_cents_usd": "average_price_per_tonne_cents_usd", "remaining_mass_g": "remaining_mass_g", + "verifier": "verifier", "standard": "standard", "sdgs": "sdgs", "tagline": "tagline", @@ -91,6 +93,7 @@ def __init__( photos=None, average_price_per_tonne_cents_usd=None, remaining_mass_g=None, + verifier=None, standard=None, sdgs=None, tagline=None, @@ -116,6 +119,7 @@ def __init__( self._photos = None self._average_price_per_tonne_cents_usd = None self._remaining_mass_g = None + self._verifier = None self._standard = None self._sdgs = None self._tagline = None @@ -138,6 +142,8 @@ def __init__( self.photos = photos self.average_price_per_tonne_cents_usd = average_price_per_tonne_cents_usd self.remaining_mass_g = remaining_mass_g + if verifier is not None: + self.verifier = verifier self.standard = standard self.sdgs = sdgs if tagline is not None: @@ -524,11 +530,34 @@ def remaining_mass_g(self, remaining_mass_g): self._remaining_mass_g = remaining_mass_g + @property + 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 + + :return: The verifier of this Project. # noqa: E501 + :rtype: str + """ + return self._verifier + + @verifier.setter + 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 + + :param verifier: The verifier of this Project. # noqa: E501 + :type: str + """ + + self._verifier = verifier + @property def standard(self): """Gets the standard of this Project. # noqa: E501 - An object returning the Standard associated with 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 :return: The standard of this Project. # noqa: E501 :rtype: Standard @@ -539,7 +568,7 @@ def standard(self): def standard(self, standard): """Sets the standard of this Project. - An object returning the Standard associated with 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 :param standard: The standard of this Project. # noqa: E501 :type: Standard diff --git a/setup.py b/setup.py index e9c83d0..6c23023 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ from setuptools import setup, find_packages # noqa: H301 NAME = "patch-api" -VERSION = "1.15.0" +VERSION = "1.15.1" # To install the library, run the following # # python setup.py install diff --git a/test/test_projects_api.py b/test/test_projects_api.py index 643f610..e2a4c8a 100644 --- a/test/test_projects_api.py +++ b/test/test_projects_api.py @@ -70,11 +70,11 @@ def test_retrieve_projects(self): self.assertGreater(project.average_price_per_tonne_cents_usd, 0) self.assertGreater(project.remaining_mass_g, 0) self.assertEqual(project.standard, None) - self.assertRegex(project.name, r"Test Offset Project") + self.assertIsInstance(project.name, str) self.assertTrue(project.description) - self.assertEqual(project.country, "US") - self.assertEqual(project.type, "biomass") - self.assertEqual(project.developer, "Patch Sandbox Supplier Test") + self.assertIsInstance(project.country, str) + self.assertIsInstance(project.type, str) + self.assertIsInstance(project.developer, str) self.assertTrue(isinstance(project.photos, list)) def test_retrieve_biomass_projects(self):