From 4961474de784e9862d1c93dfb384f63a1e634aed Mon Sep 17 00:00:00 2001 From: Jonathan Feng <76976063+jonathanfeng-scale@users.noreply.github.com> Date: Thu, 5 Sep 2024 16:14:22 -0700 Subject: [PATCH] add auto-onboard functionality to sdk (#95) * add auto-onboard functionality to sdk * formatting * formatting --- scaleapi/_version.py | 2 +- scaleapi/projects.py | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/scaleapi/_version.py b/scaleapi/_version.py index 64dfb12..8829d8b 100644 --- a/scaleapi/_version.py +++ b/scaleapi/_version.py @@ -1,2 +1,2 @@ -__version__ = "2.15.13" +__version__ = "2.15.14" __package_name__ = "scaleapi" diff --git a/scaleapi/projects.py b/scaleapi/projects.py index 3feb014..ced8bf4 100644 --- a/scaleapi/projects.py +++ b/scaleapi/projects.py @@ -9,6 +9,8 @@ def __init__(self, json, client): self.created_at = json["created_at"] self.updated_at = json["updated_at"] self.template_variables = json["template_variables"] + self.response_schema = json.get("response_schema", None) + self.auto_onboard_enabled = json.get("auto_onboard_enabled", False) def __hash__(self): return hash(self.id) @@ -23,6 +25,14 @@ def get_template_variables(self): """Returns template variables dictionary""" return self.template_variables + def is_auto_onboardable(self): + """Returns boolean value whether project is auto onboardable""" + return self.auto_onboard_enabled + + def get_response_schema(self): + """Returns response schema if enabled for your account""" + return self.response_schema + def as_dict(self): """Returns task template object as JSON dictionary""" return self._json