def serialize(self, sw):
        '''Serialize the object.'''
        detail = None
        if self.detail is not None: 
            detail = Detail()
            detail.any = self.detail

        pyobj = FaultType(self.code, self.string, self.actor, detail)
        sw.serialize(pyobj, typed=False)