Skip to content

Update to 2.1.1 #73

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 1 commit into from
Apr 18, 2023
Merged
Changes from all 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
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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).

## [2.1.1] - 2023-04-18

### Added

- Adds `issuance_type` to `project` responses
- Adds `disclaimers` to `project` responses

## [2.1.0] - 2023-04-04

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

from __future__ import absolute_import

__version__ = "2.1.0"
__version__ = "2.1.1"

# import ApiClient
from patch_api.api_client import ApiClient
2 changes: 1 addition & 1 deletion patch_api/api_client.py
Original file line number Diff line number Diff line change
@@ -92,7 +92,7 @@ def __init__(
self.default_headers[header_name] = header_value
self.cookie = cookie
# Set default User-Agent.
self.user_agent = "patch-python/2.1.0"
self.user_agent = "patch-python/2.1.1"
# Set default Patch-Version
self.patch_version = 2

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

def get_host_settings(self):
1 change: 1 addition & 0 deletions patch_api/models/__init__.py
Original file line number Diff line number Diff line change
@@ -49,6 +49,7 @@
CreateVehicleEstimateRequest,
)
from patch_api.models.delete_order_response import DeleteOrderResponse
from patch_api.models.disclaimer import Disclaimer
from patch_api.models.error_response import ErrorResponse
from patch_api.models.estimate import Estimate
from patch_api.models.estimate_list_response import EstimateListResponse
252 changes: 252 additions & 0 deletions patch_api/models/disclaimer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,252 @@
# coding: utf-8

"""
Patch API V2

The core API used to integrate with Patch's service # noqa: E501

The version of the OpenAPI document: 2
Contact: [email protected]
Generated by: https://openapi-generator.tech
"""


import pprint
import re # noqa: F401

import six

from patch_api.configuration import Configuration


class Disclaimer(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 = {
"body": "str",
"header": "str",
"severity": "str",
"link_text": "str",
"link_destination": "str",
}

attribute_map = {
"body": "body",
"header": "header",
"severity": "severity",
"link_text": "link_text",
"link_destination": "link_destination",
}

def __init__(
self,
body=None,
header=None,
severity=None,
link_text=None,
link_destination=None,
local_vars_configuration=None,
): # noqa: E501
"""Disclaimer - 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._body = None
self._header = None
self._severity = None
self._link_text = None
self._link_destination = None
self.discriminator = None

self.body = body
self.header = header
self.severity = severity
self.link_text = link_text
self.link_destination = link_destination

@property
def body(self):
"""Gets the body of this Disclaimer. # noqa: E501

The body of the disclaimer. # noqa: E501

:return: The body of this Disclaimer. # noqa: E501
:rtype: str
"""
return self._body

@body.setter
def body(self, body):
"""Sets the body of this Disclaimer.

The body of the disclaimer. # noqa: E501

:param body: The body of this Disclaimer. # noqa: E501
:type: str
"""

self._body = body

@property
def header(self):
"""Gets the header of this Disclaimer. # noqa: E501

The header for the disclaimer. # noqa: E501

:return: The header of this Disclaimer. # noqa: E501
:rtype: str
"""
return self._header

@header.setter
def header(self, header):
"""Sets the header of this Disclaimer.

The header for the disclaimer. # noqa: E501

:param header: The header of this Disclaimer. # noqa: E501
:type: str
"""
if (
self.local_vars_configuration.client_side_validation and header is None
): # noqa: E501
raise ValueError(
"Invalid value for `header`, must not be `None`"
) # noqa: E501

self._header = header

@property
def severity(self):
"""Gets the severity of this Disclaimer. # noqa: E501

The severity of the disclaimer. # noqa: E501

:return: The severity of this Disclaimer. # noqa: E501
:rtype: str
"""
return self._severity

@severity.setter
def severity(self, severity):
"""Sets the severity of this Disclaimer.

The severity of the disclaimer. # noqa: E501

:param severity: The severity of this Disclaimer. # noqa: E501
:type: str
"""
if (
self.local_vars_configuration.client_side_validation and severity is None
): # noqa: E501
raise ValueError(
"Invalid value for `severity`, must not be `None`"
) # noqa: E501

self._severity = severity

@property
def link_text(self):
"""Gets the link_text of this Disclaimer. # noqa: E501

The text for the provided link. # noqa: E501

:return: The link_text of this Disclaimer. # noqa: E501
:rtype: str
"""
return self._link_text

@link_text.setter
def link_text(self, link_text):
"""Sets the link_text of this Disclaimer.

The text for the provided link. # noqa: E501

:param link_text: The link_text of this Disclaimer. # noqa: E501
:type: str
"""

self._link_text = link_text

@property
def link_destination(self):
"""Gets the link_destination of this Disclaimer. # noqa: E501

The destination of the provided link. # noqa: E501

:return: The link_destination of this Disclaimer. # noqa: E501
:rtype: str
"""
return self._link_destination

@link_destination.setter
def link_destination(self, link_destination):
"""Sets the link_destination of this Disclaimer.

The destination of the provided link. # noqa: E501

:param link_destination: The link_destination of this Disclaimer. # noqa: E501
:type: str
"""

self._link_destination = link_destination

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, Disclaimer):
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, Disclaimer):
return True

return self.to_dict() != other.to_dict()
4 changes: 2 additions & 2 deletions patch_api/models/order.py
Original file line number Diff line number Diff line change
@@ -410,7 +410,7 @@ def currency(self, currency):
def registry_url(self):
"""Gets the registry_url of this Order. # noqa: E501

The url of this order in the public registry. # noqa: E501
The URL of this order in the public registry. Use this URL to access the order's accompanying certificate. # noqa: E501

:return: The registry_url of this Order. # noqa: E501
:rtype: str
@@ -421,7 +421,7 @@ def registry_url(self):
def registry_url(self, registry_url):
"""Sets the registry_url of this Order.

The url of this order in the public registry. # noqa: E501
The URL of this order in the public registry. Use this URL to access the order's accompanying certificate. # noqa: E501

:param registry_url: The registry_url of this Order. # noqa: E501
:type: str
4 changes: 2 additions & 2 deletions patch_api/models/order_line_item.py
Original file line number Diff line number Diff line change
@@ -183,7 +183,7 @@ def vintage_year(self, vintage_year):
def vintage_start_year(self):
"""Gets the vintage_start_year of this OrderLineItem. # noqa: E501

The starting_year in which the climate impacts of the project occurred, or will occur. # noqa: E501
The starting year in which the climate impacts of the project occurred, or will occur. # noqa: E501

:return: The vintage_start_year of this OrderLineItem. # noqa: E501
:rtype: int
@@ -194,7 +194,7 @@ def vintage_start_year(self):
def vintage_start_year(self, vintage_start_year):
"""Sets the vintage_start_year of this OrderLineItem.

The starting_year in which the climate impacts of the project occurred, or will occur. # noqa: E501
The starting year in which the climate impacts of the project occurred, or will occur. # noqa: E501

:param vintage_start_year: The vintage_start_year of this OrderLineItem. # noqa: E501
:type: int
68 changes: 68 additions & 0 deletions patch_api/models/project.py
Original file line number Diff line number Diff line change
@@ -41,6 +41,7 @@ class Project(object):
"mechanism": "str",
"country": "str",
"state": "str",
"issuance_type": "str",
"latitude": "float",
"longitude": "float",
"project_partner": "str",
@@ -52,6 +53,7 @@ class Project(object):
"technology_type": "TechnologyType",
"highlights": "list[Highlight]",
"inventory": "list[Inventory]",
"disclaimers": "list[Disclaimer]",
}

attribute_map = {
@@ -62,6 +64,7 @@ class Project(object):
"mechanism": "mechanism",
"country": "country",
"state": "state",
"issuance_type": "issuance_type",
"latitude": "latitude",
"longitude": "longitude",
"project_partner": "project_partner",
@@ -73,6 +76,7 @@ class Project(object):
"technology_type": "technology_type",
"highlights": "highlights",
"inventory": "inventory",
"disclaimers": "disclaimers",
}

def __init__(
@@ -84,6 +88,7 @@ def __init__(
mechanism=None,
country=None,
state=None,
issuance_type=None,
latitude=None,
longitude=None,
project_partner=None,
@@ -95,6 +100,7 @@ def __init__(
technology_type=None,
highlights=None,
inventory=None,
disclaimers=None,
local_vars_configuration=None,
): # noqa: E501
"""Project - a model defined in OpenAPI""" # noqa: E501
@@ -109,6 +115,7 @@ def __init__(
self._mechanism = None
self._country = None
self._state = None
self._issuance_type = None
self._latitude = None
self._longitude = None
self._project_partner = None
@@ -120,6 +127,7 @@ def __init__(
self._technology_type = None
self._highlights = None
self._inventory = None
self._disclaimers = None
self.discriminator = None

self.id = id
@@ -130,6 +138,8 @@ def __init__(
self.mechanism = mechanism
self.country = country
self.state = state
if issuance_type is not None:
self.issuance_type = issuance_type
self.latitude = latitude
self.longitude = longitude
self.project_partner = project_partner
@@ -143,6 +153,8 @@ def __init__(
self.technology_type = technology_type
self.highlights = highlights
self.inventory = inventory
if disclaimers is not None:
self.disclaimers = disclaimers

@property
def id(self):
@@ -333,6 +345,39 @@ def state(self, state):

self._state = state

@property
def issuance_type(self):
"""Gets the issuance_type of this Project. # noqa: E501
The issuance type of the project. One of: ex-ante, ex-post. # noqa: E501
:return: The issuance_type of this Project. # noqa: E501
:rtype: str
"""
return self._issuance_type

@issuance_type.setter
def issuance_type(self, issuance_type):
"""Sets the issuance_type of this Project.
The issuance type of the project. One of: ex-ante, ex-post. # noqa: E501
:param issuance_type: The issuance_type of this Project. # noqa: E501
:type: str
"""
allowed_values = ["ex-ante", "ex-post"] # noqa: E501
if (
self.local_vars_configuration.client_side_validation
and issuance_type not in allowed_values
): # noqa: E501
raise ValueError(
"Invalid value for `issuance_type` ({0}), must be one of {1}".format( # noqa: E501
issuance_type, allowed_values
)
)

self._issuance_type = issuance_type

@property
def latitude(self):
"""Gets the latitude of this Project. # noqa: E501
@@ -610,6 +655,29 @@ def inventory(self, inventory):

self._inventory = inventory

@property
def disclaimers(self):
"""Gets the disclaimers of this Project. # noqa: E501
An array of objects containing disclaimers about the project. Information, warnings, and critical concerns may be present. # noqa: E501
:return: The disclaimers of this Project. # noqa: E501
:rtype: list[Disclaimer]
"""
return self._disclaimers

@disclaimers.setter
def disclaimers(self, disclaimers):
"""Sets the disclaimers of this Project.
An array of objects containing disclaimers about the project. Information, warnings, and critical concerns may be present. # noqa: E501
:param disclaimers: The disclaimers of this Project. # noqa: E501
:type: list[Disclaimer]
"""

self._disclaimers = disclaimers

def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@
from setuptools import setup, find_packages # noqa: H301

NAME = "patch-api"
VERSION = "2.1.0"
VERSION = "2.1.1"
# To install the library, run the following
#
# python setup.py install
11 changes: 11 additions & 0 deletions test/test_projects_api.py
Original file line number Diff line number Diff line change
@@ -66,6 +66,17 @@ def test_retrieve_project(self):
self.assertTrue(isinstance(inventory[0].currency, str))
self.assertTrue(isinstance(inventory[0].unit, str))

issuance_type = project.issuance_type
self.assertTrue(isinstance(issuance_type, str))

disclaimers = project.disclaimers
self.assertTrue(isinstance(disclaimers, list))
self.assertTrue(isinstance(disclaimers[0].header, str))
self.assertTrue(isinstance(disclaimers[0].body, str))
self.assertTrue(isinstance(disclaimers[0].severity, str))
self.assertTrue(isinstance(disclaimers[0].link_text, str))
self.assertTrue(isinstance(disclaimers[0].link_destination, str))

def test_retrieve_project_language(self):
"""Test case for retrieve_project