code: def is_valid(self):
          '''checks if type is a valid type'''
          return (self.is_primitive and self.name) \
              or (self.is_complex and self.name) \
              or (self.is_list and self.nested) \
              or (self.is_map and self.nested) \
              or (self.is_model and self.nestedf is_valid(self):
          '''checks if type is a valid type'''
          return (self.is_primitive and self.name) \
              or (self.is_complex and self.name) \
              or (self.is_list and self.nested) \
              or (self.is_map and self.nested) \
              or (self.is_model and self.nested)
docs: checks if type is a valid type