@@ -184,6 +184,78 @@ class ClassPropertyContractV1(TypedDict):
184184 qudtCodes : NotRequired [list [str ]]
185185
186186
187+ class ClassRelationItemContractV1 (TypedDict ):
188+ relationType : str
189+ classUri : str
190+ className : NotRequired [str ]
191+ fraction : NotRequired [float ]
192+ dictionaryUri : NotRequired [str ]
193+
194+
195+ class ClassRelationsContractV1 (TypedDict ):
196+ totalCount : NotRequired [int ]
197+ offset : NotRequired [int ]
198+ count : NotRequired [int ]
199+ classUri : NotRequired [str ]
200+ areReversedRelations : NotRequired [bool ]
201+ classRelations : NotRequired [list [ClassRelationItemContractV1 ]]
202+
203+
204+ class ClassPropertiesContractV1 (TypedDict ):
205+ classUri : NotRequired [str ]
206+ totalCount : NotRequired [int ]
207+ offset : NotRequired [int ]
208+ count : NotRequired [int ]
209+ classProperties : list [ClassPropertyContractV1 ]
210+
211+
212+ class ClassPropertyItemContractV1 (TypedDict ):
213+ name : str
214+ propertySet : str
215+ uri : str
216+ description : NotRequired [str ]
217+ definition : NotRequired [str ]
218+ dataType : NotRequired [str ]
219+ dimension : NotRequired [str ]
220+ dimensionLength : NotRequired [int ]
221+ dimensionMass : NotRequired [int ]
222+ dimensionTime : NotRequired [int ]
223+ dimensionElectricCurrent : NotRequired [int ]
224+ dimensionThermodynamicTemperature : NotRequired [int ]
225+ dimensionAmountOfSubstance : NotRequired [int ]
226+ dimensionLuminousIntensity : NotRequired [int ]
227+ dynamicParameterPropertyCodes : NotRequired [list [str ]]
228+ example : NotRequired [str ]
229+ isDynamic : NotRequired [bool ]
230+ isRequired : NotRequired [bool ]
231+ isWritable : NotRequired [bool ]
232+ maxExclusive : NotRequired [float ]
233+ maxInclusive : NotRequired [float ]
234+ minExclusive : NotRequired [float ]
235+ minInclusive : NotRequired [float ]
236+ pattern : NotRequired [str ]
237+ physicalQuantity : NotRequired [str ]
238+ allowedValues : NotRequired [list [ClassPropertyValueItemContractV1 ]]
239+ predefinedValue : NotRequired [str ]
240+ propertyCode : NotRequired [str ]
241+ propertyDictionaryName : NotRequired [str ]
242+ propertyDictionaryUri : NotRequired [str ]
243+ propertyUri : NotRequired [str ]
244+ propertyStatus : NotRequired [str ]
245+ propertyValueKind : NotRequired [str ]
246+ symbol : NotRequired [str ]
247+ units : NotRequired [list [str ]]
248+ qudtCodes : NotRequired [list [str ]]
249+
250+
251+ class ClassPropertyValueItemContractV1 (TypedDict ):
252+ uri : NotRequired [str ]
253+ code : NotRequired [str ]
254+ value : str
255+ description : NotRequired [str ]
256+ sortNumber : NotRequired [int ]
257+
258+
187259class PropertyContractV5 (TypedDict ):
188260 dictionaryUri : NotRequired [str ]
189261 activationDateUtc : str
@@ -710,6 +782,56 @@ def get_class(
710782 params = {k : v for k , v in params .items () if v is not None }
711783 return self .get (endpoint , params )
712784
785+ def get_class_relations (
786+ self ,
787+ class_uri : str ,
788+ get_reverse_relations : bool = False ,
789+ search_text : str = "" ,
790+ offset : int = 0 ,
791+ limit : int = 1000 ,
792+ language_code : str = "" ,
793+ version = 1 ,
794+ ) -> ClassRelationsContractV1 :
795+ """
796+ Get class relations or reverse relations (paginated)
797+ """
798+ endpoint = f"Class/Relations/v{ version } "
799+ params = {
800+ "ClassUri" : class_uri ,
801+ "GetReverseRelations" : get_reverse_relations ,
802+ "SearchText" : search_text ,
803+ "Offset" : offset ,
804+ "Limit" : limit ,
805+ "languageCode" : language_code ,
806+ }
807+ return self .get (endpoint , params )
808+
809+ def get_class_properties (
810+ self ,
811+ class_uri : str ,
812+ property_set : str = "" ,
813+ property_code : str = "" ,
814+ search_text : str = "" ,
815+ offset : int = 0 ,
816+ limit : int = 1000 ,
817+ language_code : str = "" ,
818+ version = 1 ,
819+ ) -> ClassPropertiesContractV1 :
820+ """
821+ Get class properties (paginated)
822+ """
823+ endpoint = f"Class/Properties/v{ version } "
824+ params = {
825+ "ClassUri" : class_uri ,
826+ "PropertySet" : property_set ,
827+ "PropertyCode" : property_code ,
828+ "SearchText" : search_text ,
829+ "Offset" : offset ,
830+ "Limit" : limit ,
831+ "languageCode" : language_code ,
832+ }
833+ return self .get (endpoint , params )
834+
713835 def get_property (self , uri , language_code = "" , version : int = 5 ) -> PropertyContractV5 :
714836 """
715837 Get Property details.
0 commit comments