@@ -1031,6 +1031,62 @@ def insert_feature_schema_into_ontology(self, feature_schema_id: str,
10311031 "Failed to insert the feature schema into the ontology, message: "
10321032 + str (response .json ()['message' ]))
10331033
1034+ def get_unused_ontologies (self , after : str = None ) -> List [str ]:
1035+ """
1036+ Returns a list of unused ontology ids
1037+ Args:
1038+ after (str): The cursor to use for pagination
1039+ Returns:
1040+ A list of unused ontology ids
1041+ Example:
1042+ To get the first page of unused ontology ids (100 at a time)
1043+ >>> client.get_unused_ontologies()
1044+ To get the next page of unused ontology ids
1045+ >>> client.get_unused_ontologies("cleabc1my012ioqvu5anyaabc")
1046+ """
1047+
1048+ endpoint = self .rest_endpoint + "/ontologies/unused"
1049+ response = requests .get (
1050+ endpoint ,
1051+ headers = self .headers ,
1052+ json = {"after" : after },
1053+ )
1054+
1055+ if response .status_code == requests .codes .ok :
1056+ return response .json ()
1057+ else :
1058+ raise labelbox .exceptions .LabelboxError (
1059+ "Failed to get unused ontologies, message: " +
1060+ str (response .json ()['message' ]))
1061+
1062+ def get_unused_feature_schemas (self , after : str = None ) -> List [str ]:
1063+ """
1064+ Returns a list of unused feature schema ids
1065+ Args:
1066+ after (str): The cursor to use for pagination
1067+ Returns:
1068+ A list of unused feature schema ids
1069+ Example:
1070+ To get the first page of unused feature schema ids (100 at a time)
1071+ >>> client.get_unused_feature_schemas()
1072+ To get the next page of unused feature schema ids
1073+ >>> client.get_unused_feature_schemas("cleabc1my012ioqvu5anyaabc")
1074+ """
1075+
1076+ endpoint = self .rest_endpoint + "/feature-schemas/unused"
1077+ response = requests .get (
1078+ endpoint ,
1079+ headers = self .headers ,
1080+ json = {"after" : after },
1081+ )
1082+
1083+ if response .status_code == requests .codes .ok :
1084+ return response .json ()
1085+ else :
1086+ raise labelbox .exceptions .LabelboxError (
1087+ "Failed to get unused feature schemas, message: " +
1088+ str (response .json ()['message' ]))
1089+
10341090 def create_ontology (self , name , normalized , media_type = None ) -> Ontology :
10351091 """
10361092 Creates an ontology from normalized data
0 commit comments