All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.google.api.services.pubsub.Pubsub 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://code.google.com/p/google-apis-client-generator/
 * (build: 2017-02-15 17:18:02 UTC)
 * on 2017-08-08 at 23:36:27 UTC 
 * Modify at your own risk.
 */

package com.google.api.services.pubsub;

/**
 * Service definition for Pubsub (v1beta1a).
 *
 * 

* Provides reliable, many-to-many, asynchronous messaging between applications. *

* *

* For more information about this service, see the * API Documentation *

* *

* This service uses {@link PubsubRequestInitializer} to initialize global parameters via its * {@link Builder}. *

* * @since 1.3 * @author Google, Inc. */ @SuppressWarnings("javadoc") public class Pubsub 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.18.0-rc of the Google Cloud Pub/Sub 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://pubsub.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 = ""; /** * 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 Pubsub(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 */ Pubsub(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 Subscriptions collection. * *

The typical use is:

*
   *   {@code Pubsub pubsub = new Pubsub(...);}
   *   {@code Pubsub.Subscriptions.List request = pubsub.subscriptions().list(parameters ...)}
   * 
* * @return the resource collection */ public Subscriptions subscriptions() { return new Subscriptions(); } /** * The "subscriptions" collection of methods. */ public class Subscriptions { /** * Acknowledges a particular received message: the Pub/Sub system can remove the given message from * the subscription. Acknowledging a message whose Ack deadline has expired may succeed, but the * message could have been already redelivered. Acknowledging a message more than once will not * result in an error. This is only used for messages received via pull. * * Create a request for the method "subscriptions.acknowledge". * * This request holds the parameters needed by the pubsub server. After setting any optional * parameters, call the {@link Acknowledge#execute()} method to invoke the remote operation. * * @param content the {@link com.google.api.services.pubsub.model.AcknowledgeRequest} * @return the request */ public Acknowledge acknowledge(com.google.api.services.pubsub.model.AcknowledgeRequest content) throws java.io.IOException { Acknowledge result = new Acknowledge(content); initialize(result); return result; } public class Acknowledge extends PubsubRequest { private static final String REST_PATH = "v1beta1a/subscriptions/acknowledge"; /** * Acknowledges a particular received message: the Pub/Sub system can remove the given message * from the subscription. Acknowledging a message whose Ack deadline has expired may succeed, but * the message could have been already redelivered. Acknowledging a message more than once will * not result in an error. This is only used for messages received via pull. * * Create a request for the method "subscriptions.acknowledge". * * This request holds the parameters needed by the the pubsub server. After setting any optional * parameters, call the {@link Acknowledge#execute()} method to invoke the remote operation.

* {@link * Acknowledge#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} * must be called to initialize this instance immediately after invoking the constructor.

* * @param content the {@link com.google.api.services.pubsub.model.AcknowledgeRequest} * @since 1.13 */ protected Acknowledge(com.google.api.services.pubsub.model.AcknowledgeRequest content) { super(Pubsub.this, "POST", REST_PATH, content, com.google.api.services.pubsub.model.Empty.class); } @Override public Acknowledge set$Xgafv(java.lang.String $Xgafv) { return (Acknowledge) super.set$Xgafv($Xgafv); } @Override public Acknowledge setAccessToken(java.lang.String accessToken) { return (Acknowledge) super.setAccessToken(accessToken); } @Override public Acknowledge setAlt(java.lang.String alt) { return (Acknowledge) super.setAlt(alt); } @Override public Acknowledge setBearerToken(java.lang.String bearerToken) { return (Acknowledge) super.setBearerToken(bearerToken); } @Override public Acknowledge setCallback(java.lang.String callback) { return (Acknowledge) super.setCallback(callback); } @Override public Acknowledge setFields(java.lang.String fields) { return (Acknowledge) super.setFields(fields); } @Override public Acknowledge setKey(java.lang.String key) { return (Acknowledge) super.setKey(key); } @Override public Acknowledge setOauthToken(java.lang.String oauthToken) { return (Acknowledge) super.setOauthToken(oauthToken); } @Override public Acknowledge setPp(java.lang.Boolean pp) { return (Acknowledge) super.setPp(pp); } @Override public Acknowledge setPrettyPrint(java.lang.Boolean prettyPrint) { return (Acknowledge) super.setPrettyPrint(prettyPrint); } @Override public Acknowledge setQuotaUser(java.lang.String quotaUser) { return (Acknowledge) super.setQuotaUser(quotaUser); } @Override public Acknowledge setUploadType(java.lang.String uploadType) { return (Acknowledge) super.setUploadType(uploadType); } @Override public Acknowledge setUploadProtocol(java.lang.String uploadProtocol) { return (Acknowledge) super.setUploadProtocol(uploadProtocol); } @Override public Acknowledge set(String parameterName, Object value) { return (Acknowledge) super.set(parameterName, value); } } /** * Creates a subscription on a given topic for a given subscriber. If the subscription already * exists, returns ALREADY_EXISTS. If the corresponding topic doesn't exist, returns NOT_FOUND. * * If the name is not provided in the request, the server will assign a random name for this * subscription on the same project as the topic. * * Create a request for the method "subscriptions.create". * * This request holds the parameters needed by the pubsub server. After setting any optional * parameters, call the {@link Create#execute()} method to invoke the remote operation. * * @param content the {@link com.google.api.services.pubsub.model.Subscription} * @return the request */ public Create create(com.google.api.services.pubsub.model.Subscription content) throws java.io.IOException { Create result = new Create(content); initialize(result); return result; } public class Create extends PubsubRequest { private static final String REST_PATH = "v1beta1a/subscriptions"; /** * Creates a subscription on a given topic for a given subscriber. If the subscription already * exists, returns ALREADY_EXISTS. If the corresponding topic doesn't exist, returns NOT_FOUND. * * If the name is not provided in the request, the server will assign a random name for this * subscription on the same project as the topic. * * Create a request for the method "subscriptions.create". * * This request holds the parameters needed by the the pubsub server. After setting any optional * parameters, call the {@link Create#execute()} method to invoke the remote operation.

{@link * Create#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must * be called to initialize this instance immediately after invoking the constructor.

* * @param content the {@link com.google.api.services.pubsub.model.Subscription} * @since 1.13 */ protected Create(com.google.api.services.pubsub.model.Subscription content) { super(Pubsub.this, "POST", REST_PATH, content, com.google.api.services.pubsub.model.Subscription.class); } @Override public Create set$Xgafv(java.lang.String $Xgafv) { return (Create) super.set$Xgafv($Xgafv); } @Override public Create setAccessToken(java.lang.String accessToken) { return (Create) super.setAccessToken(accessToken); } @Override public Create setAlt(java.lang.String alt) { return (Create) super.setAlt(alt); } @Override public Create setBearerToken(java.lang.String bearerToken) { return (Create) super.setBearerToken(bearerToken); } @Override public Create setCallback(java.lang.String callback) { return (Create) super.setCallback(callback); } @Override public Create setFields(java.lang.String fields) { return (Create) super.setFields(fields); } @Override public Create setKey(java.lang.String key) { return (Create) super.setKey(key); } @Override public Create setOauthToken(java.lang.String oauthToken) { return (Create) super.setOauthToken(oauthToken); } @Override public Create setPp(java.lang.Boolean pp) { return (Create) super.setPp(pp); } @Override public Create setPrettyPrint(java.lang.Boolean prettyPrint) { return (Create) super.setPrettyPrint(prettyPrint); } @Override public Create setQuotaUser(java.lang.String quotaUser) { return (Create) super.setQuotaUser(quotaUser); } @Override public Create setUploadType(java.lang.String uploadType) { return (Create) super.setUploadType(uploadType); } @Override public Create setUploadProtocol(java.lang.String uploadProtocol) { return (Create) super.setUploadProtocol(uploadProtocol); } @Override public Create set(String parameterName, Object value) { return (Create) super.set(parameterName, value); } } /** * Deletes an existing subscription. All pending messages in the subscription are immediately * dropped. Calls to Pull after deletion will return NOT_FOUND. * * Create a request for the method "subscriptions.delete". * * This request holds the parameters needed by the pubsub server. After setting any optional * parameters, call the {@link Delete#execute()} method to invoke the remote operation. * * @param subscription The subscription to delete. * @return the request */ public Delete delete(java.lang.String subscription) throws java.io.IOException { Delete result = new Delete(subscription); initialize(result); return result; } public class Delete extends PubsubRequest { private static final String REST_PATH = "v1beta1a/subscriptions/{+subscription}"; private final java.util.regex.Pattern SUBSCRIPTION_PATTERN = java.util.regex.Pattern.compile("^.+$"); /** * Deletes an existing subscription. All pending messages in the subscription are immediately * dropped. Calls to Pull after deletion will return NOT_FOUND. * * Create a request for the method "subscriptions.delete". * * This request holds the parameters needed by the the pubsub 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 subscription The subscription to delete. * @since 1.13 */ protected Delete(java.lang.String subscription) { super(Pubsub.this, "DELETE", REST_PATH, null, com.google.api.services.pubsub.model.Empty.class); this.subscription = com.google.api.client.util.Preconditions.checkNotNull(subscription, "Required parameter subscription must be specified."); if (!getSuppressPatternChecks()) { com.google.api.client.util.Preconditions.checkArgument(SUBSCRIPTION_PATTERN.matcher(subscription).matches(), "Parameter subscription must conform to the pattern " + "^.+$"); } } @Override public Delete set$Xgafv(java.lang.String $Xgafv) { return (Delete) super.set$Xgafv($Xgafv); } @Override public Delete setAccessToken(java.lang.String accessToken) { return (Delete) super.setAccessToken(accessToken); } @Override public Delete setAlt(java.lang.String alt) { return (Delete) super.setAlt(alt); } @Override public Delete setBearerToken(java.lang.String bearerToken) { return (Delete) super.setBearerToken(bearerToken); } @Override public Delete setCallback(java.lang.String callback) { return (Delete) super.setCallback(callback); } @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 setPp(java.lang.Boolean pp) { return (Delete) super.setPp(pp); } @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 setUploadType(java.lang.String uploadType) { return (Delete) super.setUploadType(uploadType); } @Override public Delete setUploadProtocol(java.lang.String uploadProtocol) { return (Delete) super.setUploadProtocol(uploadProtocol); } /** The subscription to delete. */ @com.google.api.client.util.Key private java.lang.String subscription; /** The subscription to delete. */ public java.lang.String getSubscription() { return subscription; } /** The subscription to delete. */ public Delete setSubscription(java.lang.String subscription) { if (!getSuppressPatternChecks()) { com.google.api.client.util.Preconditions.checkArgument(SUBSCRIPTION_PATTERN.matcher(subscription).matches(), "Parameter subscription must conform to the pattern " + "^.+$"); } this.subscription = subscription; return this; } @Override public Delete set(String parameterName, Object value) { return (Delete) super.set(parameterName, value); } } /** * Gets the configuration details of a subscription. * * Create a request for the method "subscriptions.get". * * This request holds the parameters needed by the pubsub server. After setting any optional * parameters, call the {@link Get#execute()} method to invoke the remote operation. * * @param subscription The name of the subscription to get. * @return the request */ public Get get(java.lang.String subscription) throws java.io.IOException { Get result = new Get(subscription); initialize(result); return result; } public class Get extends PubsubRequest { private static final String REST_PATH = "v1beta1a/subscriptions/{+subscription}"; private final java.util.regex.Pattern SUBSCRIPTION_PATTERN = java.util.regex.Pattern.compile("^.+$"); /** * Gets the configuration details of a subscription. * * Create a request for the method "subscriptions.get". * * This request holds the parameters needed by the the pubsub 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 subscription The name of the subscription to get. * @since 1.13 */ protected Get(java.lang.String subscription) { super(Pubsub.this, "GET", REST_PATH, null, com.google.api.services.pubsub.model.Subscription.class); this.subscription = com.google.api.client.util.Preconditions.checkNotNull(subscription, "Required parameter subscription must be specified."); if (!getSuppressPatternChecks()) { com.google.api.client.util.Preconditions.checkArgument(SUBSCRIPTION_PATTERN.matcher(subscription).matches(), "Parameter subscription must conform to the pattern " + "^.+$"); } } @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 set$Xgafv(java.lang.String $Xgafv) { return (Get) super.set$Xgafv($Xgafv); } @Override public Get setAccessToken(java.lang.String accessToken) { return (Get) super.setAccessToken(accessToken); } @Override public Get setAlt(java.lang.String alt) { return (Get) super.setAlt(alt); } @Override public Get setBearerToken(java.lang.String bearerToken) { return (Get) super.setBearerToken(bearerToken); } @Override public Get setCallback(java.lang.String callback) { return (Get) super.setCallback(callback); } @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 setPp(java.lang.Boolean pp) { return (Get) super.setPp(pp); } @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 setUploadType(java.lang.String uploadType) { return (Get) super.setUploadType(uploadType); } @Override public Get setUploadProtocol(java.lang.String uploadProtocol) { return (Get) super.setUploadProtocol(uploadProtocol); } /** The name of the subscription to get. */ @com.google.api.client.util.Key private java.lang.String subscription; /** The name of the subscription to get. */ public java.lang.String getSubscription() { return subscription; } /** The name of the subscription to get. */ public Get setSubscription(java.lang.String subscription) { if (!getSuppressPatternChecks()) { com.google.api.client.util.Preconditions.checkArgument(SUBSCRIPTION_PATTERN.matcher(subscription).matches(), "Parameter subscription must conform to the pattern " + "^.+$"); } this.subscription = subscription; return this; } @Override public Get set(String parameterName, Object value) { return (Get) super.set(parameterName, value); } } /** * Lists matching subscriptions. * * Create a request for the method "subscriptions.list". * * This request holds the parameters needed by the pubsub server. After setting any optional * parameters, call the {@link List#execute()} method to invoke the remote operation. * * @return the request */ public List list() throws java.io.IOException { List result = new List(); initialize(result); return result; } public class List extends PubsubRequest { private static final String REST_PATH = "v1beta1a/subscriptions"; /** * Lists matching subscriptions. * * Create a request for the method "subscriptions.list". * * This request holds the parameters needed by the the pubsub 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.

* * @since 1.13 */ protected List() { super(Pubsub.this, "GET", REST_PATH, null, com.google.api.services.pubsub.model.ListSubscriptionsResponse.class); } @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 set$Xgafv(java.lang.String $Xgafv) { return (List) super.set$Xgafv($Xgafv); } @Override public List setAccessToken(java.lang.String accessToken) { return (List) super.setAccessToken(accessToken); } @Override public List setAlt(java.lang.String alt) { return (List) super.setAlt(alt); } @Override public List setBearerToken(java.lang.String bearerToken) { return (List) super.setBearerToken(bearerToken); } @Override public List setCallback(java.lang.String callback) { return (List) super.setCallback(callback); } @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 setPp(java.lang.Boolean pp) { return (List) super.setPp(pp); } @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 setUploadType(java.lang.String uploadType) { return (List) super.setUploadType(uploadType); } @Override public List setUploadProtocol(java.lang.String uploadProtocol) { return (List) super.setUploadProtocol(uploadProtocol); } /** Maximum number of subscriptions to return. */ @com.google.api.client.util.Key private java.lang.Integer maxResults; /** Maximum number of subscriptions to return. */ public java.lang.Integer getMaxResults() { return maxResults; } /** Maximum number of subscriptions to return. */ public List setMaxResults(java.lang.Integer maxResults) { this.maxResults = maxResults; return this; } /** A valid label query expression. */ @com.google.api.client.util.Key private java.lang.String query; /** A valid label query expression. */ public java.lang.String getQuery() { return query; } /** A valid label query expression. */ public List setQuery(java.lang.String query) { this.query = query; return this; } /** * The value obtained in the last ListSubscriptionsResponse for continuation. */ @com.google.api.client.util.Key private java.lang.String pageToken; /** The value obtained in the last ListSubscriptionsResponse for continuation. */ public java.lang.String getPageToken() { return pageToken; } /** * The value obtained in the last ListSubscriptionsResponse for continuation. */ public List setPageToken(java.lang.String pageToken) { this.pageToken = pageToken; return this; } @Override public List set(String parameterName, Object value) { return (List) super.set(parameterName, value); } } /** * Modifies the Ack deadline for a message received from a pull request. * * Create a request for the method "subscriptions.modifyAckDeadline". * * This request holds the parameters needed by the pubsub server. After setting any optional * parameters, call the {@link ModifyAckDeadline#execute()} method to invoke the remote operation. * * @param content the {@link com.google.api.services.pubsub.model.ModifyAckDeadlineRequest} * @return the request */ public ModifyAckDeadline modifyAckDeadline(com.google.api.services.pubsub.model.ModifyAckDeadlineRequest content) throws java.io.IOException { ModifyAckDeadline result = new ModifyAckDeadline(content); initialize(result); return result; } public class ModifyAckDeadline extends PubsubRequest { private static final String REST_PATH = "v1beta1a/subscriptions/modifyAckDeadline"; /** * Modifies the Ack deadline for a message received from a pull request. * * Create a request for the method "subscriptions.modifyAckDeadline". * * This request holds the parameters needed by the the pubsub server. After setting any optional * parameters, call the {@link ModifyAckDeadline#execute()} method to invoke the remote operation. *

{@link ModifyAckDeadline#initialize(com.google.api.client.googleapis.services.AbstractGoogl * eClientRequest)} must be called to initialize this instance immediately after invoking the * constructor.

* * @param content the {@link com.google.api.services.pubsub.model.ModifyAckDeadlineRequest} * @since 1.13 */ protected ModifyAckDeadline(com.google.api.services.pubsub.model.ModifyAckDeadlineRequest content) { super(Pubsub.this, "POST", REST_PATH, content, com.google.api.services.pubsub.model.Empty.class); } @Override public ModifyAckDeadline set$Xgafv(java.lang.String $Xgafv) { return (ModifyAckDeadline) super.set$Xgafv($Xgafv); } @Override public ModifyAckDeadline setAccessToken(java.lang.String accessToken) { return (ModifyAckDeadline) super.setAccessToken(accessToken); } @Override public ModifyAckDeadline setAlt(java.lang.String alt) { return (ModifyAckDeadline) super.setAlt(alt); } @Override public ModifyAckDeadline setBearerToken(java.lang.String bearerToken) { return (ModifyAckDeadline) super.setBearerToken(bearerToken); } @Override public ModifyAckDeadline setCallback(java.lang.String callback) { return (ModifyAckDeadline) super.setCallback(callback); } @Override public ModifyAckDeadline setFields(java.lang.String fields) { return (ModifyAckDeadline) super.setFields(fields); } @Override public ModifyAckDeadline setKey(java.lang.String key) { return (ModifyAckDeadline) super.setKey(key); } @Override public ModifyAckDeadline setOauthToken(java.lang.String oauthToken) { return (ModifyAckDeadline) super.setOauthToken(oauthToken); } @Override public ModifyAckDeadline setPp(java.lang.Boolean pp) { return (ModifyAckDeadline) super.setPp(pp); } @Override public ModifyAckDeadline setPrettyPrint(java.lang.Boolean prettyPrint) { return (ModifyAckDeadline) super.setPrettyPrint(prettyPrint); } @Override public ModifyAckDeadline setQuotaUser(java.lang.String quotaUser) { return (ModifyAckDeadline) super.setQuotaUser(quotaUser); } @Override public ModifyAckDeadline setUploadType(java.lang.String uploadType) { return (ModifyAckDeadline) super.setUploadType(uploadType); } @Override public ModifyAckDeadline setUploadProtocol(java.lang.String uploadProtocol) { return (ModifyAckDeadline) super.setUploadProtocol(uploadProtocol); } @Override public ModifyAckDeadline set(String parameterName, Object value) { return (ModifyAckDeadline) super.set(parameterName, value); } } /** * Modifies the PushConfig for a specified subscription. This method can be used to suspend the flow * of messages to an endpoint by clearing the PushConfig field in the request. Messages will be * accumulated for delivery even if no push configuration is defined or while the configuration is * modified. * * Create a request for the method "subscriptions.modifyPushConfig". * * This request holds the parameters needed by the pubsub server. After setting any optional * parameters, call the {@link ModifyPushConfig#execute()} method to invoke the remote operation. * * @param content the {@link com.google.api.services.pubsub.model.ModifyPushConfigRequest} * @return the request */ public ModifyPushConfig modifyPushConfig(com.google.api.services.pubsub.model.ModifyPushConfigRequest content) throws java.io.IOException { ModifyPushConfig result = new ModifyPushConfig(content); initialize(result); return result; } public class ModifyPushConfig extends PubsubRequest { private static final String REST_PATH = "v1beta1a/subscriptions/modifyPushConfig"; /** * Modifies the PushConfig for a specified subscription. This method can be used to suspend the * flow of messages to an endpoint by clearing the PushConfig field in the request. Messages will * be accumulated for delivery even if no push configuration is defined or while the configuration * is modified. * * Create a request for the method "subscriptions.modifyPushConfig". * * This request holds the parameters needed by the the pubsub server. After setting any optional * parameters, call the {@link ModifyPushConfig#execute()} method to invoke the remote operation. *

{@link ModifyPushConfig#initialize(com.google.api.client.googleapis.services.AbstractGoogle * ClientRequest)} must be called to initialize this instance immediately after invoking the * constructor.

* * @param content the {@link com.google.api.services.pubsub.model.ModifyPushConfigRequest} * @since 1.13 */ protected ModifyPushConfig(com.google.api.services.pubsub.model.ModifyPushConfigRequest content) { super(Pubsub.this, "POST", REST_PATH, content, com.google.api.services.pubsub.model.Empty.class); } @Override public ModifyPushConfig set$Xgafv(java.lang.String $Xgafv) { return (ModifyPushConfig) super.set$Xgafv($Xgafv); } @Override public ModifyPushConfig setAccessToken(java.lang.String accessToken) { return (ModifyPushConfig) super.setAccessToken(accessToken); } @Override public ModifyPushConfig setAlt(java.lang.String alt) { return (ModifyPushConfig) super.setAlt(alt); } @Override public ModifyPushConfig setBearerToken(java.lang.String bearerToken) { return (ModifyPushConfig) super.setBearerToken(bearerToken); } @Override public ModifyPushConfig setCallback(java.lang.String callback) { return (ModifyPushConfig) super.setCallback(callback); } @Override public ModifyPushConfig setFields(java.lang.String fields) { return (ModifyPushConfig) super.setFields(fields); } @Override public ModifyPushConfig setKey(java.lang.String key) { return (ModifyPushConfig) super.setKey(key); } @Override public ModifyPushConfig setOauthToken(java.lang.String oauthToken) { return (ModifyPushConfig) super.setOauthToken(oauthToken); } @Override public ModifyPushConfig setPp(java.lang.Boolean pp) { return (ModifyPushConfig) super.setPp(pp); } @Override public ModifyPushConfig setPrettyPrint(java.lang.Boolean prettyPrint) { return (ModifyPushConfig) super.setPrettyPrint(prettyPrint); } @Override public ModifyPushConfig setQuotaUser(java.lang.String quotaUser) { return (ModifyPushConfig) super.setQuotaUser(quotaUser); } @Override public ModifyPushConfig setUploadType(java.lang.String uploadType) { return (ModifyPushConfig) super.setUploadType(uploadType); } @Override public ModifyPushConfig setUploadProtocol(java.lang.String uploadProtocol) { return (ModifyPushConfig) super.setUploadProtocol(uploadProtocol); } @Override public ModifyPushConfig set(String parameterName, Object value) { return (ModifyPushConfig) super.set(parameterName, value); } } /** * Pulls a single message from the server. If return_immediately is true, and no messages are * available in the subscription, this method returns FAILED_PRECONDITION. The system is free to * return an UNAVAILABLE error if no messages are available in a reasonable amount of time (to * reduce system load). * * Create a request for the method "subscriptions.pull". * * This request holds the parameters needed by the pubsub server. After setting any optional * parameters, call the {@link Pull#execute()} method to invoke the remote operation. * * @param content the {@link com.google.api.services.pubsub.model.PullRequest} * @return the request */ public Pull pull(com.google.api.services.pubsub.model.PullRequest content) throws java.io.IOException { Pull result = new Pull(content); initialize(result); return result; } public class Pull extends PubsubRequest { private static final String REST_PATH = "v1beta1a/subscriptions/pull"; /** * Pulls a single message from the server. If return_immediately is true, and no messages are * available in the subscription, this method returns FAILED_PRECONDITION. The system is free to * return an UNAVAILABLE error if no messages are available in a reasonable amount of time (to * reduce system load). * * Create a request for the method "subscriptions.pull". * * This request holds the parameters needed by the the pubsub server. After setting any optional * parameters, call the {@link Pull#execute()} method to invoke the remote operation.

{@link * Pull#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must be * called to initialize this instance immediately after invoking the constructor.

* * @param content the {@link com.google.api.services.pubsub.model.PullRequest} * @since 1.13 */ protected Pull(com.google.api.services.pubsub.model.PullRequest content) { super(Pubsub.this, "POST", REST_PATH, content, com.google.api.services.pubsub.model.PullResponse.class); } @Override public Pull set$Xgafv(java.lang.String $Xgafv) { return (Pull) super.set$Xgafv($Xgafv); } @Override public Pull setAccessToken(java.lang.String accessToken) { return (Pull) super.setAccessToken(accessToken); } @Override public Pull setAlt(java.lang.String alt) { return (Pull) super.setAlt(alt); } @Override public Pull setBearerToken(java.lang.String bearerToken) { return (Pull) super.setBearerToken(bearerToken); } @Override public Pull setCallback(java.lang.String callback) { return (Pull) super.setCallback(callback); } @Override public Pull setFields(java.lang.String fields) { return (Pull) super.setFields(fields); } @Override public Pull setKey(java.lang.String key) { return (Pull) super.setKey(key); } @Override public Pull setOauthToken(java.lang.String oauthToken) { return (Pull) super.setOauthToken(oauthToken); } @Override public Pull setPp(java.lang.Boolean pp) { return (Pull) super.setPp(pp); } @Override public Pull setPrettyPrint(java.lang.Boolean prettyPrint) { return (Pull) super.setPrettyPrint(prettyPrint); } @Override public Pull setQuotaUser(java.lang.String quotaUser) { return (Pull) super.setQuotaUser(quotaUser); } @Override public Pull setUploadType(java.lang.String uploadType) { return (Pull) super.setUploadType(uploadType); } @Override public Pull setUploadProtocol(java.lang.String uploadProtocol) { return (Pull) super.setUploadProtocol(uploadProtocol); } @Override public Pull set(String parameterName, Object value) { return (Pull) super.set(parameterName, value); } } /** * Pulls messages from the server. Returns an empty list if there are no messages available in the * backlog. The system is free to return UNAVAILABLE if there are too many pull requests outstanding * for the given subscription. * * Create a request for the method "subscriptions.pullBatch". * * This request holds the parameters needed by the pubsub server. After setting any optional * parameters, call the {@link PullBatch#execute()} method to invoke the remote operation. * * @param content the {@link com.google.api.services.pubsub.model.PullBatchRequest} * @return the request */ public PullBatch pullBatch(com.google.api.services.pubsub.model.PullBatchRequest content) throws java.io.IOException { PullBatch result = new PullBatch(content); initialize(result); return result; } public class PullBatch extends PubsubRequest { private static final String REST_PATH = "v1beta1a/subscriptions/pullBatch"; /** * Pulls messages from the server. Returns an empty list if there are no messages available in the * backlog. The system is free to return UNAVAILABLE if there are too many pull requests * outstanding for the given subscription. * * Create a request for the method "subscriptions.pullBatch". * * This request holds the parameters needed by the the pubsub server. After setting any optional * parameters, call the {@link PullBatch#execute()} method to invoke the remote operation.

* {@link * PullBatch#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} * must be called to initialize this instance immediately after invoking the constructor.

* * @param content the {@link com.google.api.services.pubsub.model.PullBatchRequest} * @since 1.13 */ protected PullBatch(com.google.api.services.pubsub.model.PullBatchRequest content) { super(Pubsub.this, "POST", REST_PATH, content, com.google.api.services.pubsub.model.PullBatchResponse.class); } @Override public PullBatch set$Xgafv(java.lang.String $Xgafv) { return (PullBatch) super.set$Xgafv($Xgafv); } @Override public PullBatch setAccessToken(java.lang.String accessToken) { return (PullBatch) super.setAccessToken(accessToken); } @Override public PullBatch setAlt(java.lang.String alt) { return (PullBatch) super.setAlt(alt); } @Override public PullBatch setBearerToken(java.lang.String bearerToken) { return (PullBatch) super.setBearerToken(bearerToken); } @Override public PullBatch setCallback(java.lang.String callback) { return (PullBatch) super.setCallback(callback); } @Override public PullBatch setFields(java.lang.String fields) { return (PullBatch) super.setFields(fields); } @Override public PullBatch setKey(java.lang.String key) { return (PullBatch) super.setKey(key); } @Override public PullBatch setOauthToken(java.lang.String oauthToken) { return (PullBatch) super.setOauthToken(oauthToken); } @Override public PullBatch setPp(java.lang.Boolean pp) { return (PullBatch) super.setPp(pp); } @Override public PullBatch setPrettyPrint(java.lang.Boolean prettyPrint) { return (PullBatch) super.setPrettyPrint(prettyPrint); } @Override public PullBatch setQuotaUser(java.lang.String quotaUser) { return (PullBatch) super.setQuotaUser(quotaUser); } @Override public PullBatch setUploadType(java.lang.String uploadType) { return (PullBatch) super.setUploadType(uploadType); } @Override public PullBatch setUploadProtocol(java.lang.String uploadProtocol) { return (PullBatch) super.setUploadProtocol(uploadProtocol); } @Override public PullBatch set(String parameterName, Object value) { return (PullBatch) super.set(parameterName, value); } } } /** * An accessor for creating requests from the Topics collection. * *

The typical use is:

*
   *   {@code Pubsub pubsub = new Pubsub(...);}
   *   {@code Pubsub.Topics.List request = pubsub.topics().list(parameters ...)}
   * 
* * @return the resource collection */ public Topics topics() { return new Topics(); } /** * The "topics" collection of methods. */ public class Topics { /** * Creates the given topic with the given name. * * Create a request for the method "topics.create". * * This request holds the parameters needed by the pubsub server. After setting any optional * parameters, call the {@link Create#execute()} method to invoke the remote operation. * * @param content the {@link com.google.api.services.pubsub.model.Topic} * @return the request */ public Create create(com.google.api.services.pubsub.model.Topic content) throws java.io.IOException { Create result = new Create(content); initialize(result); return result; } public class Create extends PubsubRequest { private static final String REST_PATH = "v1beta1a/topics"; /** * Creates the given topic with the given name. * * Create a request for the method "topics.create". * * This request holds the parameters needed by the the pubsub server. After setting any optional * parameters, call the {@link Create#execute()} method to invoke the remote operation.

{@link * Create#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must * be called to initialize this instance immediately after invoking the constructor.

* * @param content the {@link com.google.api.services.pubsub.model.Topic} * @since 1.13 */ protected Create(com.google.api.services.pubsub.model.Topic content) { super(Pubsub.this, "POST", REST_PATH, content, com.google.api.services.pubsub.model.Topic.class); } @Override public Create set$Xgafv(java.lang.String $Xgafv) { return (Create) super.set$Xgafv($Xgafv); } @Override public Create setAccessToken(java.lang.String accessToken) { return (Create) super.setAccessToken(accessToken); } @Override public Create setAlt(java.lang.String alt) { return (Create) super.setAlt(alt); } @Override public Create setBearerToken(java.lang.String bearerToken) { return (Create) super.setBearerToken(bearerToken); } @Override public Create setCallback(java.lang.String callback) { return (Create) super.setCallback(callback); } @Override public Create setFields(java.lang.String fields) { return (Create) super.setFields(fields); } @Override public Create setKey(java.lang.String key) { return (Create) super.setKey(key); } @Override public Create setOauthToken(java.lang.String oauthToken) { return (Create) super.setOauthToken(oauthToken); } @Override public Create setPp(java.lang.Boolean pp) { return (Create) super.setPp(pp); } @Override public Create setPrettyPrint(java.lang.Boolean prettyPrint) { return (Create) super.setPrettyPrint(prettyPrint); } @Override public Create setQuotaUser(java.lang.String quotaUser) { return (Create) super.setQuotaUser(quotaUser); } @Override public Create setUploadType(java.lang.String uploadType) { return (Create) super.setUploadType(uploadType); } @Override public Create setUploadProtocol(java.lang.String uploadProtocol) { return (Create) super.setUploadProtocol(uploadProtocol); } @Override public Create set(String parameterName, Object value) { return (Create) super.set(parameterName, value); } } /** * Deletes the topic with the given name. Returns NOT_FOUND if the topic does not exist. After a * topic is deleted, a new topic may be created with the same name. * * Create a request for the method "topics.delete". * * This request holds the parameters needed by the pubsub server. After setting any optional * parameters, call the {@link Delete#execute()} method to invoke the remote operation. * * @param topic Name of the topic to delete. * @return the request */ public Delete delete(java.lang.String topic) throws java.io.IOException { Delete result = new Delete(topic); initialize(result); return result; } public class Delete extends PubsubRequest { private static final String REST_PATH = "v1beta1a/topics/{+topic}"; private final java.util.regex.Pattern TOPIC_PATTERN = java.util.regex.Pattern.compile("^.+$"); /** * Deletes the topic with the given name. Returns NOT_FOUND if the topic does not exist. After a * topic is deleted, a new topic may be created with the same name. * * Create a request for the method "topics.delete". * * This request holds the parameters needed by the the pubsub 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 topic Name of the topic to delete. * @since 1.13 */ protected Delete(java.lang.String topic) { super(Pubsub.this, "DELETE", REST_PATH, null, com.google.api.services.pubsub.model.Empty.class); this.topic = com.google.api.client.util.Preconditions.checkNotNull(topic, "Required parameter topic must be specified."); if (!getSuppressPatternChecks()) { com.google.api.client.util.Preconditions.checkArgument(TOPIC_PATTERN.matcher(topic).matches(), "Parameter topic must conform to the pattern " + "^.+$"); } } @Override public Delete set$Xgafv(java.lang.String $Xgafv) { return (Delete) super.set$Xgafv($Xgafv); } @Override public Delete setAccessToken(java.lang.String accessToken) { return (Delete) super.setAccessToken(accessToken); } @Override public Delete setAlt(java.lang.String alt) { return (Delete) super.setAlt(alt); } @Override public Delete setBearerToken(java.lang.String bearerToken) { return (Delete) super.setBearerToken(bearerToken); } @Override public Delete setCallback(java.lang.String callback) { return (Delete) super.setCallback(callback); } @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 setPp(java.lang.Boolean pp) { return (Delete) super.setPp(pp); } @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 setUploadType(java.lang.String uploadType) { return (Delete) super.setUploadType(uploadType); } @Override public Delete setUploadProtocol(java.lang.String uploadProtocol) { return (Delete) super.setUploadProtocol(uploadProtocol); } /** Name of the topic to delete. */ @com.google.api.client.util.Key private java.lang.String topic; /** Name of the topic to delete. */ public java.lang.String getTopic() { return topic; } /** Name of the topic to delete. */ public Delete setTopic(java.lang.String topic) { if (!getSuppressPatternChecks()) { com.google.api.client.util.Preconditions.checkArgument(TOPIC_PATTERN.matcher(topic).matches(), "Parameter topic must conform to the pattern " + "^.+$"); } this.topic = topic; return this; } @Override public Delete set(String parameterName, Object value) { return (Delete) super.set(parameterName, value); } } /** * Gets the configuration of a topic. Since the topic only has the name attribute, this method is * only useful to check the existence of a topic. If other attributes are added in the future, they * will be returned here. * * Create a request for the method "topics.get". * * This request holds the parameters needed by the pubsub server. After setting any optional * parameters, call the {@link Get#execute()} method to invoke the remote operation. * * @param topic The name of the topic to get. * @return the request */ public Get get(java.lang.String topic) throws java.io.IOException { Get result = new Get(topic); initialize(result); return result; } public class Get extends PubsubRequest { private static final String REST_PATH = "v1beta1a/topics/{+topic}"; private final java.util.regex.Pattern TOPIC_PATTERN = java.util.regex.Pattern.compile("^.+$"); /** * Gets the configuration of a topic. Since the topic only has the name attribute, this method is * only useful to check the existence of a topic. If other attributes are added in the future, * they will be returned here. * * Create a request for the method "topics.get". * * This request holds the parameters needed by the the pubsub 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 topic The name of the topic to get. * @since 1.13 */ protected Get(java.lang.String topic) { super(Pubsub.this, "GET", REST_PATH, null, com.google.api.services.pubsub.model.Topic.class); this.topic = com.google.api.client.util.Preconditions.checkNotNull(topic, "Required parameter topic must be specified."); if (!getSuppressPatternChecks()) { com.google.api.client.util.Preconditions.checkArgument(TOPIC_PATTERN.matcher(topic).matches(), "Parameter topic must conform to the pattern " + "^.+$"); } } @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 set$Xgafv(java.lang.String $Xgafv) { return (Get) super.set$Xgafv($Xgafv); } @Override public Get setAccessToken(java.lang.String accessToken) { return (Get) super.setAccessToken(accessToken); } @Override public Get setAlt(java.lang.String alt) { return (Get) super.setAlt(alt); } @Override public Get setBearerToken(java.lang.String bearerToken) { return (Get) super.setBearerToken(bearerToken); } @Override public Get setCallback(java.lang.String callback) { return (Get) super.setCallback(callback); } @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 setPp(java.lang.Boolean pp) { return (Get) super.setPp(pp); } @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 setUploadType(java.lang.String uploadType) { return (Get) super.setUploadType(uploadType); } @Override public Get setUploadProtocol(java.lang.String uploadProtocol) { return (Get) super.setUploadProtocol(uploadProtocol); } /** The name of the topic to get. */ @com.google.api.client.util.Key private java.lang.String topic; /** The name of the topic to get. */ public java.lang.String getTopic() { return topic; } /** The name of the topic to get. */ public Get setTopic(java.lang.String topic) { if (!getSuppressPatternChecks()) { com.google.api.client.util.Preconditions.checkArgument(TOPIC_PATTERN.matcher(topic).matches(), "Parameter topic must conform to the pattern " + "^.+$"); } this.topic = topic; return this; } @Override public Get set(String parameterName, Object value) { return (Get) super.set(parameterName, value); } } /** * Lists matching topics. * * Create a request for the method "topics.list". * * This request holds the parameters needed by the pubsub server. After setting any optional * parameters, call the {@link List#execute()} method to invoke the remote operation. * * @return the request */ public List list() throws java.io.IOException { List result = new List(); initialize(result); return result; } public class List extends PubsubRequest { private static final String REST_PATH = "v1beta1a/topics"; /** * Lists matching topics. * * Create a request for the method "topics.list". * * This request holds the parameters needed by the the pubsub 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.

* * @since 1.13 */ protected List() { super(Pubsub.this, "GET", REST_PATH, null, com.google.api.services.pubsub.model.ListTopicsResponse.class); } @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 set$Xgafv(java.lang.String $Xgafv) { return (List) super.set$Xgafv($Xgafv); } @Override public List setAccessToken(java.lang.String accessToken) { return (List) super.setAccessToken(accessToken); } @Override public List setAlt(java.lang.String alt) { return (List) super.setAlt(alt); } @Override public List setBearerToken(java.lang.String bearerToken) { return (List) super.setBearerToken(bearerToken); } @Override public List setCallback(java.lang.String callback) { return (List) super.setCallback(callback); } @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 setPp(java.lang.Boolean pp) { return (List) super.setPp(pp); } @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 setUploadType(java.lang.String uploadType) { return (List) super.setUploadType(uploadType); } @Override public List setUploadProtocol(java.lang.String uploadProtocol) { return (List) super.setUploadProtocol(uploadProtocol); } /** Maximum number of topics to return. */ @com.google.api.client.util.Key private java.lang.Integer maxResults; /** Maximum number of topics to return. */ public java.lang.Integer getMaxResults() { return maxResults; } /** Maximum number of topics to return. */ public List setMaxResults(java.lang.Integer maxResults) { this.maxResults = maxResults; return this; } /** A valid label query expression. */ @com.google.api.client.util.Key private java.lang.String query; /** A valid label query expression. */ public java.lang.String getQuery() { return query; } /** A valid label query expression. */ public List setQuery(java.lang.String query) { this.query = query; return this; } /** * The value obtained in the last ListTopicsResponse for continuation. */ @com.google.api.client.util.Key private java.lang.String pageToken; /** The value obtained in the last ListTopicsResponse for continuation. */ public java.lang.String getPageToken() { return pageToken; } /** * The value obtained in the last ListTopicsResponse for continuation. */ public List setPageToken(java.lang.String pageToken) { this.pageToken = pageToken; return this; } @Override public List set(String parameterName, Object value) { return (List) super.set(parameterName, value); } } /** * Adds a message to the topic. Returns NOT_FOUND if the topic does not exist. * * Create a request for the method "topics.publish". * * This request holds the parameters needed by the pubsub server. After setting any optional * parameters, call the {@link Publish#execute()} method to invoke the remote operation. * * @param content the {@link com.google.api.services.pubsub.model.PublishRequest} * @return the request */ public Publish publish(com.google.api.services.pubsub.model.PublishRequest content) throws java.io.IOException { Publish result = new Publish(content); initialize(result); return result; } public class Publish extends PubsubRequest { private static final String REST_PATH = "v1beta1a/topics/publish"; /** * Adds a message to the topic. Returns NOT_FOUND if the topic does not exist. * * Create a request for the method "topics.publish". * * This request holds the parameters needed by the the pubsub server. After setting any optional * parameters, call the {@link Publish#execute()} method to invoke the remote operation.

* {@link * Publish#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must * be called to initialize this instance immediately after invoking the constructor.

* * @param content the {@link com.google.api.services.pubsub.model.PublishRequest} * @since 1.13 */ protected Publish(com.google.api.services.pubsub.model.PublishRequest content) { super(Pubsub.this, "POST", REST_PATH, content, com.google.api.services.pubsub.model.Empty.class); } @Override public Publish set$Xgafv(java.lang.String $Xgafv) { return (Publish) super.set$Xgafv($Xgafv); } @Override public Publish setAccessToken(java.lang.String accessToken) { return (Publish) super.setAccessToken(accessToken); } @Override public Publish setAlt(java.lang.String alt) { return (Publish) super.setAlt(alt); } @Override public Publish setBearerToken(java.lang.String bearerToken) { return (Publish) super.setBearerToken(bearerToken); } @Override public Publish setCallback(java.lang.String callback) { return (Publish) super.setCallback(callback); } @Override public Publish setFields(java.lang.String fields) { return (Publish) super.setFields(fields); } @Override public Publish setKey(java.lang.String key) { return (Publish) super.setKey(key); } @Override public Publish setOauthToken(java.lang.String oauthToken) { return (Publish) super.setOauthToken(oauthToken); } @Override public Publish setPp(java.lang.Boolean pp) { return (Publish) super.setPp(pp); } @Override public Publish setPrettyPrint(java.lang.Boolean prettyPrint) { return (Publish) super.setPrettyPrint(prettyPrint); } @Override public Publish setQuotaUser(java.lang.String quotaUser) { return (Publish) super.setQuotaUser(quotaUser); } @Override public Publish setUploadType(java.lang.String uploadType) { return (Publish) super.setUploadType(uploadType); } @Override public Publish setUploadProtocol(java.lang.String uploadProtocol) { return (Publish) super.setUploadProtocol(uploadProtocol); } @Override public Publish set(String parameterName, Object value) { return (Publish) super.set(parameterName, value); } } /** * Adds one or more messages to the topic. Returns NOT_FOUND if the topic does not exist. * * Create a request for the method "topics.publishBatch". * * This request holds the parameters needed by the pubsub server. After setting any optional * parameters, call the {@link PublishBatch#execute()} method to invoke the remote operation. * * @param content the {@link com.google.api.services.pubsub.model.PublishBatchRequest} * @return the request */ public PublishBatch publishBatch(com.google.api.services.pubsub.model.PublishBatchRequest content) throws java.io.IOException { PublishBatch result = new PublishBatch(content); initialize(result); return result; } public class PublishBatch extends PubsubRequest { private static final String REST_PATH = "v1beta1a/topics/publishBatch"; /** * Adds one or more messages to the topic. Returns NOT_FOUND if the topic does not exist. * * Create a request for the method "topics.publishBatch". * * This request holds the parameters needed by the the pubsub server. After setting any optional * parameters, call the {@link PublishBatch#execute()} method to invoke the remote operation.

* {@link * PublishBatch#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} * must be called to initialize this instance immediately after invoking the constructor.

* * @param content the {@link com.google.api.services.pubsub.model.PublishBatchRequest} * @since 1.13 */ protected PublishBatch(com.google.api.services.pubsub.model.PublishBatchRequest content) { super(Pubsub.this, "POST", REST_PATH, content, com.google.api.services.pubsub.model.PublishBatchResponse.class); } @Override public PublishBatch set$Xgafv(java.lang.String $Xgafv) { return (PublishBatch) super.set$Xgafv($Xgafv); } @Override public PublishBatch setAccessToken(java.lang.String accessToken) { return (PublishBatch) super.setAccessToken(accessToken); } @Override public PublishBatch setAlt(java.lang.String alt) { return (PublishBatch) super.setAlt(alt); } @Override public PublishBatch setBearerToken(java.lang.String bearerToken) { return (PublishBatch) super.setBearerToken(bearerToken); } @Override public PublishBatch setCallback(java.lang.String callback) { return (PublishBatch) super.setCallback(callback); } @Override public PublishBatch setFields(java.lang.String fields) { return (PublishBatch) super.setFields(fields); } @Override public PublishBatch setKey(java.lang.String key) { return (PublishBatch) super.setKey(key); } @Override public PublishBatch setOauthToken(java.lang.String oauthToken) { return (PublishBatch) super.setOauthToken(oauthToken); } @Override public PublishBatch setPp(java.lang.Boolean pp) { return (PublishBatch) super.setPp(pp); } @Override public PublishBatch setPrettyPrint(java.lang.Boolean prettyPrint) { return (PublishBatch) super.setPrettyPrint(prettyPrint); } @Override public PublishBatch setQuotaUser(java.lang.String quotaUser) { return (PublishBatch) super.setQuotaUser(quotaUser); } @Override public PublishBatch setUploadType(java.lang.String uploadType) { return (PublishBatch) super.setUploadType(uploadType); } @Override public PublishBatch setUploadProtocol(java.lang.String uploadProtocol) { return (PublishBatch) super.setUploadProtocol(uploadProtocol); } @Override public PublishBatch set(String parameterName, Object value) { return (PublishBatch) super.set(parameterName, value); } } } /** * Builder for {@link Pubsub}. * *

* 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 Pubsub}. */ @Override public Pubsub build() { return new Pubsub(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 PubsubRequestInitializer}. * * @since 1.12 */ public Builder setPubsubRequestInitializer( PubsubRequestInitializer pubsubRequestInitializer) { return (Builder) super.setGoogleClientRequestInitializer(pubsubRequestInitializer); } @Override public Builder setGoogleClientRequestInitializer( com.google.api.client.googleapis.services.GoogleClientRequestInitializer googleClientRequestInitializer) { return (Builder) super.setGoogleClientRequestInitializer(googleClientRequestInitializer); } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy