lib/index.js
function makeTaskqueueAddProto(taskOptions) {
  var taskqueueAddRequest = new apphosting.TaskQueueAddRequest();
  taskqueueAddRequest.setUrl(taskOptions.url);
  taskqueueAddRequest.setQueueName(goog.isDefAndNotNull(taskOptions.queueName) ?
    taskOptions.queueName : 'default');
  taskqueueAddRequest.setTaskName(goog.isDefAndNotNull(taskOptions.taskName) ?
    taskOptions.taskName : '');
  taskqueueAddRequest.setEtaUsec(goog.isDefAndNotNull(taskOptions.etaUsec) ?
    taskOptions.etaUsec : '0');
  var method = 'post';
  if (goog.isDefAndNotNull(taskOptions.method)) {
    method = taskOptions.method;
  }
  taskqueueAddRequest.setMethod(methodToProtoMethod[method]);
  if (goog.isDefAndNotNull(taskOptions.body)) {
    taskqueueAddRequest.setBody(taskOptions.body);
  }
  if (goog.isDefAndNotNull(taskOptions.headers)) {
    goog.object.forEach(taskOptions.headers, function(value, key) {
      var header = new apphosting.TaskQueueAddRequest.Header();
      header.setKey(key);
      header.setValue(value);
      taskqueueAddRequest.addHeader(header);
    });
  }
  return taskqueueAddRequest;
}
function makeTaskqueueAddProto(taskOptions) {
  var taskqueueAddRequest = new apphosting.TaskQueueAddRequest();
  taskqueueAddRequest.setUrl(taskOptions.url);
  taskqueueAddRequest.setQueueName(goog.isDefAndNotNull(taskOptions.queueName) ?
    taskOptions.queueName : 'default');
  taskqueueAddRequest.setTaskName(goog.isDefAndNotNull(taskOptions.taskName) ?
    taskOptions.taskName : '');
  taskqueueAddRequest.setEtaUsec(goog.isDefAndNotNull(taskOptions.etaUsec) ?
    taskOptions.etaUsec : '0');
  var method = 'post';
  if (goog.isDefAndNotNull(taskOptions.method)) {
    method = taskOptions.method;
  }
  taskqueueAddRequest.setMethod(methodToProtoMethod[method]);
  if (goog.isDefAndNotNull(taskOptions.body)) {
    taskqueueAddRequest.setBody(taskOptions.body);
  }
  if (goog.isDefAndNotNull(taskOptions.headers)) {
    goog.object.forEach(taskOptions.headers, function(value, key) {
      var header = new apphosting.TaskQueueAddRequest.Header();
      header.setKey(key);
      header.setValue(value);
      taskqueueAddRequest.addHeader(header);
    });
  }
  return taskqueueAddRequest;
}
function makeTaskqueueAddProto ( taskOptions ) { var taskqueueAddRequest = new apphosting . TaskQueueAddRequest ( ) ; taskqueueAddRequest . setUrl ( taskOptions . url ) ; taskqueueAddRequest . setQueueName ( goog . isDefAndNotNull ( taskOptions . queueName ) ? taskOptions . queueName : 'default' ) ; taskqueueAddRequest . setTaskName ( goog . isDefAndNotNull ( taskOptions . taskName ) ? taskOptions . taskName : '' ) ; taskqueueAddRequest . setEtaUsec ( goog . isDefAndNotNull ( taskOptions . etaUsec ) ? taskOptions . etaUsec : '0' ) ; var method = 'post' ; if ( goog . isDefAndNotNull ( taskOptions . method ) ) { method = taskOptions . method ; } taskqueueAddRequest . setMethod ( methodToProtoMethod [ method ] ) ; if ( goog . isDefAndNotNull ( taskOptions . body ) ) { taskqueueAddRequest . setBody ( taskOptions . body ) ; } if ( goog . isDefAndNotNull ( taskOptions . headers ) ) { goog . object . forEach ( taskOptions . headers , function ( value , key ) { var header = new apphosting . TaskQueueAddRequest . Header ( ) ; header . setKey ( key ) ; header . setValue ( value ) ; taskqueueAddRequest . addHeader ( header ) ; } ) ; } return taskqueueAddRequest ; }
Return a taskqueue add request proto.

The object representing the task options must satisfy the following contract.
It must have the following (required) properties:
url : a string, the url to dispatch the task request to

It may have the following (optional) properties:
queueName : a string, the name of the queue to add the task to
(defaults to 'default')
taskName : a string, the name of the task
etaUsec: a string, the ETA in microseconds as a string
method: a string among 'get', 'post', 'head', 'put', 'delete'
(defaults to 'post')
body: a string, the body of the request (for 'post' and 'put' only)
headers: an object containing a property for each desired header in the request

@param {!Object} the task options (see above)
@return {apphosting.TaskQueueAddRequest} a taskqueue add request proto
Return a taskqueue add request proto .