#NEWLINE# def __init__( self , data = None , status = None , content_type = None , type = None ) : #NEWLINE# #INDENT# self . status = ( - 1 ) #NEWLINE# self . contentType = [ ] #NEWLINE# self . type = None #NEWLINE# self . headers = [ ] #NEWLINE# self . description = None #NEWLINE# if ( data is not None ) : #NEWLINE# #INDENT# if ( ( status is not None ) or ( content_type is not None ) or ( type is not None ) ) : #NEWLINE# #INDENT# raise APIDescriptionException ( 'status, content_type and type attributes must be None when the data field is provided' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# init_field ( self , data , STATUS , True ) #NEWLINE# init_field ( self , data , CONTENT_TYPE ) #NEWLINE# init_field ( self , data , DESCRIPTION ) #NEWLINE# if data . has_key ( TYPE ) : #NEWLINE# #INDENT# self . type = DataType ( status ) #NEWLINE# #UNINDENT# if data . has_key ( HEADERS ) : #NEWLINE# #INDENT# for header in data [ HEADERS ] : #NEWLINE# #INDENT# self . headers . append ( Header ( header ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# self . status = status #NEWLINE# self . contentType = content_type #NEWLINE# self . type = type