#NEWLINE# def _on_after_api_serialize( self , r , withClean ) : #NEWLINE# #INDENT# Util . validate_type ( withClean , 'bool' ) #NEWLINE# if ( withClean is None ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# if ( self . _source is not None ) : #NEWLINE# #INDENT# if ( self . _source . _class_name ( ) == 'Disk' ) : #NEWLINE# #INDENT# s = ( self . _source . api_serialize ( True ) if withClean else { #NEWLINE# #INDENT# 'ID' : self . _source . _id ( ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# r [ 'SourceDisk' ] = s #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( self . _source . _class_name ( ) == 'Archive' ) : #NEWLINE# #INDENT# s = ( self . _source . api_serialize ( True ) if withClean else { #NEWLINE# #INDENT# 'ID' : self . _source . _id ( ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# r [ 'SourceArchive' ] = s #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . _source = None #NEWLINE# Util . validate_type ( self . _source , 'Disk or Archive' , True )