@@ -226,9 +226,8 @@ def list(self, **kwargs: Any) -> Union[base.RESTObjectList, List[base.RESTObject
226226data .setdefault ("order_by" ,self .gitlab .order_by )
227227
228228# We get the attributes that need some special transformation
229- types = getattr (self ,"_types" , {})
230- if types :
231- for attr_name ,type_cls in types .items ():
229+ if self ._types :
230+ for attr_name ,type_cls in self ._types .items ():
232231if attr_name in data .keys ():
233232type_obj = type_cls (data [attr_name ])
234233data [attr_name ]= type_obj .get_for_api ()
@@ -311,17 +310,16 @@ def create(
311310files = {}
312311
313312# We get the attributes that need some special transformation
314- types = getattr (self ,"_types" , {})
315- if types :
313+ if self ._types :
316314# Duplicate data to avoid messing with what the user sent us
317315data = data .copy ()
318- for attr_name ,type_cls in types .items ():
316+ for attr_name ,type_cls in self . _types .items ():
319317if attr_name in data .keys ():
320318type_obj = type_cls (data [attr_name ])
321319
322320# if the type if FileAttribute we need to pass the data as
323321# file
324- if issubclass ( type_cls ,g_types .FileAttribute ):
322+ if isinstance ( type_obj ,g_types .FileAttribute ):
325323k = type_obj .get_file_name (attr_name )
326324files [attr_name ]= (k ,data .pop (attr_name ))
327325else :
@@ -414,17 +412,16 @@ def update(
414412files = {}
415413
416414# We get the attributes that need some special transformation
417- types = getattr (self ,"_types" , {})
418- if types :
415+ if self ._types :
419416# Duplicate data to avoid messing with what the user sent us
420417new_data = new_data .copy ()
421- for attr_name ,type_cls in types .items ():
418+ for attr_name ,type_cls in self . _types .items ():
422419if attr_name in new_data .keys ():
423420type_obj = type_cls (new_data [attr_name ])
424421
425422# if the type if FileAttribute we need to pass the data as
426423# file
427- if issubclass ( type_cls ,g_types .FileAttribute ):
424+ if isinstance ( type_obj ,g_types .FileAttribute ):
428425k = type_obj .get_file_name (attr_name )
429426files [attr_name ]= (k ,new_data .pop (attr_name ))
430427else :