#NEWLINE# def build( self , image_obj , detail = False ) : #NEWLINE# #INDENT# 'Return a standardized image structure for display by the API.' #NEWLINE# image = ViewBuilder . build ( self , image_obj , detail ) #NEWLINE# href = self . generate_href ( image_obj [ 'id' ] ) #NEWLINE# bookmark = self . generate_bookmark ( image_obj [ 'id' ] ) #NEWLINE# image [ 'links' ] = [ { #NEWLINE# #INDENT# 'rel' : 'self' , #NEWLINE# 'href' : href , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'rel' : 'bookmark' , #NEWLINE# 'href' : bookmark , #NEWLINE# #UNINDENT# } ] #NEWLINE# if detail : #NEWLINE# #INDENT# image [ 'metadata' ] = image_obj . get ( 'properties' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# return image