code: def __add_parameter(self, param, path_parameters, params):
      
      # If this is a simple field, just build the descriptor and append it.
      # Otherwise, build a schema and assign it to this descriptor
      if not isinstance(param, messages.MessageField):
        if param.name in path_parameters:
          descriptor = self.__path_parameter_descriptor(param)
        else:
          descriptor = self.__query_parameter_descriptor(param)
  
        params.append(descriptor)
      else:
        # If a subfield of a MessageField is found in the path, build a descriptor
        # for the path parameter.
        for subfield_list in self.__field_to_subfields(param):
          qualified_name = '.'.join(subfield.name for subfield in subfield_list)
          if qualified_name in path_parameters:
            descriptor = self.__path_parameter_descriptor(subfield_list[-1])
            descriptor['required'] = True
  
            params.append(descriptor)
docs: Adds all parameters in a field to a method parameters descriptor.
  
      Simple fields will only have one parameter, but a message field 'x' that
      corresponds to a message class with fields 'y' and 'z' will result in
      parameters 'x.y' and 'x.z', for example. The mapping from field to
      parameters is mostly handled by __field_to_subfields.
  
      Args:
        param: Parameter to be added to the descriptor.
        path_parameters: A list of parameters matched from a path for this field.
           For example for the hypothetical 'x' from above if the path was
           '/a/{x.z}/b/{other}' then this list would contain only the element
           'x.z' since 'other' does not match to this field.
        params: List of parameters. Each parameter in the field.