Skip to content

Commit 15471bf

Browse files
authored
feat(insight): implement get objectschema objecttypes flat (#1245)
Signed-off-by: gardar <gardar@users.noreply.github.com>
1 parent a633ce0 commit 15471bf

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

atlassian/insight.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,11 +529,23 @@ def get_object_schema_attributes(self, schema_id):
529529
"""
530530
raise NotImplementedError
531531

532-
def get_object_schema_object_types_flat(self, schema_id):
532+
def get_object_schema_object_types_flat(self, schema_id, query=None, exclude=None, includeObjectCounts=None):
533533
"""
534534
Find all object types for this object schema
535+
https://developer.atlassian.com/cloud/assets/rest/api-group-objectschema/#api-objectschema-id-objecttypes-flat-get
536+
Args:
537+
schema_id (str): id of the object schema
538+
query (bool, optional): Object Type Names to search for, defaults to None (Use API default)
539+
exclude (str, optional): Exclude objects with this name, defaults to None (Use API default)
540+
includeObjectCounts (bool, optional): Populate objectCount attribute for each object type, defaults to None (Use API default)
535541
"""
536-
raise NotImplementedError
542+
kwargs = locals().items()
543+
params = dict()
544+
params.update({k: v for k, v in kwargs if v is not None and k not in ["self", "schema_id"]})
545+
return self.get(
546+
"{0}/objectschema/{1}/objecttypes/flat".format(self.api_root, schema_id),
547+
params=params,
548+
)
537549

538550
def get_object_type_attributes(
539551
self,

0 commit comments

Comments
 (0)