#NEWLINE# def write( self , oprot ) : #NEWLINE# #INDENT# if ( ( oprot . __class__ == TBinaryProtocol . TBinaryProtocolAccelerated ) and ( self . thrift_spec is not None ) and ( fastbinary is not None ) ) : #NEWLINE# #INDENT# oprot . trans . write ( fastbinary . encode_binary ( self , ( self . __class__ , self . thrift_spec ) ) ) #NEWLINE# return #NEWLINE# #UNINDENT# oprot . writeStructBegin ( 'RestResponse' ) #NEWLINE# if ( self . status != None ) : #NEWLINE# #INDENT# oprot . writeFieldBegin ( 'status' , TType . I32 , 1 ) #NEWLINE# oprot . writeI32 ( self . status ) #NEWLINE# oprot . writeFieldEnd ( ) #NEWLINE# #UNINDENT# if ( self . headers != None ) : #NEWLINE# #INDENT# oprot . writeFieldBegin ( 'headers' , TType . MAP , 2 ) #NEWLINE# oprot . writeMapBegin ( TType . STRING , TType . STRING , len ( self . headers ) ) #NEWLINE# for ( kiter25 , viter26 ) in self . headers . items ( ) : #NEWLINE# #INDENT# oprot . writeString ( kiter25 ) #NEWLINE# oprot . writeString ( viter26 ) #NEWLINE# #UNINDENT# oprot . writeMapEnd ( ) #NEWLINE# oprot . writeFieldEnd ( ) #NEWLINE# #UNINDENT# if ( self . body != None ) : #NEWLINE# #INDENT# oprot . writeFieldBegin ( 'body' , TType . STRING , 3 ) #NEWLINE# oprot . writeString ( kiter25 . body ) #NEWLINE# oprot . writeFieldEnd ( ) #NEWLINE# #UNINDENT# oprot . writeFieldStop ( ) #NEWLINE# oprot . writeStructEnd ( ) #NEWLINE# def validate( self ) : #NEWLINE# #INDENT# if ( self . status is None ) : #NEWLINE# #INDENT# raise TProtocol . TProtocolException ( message = 'Required field status is unset!' ) #NEWLINE# #UNINDENT# return