com.google.api.services.logging.v2beta1.Logging 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-07-08 17:28:43 UTC)
* on 2016-10-11 at 14:55:20 UTC
* Modify at your own risk.
*/
package com.google.api.services.logging.v2beta1;
/**
* Service definition for Logging (v2beta1).
*
*
* Writes log entries and manages your Stackdriver Logging configuration.
*
*
*
* For more information about this service, see the
* API Documentation
*
*
*
* This service uses {@link LoggingRequestInitializer} to initialize global parameters via its
* {@link Builder}.
*
*
* @since 1.3
* @author Google, Inc.
*/
@SuppressWarnings("javadoc")
public class Logging 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 Stackdriver Logging 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://logging.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 Logging(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
*/
Logging(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 BillingAccounts collection.
*
* The typical use is:
*
* {@code Logging logging = new Logging(...);}
* {@code Logging.BillingAccounts.List request = logging.billingAccounts().list(parameters ...)}
*
*
* @return the resource collection
*/
public BillingAccounts billingAccounts() {
return new BillingAccounts();
}
/**
* The "billingAccounts" collection of methods.
*/
public class BillingAccounts {
/**
* An accessor for creating requests from the Logs collection.
*
* The typical use is:
*
* {@code Logging logging = new Logging(...);}
* {@code Logging.Logs.List request = logging.logs().list(parameters ...)}
*
*
* @return the resource collection
*/
public Logs logs() {
return new Logs();
}
/**
* The "logs" collection of methods.
*/
public class Logs {
/**
* Deletes a log and all its log entries. The log will reappear if it receives new entries.
*
* Create a request for the method "logs.delete".
*
* This request holds the parameters needed by the logging server. After setting any optional
* parameters, call the {@link Delete#execute()} method to invoke the remote operation.
*
* @param logName Required. The resource name of the log to delete. Example:
`"projects/my-project/logs/syslog"`.
* @return the request
*/
public Delete delete(java.lang.String logName) throws java.io.IOException {
Delete result = new Delete(logName);
initialize(result);
return result;
}
public class Delete extends LoggingRequest {
private static final String REST_PATH = "v2beta1/{+logName}";
private final java.util.regex.Pattern LOG_NAME_PATTERN =
java.util.regex.Pattern.compile("^billingAccounts/[^/]*/logs/[^/]*$");
/**
* Deletes a log and all its log entries. The log will reappear if it receives new entries.
*
* Create a request for the method "logs.delete".
*
* This request holds the parameters needed by the the logging 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 logName Required. The resource name of the log to delete. Example:
`"projects/my-project/logs/syslog"`.
* @since 1.13
*/
protected Delete(java.lang.String logName) {
super(Logging.this, "DELETE", REST_PATH, null, com.google.api.services.logging.v2beta1.model.Empty.class);
this.logName = com.google.api.client.util.Preconditions.checkNotNull(logName, "Required parameter logName must be specified.");
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(LOG_NAME_PATTERN.matcher(logName).matches(),
"Parameter logName must conform to the pattern " +
"^billingAccounts/[^/]*/logs/[^/]*$");
}
}
@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);
}
/**
* Required. The resource name of the log to delete. Example: `"projects/my-
* project/logs/syslog"`.
*/
@com.google.api.client.util.Key
private java.lang.String logName;
/** Required. The resource name of the log to delete. Example: `"projects/my-project/logs/syslog"`.
*/
public java.lang.String getLogName() {
return logName;
}
/**
* Required. The resource name of the log to delete. Example: `"projects/my-
* project/logs/syslog"`.
*/
public Delete setLogName(java.lang.String logName) {
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(LOG_NAME_PATTERN.matcher(logName).matches(),
"Parameter logName must conform to the pattern " +
"^billingAccounts/[^/]*/logs/[^/]*$");
}
this.logName = logName;
return this;
}
@Override
public Delete set(String parameterName, Object value) {
return (Delete) super.set(parameterName, value);
}
}
}
}
/**
* An accessor for creating requests from the Entries collection.
*
* The typical use is:
*
* {@code Logging logging = new Logging(...);}
* {@code Logging.Entries.List request = logging.entries().list(parameters ...)}
*
*
* @return the resource collection
*/
public Entries entries() {
return new Entries();
}
/**
* The "entries" collection of methods.
*/
public class Entries {
/**
* Lists log entries. Use this method to retrieve log entries from Cloud Logging. For ways to
* export log entries, see [Exporting Logs](/logging/docs/export).
*
* Create a request for the method "entries.list".
*
* This request holds the parameters needed by the logging server. After setting any optional
* parameters, call the {@link List#execute()} method to invoke the remote operation.
*
* @param content the {@link com.google.api.services.logging.v2beta1.model.ListLogEntriesRequest}
* @return the request
*/
public List list(com.google.api.services.logging.v2beta1.model.ListLogEntriesRequest content) throws java.io.IOException {
List result = new List(content);
initialize(result);
return result;
}
public class List extends LoggingRequest {
private static final String REST_PATH = "v2beta1/entries:list";
/**
* Lists log entries. Use this method to retrieve log entries from Cloud Logging. For ways to
* export log entries, see [Exporting Logs](/logging/docs/export).
*
* Create a request for the method "entries.list".
*
* This request holds the parameters needed by the the logging 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 content the {@link com.google.api.services.logging.v2beta1.model.ListLogEntriesRequest}
* @since 1.13
*/
protected List(com.google.api.services.logging.v2beta1.model.ListLogEntriesRequest content) {
super(Logging.this, "POST", REST_PATH, content, com.google.api.services.logging.v2beta1.model.ListLogEntriesResponse.class);
}
@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);
}
@Override
public List set(String parameterName, Object value) {
return (List) super.set(parameterName, value);
}
}
/**
* Writes log entries to Stackdriver Logging. All log entries are written by this method.
*
* Create a request for the method "entries.write".
*
* This request holds the parameters needed by the logging server. After setting any optional
* parameters, call the {@link Write#execute()} method to invoke the remote operation.
*
* @param content the {@link com.google.api.services.logging.v2beta1.model.WriteLogEntriesRequest}
* @return the request
*/
public Write write(com.google.api.services.logging.v2beta1.model.WriteLogEntriesRequest content) throws java.io.IOException {
Write result = new Write(content);
initialize(result);
return result;
}
public class Write extends LoggingRequest {
private static final String REST_PATH = "v2beta1/entries:write";
/**
* Writes log entries to Stackdriver Logging. All log entries are written by this method.
*
* Create a request for the method "entries.write".
*
* This request holds the parameters needed by the the logging server. After setting any optional
* parameters, call the {@link Write#execute()} method to invoke the remote operation. {@link
* Write#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.logging.v2beta1.model.WriteLogEntriesRequest}
* @since 1.13
*/
protected Write(com.google.api.services.logging.v2beta1.model.WriteLogEntriesRequest content) {
super(Logging.this, "POST", REST_PATH, content, com.google.api.services.logging.v2beta1.model.WriteLogEntriesResponse.class);
}
@Override
public Write set$Xgafv(java.lang.String $Xgafv) {
return (Write) super.set$Xgafv($Xgafv);
}
@Override
public Write setAccessToken(java.lang.String accessToken) {
return (Write) super.setAccessToken(accessToken);
}
@Override
public Write setAlt(java.lang.String alt) {
return (Write) super.setAlt(alt);
}
@Override
public Write setBearerToken(java.lang.String bearerToken) {
return (Write) super.setBearerToken(bearerToken);
}
@Override
public Write setCallback(java.lang.String callback) {
return (Write) super.setCallback(callback);
}
@Override
public Write setFields(java.lang.String fields) {
return (Write) super.setFields(fields);
}
@Override
public Write setKey(java.lang.String key) {
return (Write) super.setKey(key);
}
@Override
public Write setOauthToken(java.lang.String oauthToken) {
return (Write) super.setOauthToken(oauthToken);
}
@Override
public Write setPp(java.lang.Boolean pp) {
return (Write) super.setPp(pp);
}
@Override
public Write setPrettyPrint(java.lang.Boolean prettyPrint) {
return (Write) super.setPrettyPrint(prettyPrint);
}
@Override
public Write setQuotaUser(java.lang.String quotaUser) {
return (Write) super.setQuotaUser(quotaUser);
}
@Override
public Write setUploadType(java.lang.String uploadType) {
return (Write) super.setUploadType(uploadType);
}
@Override
public Write setUploadProtocol(java.lang.String uploadProtocol) {
return (Write) super.setUploadProtocol(uploadProtocol);
}
@Override
public Write set(String parameterName, Object value) {
return (Write) super.set(parameterName, value);
}
}
}
/**
* An accessor for creating requests from the MonitoredResourceDescriptors collection.
*
* The typical use is:
*
* {@code Logging logging = new Logging(...);}
* {@code Logging.MonitoredResourceDescriptors.List request = logging.monitoredResourceDescriptors().list(parameters ...)}
*
*
* @return the resource collection
*/
public MonitoredResourceDescriptors monitoredResourceDescriptors() {
return new MonitoredResourceDescriptors();
}
/**
* The "monitoredResourceDescriptors" collection of methods.
*/
public class MonitoredResourceDescriptors {
/**
* Lists the monitored resource descriptors used by Stackdriver Logging.
*
* Create a request for the method "monitoredResourceDescriptors.list".
*
* This request holds the parameters needed by the logging 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 LoggingRequest {
private static final String REST_PATH = "v2beta1/monitoredResourceDescriptors";
/**
* Lists the monitored resource descriptors used by Stackdriver Logging.
*
* Create a request for the method "monitoredResourceDescriptors.list".
*
* This request holds the parameters needed by the the logging 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(Logging.this, "GET", REST_PATH, null, com.google.api.services.logging.v2beta1.model.ListMonitoredResourceDescriptorsResponse.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);
}
/**
* Optional. The maximum number of results to return from this request. Non-positive values
* are ignored. The presence of `nextPageToken` in the response indicates that more results
* might be available.
*/
@com.google.api.client.util.Key
private java.lang.Integer pageSize;
/** Optional. The maximum number of results to return from this request. Non-positive values are
ignored. The presence of `nextPageToken` in the response indicates that more results might be
available.
*/
public java.lang.Integer getPageSize() {
return pageSize;
}
/**
* Optional. The maximum number of results to return from this request. Non-positive values
* are ignored. The presence of `nextPageToken` in the response indicates that more results
* might be available.
*/
public List setPageSize(java.lang.Integer pageSize) {
this.pageSize = pageSize;
return this;
}
/**
* Optional. If present, then retrieve the next batch of results from the preceding call to
* this method. `pageToken` must be the value of `nextPageToken` from the previous response.
* The values of other method parameters should be identical to those in the previous call.
*/
@com.google.api.client.util.Key
private java.lang.String pageToken;
/** Optional. If present, then retrieve the next batch of results from the preceding call to this
method. `pageToken` must be the value of `nextPageToken` from the previous response. The values
of other method parameters should be identical to those in the previous call.
*/
public java.lang.String getPageToken() {
return pageToken;
}
/**
* Optional. If present, then retrieve the next batch of results from the preceding call to
* this method. `pageToken` must be the value of `nextPageToken` from the previous response.
* The values of other method parameters should be identical to those in the previous call.
*/
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);
}
}
}
/**
* An accessor for creating requests from the Organizations collection.
*
* The typical use is:
*
* {@code Logging logging = new Logging(...);}
* {@code Logging.Organizations.List request = logging.organizations().list(parameters ...)}
*
*
* @return the resource collection
*/
public Organizations organizations() {
return new Organizations();
}
/**
* The "organizations" collection of methods.
*/
public class Organizations {
/**
* An accessor for creating requests from the Logs collection.
*
* The typical use is:
*
* {@code Logging logging = new Logging(...);}
* {@code Logging.Logs.List request = logging.logs().list(parameters ...)}
*
*
* @return the resource collection
*/
public Logs logs() {
return new Logs();
}
/**
* The "logs" collection of methods.
*/
public class Logs {
/**
* Deletes a log and all its log entries. The log will reappear if it receives new entries.
*
* Create a request for the method "logs.delete".
*
* This request holds the parameters needed by the logging server. After setting any optional
* parameters, call the {@link Delete#execute()} method to invoke the remote operation.
*
* @param logName Required. The resource name of the log to delete. Example:
`"projects/my-project/logs/syslog"`.
* @return the request
*/
public Delete delete(java.lang.String logName) throws java.io.IOException {
Delete result = new Delete(logName);
initialize(result);
return result;
}
public class Delete extends LoggingRequest {
private static final String REST_PATH = "v2beta1/{+logName}";
private final java.util.regex.Pattern LOG_NAME_PATTERN =
java.util.regex.Pattern.compile("^organizations/[^/]*/logs/[^/]*$");
/**
* Deletes a log and all its log entries. The log will reappear if it receives new entries.
*
* Create a request for the method "logs.delete".
*
* This request holds the parameters needed by the the logging 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 logName Required. The resource name of the log to delete. Example:
`"projects/my-project/logs/syslog"`.
* @since 1.13
*/
protected Delete(java.lang.String logName) {
super(Logging.this, "DELETE", REST_PATH, null, com.google.api.services.logging.v2beta1.model.Empty.class);
this.logName = com.google.api.client.util.Preconditions.checkNotNull(logName, "Required parameter logName must be specified.");
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(LOG_NAME_PATTERN.matcher(logName).matches(),
"Parameter logName must conform to the pattern " +
"^organizations/[^/]*/logs/[^/]*$");
}
}
@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);
}
/**
* Required. The resource name of the log to delete. Example: `"projects/my-
* project/logs/syslog"`.
*/
@com.google.api.client.util.Key
private java.lang.String logName;
/** Required. The resource name of the log to delete. Example: `"projects/my-project/logs/syslog"`.
*/
public java.lang.String getLogName() {
return logName;
}
/**
* Required. The resource name of the log to delete. Example: `"projects/my-
* project/logs/syslog"`.
*/
public Delete setLogName(java.lang.String logName) {
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(LOG_NAME_PATTERN.matcher(logName).matches(),
"Parameter logName must conform to the pattern " +
"^organizations/[^/]*/logs/[^/]*$");
}
this.logName = logName;
return this;
}
@Override
public Delete set(String parameterName, Object value) {
return (Delete) super.set(parameterName, value);
}
}
}
}
/**
* An accessor for creating requests from the Projects collection.
*
* The typical use is:
*
* {@code Logging logging = new Logging(...);}
* {@code Logging.Projects.List request = logging.projects().list(parameters ...)}
*
*
* @return the resource collection
*/
public Projects projects() {
return new Projects();
}
/**
* The "projects" collection of methods.
*/
public class Projects {
/**
* An accessor for creating requests from the Logs collection.
*
* The typical use is:
*
* {@code Logging logging = new Logging(...);}
* {@code Logging.Logs.List request = logging.logs().list(parameters ...)}
*
*
* @return the resource collection
*/
public Logs logs() {
return new Logs();
}
/**
* The "logs" collection of methods.
*/
public class Logs {
/**
* Deletes a log and all its log entries. The log will reappear if it receives new entries.
*
* Create a request for the method "logs.delete".
*
* This request holds the parameters needed by the logging server. After setting any optional
* parameters, call the {@link Delete#execute()} method to invoke the remote operation.
*
* @param logName Required. The resource name of the log to delete. Example:
`"projects/my-project/logs/syslog"`.
* @return the request
*/
public Delete delete(java.lang.String logName) throws java.io.IOException {
Delete result = new Delete(logName);
initialize(result);
return result;
}
public class Delete extends LoggingRequest {
private static final String REST_PATH = "v2beta1/{+logName}";
private final java.util.regex.Pattern LOG_NAME_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]*/logs/[^/]*$");
/**
* Deletes a log and all its log entries. The log will reappear if it receives new entries.
*
* Create a request for the method "logs.delete".
*
* This request holds the parameters needed by the the logging 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 logName Required. The resource name of the log to delete. Example:
`"projects/my-project/logs/syslog"`.
* @since 1.13
*/
protected Delete(java.lang.String logName) {
super(Logging.this, "DELETE", REST_PATH, null, com.google.api.services.logging.v2beta1.model.Empty.class);
this.logName = com.google.api.client.util.Preconditions.checkNotNull(logName, "Required parameter logName must be specified.");
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(LOG_NAME_PATTERN.matcher(logName).matches(),
"Parameter logName must conform to the pattern " +
"^projects/[^/]*/logs/[^/]*$");
}
}
@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);
}
/**
* Required. The resource name of the log to delete. Example: `"projects/my-
* project/logs/syslog"`.
*/
@com.google.api.client.util.Key
private java.lang.String logName;
/** Required. The resource name of the log to delete. Example: `"projects/my-project/logs/syslog"`.
*/
public java.lang.String getLogName() {
return logName;
}
/**
* Required. The resource name of the log to delete. Example: `"projects/my-
* project/logs/syslog"`.
*/
public Delete setLogName(java.lang.String logName) {
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(LOG_NAME_PATTERN.matcher(logName).matches(),
"Parameter logName must conform to the pattern " +
"^projects/[^/]*/logs/[^/]*$");
}
this.logName = logName;
return this;
}
@Override
public Delete set(String parameterName, Object value) {
return (Delete) super.set(parameterName, value);
}
}
}
/**
* An accessor for creating requests from the Metrics collection.
*
* The typical use is:
*
* {@code Logging logging = new Logging(...);}
* {@code Logging.Metrics.List request = logging.metrics().list(parameters ...)}
*
*
* @return the resource collection
*/
public Metrics metrics() {
return new Metrics();
}
/**
* The "metrics" collection of methods.
*/
public class Metrics {
/**
* Creates a logs-based metric.
*
* Create a request for the method "metrics.create".
*
* This request holds the parameters needed by the logging server. After setting any optional
* parameters, call the {@link Create#execute()} method to invoke the remote operation.
*
* @param parent The resource name of the project in which to create the metric.
Example: `"projects/my-project-id"`.
* The new metric must be provided in the request.
* @param content the {@link com.google.api.services.logging.v2beta1.model.LogMetric}
* @return the request
*/
public Create create(java.lang.String parent, com.google.api.services.logging.v2beta1.model.LogMetric content) throws java.io.IOException {
Create result = new Create(parent, content);
initialize(result);
return result;
}
public class Create extends LoggingRequest {
private static final String REST_PATH = "v2beta1/{+parent}/metrics";
private final java.util.regex.Pattern PARENT_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]*$");
/**
* Creates a logs-based metric.
*
* Create a request for the method "metrics.create".
*
* This request holds the parameters needed by the the logging 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 parent The resource name of the project in which to create the metric.
Example: `"projects/my-project-id"`.
* The new metric must be provided in the request.
* @param content the {@link com.google.api.services.logging.v2beta1.model.LogMetric}
* @since 1.13
*/
protected Create(java.lang.String parent, com.google.api.services.logging.v2beta1.model.LogMetric content) {
super(Logging.this, "POST", REST_PATH, content, com.google.api.services.logging.v2beta1.model.LogMetric.class);
this.parent = com.google.api.client.util.Preconditions.checkNotNull(parent, "Required parameter parent must be specified.");
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
"Parameter parent must conform to the pattern " +
"^projects/[^/]*$");
}
}
@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);
}
/**
* The resource name of the project in which to create the metric. Example: `"projects/my-
* project-id"`.
*
* The new metric must be provided in the request.
*/
@com.google.api.client.util.Key
private java.lang.String parent;
/** The resource name of the project in which to create the metric. Example: `"projects/my-project-
id"`.
The new metric must be provided in the request.
*/
public java.lang.String getParent() {
return parent;
}
/**
* The resource name of the project in which to create the metric. Example: `"projects/my-
* project-id"`.
*
* The new metric must be provided in the request.
*/
public Create setParent(java.lang.String parent) {
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
"Parameter parent must conform to the pattern " +
"^projects/[^/]*$");
}
this.parent = parent;
return this;
}
@Override
public Create set(String parameterName, Object value) {
return (Create) super.set(parameterName, value);
}
}
/**
* Deletes a logs-based metric.
*
* Create a request for the method "metrics.delete".
*
* This request holds the parameters needed by the logging server. After setting any optional
* parameters, call the {@link Delete#execute()} method to invoke the remote operation.
*
* @param metricName The resource name of the metric to delete.
Example: `"projects/my-project-id/metrics/my-metric-id"`.
* @return the request
*/
public Delete delete(java.lang.String metricName) throws java.io.IOException {
Delete result = new Delete(metricName);
initialize(result);
return result;
}
public class Delete extends LoggingRequest {
private static final String REST_PATH = "v2beta1/{+metricName}";
private final java.util.regex.Pattern METRIC_NAME_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]*/metrics/[^/]*$");
/**
* Deletes a logs-based metric.
*
* Create a request for the method "metrics.delete".
*
* This request holds the parameters needed by the the logging 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 metricName The resource name of the metric to delete.
Example: `"projects/my-project-id/metrics/my-metric-id"`.
* @since 1.13
*/
protected Delete(java.lang.String metricName) {
super(Logging.this, "DELETE", REST_PATH, null, com.google.api.services.logging.v2beta1.model.Empty.class);
this.metricName = com.google.api.client.util.Preconditions.checkNotNull(metricName, "Required parameter metricName must be specified.");
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(METRIC_NAME_PATTERN.matcher(metricName).matches(),
"Parameter metricName must conform to the pattern " +
"^projects/[^/]*/metrics/[^/]*$");
}
}
@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 resource name of the metric to delete. Example: `"projects/my-project-id/metrics/my-
* metric-id"`.
*/
@com.google.api.client.util.Key
private java.lang.String metricName;
/** The resource name of the metric to delete. Example: `"projects/my-project-id/metrics/my-metric-
id"`.
*/
public java.lang.String getMetricName() {
return metricName;
}
/**
* The resource name of the metric to delete. Example: `"projects/my-project-id/metrics/my-
* metric-id"`.
*/
public Delete setMetricName(java.lang.String metricName) {
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(METRIC_NAME_PATTERN.matcher(metricName).matches(),
"Parameter metricName must conform to the pattern " +
"^projects/[^/]*/metrics/[^/]*$");
}
this.metricName = metricName;
return this;
}
@Override
public Delete set(String parameterName, Object value) {
return (Delete) super.set(parameterName, value);
}
}
/**
* Gets a logs-based metric.
*
* Create a request for the method "metrics.get".
*
* This request holds the parameters needed by the logging server. After setting any optional
* parameters, call the {@link Get#execute()} method to invoke the remote operation.
*
* @param metricName The resource name of the desired metric.
Example: `"projects/my-project-id/metrics/my-metric-id"`.
* @return the request
*/
public Get get(java.lang.String metricName) throws java.io.IOException {
Get result = new Get(metricName);
initialize(result);
return result;
}
public class Get extends LoggingRequest {
private static final String REST_PATH = "v2beta1/{+metricName}";
private final java.util.regex.Pattern METRIC_NAME_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]*/metrics/[^/]*$");
/**
* Gets a logs-based metric.
*
* Create a request for the method "metrics.get".
*
* This request holds the parameters needed by the the logging 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 metricName The resource name of the desired metric.
Example: `"projects/my-project-id/metrics/my-metric-id"`.
* @since 1.13
*/
protected Get(java.lang.String metricName) {
super(Logging.this, "GET", REST_PATH, null, com.google.api.services.logging.v2beta1.model.LogMetric.class);
this.metricName = com.google.api.client.util.Preconditions.checkNotNull(metricName, "Required parameter metricName must be specified.");
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(METRIC_NAME_PATTERN.matcher(metricName).matches(),
"Parameter metricName must conform to the pattern " +
"^projects/[^/]*/metrics/[^/]*$");
}
}
@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 resource name of the desired metric. Example: `"projects/my-project-id/metrics/my-
* metric-id"`.
*/
@com.google.api.client.util.Key
private java.lang.String metricName;
/** The resource name of the desired metric. Example: `"projects/my-project-id/metrics/my-metric-id"`.
*/
public java.lang.String getMetricName() {
return metricName;
}
/**
* The resource name of the desired metric. Example: `"projects/my-project-id/metrics/my-
* metric-id"`.
*/
public Get setMetricName(java.lang.String metricName) {
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(METRIC_NAME_PATTERN.matcher(metricName).matches(),
"Parameter metricName must conform to the pattern " +
"^projects/[^/]*/metrics/[^/]*$");
}
this.metricName = metricName;
return this;
}
@Override
public Get set(String parameterName, Object value) {
return (Get) super.set(parameterName, value);
}
}
/**
* Lists logs-based metrics.
*
* Create a request for the method "metrics.list".
*
* This request holds the parameters needed by the logging server. After setting any optional
* parameters, call the {@link List#execute()} method to invoke the remote operation.
*
* @param parent Required. The resource name containing the metrics.
Example: `"projects/my-project-id"`.
* @return the request
*/
public List list(java.lang.String parent) throws java.io.IOException {
List result = new List(parent);
initialize(result);
return result;
}
public class List extends LoggingRequest {
private static final String REST_PATH = "v2beta1/{+parent}/metrics";
private final java.util.regex.Pattern PARENT_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]*$");
/**
* Lists logs-based metrics.
*
* Create a request for the method "metrics.list".
*
* This request holds the parameters needed by the the logging 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 parent Required. The resource name containing the metrics.
Example: `"projects/my-project-id"`.
* @since 1.13
*/
protected List(java.lang.String parent) {
super(Logging.this, "GET", REST_PATH, null, com.google.api.services.logging.v2beta1.model.ListLogMetricsResponse.class);
this.parent = com.google.api.client.util.Preconditions.checkNotNull(parent, "Required parameter parent must be specified.");
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
"Parameter parent must conform to the pattern " +
"^projects/[^/]*$");
}
}
@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);
}
/**
* Required. The resource name containing the metrics. Example: `"projects/my-project-id"`.
*/
@com.google.api.client.util.Key
private java.lang.String parent;
/** Required. The resource name containing the metrics. Example: `"projects/my-project-id"`.
*/
public java.lang.String getParent() {
return parent;
}
/**
* Required. The resource name containing the metrics. Example: `"projects/my-project-id"`.
*/
public List setParent(java.lang.String parent) {
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
"Parameter parent must conform to the pattern " +
"^projects/[^/]*$");
}
this.parent = parent;
return this;
}
/**
* Optional. The maximum number of results to return from this request. Non-positive values
* are ignored. The presence of `nextPageToken` in the response indicates that more results
* might be available.
*/
@com.google.api.client.util.Key
private java.lang.Integer pageSize;
/** Optional. The maximum number of results to return from this request. Non-positive values are
ignored. The presence of `nextPageToken` in the response indicates that more results might be
available.
*/
public java.lang.Integer getPageSize() {
return pageSize;
}
/**
* Optional. The maximum number of results to return from this request. Non-positive values
* are ignored. The presence of `nextPageToken` in the response indicates that more results
* might be available.
*/
public List setPageSize(java.lang.Integer pageSize) {
this.pageSize = pageSize;
return this;
}
/**
* Optional. If present, then retrieve the next batch of results from the preceding call to
* this method. `pageToken` must be the value of `nextPageToken` from the previous
* response. The values of other method parameters should be identical to those in the
* previous call.
*/
@com.google.api.client.util.Key
private java.lang.String pageToken;
/** Optional. If present, then retrieve the next batch of results from the preceding call to this
method. `pageToken` must be the value of `nextPageToken` from the previous response. The values
of other method parameters should be identical to those in the previous call.
*/
public java.lang.String getPageToken() {
return pageToken;
}
/**
* Optional. If present, then retrieve the next batch of results from the preceding call to
* this method. `pageToken` must be the value of `nextPageToken` from the previous
* response. The values of other method parameters should be identical to those in the
* previous call.
*/
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);
}
}
/**
* Creates or updates a logs-based metric.
*
* Create a request for the method "metrics.update".
*
* This request holds the parameters needed by the logging server. After setting any optional
* parameters, call the {@link Update#execute()} method to invoke the remote operation.
*
* @param metricName The resource name of the metric to update.
Example: `"projects/my-project-id/metrics/my-metric-id"`.
* The updated metric must be provided in the request and have the
same identifier that is
* specified in `metricName`.
If the metric does not exist, it is created.
* @param content the {@link com.google.api.services.logging.v2beta1.model.LogMetric}
* @return the request
*/
public Update update(java.lang.String metricName, com.google.api.services.logging.v2beta1.model.LogMetric content) throws java.io.IOException {
Update result = new Update(metricName, content);
initialize(result);
return result;
}
public class Update extends LoggingRequest {
private static final String REST_PATH = "v2beta1/{+metricName}";
private final java.util.regex.Pattern METRIC_NAME_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]*/metrics/[^/]*$");
/**
* Creates or updates a logs-based metric.
*
* Create a request for the method "metrics.update".
*
* This request holds the parameters needed by the the logging 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 metricName The resource name of the metric to update.
Example: `"projects/my-project-id/metrics/my-metric-id"`.
* The updated metric must be provided in the request and have the
same identifier that is
* specified in `metricName`.
If the metric does not exist, it is created.
* @param content the {@link com.google.api.services.logging.v2beta1.model.LogMetric}
* @since 1.13
*/
protected Update(java.lang.String metricName, com.google.api.services.logging.v2beta1.model.LogMetric content) {
super(Logging.this, "PUT", REST_PATH, content, com.google.api.services.logging.v2beta1.model.LogMetric.class);
this.metricName = com.google.api.client.util.Preconditions.checkNotNull(metricName, "Required parameter metricName must be specified.");
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(METRIC_NAME_PATTERN.matcher(metricName).matches(),
"Parameter metricName must conform to the pattern " +
"^projects/[^/]*/metrics/[^/]*$");
}
}
@Override
public Update set$Xgafv(java.lang.String $Xgafv) {
return (Update) super.set$Xgafv($Xgafv);
}
@Override
public Update setAccessToken(java.lang.String accessToken) {
return (Update) super.setAccessToken(accessToken);
}
@Override
public Update setAlt(java.lang.String alt) {
return (Update) super.setAlt(alt);
}
@Override
public Update setBearerToken(java.lang.String bearerToken) {
return (Update) super.setBearerToken(bearerToken);
}
@Override
public Update setCallback(java.lang.String callback) {
return (Update) super.setCallback(callback);
}
@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 setPp(java.lang.Boolean pp) {
return (Update) super.setPp(pp);
}
@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 setUploadType(java.lang.String uploadType) {
return (Update) super.setUploadType(uploadType);
}
@Override
public Update setUploadProtocol(java.lang.String uploadProtocol) {
return (Update) super.setUploadProtocol(uploadProtocol);
}
/**
* The resource name of the metric to update. Example: `"projects/my-project-id/metrics/my-
* metric-id"`.
*
* The updated metric must be provided in the request and have the same identifier that is
* specified in `metricName`. If the metric does not exist, it is created.
*/
@com.google.api.client.util.Key
private java.lang.String metricName;
/** The resource name of the metric to update. Example: `"projects/my-project-id/metrics/my-metric-
id"`.
The updated metric must be provided in the request and have the same identifier that is specified
in `metricName`. If the metric does not exist, it is created.
*/
public java.lang.String getMetricName() {
return metricName;
}
/**
* The resource name of the metric to update. Example: `"projects/my-project-id/metrics/my-
* metric-id"`.
*
* The updated metric must be provided in the request and have the same identifier that is
* specified in `metricName`. If the metric does not exist, it is created.
*/
public Update setMetricName(java.lang.String metricName) {
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(METRIC_NAME_PATTERN.matcher(metricName).matches(),
"Parameter metricName must conform to the pattern " +
"^projects/[^/]*/metrics/[^/]*$");
}
this.metricName = metricName;
return this;
}
@Override
public Update set(String parameterName, Object value) {
return (Update) super.set(parameterName, value);
}
}
}
/**
* An accessor for creating requests from the Sinks collection.
*
* The typical use is:
*
* {@code Logging logging = new Logging(...);}
* {@code Logging.Sinks.List request = logging.sinks().list(parameters ...)}
*
*
* @return the resource collection
*/
public Sinks sinks() {
return new Sinks();
}
/**
* The "sinks" collection of methods.
*/
public class Sinks {
/**
* Creates a sink.
*
* Create a request for the method "sinks.create".
*
* This request holds the parameters needed by the logging server. After setting any optional
* parameters, call the {@link Create#execute()} method to invoke the remote operation.
*
* @param parent Required. The resource in which to create the sink.
Example: `"projects/my-project-id"`.
The new
* sink must be provided in the request.
* @param content the {@link com.google.api.services.logging.v2beta1.model.LogSink}
* @return the request
*/
public Create create(java.lang.String parent, com.google.api.services.logging.v2beta1.model.LogSink content) throws java.io.IOException {
Create result = new Create(parent, content);
initialize(result);
return result;
}
public class Create extends LoggingRequest {
private static final String REST_PATH = "v2beta1/{+parent}/sinks";
private final java.util.regex.Pattern PARENT_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]*$");
/**
* Creates a sink.
*
* Create a request for the method "sinks.create".
*
* This request holds the parameters needed by the the logging 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 parent Required. The resource in which to create the sink.
Example: `"projects/my-project-id"`.
The new
* sink must be provided in the request.
* @param content the {@link com.google.api.services.logging.v2beta1.model.LogSink}
* @since 1.13
*/
protected Create(java.lang.String parent, com.google.api.services.logging.v2beta1.model.LogSink content) {
super(Logging.this, "POST", REST_PATH, content, com.google.api.services.logging.v2beta1.model.LogSink.class);
this.parent = com.google.api.client.util.Preconditions.checkNotNull(parent, "Required parameter parent must be specified.");
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
"Parameter parent must conform to the pattern " +
"^projects/[^/]*$");
}
}
@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);
}
/**
* Required. The resource in which to create the sink. Example: `"projects/my-project-id"`.
* The new sink must be provided in the request.
*/
@com.google.api.client.util.Key
private java.lang.String parent;
/** Required. The resource in which to create the sink. Example: `"projects/my-project-id"`. The new
sink must be provided in the request.
*/
public java.lang.String getParent() {
return parent;
}
/**
* Required. The resource in which to create the sink. Example: `"projects/my-project-id"`.
* The new sink must be provided in the request.
*/
public Create setParent(java.lang.String parent) {
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
"Parameter parent must conform to the pattern " +
"^projects/[^/]*$");
}
this.parent = parent;
return this;
}
@Override
public Create set(String parameterName, Object value) {
return (Create) super.set(parameterName, value);
}
}
/**
* Deletes a sink.
*
* Create a request for the method "sinks.delete".
*
* This request holds the parameters needed by the logging server. After setting any optional
* parameters, call the {@link Delete#execute()} method to invoke the remote operation.
*
* @param sinkName Required. The resource name of the sink to delete, including the parent
resource and the sink
* identifier. Example:
`"projects/my-project-id/sinks/my-sink-id"`. It is an error if the
* sink
does not exist.
* @return the request
*/
public Delete delete(java.lang.String sinkName) throws java.io.IOException {
Delete result = new Delete(sinkName);
initialize(result);
return result;
}
public class Delete extends LoggingRequest {
private static final String REST_PATH = "v2beta1/{+sinkName}";
private final java.util.regex.Pattern SINK_NAME_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]*/sinks/[^/]*$");
/**
* Deletes a sink.
*
* Create a request for the method "sinks.delete".
*
* This request holds the parameters needed by the the logging 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 sinkName Required. The resource name of the sink to delete, including the parent
resource and the sink
* identifier. Example:
`"projects/my-project-id/sinks/my-sink-id"`. It is an error if the
* sink
does not exist.
* @since 1.13
*/
protected Delete(java.lang.String sinkName) {
super(Logging.this, "DELETE", REST_PATH, null, com.google.api.services.logging.v2beta1.model.Empty.class);
this.sinkName = com.google.api.client.util.Preconditions.checkNotNull(sinkName, "Required parameter sinkName must be specified.");
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(SINK_NAME_PATTERN.matcher(sinkName).matches(),
"Parameter sinkName must conform to the pattern " +
"^projects/[^/]*/sinks/[^/]*$");
}
}
@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);
}
/**
* Required. The resource name of the sink to delete, including the parent resource and the
* sink identifier. Example: `"projects/my-project-id/sinks/my-sink-id"`. It is an error
* if the sink does not exist.
*/
@com.google.api.client.util.Key
private java.lang.String sinkName;
/** Required. The resource name of the sink to delete, including the parent resource and the sink
identifier. Example: `"projects/my-project-id/sinks/my-sink-id"`. It is an error if the sink does
not exist.
*/
public java.lang.String getSinkName() {
return sinkName;
}
/**
* Required. The resource name of the sink to delete, including the parent resource and the
* sink identifier. Example: `"projects/my-project-id/sinks/my-sink-id"`. It is an error
* if the sink does not exist.
*/
public Delete setSinkName(java.lang.String sinkName) {
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(SINK_NAME_PATTERN.matcher(sinkName).matches(),
"Parameter sinkName must conform to the pattern " +
"^projects/[^/]*/sinks/[^/]*$");
}
this.sinkName = sinkName;
return this;
}
@Override
public Delete set(String parameterName, Object value) {
return (Delete) super.set(parameterName, value);
}
}
/**
* Gets a sink.
*
* Create a request for the method "sinks.get".
*
* This request holds the parameters needed by the logging server. After setting any optional
* parameters, call the {@link Get#execute()} method to invoke the remote operation.
*
* @param sinkName Required. The resource name of the sink to return.
Example: `"projects/my-project-id/sinks/my-sink-
* id"`.
* @return the request
*/
public Get get(java.lang.String sinkName) throws java.io.IOException {
Get result = new Get(sinkName);
initialize(result);
return result;
}
public class Get extends LoggingRequest {
private static final String REST_PATH = "v2beta1/{+sinkName}";
private final java.util.regex.Pattern SINK_NAME_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]*/sinks/[^/]*$");
/**
* Gets a sink.
*
* Create a request for the method "sinks.get".
*
* This request holds the parameters needed by the the logging 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 sinkName Required. The resource name of the sink to return.
Example: `"projects/my-project-id/sinks/my-sink-
* id"`.
* @since 1.13
*/
protected Get(java.lang.String sinkName) {
super(Logging.this, "GET", REST_PATH, null, com.google.api.services.logging.v2beta1.model.LogSink.class);
this.sinkName = com.google.api.client.util.Preconditions.checkNotNull(sinkName, "Required parameter sinkName must be specified.");
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(SINK_NAME_PATTERN.matcher(sinkName).matches(),
"Parameter sinkName must conform to the pattern " +
"^projects/[^/]*/sinks/[^/]*$");
}
}
@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);
}
/**
* Required. The resource name of the sink to return. Example: `"projects/my-project-
* id/sinks/my-sink-id"`.
*/
@com.google.api.client.util.Key
private java.lang.String sinkName;
/** Required. The resource name of the sink to return. Example: `"projects/my-project-id/sinks/my-sink-
id"`.
*/
public java.lang.String getSinkName() {
return sinkName;
}
/**
* Required. The resource name of the sink to return. Example: `"projects/my-project-
* id/sinks/my-sink-id"`.
*/
public Get setSinkName(java.lang.String sinkName) {
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(SINK_NAME_PATTERN.matcher(sinkName).matches(),
"Parameter sinkName must conform to the pattern " +
"^projects/[^/]*/sinks/[^/]*$");
}
this.sinkName = sinkName;
return this;
}
@Override
public Get set(String parameterName, Object value) {
return (Get) super.set(parameterName, value);
}
}
/**
* Lists sinks.
*
* Create a request for the method "sinks.list".
*
* This request holds the parameters needed by the logging server. After setting any optional
* parameters, call the {@link List#execute()} method to invoke the remote operation.
*
* @param parent Required. The cloud resource containing the sinks.
Example: `"projects/my-logging-project"`.
* @return the request
*/
public List list(java.lang.String parent) throws java.io.IOException {
List result = new List(parent);
initialize(result);
return result;
}
public class List extends LoggingRequest {
private static final String REST_PATH = "v2beta1/{+parent}/sinks";
private final java.util.regex.Pattern PARENT_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]*$");
/**
* Lists sinks.
*
* Create a request for the method "sinks.list".
*
* This request holds the parameters needed by the the logging 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 parent Required. The cloud resource containing the sinks.
Example: `"projects/my-logging-project"`.
* @since 1.13
*/
protected List(java.lang.String parent) {
super(Logging.this, "GET", REST_PATH, null, com.google.api.services.logging.v2beta1.model.ListSinksResponse.class);
this.parent = com.google.api.client.util.Preconditions.checkNotNull(parent, "Required parameter parent must be specified.");
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
"Parameter parent must conform to the pattern " +
"^projects/[^/]*$");
}
}
@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);
}
/**
* Required. The cloud resource containing the sinks. Example: `"projects/my-logging-
* project"`.
*/
@com.google.api.client.util.Key
private java.lang.String parent;
/** Required. The cloud resource containing the sinks. Example: `"projects/my-logging-project"`.
*/
public java.lang.String getParent() {
return parent;
}
/**
* Required. The cloud resource containing the sinks. Example: `"projects/my-logging-
* project"`.
*/
public List setParent(java.lang.String parent) {
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
"Parameter parent must conform to the pattern " +
"^projects/[^/]*$");
}
this.parent = parent;
return this;
}
/**
* Optional. The maximum number of results to return from this request. Non-positive values
* are ignored. The presence of `nextPageToken` in the response indicates that more results
* might be available.
*/
@com.google.api.client.util.Key
private java.lang.Integer pageSize;
/** Optional. The maximum number of results to return from this request. Non-positive values are
ignored. The presence of `nextPageToken` in the response indicates that more results might be
available.
*/
public java.lang.Integer getPageSize() {
return pageSize;
}
/**
* Optional. The maximum number of results to return from this request. Non-positive values
* are ignored. The presence of `nextPageToken` in the response indicates that more results
* might be available.
*/
public List setPageSize(java.lang.Integer pageSize) {
this.pageSize = pageSize;
return this;
}
/**
* Optional. If present, then retrieve the next batch of results from the preceding call to
* this method. `pageToken` must be the value of `nextPageToken` from the previous
* response. The values of other method parameters should be identical to those in the
* previous call.
*/
@com.google.api.client.util.Key
private java.lang.String pageToken;
/** Optional. If present, then retrieve the next batch of results from the preceding call to this
method. `pageToken` must be the value of `nextPageToken` from the previous response. The values
of other method parameters should be identical to those in the previous call.
*/
public java.lang.String getPageToken() {
return pageToken;
}
/**
* Optional. If present, then retrieve the next batch of results from the preceding call to
* this method. `pageToken` must be the value of `nextPageToken` from the previous
* response. The values of other method parameters should be identical to those in the
* previous call.
*/
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);
}
}
/**
* Updates or creates a sink.
*
* Create a request for the method "sinks.update".
*
* This request holds the parameters needed by the logging server. After setting any optional
* parameters, call the {@link Update#execute()} method to invoke the remote operation.
*
* @param sinkName Required. The resource name of the sink to update, including the parent
resource and the sink
* identifier. If the sink does not exist, this method
creates the sink. Example:
* `"projects/my-project-id/sinks/my-sink-id"`.
* @param content the {@link com.google.api.services.logging.v2beta1.model.LogSink}
* @return the request
*/
public Update update(java.lang.String sinkName, com.google.api.services.logging.v2beta1.model.LogSink content) throws java.io.IOException {
Update result = new Update(sinkName, content);
initialize(result);
return result;
}
public class Update extends LoggingRequest {
private static final String REST_PATH = "v2beta1/{+sinkName}";
private final java.util.regex.Pattern SINK_NAME_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]*/sinks/[^/]*$");
/**
* Updates or creates a sink.
*
* Create a request for the method "sinks.update".
*
* This request holds the parameters needed by the the logging 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 sinkName Required. The resource name of the sink to update, including the parent
resource and the sink
* identifier. If the sink does not exist, this method
creates the sink. Example:
* `"projects/my-project-id/sinks/my-sink-id"`.
* @param content the {@link com.google.api.services.logging.v2beta1.model.LogSink}
* @since 1.13
*/
protected Update(java.lang.String sinkName, com.google.api.services.logging.v2beta1.model.LogSink content) {
super(Logging.this, "PUT", REST_PATH, content, com.google.api.services.logging.v2beta1.model.LogSink.class);
this.sinkName = com.google.api.client.util.Preconditions.checkNotNull(sinkName, "Required parameter sinkName must be specified.");
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(SINK_NAME_PATTERN.matcher(sinkName).matches(),
"Parameter sinkName must conform to the pattern " +
"^projects/[^/]*/sinks/[^/]*$");
}
}
@Override
public Update set$Xgafv(java.lang.String $Xgafv) {
return (Update) super.set$Xgafv($Xgafv);
}
@Override
public Update setAccessToken(java.lang.String accessToken) {
return (Update) super.setAccessToken(accessToken);
}
@Override
public Update setAlt(java.lang.String alt) {
return (Update) super.setAlt(alt);
}
@Override
public Update setBearerToken(java.lang.String bearerToken) {
return (Update) super.setBearerToken(bearerToken);
}
@Override
public Update setCallback(java.lang.String callback) {
return (Update) super.setCallback(callback);
}
@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 setPp(java.lang.Boolean pp) {
return (Update) super.setPp(pp);
}
@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 setUploadType(java.lang.String uploadType) {
return (Update) super.setUploadType(uploadType);
}
@Override
public Update setUploadProtocol(java.lang.String uploadProtocol) {
return (Update) super.setUploadProtocol(uploadProtocol);
}
/**
* Required. The resource name of the sink to update, including the parent resource and the
* sink identifier. If the sink does not exist, this method creates the sink. Example:
* `"projects/my-project-id/sinks/my-sink-id"`.
*/
@com.google.api.client.util.Key
private java.lang.String sinkName;
/** Required. The resource name of the sink to update, including the parent resource and the sink
identifier. If the sink does not exist, this method creates the sink. Example: `"projects/my-
project-id/sinks/my-sink-id"`.
*/
public java.lang.String getSinkName() {
return sinkName;
}
/**
* Required. The resource name of the sink to update, including the parent resource and the
* sink identifier. If the sink does not exist, this method creates the sink. Example:
* `"projects/my-project-id/sinks/my-sink-id"`.
*/
public Update setSinkName(java.lang.String sinkName) {
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(SINK_NAME_PATTERN.matcher(sinkName).matches(),
"Parameter sinkName must conform to the pattern " +
"^projects/[^/]*/sinks/[^/]*$");
}
this.sinkName = sinkName;
return this;
}
@Override
public Update set(String parameterName, Object value) {
return (Update) super.set(parameterName, value);
}
}
}
}
/**
* Builder for {@link Logging}.
*
*
* 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 Logging}. */
@Override
public Logging build() {
return new Logging(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 LoggingRequestInitializer}.
*
* @since 1.12
*/
public Builder setLoggingRequestInitializer(
LoggingRequestInitializer loggingRequestInitializer) {
return (Builder) super.setGoogleClientRequestInitializer(loggingRequestInitializer);
}
@Override
public Builder setGoogleClientRequestInitializer(
com.google.api.client.googleapis.services.GoogleClientRequestInitializer googleClientRequestInitializer) {
return (Builder) super.setGoogleClientRequestInitializer(googleClientRequestInitializer);
}
}
}