Skip to content
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

Added support for new endpoint (area_information_dates) #13

Merged
merged 2 commits into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

setup(
name="valueguard",
version="0.2.0",
version="0.2.1",
author="Valueguard",
author_email="info@valueguard.se",
description="The official client for the Valueguard API",
Expand Down
28 changes: 28 additions & 0 deletions valueguard/valueguard.py
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,34 @@ def area_information(self, search_criteria=None):
raise Exception(response.content.decode("utf-8"))
return json.loads(response.content.decode("utf-8"))

def area_information_dates(self, search_criteria=None):
""" Handles the query to get the area information.

Parameters
----------
:param search_criteria:
Defines the search criteria used to filter the query.

Returns
-------
:return:
The query result in JSON format
"""
if search_criteria is None:
search_criteria = {}

url = self.server_url + "/v1/area/information/dates?access_token=" + \
urllib.parse.quote(self.access_token)

url += _generate_request_search_criteria(search_criteria.items())
# print(url)
session = requests.Session()
response = session.get(url)
if response.status_code != 200:
# print(response.content.decode("utf-8"))
raise Exception(response.content.decode("utf-8"))
return json.loads(response.content.decode("utf-8"))

def area_information_field(self, search_criteria=None):
""" Handles the query to get the area information fields.

Expand Down