def __add_parameter(self, param, path_parameters, params):
<EOL>descriptor = None<EOL>if not isinstance(param, messages.MessageField):<EOL><INDENT>name = param.name<EOL>descriptor = self.__parameter_descriptor(param)<EOL>descriptor['<STR_LIT:location>'] = '<STR_LIT:path>' if name in path_parameters else '<STR_LIT>'<EOL>if descriptor:<EOL><INDENT>params[name] = descriptor<EOL><DEDENT><DEDENT>else:<EOL><INDENT>for subfield_list in self.__field_to_subfields(param):<EOL><INDENT>name = '<STR_LIT:.>'.join(subfield.name for subfield in subfield_list)<EOL>descriptor = self.__parameter_descriptor(subfield_list[-<NUM_LIT:1>])<EOL>if name in path_parameters:<EOL><INDENT>descriptor['<STR_LIT>'] = True<EOL>descriptor['<STR_LIT:location>'] = '<STR_LIT:path>'<EOL><DEDENT>else:<EOL><INDENT>descriptor.pop('<STR_LIT>', None)<EOL>descriptor['<STR_LIT:location>'] = '<STR_LIT>'<EOL><DEDENT>if descriptor:<EOL><INDENT>params[name] = descriptor<EOL><DEDENT><DEDENT><DEDENT>
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.