Write this object to the given output protocol and return self.

        :type oprot: thryft.protocol._output_protocol._OutputProtocol
        :rtype: pastpy.gen.database.impl.online.online_database_object_detail.OnlineDatabaseObjectDetail

def write(self, oprot):
        '''
        Write this object to the given output protocol and return self.

        :type oprot: thryft.protocol._output_protocol._OutputProtocol
        :rtype: pastpy.gen.database.impl.online.online_database_object_detail.OnlineDatabaseObjectDetail
        '''

        oprot.write_struct_begin('OnlineDatabaseObjectDetail')

        oprot.write_field_begin(name='attributes', type=13, id=None)
        oprot.write_map_begin(11, len(self.attributes), 11)
        for __key0, __value0 in self.attributes.items():
            oprot.write_string(__key0)
            oprot.write_string(__value0)
        oprot.write_map_end()
        oprot.write_field_end()

        oprot.write_field_begin(name='guid', type=11, id=None)
        oprot.write_string(self.guid)
        oprot.write_field_end()

        oprot.write_field_begin(name='id', type=11, id=None)
        oprot.write_string(self.id)
        oprot.write_field_end()

        oprot.write_field_begin(name='related_photos', type=15, id=None)
        oprot.write_list_begin(12, len(self.related_photos))
        for _0 in self.related_photos:
            _0.write(oprot)
        oprot.write_list_end()
        oprot.write_field_end()

        oprot.write_field_stop()

        oprot.write_struct_end()

        return self