code: def type(self, value):
          
          if value not in list(defines.Types.values()):
              raise AttributeError
          self._type = value
docs: Sets the type of the message.
  
          :type value: Types
          :param value: the type
          :raise AttributeError: if value is not a valid type