com.google.api.services.taskqueue.Taskqueue Maven / Gradle / Ivy
/*
* Copyright 2010 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
/*
* This code was generated by https://github.com/google/apis-client-generator/
* (build: 2016-05-04 15:59:39 UTC)
* on 2016-05-18 at 04:32:05 UTC
* Modify at your own risk.
*/
package com.google.api.services.taskqueue;
/**
* Service definition for Taskqueue (v1beta2).
*
*
* Accesses a Google App Engine Pull Task Queue over REST.
*
*
*
* For more information about this service, see the
* API Documentation
*
*
*
* This service uses {@link TaskqueueRequestInitializer} to initialize global parameters via its
* {@link Builder}.
*
*
* @since 1.3
* @author Google, Inc.
*/
@SuppressWarnings("javadoc")
public class Taskqueue extends com.google.api.client.googleapis.services.json.AbstractGoogleJsonClient {
// Note: Leave this static initializer at the top of the file.
static {
com.google.api.client.util.Preconditions.checkState(
com.google.api.client.googleapis.GoogleUtils.MAJOR_VERSION == 1 &&
com.google.api.client.googleapis.GoogleUtils.MINOR_VERSION >= 15,
"You are currently running with version %s of google-api-client. " +
"You need at least version 1.15 of google-api-client to run version " +
"1.22.0 of the TaskQueue API library.", com.google.api.client.googleapis.GoogleUtils.VERSION);
}
/**
* The default encoded root URL of the service. This is determined when the library is generated
* and normally should not be changed.
*
* @since 1.7
*/
public static final String DEFAULT_ROOT_URL = "https://www.googleapis.com/";
/**
* The default encoded service path of the service. This is determined when the library is
* generated and normally should not be changed.
*
* @since 1.7
*/
public static final String DEFAULT_SERVICE_PATH = "taskqueue/v1beta2/projects/";
/**
* The default encoded base URL of the service. This is determined when the library is generated
* and normally should not be changed.
*/
public static final String DEFAULT_BASE_URL = DEFAULT_ROOT_URL + DEFAULT_SERVICE_PATH;
/**
* Constructor.
*
*
* Use {@link Builder} if you need to specify any of the optional parameters.
*
*
* @param transport HTTP transport, which should normally be:
*
* - Google App Engine:
* {@code com.google.api.client.extensions.appengine.http.UrlFetchTransport}
* - Android: {@code newCompatibleTransport} from
* {@code com.google.api.client.extensions.android.http.AndroidHttp}
* - Java: {@link com.google.api.client.googleapis.javanet.GoogleNetHttpTransport#newTrustedTransport()}
*
*
* @param jsonFactory JSON factory, which may be:
*
* - Jackson: {@code com.google.api.client.json.jackson2.JacksonFactory}
* - Google GSON: {@code com.google.api.client.json.gson.GsonFactory}
* - Android Honeycomb or higher:
* {@code com.google.api.client.extensions.android.json.AndroidJsonFactory}
*
* @param httpRequestInitializer HTTP request initializer or {@code null} for none
* @since 1.7
*/
public Taskqueue(com.google.api.client.http.HttpTransport transport, com.google.api.client.json.JsonFactory jsonFactory,
com.google.api.client.http.HttpRequestInitializer httpRequestInitializer) {
this(new Builder(transport, jsonFactory, httpRequestInitializer));
}
/**
* @param builder builder
*/
Taskqueue(Builder builder) {
super(builder);
}
@Override
protected void initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest> httpClientRequest) throws java.io.IOException {
super.initialize(httpClientRequest);
}
/**
* An accessor for creating requests from the Taskqueues collection.
*
* The typical use is:
*
* {@code Taskqueue taskqueue = new Taskqueue(...);}
* {@code Taskqueue.Taskqueues.List request = taskqueue.taskqueues().list(parameters ...)}
*
*
* @return the resource collection
*/
public Taskqueues taskqueues() {
return new Taskqueues();
}
/**
* The "taskqueues" collection of methods.
*/
public class Taskqueues {
/**
* Get detailed information about a TaskQueue.
*
* Create a request for the method "taskqueues.get".
*
* This request holds the parameters needed by the taskqueue server. After setting any optional
* parameters, call the {@link Get#execute()} method to invoke the remote operation.
*
* @param project The project under which the queue lies.
* @param taskqueue The id of the taskqueue to get the properties of.
* @return the request
*/
public Get get(java.lang.String project, java.lang.String taskqueue) throws java.io.IOException {
Get result = new Get(project, taskqueue);
initialize(result);
return result;
}
public class Get extends TaskqueueRequest {
private static final String REST_PATH = "{project}/taskqueues/{taskqueue}";
/**
* Get detailed information about a TaskQueue.
*
* Create a request for the method "taskqueues.get".
*
* This request holds the parameters needed by the the taskqueue server. After setting any
* optional parameters, call the {@link Get#execute()} method to invoke the remote operation.
* {@link Get#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
* must be called to initialize this instance immediately after invoking the constructor.
*
* @param project The project under which the queue lies.
* @param taskqueue The id of the taskqueue to get the properties of.
* @since 1.13
*/
protected Get(java.lang.String project, java.lang.String taskqueue) {
super(Taskqueue.this, "GET", REST_PATH, null, com.google.api.services.taskqueue.model.TaskQueue.class);
this.project = com.google.api.client.util.Preconditions.checkNotNull(project, "Required parameter project must be specified.");
this.taskqueue = com.google.api.client.util.Preconditions.checkNotNull(taskqueue, "Required parameter taskqueue must be specified.");
}
@Override
public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
return super.executeUsingHead();
}
@Override
public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
return super.buildHttpRequestUsingHead();
}
@Override
public Get setAlt(java.lang.String alt) {
return (Get) super.setAlt(alt);
}
@Override
public Get setFields(java.lang.String fields) {
return (Get) super.setFields(fields);
}
@Override
public Get setKey(java.lang.String key) {
return (Get) super.setKey(key);
}
@Override
public Get setOauthToken(java.lang.String oauthToken) {
return (Get) super.setOauthToken(oauthToken);
}
@Override
public Get setPrettyPrint(java.lang.Boolean prettyPrint) {
return (Get) super.setPrettyPrint(prettyPrint);
}
@Override
public Get setQuotaUser(java.lang.String quotaUser) {
return (Get) super.setQuotaUser(quotaUser);
}
@Override
public Get setUserIp(java.lang.String userIp) {
return (Get) super.setUserIp(userIp);
}
/** The project under which the queue lies. */
@com.google.api.client.util.Key
private java.lang.String project;
/** The project under which the queue lies.
*/
public java.lang.String getProject() {
return project;
}
/** The project under which the queue lies. */
public Get setProject(java.lang.String project) {
this.project = project;
return this;
}
/** The id of the taskqueue to get the properties of. */
@com.google.api.client.util.Key
private java.lang.String taskqueue;
/** The id of the taskqueue to get the properties of.
*/
public java.lang.String getTaskqueue() {
return taskqueue;
}
/** The id of the taskqueue to get the properties of. */
public Get setTaskqueue(java.lang.String taskqueue) {
this.taskqueue = taskqueue;
return this;
}
/** Whether to get stats. Optional. */
@com.google.api.client.util.Key
private java.lang.Boolean getStats;
/** Whether to get stats. Optional.
*/
public java.lang.Boolean getGetStats() {
return getStats;
}
/** Whether to get stats. Optional. */
public Get setGetStats(java.lang.Boolean getStats) {
this.getStats = getStats;
return this;
}
@Override
public Get set(String parameterName, Object value) {
return (Get) super.set(parameterName, value);
}
}
}
/**
* An accessor for creating requests from the Tasks collection.
*
* The typical use is:
*
* {@code Taskqueue taskqueue = new Taskqueue(...);}
* {@code Taskqueue.Tasks.List request = taskqueue.tasks().list(parameters ...)}
*
*
* @return the resource collection
*/
public Tasks tasks() {
return new Tasks();
}
/**
* The "tasks" collection of methods.
*/
public class Tasks {
/**
* Delete a task from a TaskQueue.
*
* Create a request for the method "tasks.delete".
*
* This request holds the parameters needed by the taskqueue server. After setting any optional
* parameters, call the {@link Delete#execute()} method to invoke the remote operation.
*
* @param project The project under which the queue lies.
* @param taskqueue The taskqueue to delete a task from.
* @param task The id of the task to delete.
* @return the request
*/
public Delete delete(java.lang.String project, java.lang.String taskqueue, java.lang.String task) throws java.io.IOException {
Delete result = new Delete(project, taskqueue, task);
initialize(result);
return result;
}
public class Delete extends TaskqueueRequest {
private static final String REST_PATH = "{project}/taskqueues/{taskqueue}/tasks/{task}";
/**
* Delete a task from a TaskQueue.
*
* Create a request for the method "tasks.delete".
*
* This request holds the parameters needed by the the taskqueue server. After setting any
* optional parameters, call the {@link Delete#execute()} method to invoke the remote operation.
* {@link
* Delete#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
* be called to initialize this instance immediately after invoking the constructor.
*
* @param project The project under which the queue lies.
* @param taskqueue The taskqueue to delete a task from.
* @param task The id of the task to delete.
* @since 1.13
*/
protected Delete(java.lang.String project, java.lang.String taskqueue, java.lang.String task) {
super(Taskqueue.this, "DELETE", REST_PATH, null, Void.class);
this.project = com.google.api.client.util.Preconditions.checkNotNull(project, "Required parameter project must be specified.");
this.taskqueue = com.google.api.client.util.Preconditions.checkNotNull(taskqueue, "Required parameter taskqueue must be specified.");
this.task = com.google.api.client.util.Preconditions.checkNotNull(task, "Required parameter task must be specified.");
}
@Override
public Delete setAlt(java.lang.String alt) {
return (Delete) super.setAlt(alt);
}
@Override
public Delete setFields(java.lang.String fields) {
return (Delete) super.setFields(fields);
}
@Override
public Delete setKey(java.lang.String key) {
return (Delete) super.setKey(key);
}
@Override
public Delete setOauthToken(java.lang.String oauthToken) {
return (Delete) super.setOauthToken(oauthToken);
}
@Override
public Delete setPrettyPrint(java.lang.Boolean prettyPrint) {
return (Delete) super.setPrettyPrint(prettyPrint);
}
@Override
public Delete setQuotaUser(java.lang.String quotaUser) {
return (Delete) super.setQuotaUser(quotaUser);
}
@Override
public Delete setUserIp(java.lang.String userIp) {
return (Delete) super.setUserIp(userIp);
}
/** The project under which the queue lies. */
@com.google.api.client.util.Key
private java.lang.String project;
/** The project under which the queue lies.
*/
public java.lang.String getProject() {
return project;
}
/** The project under which the queue lies. */
public Delete setProject(java.lang.String project) {
this.project = project;
return this;
}
/** The taskqueue to delete a task from. */
@com.google.api.client.util.Key
private java.lang.String taskqueue;
/** The taskqueue to delete a task from.
*/
public java.lang.String getTaskqueue() {
return taskqueue;
}
/** The taskqueue to delete a task from. */
public Delete setTaskqueue(java.lang.String taskqueue) {
this.taskqueue = taskqueue;
return this;
}
/** The id of the task to delete. */
@com.google.api.client.util.Key
private java.lang.String task;
/** The id of the task to delete.
*/
public java.lang.String getTask() {
return task;
}
/** The id of the task to delete. */
public Delete setTask(java.lang.String task) {
this.task = task;
return this;
}
@Override
public Delete set(String parameterName, Object value) {
return (Delete) super.set(parameterName, value);
}
}
/**
* Get a particular task from a TaskQueue.
*
* Create a request for the method "tasks.get".
*
* This request holds the parameters needed by the taskqueue server. After setting any optional
* parameters, call the {@link Get#execute()} method to invoke the remote operation.
*
* @param project The project under which the queue lies.
* @param taskqueue The taskqueue in which the task belongs.
* @param task The task to get properties of.
* @return the request
*/
public Get get(java.lang.String project, java.lang.String taskqueue, java.lang.String task) throws java.io.IOException {
Get result = new Get(project, taskqueue, task);
initialize(result);
return result;
}
public class Get extends TaskqueueRequest {
private static final String REST_PATH = "{project}/taskqueues/{taskqueue}/tasks/{task}";
/**
* Get a particular task from a TaskQueue.
*
* Create a request for the method "tasks.get".
*
* This request holds the parameters needed by the the taskqueue server. After setting any
* optional parameters, call the {@link Get#execute()} method to invoke the remote operation.
* {@link Get#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
* must be called to initialize this instance immediately after invoking the constructor.
*
* @param project The project under which the queue lies.
* @param taskqueue The taskqueue in which the task belongs.
* @param task The task to get properties of.
* @since 1.13
*/
protected Get(java.lang.String project, java.lang.String taskqueue, java.lang.String task) {
super(Taskqueue.this, "GET", REST_PATH, null, com.google.api.services.taskqueue.model.Task.class);
this.project = com.google.api.client.util.Preconditions.checkNotNull(project, "Required parameter project must be specified.");
this.taskqueue = com.google.api.client.util.Preconditions.checkNotNull(taskqueue, "Required parameter taskqueue must be specified.");
this.task = com.google.api.client.util.Preconditions.checkNotNull(task, "Required parameter task must be specified.");
}
@Override
public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
return super.executeUsingHead();
}
@Override
public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
return super.buildHttpRequestUsingHead();
}
@Override
public Get setAlt(java.lang.String alt) {
return (Get) super.setAlt(alt);
}
@Override
public Get setFields(java.lang.String fields) {
return (Get) super.setFields(fields);
}
@Override
public Get setKey(java.lang.String key) {
return (Get) super.setKey(key);
}
@Override
public Get setOauthToken(java.lang.String oauthToken) {
return (Get) super.setOauthToken(oauthToken);
}
@Override
public Get setPrettyPrint(java.lang.Boolean prettyPrint) {
return (Get) super.setPrettyPrint(prettyPrint);
}
@Override
public Get setQuotaUser(java.lang.String quotaUser) {
return (Get) super.setQuotaUser(quotaUser);
}
@Override
public Get setUserIp(java.lang.String userIp) {
return (Get) super.setUserIp(userIp);
}
/** The project under which the queue lies. */
@com.google.api.client.util.Key
private java.lang.String project;
/** The project under which the queue lies.
*/
public java.lang.String getProject() {
return project;
}
/** The project under which the queue lies. */
public Get setProject(java.lang.String project) {
this.project = project;
return this;
}
/** The taskqueue in which the task belongs. */
@com.google.api.client.util.Key
private java.lang.String taskqueue;
/** The taskqueue in which the task belongs.
*/
public java.lang.String getTaskqueue() {
return taskqueue;
}
/** The taskqueue in which the task belongs. */
public Get setTaskqueue(java.lang.String taskqueue) {
this.taskqueue = taskqueue;
return this;
}
/** The task to get properties of. */
@com.google.api.client.util.Key
private java.lang.String task;
/** The task to get properties of.
*/
public java.lang.String getTask() {
return task;
}
/** The task to get properties of. */
public Get setTask(java.lang.String task) {
this.task = task;
return this;
}
@Override
public Get set(String parameterName, Object value) {
return (Get) super.set(parameterName, value);
}
}
/**
* Insert a new task in a TaskQueue
*
* Create a request for the method "tasks.insert".
*
* This request holds the parameters needed by the taskqueue server. After setting any optional
* parameters, call the {@link Insert#execute()} method to invoke the remote operation.
*
* @param project The project under which the queue lies
* @param taskqueue The taskqueue to insert the task into
* @param content the {@link com.google.api.services.taskqueue.model.Task}
* @return the request
*/
public Insert insert(java.lang.String project, java.lang.String taskqueue, com.google.api.services.taskqueue.model.Task content) throws java.io.IOException {
Insert result = new Insert(project, taskqueue, content);
initialize(result);
return result;
}
public class Insert extends TaskqueueRequest {
private static final String REST_PATH = "{project}/taskqueues/{taskqueue}/tasks";
/**
* Insert a new task in a TaskQueue
*
* Create a request for the method "tasks.insert".
*
* This request holds the parameters needed by the the taskqueue server. After setting any
* optional parameters, call the {@link Insert#execute()} method to invoke the remote operation.
* {@link
* Insert#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
* be called to initialize this instance immediately after invoking the constructor.
*
* @param project The project under which the queue lies
* @param taskqueue The taskqueue to insert the task into
* @param content the {@link com.google.api.services.taskqueue.model.Task}
* @since 1.13
*/
protected Insert(java.lang.String project, java.lang.String taskqueue, com.google.api.services.taskqueue.model.Task content) {
super(Taskqueue.this, "POST", REST_PATH, content, com.google.api.services.taskqueue.model.Task.class);
this.project = com.google.api.client.util.Preconditions.checkNotNull(project, "Required parameter project must be specified.");
this.taskqueue = com.google.api.client.util.Preconditions.checkNotNull(taskqueue, "Required parameter taskqueue must be specified.");
}
@Override
public Insert setAlt(java.lang.String alt) {
return (Insert) super.setAlt(alt);
}
@Override
public Insert setFields(java.lang.String fields) {
return (Insert) super.setFields(fields);
}
@Override
public Insert setKey(java.lang.String key) {
return (Insert) super.setKey(key);
}
@Override
public Insert setOauthToken(java.lang.String oauthToken) {
return (Insert) super.setOauthToken(oauthToken);
}
@Override
public Insert setPrettyPrint(java.lang.Boolean prettyPrint) {
return (Insert) super.setPrettyPrint(prettyPrint);
}
@Override
public Insert setQuotaUser(java.lang.String quotaUser) {
return (Insert) super.setQuotaUser(quotaUser);
}
@Override
public Insert setUserIp(java.lang.String userIp) {
return (Insert) super.setUserIp(userIp);
}
/** The project under which the queue lies */
@com.google.api.client.util.Key
private java.lang.String project;
/** The project under which the queue lies
*/
public java.lang.String getProject() {
return project;
}
/** The project under which the queue lies */
public Insert setProject(java.lang.String project) {
this.project = project;
return this;
}
/** The taskqueue to insert the task into */
@com.google.api.client.util.Key
private java.lang.String taskqueue;
/** The taskqueue to insert the task into
*/
public java.lang.String getTaskqueue() {
return taskqueue;
}
/** The taskqueue to insert the task into */
public Insert setTaskqueue(java.lang.String taskqueue) {
this.taskqueue = taskqueue;
return this;
}
@Override
public Insert set(String parameterName, Object value) {
return (Insert) super.set(parameterName, value);
}
}
/**
* Lease 1 or more tasks from a TaskQueue.
*
* Create a request for the method "tasks.lease".
*
* This request holds the parameters needed by the taskqueue server. After setting any optional
* parameters, call the {@link Lease#execute()} method to invoke the remote operation.
*
* @param project The project under which the queue lies.
* @param taskqueue The taskqueue to lease a task from.
* @param numTasks The number of tasks to lease.
* @param leaseSecs The lease in seconds.
* @return the request
*/
public Lease lease(java.lang.String project, java.lang.String taskqueue, java.lang.Integer numTasks, java.lang.Integer leaseSecs) throws java.io.IOException {
Lease result = new Lease(project, taskqueue, numTasks, leaseSecs);
initialize(result);
return result;
}
public class Lease extends TaskqueueRequest {
private static final String REST_PATH = "{project}/taskqueues/{taskqueue}/tasks/lease";
/**
* Lease 1 or more tasks from a TaskQueue.
*
* Create a request for the method "tasks.lease".
*
* This request holds the parameters needed by the the taskqueue server. After setting any
* optional parameters, call the {@link Lease#execute()} method to invoke the remote operation.
* {@link
* Lease#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
* be called to initialize this instance immediately after invoking the constructor.
*
* @param project The project under which the queue lies.
* @param taskqueue The taskqueue to lease a task from.
* @param numTasks The number of tasks to lease.
* @param leaseSecs The lease in seconds.
* @since 1.13
*/
protected Lease(java.lang.String project, java.lang.String taskqueue, java.lang.Integer numTasks, java.lang.Integer leaseSecs) {
super(Taskqueue.this, "POST", REST_PATH, null, com.google.api.services.taskqueue.model.Tasks.class);
this.project = com.google.api.client.util.Preconditions.checkNotNull(project, "Required parameter project must be specified.");
this.taskqueue = com.google.api.client.util.Preconditions.checkNotNull(taskqueue, "Required parameter taskqueue must be specified.");
this.numTasks = com.google.api.client.util.Preconditions.checkNotNull(numTasks, "Required parameter numTasks must be specified.");
this.leaseSecs = com.google.api.client.util.Preconditions.checkNotNull(leaseSecs, "Required parameter leaseSecs must be specified.");
}
@Override
public Lease setAlt(java.lang.String alt) {
return (Lease) super.setAlt(alt);
}
@Override
public Lease setFields(java.lang.String fields) {
return (Lease) super.setFields(fields);
}
@Override
public Lease setKey(java.lang.String key) {
return (Lease) super.setKey(key);
}
@Override
public Lease setOauthToken(java.lang.String oauthToken) {
return (Lease) super.setOauthToken(oauthToken);
}
@Override
public Lease setPrettyPrint(java.lang.Boolean prettyPrint) {
return (Lease) super.setPrettyPrint(prettyPrint);
}
@Override
public Lease setQuotaUser(java.lang.String quotaUser) {
return (Lease) super.setQuotaUser(quotaUser);
}
@Override
public Lease setUserIp(java.lang.String userIp) {
return (Lease) super.setUserIp(userIp);
}
/** The project under which the queue lies. */
@com.google.api.client.util.Key
private java.lang.String project;
/** The project under which the queue lies.
*/
public java.lang.String getProject() {
return project;
}
/** The project under which the queue lies. */
public Lease setProject(java.lang.String project) {
this.project = project;
return this;
}
/** The taskqueue to lease a task from. */
@com.google.api.client.util.Key
private java.lang.String taskqueue;
/** The taskqueue to lease a task from.
*/
public java.lang.String getTaskqueue() {
return taskqueue;
}
/** The taskqueue to lease a task from. */
public Lease setTaskqueue(java.lang.String taskqueue) {
this.taskqueue = taskqueue;
return this;
}
/** The number of tasks to lease. */
@com.google.api.client.util.Key
private java.lang.Integer numTasks;
/** The number of tasks to lease.
*/
public java.lang.Integer getNumTasks() {
return numTasks;
}
/** The number of tasks to lease. */
public Lease setNumTasks(java.lang.Integer numTasks) {
this.numTasks = numTasks;
return this;
}
/** The lease in seconds. */
@com.google.api.client.util.Key
private java.lang.Integer leaseSecs;
/** The lease in seconds.
*/
public java.lang.Integer getLeaseSecs() {
return leaseSecs;
}
/** The lease in seconds. */
public Lease setLeaseSecs(java.lang.Integer leaseSecs) {
this.leaseSecs = leaseSecs;
return this;
}
/** When true, all returned tasks will have the same tag */
@com.google.api.client.util.Key
private java.lang.Boolean groupByTag;
/** When true, all returned tasks will have the same tag
*/
public java.lang.Boolean getGroupByTag() {
return groupByTag;
}
/** When true, all returned tasks will have the same tag */
public Lease setGroupByTag(java.lang.Boolean groupByTag) {
this.groupByTag = groupByTag;
return this;
}
/**
* The tag allowed for tasks in the response. Must only be specified if group_by_tag is true.
* If group_by_tag is true and tag is not specified the tag will be that of the oldest task by
* eta, i.e. the first available tag
*/
@com.google.api.client.util.Key
private java.lang.String tag;
/** The tag allowed for tasks in the response. Must only be specified if group_by_tag is true. If
group_by_tag is true and tag is not specified the tag will be that of the oldest task by eta, i.e.
the first available tag
*/
public java.lang.String getTag() {
return tag;
}
/**
* The tag allowed for tasks in the response. Must only be specified if group_by_tag is true.
* If group_by_tag is true and tag is not specified the tag will be that of the oldest task by
* eta, i.e. the first available tag
*/
public Lease setTag(java.lang.String tag) {
this.tag = tag;
return this;
}
@Override
public Lease set(String parameterName, Object value) {
return (Lease) super.set(parameterName, value);
}
}
/**
* List Tasks in a TaskQueue
*
* Create a request for the method "tasks.list".
*
* This request holds the parameters needed by the taskqueue server. After setting any optional
* parameters, call the {@link List#execute()} method to invoke the remote operation.
*
* @param project The project under which the queue lies.
* @param taskqueue The id of the taskqueue to list tasks from.
* @return the request
*/
public List list(java.lang.String project, java.lang.String taskqueue) throws java.io.IOException {
List result = new List(project, taskqueue);
initialize(result);
return result;
}
public class List extends TaskqueueRequest {
private static final String REST_PATH = "{project}/taskqueues/{taskqueue}/tasks";
/**
* List Tasks in a TaskQueue
*
* Create a request for the method "tasks.list".
*
* This request holds the parameters needed by the the taskqueue server. After setting any
* optional parameters, call the {@link List#execute()} method to invoke the remote operation.
* {@link List#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
* must be called to initialize this instance immediately after invoking the constructor.
*
* @param project The project under which the queue lies.
* @param taskqueue The id of the taskqueue to list tasks from.
* @since 1.13
*/
protected List(java.lang.String project, java.lang.String taskqueue) {
super(Taskqueue.this, "GET", REST_PATH, null, com.google.api.services.taskqueue.model.Tasks2.class);
this.project = com.google.api.client.util.Preconditions.checkNotNull(project, "Required parameter project must be specified.");
this.taskqueue = com.google.api.client.util.Preconditions.checkNotNull(taskqueue, "Required parameter taskqueue must be specified.");
}
@Override
public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
return super.executeUsingHead();
}
@Override
public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
return super.buildHttpRequestUsingHead();
}
@Override
public List setAlt(java.lang.String alt) {
return (List) super.setAlt(alt);
}
@Override
public List setFields(java.lang.String fields) {
return (List) super.setFields(fields);
}
@Override
public List setKey(java.lang.String key) {
return (List) super.setKey(key);
}
@Override
public List setOauthToken(java.lang.String oauthToken) {
return (List) super.setOauthToken(oauthToken);
}
@Override
public List setPrettyPrint(java.lang.Boolean prettyPrint) {
return (List) super.setPrettyPrint(prettyPrint);
}
@Override
public List setQuotaUser(java.lang.String quotaUser) {
return (List) super.setQuotaUser(quotaUser);
}
@Override
public List setUserIp(java.lang.String userIp) {
return (List) super.setUserIp(userIp);
}
/** The project under which the queue lies. */
@com.google.api.client.util.Key
private java.lang.String project;
/** The project under which the queue lies.
*/
public java.lang.String getProject() {
return project;
}
/** The project under which the queue lies. */
public List setProject(java.lang.String project) {
this.project = project;
return this;
}
/** The id of the taskqueue to list tasks from. */
@com.google.api.client.util.Key
private java.lang.String taskqueue;
/** The id of the taskqueue to list tasks from.
*/
public java.lang.String getTaskqueue() {
return taskqueue;
}
/** The id of the taskqueue to list tasks from. */
public List setTaskqueue(java.lang.String taskqueue) {
this.taskqueue = taskqueue;
return this;
}
@Override
public List set(String parameterName, Object value) {
return (List) super.set(parameterName, value);
}
}
/**
* Update tasks that are leased out of a TaskQueue. This method supports patch semantics.
*
* Create a request for the method "tasks.patch".
*
* This request holds the parameters needed by the taskqueue server. After setting any optional
* parameters, call the {@link Patch#execute()} method to invoke the remote operation.
*
* @param project The project under which the queue lies.
* @param taskqueue
* @param task
* @param newLeaseSeconds The new lease in seconds.
* @param content the {@link com.google.api.services.taskqueue.model.Task}
* @return the request
*/
public Patch patch(java.lang.String project, java.lang.String taskqueue, java.lang.String task, java.lang.Integer newLeaseSeconds, com.google.api.services.taskqueue.model.Task content) throws java.io.IOException {
Patch result = new Patch(project, taskqueue, task, newLeaseSeconds, content);
initialize(result);
return result;
}
public class Patch extends TaskqueueRequest {
private static final String REST_PATH = "{project}/taskqueues/{taskqueue}/tasks/{task}";
/**
* Update tasks that are leased out of a TaskQueue. This method supports patch semantics.
*
* Create a request for the method "tasks.patch".
*
* This request holds the parameters needed by the the taskqueue server. After setting any
* optional parameters, call the {@link Patch#execute()} method to invoke the remote operation.
* {@link
* Patch#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
* be called to initialize this instance immediately after invoking the constructor.
*
* @param project The project under which the queue lies.
* @param taskqueue
* @param task
* @param newLeaseSeconds The new lease in seconds.
* @param content the {@link com.google.api.services.taskqueue.model.Task}
* @since 1.13
*/
protected Patch(java.lang.String project, java.lang.String taskqueue, java.lang.String task, java.lang.Integer newLeaseSeconds, com.google.api.services.taskqueue.model.Task content) {
super(Taskqueue.this, "PATCH", REST_PATH, content, com.google.api.services.taskqueue.model.Task.class);
this.project = com.google.api.client.util.Preconditions.checkNotNull(project, "Required parameter project must be specified.");
this.taskqueue = com.google.api.client.util.Preconditions.checkNotNull(taskqueue, "Required parameter taskqueue must be specified.");
this.task = com.google.api.client.util.Preconditions.checkNotNull(task, "Required parameter task must be specified.");
this.newLeaseSeconds = com.google.api.client.util.Preconditions.checkNotNull(newLeaseSeconds, "Required parameter newLeaseSeconds must be specified.");
}
@Override
public Patch setAlt(java.lang.String alt) {
return (Patch) super.setAlt(alt);
}
@Override
public Patch setFields(java.lang.String fields) {
return (Patch) super.setFields(fields);
}
@Override
public Patch setKey(java.lang.String key) {
return (Patch) super.setKey(key);
}
@Override
public Patch setOauthToken(java.lang.String oauthToken) {
return (Patch) super.setOauthToken(oauthToken);
}
@Override
public Patch setPrettyPrint(java.lang.Boolean prettyPrint) {
return (Patch) super.setPrettyPrint(prettyPrint);
}
@Override
public Patch setQuotaUser(java.lang.String quotaUser) {
return (Patch) super.setQuotaUser(quotaUser);
}
@Override
public Patch setUserIp(java.lang.String userIp) {
return (Patch) super.setUserIp(userIp);
}
/** The project under which the queue lies. */
@com.google.api.client.util.Key
private java.lang.String project;
/** The project under which the queue lies.
*/
public java.lang.String getProject() {
return project;
}
/** The project under which the queue lies. */
public Patch setProject(java.lang.String project) {
this.project = project;
return this;
}
@com.google.api.client.util.Key
private java.lang.String taskqueue;
/**
*/
public java.lang.String getTaskqueue() {
return taskqueue;
}
public Patch setTaskqueue(java.lang.String taskqueue) {
this.taskqueue = taskqueue;
return this;
}
@com.google.api.client.util.Key
private java.lang.String task;
/**
*/
public java.lang.String getTask() {
return task;
}
public Patch setTask(java.lang.String task) {
this.task = task;
return this;
}
/** The new lease in seconds. */
@com.google.api.client.util.Key
private java.lang.Integer newLeaseSeconds;
/** The new lease in seconds.
*/
public java.lang.Integer getNewLeaseSeconds() {
return newLeaseSeconds;
}
/** The new lease in seconds. */
public Patch setNewLeaseSeconds(java.lang.Integer newLeaseSeconds) {
this.newLeaseSeconds = newLeaseSeconds;
return this;
}
@Override
public Patch set(String parameterName, Object value) {
return (Patch) super.set(parameterName, value);
}
}
/**
* Update tasks that are leased out of a TaskQueue.
*
* Create a request for the method "tasks.update".
*
* This request holds the parameters needed by the taskqueue server. After setting any optional
* parameters, call the {@link Update#execute()} method to invoke the remote operation.
*
* @param project The project under which the queue lies.
* @param taskqueue
* @param task
* @param newLeaseSeconds The new lease in seconds.
* @param content the {@link com.google.api.services.taskqueue.model.Task}
* @return the request
*/
public Update update(java.lang.String project, java.lang.String taskqueue, java.lang.String task, java.lang.Integer newLeaseSeconds, com.google.api.services.taskqueue.model.Task content) throws java.io.IOException {
Update result = new Update(project, taskqueue, task, newLeaseSeconds, content);
initialize(result);
return result;
}
public class Update extends TaskqueueRequest {
private static final String REST_PATH = "{project}/taskqueues/{taskqueue}/tasks/{task}";
/**
* Update tasks that are leased out of a TaskQueue.
*
* Create a request for the method "tasks.update".
*
* This request holds the parameters needed by the the taskqueue server. After setting any
* optional parameters, call the {@link Update#execute()} method to invoke the remote operation.
* {@link
* Update#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
* be called to initialize this instance immediately after invoking the constructor.
*
* @param project The project under which the queue lies.
* @param taskqueue
* @param task
* @param newLeaseSeconds The new lease in seconds.
* @param content the {@link com.google.api.services.taskqueue.model.Task}
* @since 1.13
*/
protected Update(java.lang.String project, java.lang.String taskqueue, java.lang.String task, java.lang.Integer newLeaseSeconds, com.google.api.services.taskqueue.model.Task content) {
super(Taskqueue.this, "POST", REST_PATH, content, com.google.api.services.taskqueue.model.Task.class);
this.project = com.google.api.client.util.Preconditions.checkNotNull(project, "Required parameter project must be specified.");
this.taskqueue = com.google.api.client.util.Preconditions.checkNotNull(taskqueue, "Required parameter taskqueue must be specified.");
this.task = com.google.api.client.util.Preconditions.checkNotNull(task, "Required parameter task must be specified.");
this.newLeaseSeconds = com.google.api.client.util.Preconditions.checkNotNull(newLeaseSeconds, "Required parameter newLeaseSeconds must be specified.");
}
@Override
public Update setAlt(java.lang.String alt) {
return (Update) super.setAlt(alt);
}
@Override
public Update setFields(java.lang.String fields) {
return (Update) super.setFields(fields);
}
@Override
public Update setKey(java.lang.String key) {
return (Update) super.setKey(key);
}
@Override
public Update setOauthToken(java.lang.String oauthToken) {
return (Update) super.setOauthToken(oauthToken);
}
@Override
public Update setPrettyPrint(java.lang.Boolean prettyPrint) {
return (Update) super.setPrettyPrint(prettyPrint);
}
@Override
public Update setQuotaUser(java.lang.String quotaUser) {
return (Update) super.setQuotaUser(quotaUser);
}
@Override
public Update setUserIp(java.lang.String userIp) {
return (Update) super.setUserIp(userIp);
}
/** The project under which the queue lies. */
@com.google.api.client.util.Key
private java.lang.String project;
/** The project under which the queue lies.
*/
public java.lang.String getProject() {
return project;
}
/** The project under which the queue lies. */
public Update setProject(java.lang.String project) {
this.project = project;
return this;
}
@com.google.api.client.util.Key
private java.lang.String taskqueue;
/**
*/
public java.lang.String getTaskqueue() {
return taskqueue;
}
public Update setTaskqueue(java.lang.String taskqueue) {
this.taskqueue = taskqueue;
return this;
}
@com.google.api.client.util.Key
private java.lang.String task;
/**
*/
public java.lang.String getTask() {
return task;
}
public Update setTask(java.lang.String task) {
this.task = task;
return this;
}
/** The new lease in seconds. */
@com.google.api.client.util.Key
private java.lang.Integer newLeaseSeconds;
/** The new lease in seconds.
*/
public java.lang.Integer getNewLeaseSeconds() {
return newLeaseSeconds;
}
/** The new lease in seconds. */
public Update setNewLeaseSeconds(java.lang.Integer newLeaseSeconds) {
this.newLeaseSeconds = newLeaseSeconds;
return this;
}
@Override
public Update set(String parameterName, Object value) {
return (Update) super.set(parameterName, value);
}
}
}
/**
* Builder for {@link Taskqueue}.
*
*
* Implementation is not thread-safe.
*
*
* @since 1.3.0
*/
public static final class Builder extends com.google.api.client.googleapis.services.json.AbstractGoogleJsonClient.Builder {
/**
* Returns an instance of a new builder.
*
* @param transport HTTP transport, which should normally be:
*
* - Google App Engine:
* {@code com.google.api.client.extensions.appengine.http.UrlFetchTransport}
* - Android: {@code newCompatibleTransport} from
* {@code com.google.api.client.extensions.android.http.AndroidHttp}
* - Java: {@link com.google.api.client.googleapis.javanet.GoogleNetHttpTransport#newTrustedTransport()}
*
*
* @param jsonFactory JSON factory, which may be:
*
* - Jackson: {@code com.google.api.client.json.jackson2.JacksonFactory}
* - Google GSON: {@code com.google.api.client.json.gson.GsonFactory}
* - Android Honeycomb or higher:
* {@code com.google.api.client.extensions.android.json.AndroidJsonFactory}
*
* @param httpRequestInitializer HTTP request initializer or {@code null} for none
* @since 1.7
*/
public Builder(com.google.api.client.http.HttpTransport transport, com.google.api.client.json.JsonFactory jsonFactory,
com.google.api.client.http.HttpRequestInitializer httpRequestInitializer) {
super(
transport,
jsonFactory,
DEFAULT_ROOT_URL,
DEFAULT_SERVICE_PATH,
httpRequestInitializer,
false);
}
/** Builds a new instance of {@link Taskqueue}. */
@Override
public Taskqueue build() {
return new Taskqueue(this);
}
@Override
public Builder setRootUrl(String rootUrl) {
return (Builder) super.setRootUrl(rootUrl);
}
@Override
public Builder setServicePath(String servicePath) {
return (Builder) super.setServicePath(servicePath);
}
@Override
public Builder setHttpRequestInitializer(com.google.api.client.http.HttpRequestInitializer httpRequestInitializer) {
return (Builder) super.setHttpRequestInitializer(httpRequestInitializer);
}
@Override
public Builder setApplicationName(String applicationName) {
return (Builder) super.setApplicationName(applicationName);
}
@Override
public Builder setSuppressPatternChecks(boolean suppressPatternChecks) {
return (Builder) super.setSuppressPatternChecks(suppressPatternChecks);
}
@Override
public Builder setSuppressRequiredParameterChecks(boolean suppressRequiredParameterChecks) {
return (Builder) super.setSuppressRequiredParameterChecks(suppressRequiredParameterChecks);
}
@Override
public Builder setSuppressAllChecks(boolean suppressAllChecks) {
return (Builder) super.setSuppressAllChecks(suppressAllChecks);
}
/**
* Set the {@link TaskqueueRequestInitializer}.
*
* @since 1.12
*/
public Builder setTaskqueueRequestInitializer(
TaskqueueRequestInitializer taskqueueRequestInitializer) {
return (Builder) super.setGoogleClientRequestInitializer(taskqueueRequestInitializer);
}
@Override
public Builder setGoogleClientRequestInitializer(
com.google.api.client.googleapis.services.GoogleClientRequestInitializer googleClientRequestInitializer) {
return (Builder) super.setGoogleClientRequestInitializer(googleClientRequestInitializer);
}
}
}