def __params_descriptor(self, message_type, request_kind, path, method_id):
    """Describe the parameters of a method.

    If the message_type is not a ResourceContainer, will fall back to
    __params_descriptor_without_container (which will eventually be deprecated).

    If the message type is a ResourceContainer, then all path/query parameters
    will come from the ResourceContainer. This method will also make sure all
    path parameters are covered by the message fields.

    Args:
      message_type: messages.Message or ResourceContainer class, Message with
        parameters to describe.
      request_kind: The type of request being made.
      path: string, HTTP path to method.
      method_id: string, Unique method identifier (e.g. 'myapi.items.method')

    Returns:
      A tuple (dict, list of string): Descriptor of the parameters, Order of the
        parameters.
    """
    path_parameter_dict = self.__get_path_parameters(path)

    if not isinstance(message_type, resource_container.ResourceContainer):
      if path_parameter_dict:
        _logger.warning('Method %s specifies path parameters but you are not '
                        'using a ResourceContainer; instead, you are using %r. '
                        'This will fail in future releases; please switch to '
                        'using ResourceContainer as soon as possible.',
                        method_id, type(message_type))
      return self.__params_descriptor_without_container(
          message_type, request_kind, method_id, path)

    # From here, we can assume message_type is a ResourceContainer.
    params = []

    # Process body parameter, if any
    if message_type.body_message_class != message_types.VoidMessage:
      params.append(self.__body_parameter_descriptor(method_id))

    # Process path/querystring parameters
    params_message_type = message_type.parameters_message_class()

    # Make sure all path parameters are covered.
    for field_name, matched_path_parameters in path_parameter_dict.iteritems():
      field = params_message_type.field_by_name(field_name)
      self.__validate_path_parameters(field, matched_path_parameters)

    # Add all fields, sort by field.number since we have parameterOrder.
    for field in sorted(params_message_type.all_fields(),
                        key=lambda f: f.number):
      matched_path_parameters = path_parameter_dict.get(field.name, [])
      self.__add_parameter(field, matched_path_parameters, params)

    return params
def __params_descriptor ( self , message_type , request_kind , path , method_id ) : path_parameter_dict = self . __get_path_parameters ( path ) if not isinstance ( message_type , resource_container . ResourceContainer ) : if path_parameter_dict : _logger . warning ( 'Method %s specifies path parameters but you are not ' 'using a ResourceContainer; instead, you are using %r. ' 'This will fail in future releases; please switch to ' 'using ResourceContainer as soon as possible.' , method_id , type ( message_type ) ) return self . __params_descriptor_without_container ( message_type , request_kind , method_id , path ) params = [ ] if message_type . body_message_class != message_types . VoidMessage : params . append ( self . __body_parameter_descriptor ( method_id ) ) params_message_type = message_type . parameters_message_class ( ) for field_name , matched_path_parameters in path_parameter_dict . iteritems ( ) : field = params_message_type . field_by_name ( field_name ) self . __validate_path_parameters ( field , matched_path_parameters ) for field in sorted ( params_message_type . all_fields ( ) , key = lambda f : f . number ) : matched_path_parameters = path_parameter_dict . get ( field . name , [ ] ) self . __add_parameter ( field , matched_path_parameters , params ) return params
Describe the parameters of a method.

    If the message_type is not a ResourceContainer, will fall back to
    __params_descriptor_without_container (which will eventually be deprecated).

    If the message type is a ResourceContainer, then all path/query parameters
    will come from the ResourceContainer. This method will also make sure all
    path parameters are covered by the message fields.

    Args:
      message_type: messages.Message or ResourceContainer class, Message with
        parameters to describe.
      request_kind: The type of request being made.
      path: string, HTTP path to method.
      method_id: string, Unique method identifier (e.g. 'myapi.items.method')

    Returns:
      A tuple (dict, list of string): Descriptor of the parameters, Order of the
        parameters.