Skip to content

Commit fc359ec

Browse files
add new schema
future Schema can be a first class thing but for now just ability to do this
1 parent dc5d2d6 commit fc359ec

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

sdk/diffgram/core/core.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,23 @@ def set_default_directory(self,
335335
self.session.headers.update(
336336
{'directory_id': str(self.directory_id)})
337337

338+
339+
340+
def new_schema(self,
341+
name: str):
342+
343+
endpoint = "/api/v1/project/" + self.project_string_id + \
344+
"/labels-schema/new"
345+
346+
request_json_body = {'name': name}
347+
348+
response = self.session.post(self.host + endpoint,
349+
json = request_json_body)
350+
351+
self.handle_errors(response)
352+
return response.json()
353+
354+
338355
# TODO review not using this pattern anymore
339356

340357
setattr(Project, "get_label_file_dict", get_label_file_dict)

0 commit comments

Comments
 (0)