function buildPath(path, parameters) {
  let pathParameters = path.match(/\/:(\w+)\b/g);
  if (pathParameters) {
    for (let i = 0; i < pathParameters.length; ++i) {
      let key = pathParameters[i].substring(2);  // Trim the /:
      if (key in parameters) {
        let value = parameters[key];
        if (WebElement.isId(value)) {
          // When inserting a WebElement into the URL, only use its ID value,
          // not the full JSON.
          value = WebElement.extractId(value);
        }
        path = path.replace(pathParameters[i], '/' + value);
        delete parameters[key];
      } else {
        throw new error.InvalidArgumentError(
            'Missing required parameter: ' + key);
      }
    }
  }
  return path;
}
function buildPath(path, parameters) {
  let pathParameters = path.match(/\/:(\w+)\b/g);
  if (pathParameters) {
    for (let i = 0; i < pathParameters.length; ++i) {
      let key = pathParameters[i].substring(2);  // Trim the /:
      if (key in parameters) {
        let value = parameters[key];
        if (WebElement.isId(value)) {
          // When inserting a WebElement into the URL, only use its ID value,
          // not the full JSON.
          value = WebElement.extractId(value);
        }
        path = path.replace(pathParameters[i], '/' + value);
        delete parameters[key];
      } else {
        throw new error.InvalidArgumentError(
            'Missing required parameter: ' + key);
      }
    }
  }
  return path;
}
function buildPath ( path , parameters ) { let pathParameters = path . match ( / \/:(\w+)\b / g ) ; if ( pathParameters ) { for ( let i = 0 ; i < pathParameters . length ; ++ i ) { let key = pathParameters [ i ] . substring ( 2 ) ; // Trim the /: if ( key in parameters ) { let value = parameters [ key ] ; if ( WebElement . isId ( value ) ) { // When inserting a WebElement into the URL, only use its ID value, // not the full JSON. value = WebElement . extractId ( value ) ; } path = path . replace ( pathParameters [ i ] , '/' + value ) ; delete parameters [ key ] ; } else { throw new error . InvalidArgumentError ( 'Missing required parameter: ' + key ) ; } } } return path ; }
Builds a fully qualified path using the given set of command parameters. Each
path segment prefixed with ':' will be replaced by the value of the
corresponding parameter. All parameters spliced into the path will be
removed from the parameter map.
@param {string} path The original resource path.
@param {!Object<*>} parameters The parameters object to splice into the path.
@return {string} The modified path.
Builds a fully qualified path using the given set of command parameters . Each path segment prefixed with : will be replaced by the value of the corresponding parameter . All parameters spliced into the path will be removed from the parameter map .
Build a path from the parameters