code: def set_attributes(self, doc, fields, parent_type=None):
          
  
          if parent_type:
              assert isinstance(parent_type, Struct)
  
          self.subtypes = []
  
          # These are only set if this struct enumerates subtypes.
          self._enumerated_subtypes = None  # Optional[List[Tuple[str, DataType]]]
          self._is_catch_all = None  # Optional[Bool]
  
          super(Struct, self).set_attributes(doc, fields, parent_type)
  
          if self.parent_type:
              self.parent_type.subtypes.append(self)
docs: See :meth:`Composite.set_attributes` for parameter definitions.