class_docstr: Descriptor for a method in a service.
  
  Attributes:
    name (str): Name of the method within the service.
    full_name (str): Full name of method.
    index (int): 0-indexed index of the method inside the service.
    containing_service (ServiceDescriptor): The service that contains this
      method.
    input_type (Descriptor): The descriptor of the message that this method
      accepts.
    output_type (Descriptor): The descriptor of the message that this method
      returns.
    options (descriptor_pb2.MethodOptions or None): Method options message, or
      None to use default method options.
docstr: Copies this to a descriptor_pb2.MethodDescriptorProto.
  
  Args:
    proto (descriptor_pb2.MethodDescriptorProto): An empty descriptor proto.
  
  Raises:
    Error: If self couldn't be serialized, due to too few constructor
      arguments.
docstr_tok: ["Copies","this","to","a","descriptor_pb2.MethodDescriptorProto",".","Args",":","proto","(","descriptor_pb2.MethodDescriptorProto",")",":","An","empty","descriptor","proto",".","Raises",":","Error",":","If","self","could","n't","be","serialized",",","due","to","too","few","constructor","arguments","."]
code: def CopyToProto(self, proto):
      """Copies this to a descriptor_pb2.MethodDescriptorProto.
  
      Args:
        proto (descriptor_pb2.MethodDescriptorProto): An empty descriptor proto.
  
      Raises:
        Error: If self couldn't be serialized, due to too few constructor
          arguments.
      """
      if self.containing_service is not None:
          from google.protobuf import descriptor_pb2
  
          service_proto = descriptor_pb2.ServiceDescriptorProto()
          self.containing_service.CopyToProto(service_proto)
          proto.CopyFrom(service_proto.method[self.index])
      else:
          raise Error("Descriptor does not contain a service.")
  
imports: import threading
  import warnings
  from google.protobuf.internal import api_implementation
label_desc: Use image node_id 2 for calling the MethodDescriptor obj's underlying member method code with example usage: obj.CopyToProto(proto) without return types