From de7fdef10d3776d1a1ab5ec222c0310ffe106681 Mon Sep 17 00:00:00 2001 From: Shin Fan Date: Fri, 18 Mar 2016 16:05:03 -0700 Subject: [PATCH] Update and fix gcloud-java-logging --- .../logging/spi/v2/ConfigServiceV2Api.java | 472 +++ .../spi/v2/ConfigServiceV2Settings.java | 289 ++ .../logging/spi/v2/LoggingServiceV2Api.java | 506 ++++ .../spi/v2/LoggingServiceV2Settings.java | 371 +++ .../logging/spi/v2/MetricsServiceV2Api.java | 477 +++ .../spi/v2/MetricsServiceV2Settings.java | 293 ++ .../com/google/logging/type/HttpRequest.java | 1478 --------- .../logging/type/HttpRequestOrBuilder.java | 157 - .../google/logging/type/HttpRequestProto.java | 56 - .../com/google/logging/type/LogSeverity.java | 245 -- .../google/logging/type/LogSeverityProto.java | 43 - .../logging/v2/ConfigServiceV2Grpc.java | 356 --- .../logging/v2/CreateLogMetricRequest.java | 722 ----- .../v2/CreateLogMetricRequestOrBuilder.java | 59 - .../google/logging/v2/CreateSinkRequest.java | 722 ----- .../v2/CreateSinkRequestOrBuilder.java | 59 - .../logging/v2/DeleteLogMetricRequest.java | 483 --- .../v2/DeleteLogMetricRequestOrBuilder.java | 29 - .../google/logging/v2/DeleteLogRequest.java | 483 --- .../logging/v2/DeleteLogRequestOrBuilder.java | 29 - .../google/logging/v2/DeleteSinkRequest.java | 483 --- .../v2/DeleteSinkRequestOrBuilder.java | 29 - .../logging/v2/GetLogMetricRequest.java | 483 --- .../v2/GetLogMetricRequestOrBuilder.java | 29 - .../com/google/logging/v2/GetSinkRequest.java | 483 --- .../logging/v2/GetSinkRequestOrBuilder.java | 29 - .../logging/v2/ListLogEntriesRequest.java | 1182 -------- .../v2/ListLogEntriesRequestOrBuilder.java | 139 - .../logging/v2/ListLogEntriesResponse.java | 923 ------ .../v2/ListLogEntriesResponseOrBuilder.java | 75 - .../logging/v2/ListLogMetricsRequest.java | 748 ----- .../v2/ListLogMetricsRequestOrBuilder.java | 68 - .../logging/v2/ListLogMetricsResponse.java | 923 ------ .../v2/ListLogMetricsResponseOrBuilder.java | 75 - ...stMonitoredResourceDescriptorsRequest.java | 583 ---- ...edResourceDescriptorsRequestOrBuilder.java | 46 - ...tMonitoredResourceDescriptorsResponse.java | 923 ------ ...dResourceDescriptorsResponseOrBuilder.java | 75 - .../google/logging/v2/ListSinksRequest.java | 748 ----- .../logging/v2/ListSinksRequestOrBuilder.java | 68 - .../google/logging/v2/ListSinksResponse.java | 923 ------ .../v2/ListSinksResponseOrBuilder.java | 75 - .../java/com/google/logging/v2/LogEntry.java | 2648 ----------------- .../google/logging/v2/LogEntryOperation.java | 790 ----- .../v2/LogEntryOperationOrBuilder.java | 69 - .../google/logging/v2/LogEntryOrBuilder.java | 277 -- .../com/google/logging/v2/LogEntryProto.java | 108 - .../java/com/google/logging/v2/LogMetric.java | 934 ------ .../google/logging/v2/LogMetricOrBuilder.java | 75 - .../java/com/google/logging/v2/LogSink.java | 1115 ------- .../google/logging/v2/LogSinkOrBuilder.java | 108 - .../com/google/logging/v2/LoggingConfig.java | 162 - .../com/google/logging/v2/LoggingMetrics.java | 159 - .../com/google/logging/v2/LoggingProto.java | 208 -- .../logging/v2/LoggingServiceV2Grpc.java | 348 --- .../logging/v2/MetricsServiceV2Grpc.java | 356 --- .../logging/v2/ReadLogEntriesRequest.java | 1094 ------- .../v2/ReadLogEntriesRequestOrBuilder.java | 122 - .../logging/v2/ReadLogEntriesResponse.java | 946 ------ .../v2/ReadLogEntriesResponseOrBuilder.java | 80 - .../logging/v2/UpdateLogMetricRequest.java | 748 ----- .../v2/UpdateLogMetricRequestOrBuilder.java | 66 - .../google/logging/v2/UpdateSinkRequest.java | 748 ----- .../v2/UpdateSinkRequestOrBuilder.java | 66 - .../logging/v2/WriteLogEntriesRequest.java | 1356 --------- .../v2/WriteLogEntriesRequestOrBuilder.java | 123 - .../logging/v2/WriteLogEntriesResponse.java | 324 -- .../v2/WriteLogEntriesResponseOrBuilder.java | 9 - gcloud-java-logging/pom.xml | 23 +- .../logging/spi/v2/ConfigServiceV2Api.java | 353 +-- .../spi/v2/ConfigServiceV2Settings.java | 290 ++ .../logging/spi/v2/LoggingServiceV2Api.java | 383 +-- .../spi/v2/LoggingServiceV2Settings.java | 372 +++ .../logging/spi/v2/MetricsServiceV2Api.java | 352 +-- .../spi/v2/MetricsServiceV2Settings.java | 294 ++ .../v2}/testing/LocalLoggingHelper.java | 17 +- .../spi/v2/testing/LocalLoggingImpl.java | 16 +- .../spi/v2/LoggingServiceV2ApiTest.java | 26 +- 78 files changed, 3875 insertions(+), 27729 deletions(-) create mode 100644 gcloud-java-logging/baseline/src/main/java/com/google/gcloud/logging/spi/v2/ConfigServiceV2Api.java create mode 100644 gcloud-java-logging/baseline/src/main/java/com/google/gcloud/logging/spi/v2/ConfigServiceV2Settings.java create mode 100644 gcloud-java-logging/baseline/src/main/java/com/google/gcloud/logging/spi/v2/LoggingServiceV2Api.java create mode 100644 gcloud-java-logging/baseline/src/main/java/com/google/gcloud/logging/spi/v2/LoggingServiceV2Settings.java create mode 100644 gcloud-java-logging/baseline/src/main/java/com/google/gcloud/logging/spi/v2/MetricsServiceV2Api.java create mode 100644 gcloud-java-logging/baseline/src/main/java/com/google/gcloud/logging/spi/v2/MetricsServiceV2Settings.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/type/HttpRequest.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/type/HttpRequestOrBuilder.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/type/HttpRequestProto.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/type/LogSeverity.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/type/LogSeverityProto.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ConfigServiceV2Grpc.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/v2/CreateLogMetricRequest.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/v2/CreateLogMetricRequestOrBuilder.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/v2/CreateSinkRequest.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/v2/CreateSinkRequestOrBuilder.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/v2/DeleteLogMetricRequest.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/v2/DeleteLogMetricRequestOrBuilder.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/v2/DeleteLogRequest.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/v2/DeleteLogRequestOrBuilder.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/v2/DeleteSinkRequest.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/v2/DeleteSinkRequestOrBuilder.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/v2/GetLogMetricRequest.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/v2/GetLogMetricRequestOrBuilder.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/v2/GetSinkRequest.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/v2/GetSinkRequestOrBuilder.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListLogEntriesRequest.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListLogEntriesRequestOrBuilder.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListLogEntriesResponse.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListLogEntriesResponseOrBuilder.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListLogMetricsRequest.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListLogMetricsRequestOrBuilder.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListLogMetricsResponse.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListLogMetricsResponseOrBuilder.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListMonitoredResourceDescriptorsRequest.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListMonitoredResourceDescriptorsRequestOrBuilder.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListMonitoredResourceDescriptorsResponse.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListMonitoredResourceDescriptorsResponseOrBuilder.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListSinksRequest.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListSinksRequestOrBuilder.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListSinksResponse.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListSinksResponseOrBuilder.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/v2/LogEntry.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/v2/LogEntryOperation.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/v2/LogEntryOperationOrBuilder.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/v2/LogEntryOrBuilder.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/v2/LogEntryProto.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/v2/LogMetric.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/v2/LogMetricOrBuilder.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/v2/LogSink.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/v2/LogSinkOrBuilder.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/v2/LoggingConfig.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/v2/LoggingMetrics.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/v2/LoggingProto.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/v2/LoggingServiceV2Grpc.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/v2/MetricsServiceV2Grpc.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ReadLogEntriesRequest.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ReadLogEntriesRequestOrBuilder.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ReadLogEntriesResponse.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ReadLogEntriesResponseOrBuilder.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/v2/UpdateLogMetricRequest.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/v2/UpdateLogMetricRequestOrBuilder.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/v2/UpdateSinkRequest.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/v2/UpdateSinkRequestOrBuilder.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/v2/WriteLogEntriesRequest.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/v2/WriteLogEntriesRequestOrBuilder.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/v2/WriteLogEntriesResponse.java delete mode 100644 gcloud-java-logging/generated/src/main/java/com/google/logging/v2/WriteLogEntriesResponseOrBuilder.java create mode 100644 gcloud-java-logging/src/main/java/com/google/gcloud/logging/spi/v2/ConfigServiceV2Settings.java create mode 100644 gcloud-java-logging/src/main/java/com/google/gcloud/logging/spi/v2/LoggingServiceV2Settings.java create mode 100644 gcloud-java-logging/src/main/java/com/google/gcloud/logging/spi/v2/MetricsServiceV2Settings.java rename gcloud-java-logging/src/main/java/com/google/gcloud/logging/{ => spi/v2}/testing/LocalLoggingHelper.java (76%) diff --git a/gcloud-java-logging/baseline/src/main/java/com/google/gcloud/logging/spi/v2/ConfigServiceV2Api.java b/gcloud-java-logging/baseline/src/main/java/com/google/gcloud/logging/spi/v2/ConfigServiceV2Api.java new file mode 100644 index 000000000000..5c35c9c96c83 --- /dev/null +++ b/gcloud-java-logging/baseline/src/main/java/com/google/gcloud/logging/spi/v2/ConfigServiceV2Api.java @@ -0,0 +1,472 @@ +/* + * Copyright 2016 Google Inc. All Rights Reserved. + * + * 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. + */ + +/* + * EDITING INSTRUCTIONS + * This file was generated from the file + * https://github.com/google/googleapis/blob/master/google/logging/v2/logging_config.proto + * and updates to that file get reflected here through a refresh process. + * For the short term, the refresh process will only be runnable by Google engineers. + * Manual additions are allowed because the refresh process performs + * a 3-way merge in order to preserve those manual additions. In order to not + * break the refresh process, only certain types of modifications are + * allowed. + * + * Allowed modifications - currently these are the only types allowed: + * 1. New methods (these should be added to the end of the class) + * 2. New imports + * 3. Additional documentation between "manual edit" demarcations + * + * Happy editing! + */ + +package com.google.gcloud.logging.spi.v2; + +import com.google.api.gax.grpc.ApiCallable; +import com.google.api.gax.protobuf.PathTemplate; +import com.google.logging.v2.CreateSinkRequest; +import com.google.logging.v2.DeleteSinkRequest; +import com.google.logging.v2.GetSinkRequest; +import com.google.logging.v2.ListSinksRequest; +import com.google.logging.v2.ListSinksResponse; +import com.google.logging.v2.LogSink; +import com.google.logging.v2.UpdateSinkRequest; +import com.google.protobuf.Empty; +import io.grpc.ManagedChannel; +import java.io.Closeable; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +// Manually-added imports: add custom (non-generated) imports after this point. + +// AUTO-GENERATED DOCUMENTATION AND SERVICE - see instructions at the top of the file for editing. +/** + * Service Description: See src/api/google/logging/v2/logging.proto for documentation + * + * + * + */ +@javax.annotation.Generated("by GAPIC") +public class ConfigServiceV2Api implements AutoCloseable { + + public static class ResourceNames { + private ResourceNames() {} + + // ======================= + // ResourceNames Constants + // ======================= + + /** + * A PathTemplate representing the fully-qualified path to represent + * a project resource. + * + * + * + */ + private static final PathTemplate PROJECT_PATH_TEMPLATE = + PathTemplate.create("projects/{project}"); + + /** + * A PathTemplate representing the fully-qualified path to represent + * a sink resource. + * + * + * + */ + private static final PathTemplate SINK_PATH_TEMPLATE = + PathTemplate.create("projects/{project}/sinks/{sink}"); + + // ============================== + // Resource Name Helper Functions + // ============================== + + /** + * Formats a string containing the fully-qualified path to represent + * a project resource. + * + * + * + */ + public static final String formatProjectPath(String project) { + return PROJECT_PATH_TEMPLATE.instantiate("project", project); + } + + /** + * Formats a string containing the fully-qualified path to represent + * a sink resource. + * + * + * + */ + public static final String formatSinkPath(String project, String sink) { + return SINK_PATH_TEMPLATE.instantiate("project", project, "sink", sink); + } + + /** + * Parses the project from the given fully-qualified path which + * represents a project resource. + * + * + * + */ + public static final String parseProjectFromProjectPath(String projectPath) { + return PROJECT_PATH_TEMPLATE.parse(projectPath).get("project"); + } + + /** + * Parses the project from the given fully-qualified path which + * represents a sink resource. + * + * + * + */ + public static final String parseProjectFromSinkPath(String sinkPath) { + return SINK_PATH_TEMPLATE.parse(sinkPath).get("project"); + } + + /** + * Parses the sink from the given fully-qualified path which + * represents a sink resource. + * + * + * + */ + public static final String parseSinkFromSinkPath(String sinkPath) { + return SINK_PATH_TEMPLATE.parse(sinkPath).get("sink"); + } + } + + // ======== + // Members + // ======== + + private final ManagedChannel channel; + private final List closeables = new ArrayList<>(); + + private final ApiCallable listSinksCallable; + private final ApiCallable> listSinksIterableCallable; + private final ApiCallable getSinkCallable; + private final ApiCallable createSinkCallable; + private final ApiCallable updateSinkCallable; + private final ApiCallable deleteSinkCallable; + + // =============== + // Factory Methods + // =============== + + /** + * Constructs an instance of ConfigServiceV2Api with default settings. + * + * + * + */ + public static ConfigServiceV2Api create() throws IOException { + return create(ConfigServiceV2Settings.create()); + } + + /** + * Constructs an instance of ConfigServiceV2Api, using the given settings. The channels are + * created based on the settings passed in, or defaults for any settings that are not set. + * + * + * + */ + public static ConfigServiceV2Api create(ConfigServiceV2Settings settings) throws IOException { + return new ConfigServiceV2Api(settings); + } + + /** + * Constructs an instance of ConfigServiceV2Api, using the given settings. This is protected so + * that it easy to make a subclass, but otherwise, the static factory methods should be preferred. + * + * + * + */ + protected ConfigServiceV2Api(ConfigServiceV2Settings settings) throws IOException { + this.channel = settings.getChannel(); + + this.listSinksCallable = settings.listSinksMethod().build(settings); + this.listSinksIterableCallable = settings.listSinksMethod().buildPageStreaming(settings); + this.getSinkCallable = settings.getSinkMethod().build(settings); + this.createSinkCallable = settings.createSinkMethod().build(settings); + this.updateSinkCallable = settings.updateSinkMethod().build(settings); + this.deleteSinkCallable = settings.deleteSinkMethod().build(settings); + + closeables.add( + new Closeable() { + @Override + public void close() throws IOException { + channel.shutdown(); + } + }); + } + + // ============= + // Service Calls + // ============= + + // ----- listSinks ----- + + // AUTO-GENERATED DOCUMENTATION AND METHOD - see instructions at the top of the file for editing. + /** + * Lists sinks. + * + * + * + */ + public Iterable listSinks(String projectName) { + ListSinksRequest request = ListSinksRequest.newBuilder().setProjectName(projectName).build(); + return listSinks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD - see instructions at the top of the file for editing. + /** + * Lists sinks. + * + * + * + * + * @param request The request object containing all of the parameters for the API call. + */ + public Iterable listSinks(ListSinksRequest request) { + return listSinksIterableCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD - see instructions at the top of the file for editing. + /** + * Lists sinks. + * + * + * + */ + public ApiCallable> listSinksIterableCallable() { + return listSinksIterableCallable; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD - see instructions at the top of the file for editing. + /** + * Lists sinks. + * + * + * + */ + public ApiCallable listSinksCallable() { + return listSinksCallable; + } + + // ----- getSink ----- + + // AUTO-GENERATED DOCUMENTATION AND METHOD - see instructions at the top of the file for editing. + /** + * Gets a sink. + * + * + * + * + * @param sinkName The resource name of the sink to return. + * Example: `"projects/my-project-id/sinks/my-sink-id"`. + */ + public LogSink getSink(String sinkName) { + GetSinkRequest request = GetSinkRequest.newBuilder().setSinkName(sinkName).build(); + + return getSink(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD - see instructions at the top of the file for editing. + /** + * Gets a sink. + * + * + * + * + * @param request The request object containing all of the parameters for the API call. + */ + private LogSink getSink(GetSinkRequest request) { + return getSinkCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD - see instructions at the top of the file for editing. + /** + * Gets a sink. + * + * + * + */ + public ApiCallable getSinkCallable() { + return getSinkCallable; + } + + // ----- createSink ----- + + // AUTO-GENERATED DOCUMENTATION AND METHOD - see instructions at the top of the file for editing. + /** + * Creates a sink. + * + * + * + * + * @param projectName The resource name of the project in which to create the sink. + * Example: `"projects/my-project-id"`. + * + * The new sink must be provided in the request. + * @param sink The new sink, which must not have an identifier that already + * exists. + */ + public LogSink createSink(String projectName, LogSink sink) { + CreateSinkRequest request = + CreateSinkRequest.newBuilder().setProjectName(projectName).setSink(sink).build(); + + return createSink(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD - see instructions at the top of the file for editing. + /** + * Creates a sink. + * + * + * + * + * @param request The request object containing all of the parameters for the API call. + */ + public LogSink createSink(CreateSinkRequest request) { + return createSinkCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD - see instructions at the top of the file for editing. + /** + * Creates a sink. + * + * + * + */ + public ApiCallable createSinkCallable() { + return createSinkCallable; + } + + // ----- updateSink ----- + + // AUTO-GENERATED DOCUMENTATION AND METHOD - see instructions at the top of the file for editing. + /** + * Creates or updates a sink. + * + * + * + * + * @param sinkName The resource name of the sink to update. + * Example: `"projects/my-project-id/sinks/my-sink-id"`. + * + * The updated sink must be provided in the request and have the + * same name that is specified in `sinkName`. If the sink does not + * exist, it is created. + * @param sink The updated sink, whose name must be the same as the sink + * identifier in `sinkName`. If `sinkName` does not exist, then + * this method creates a new sink. + */ + public LogSink updateSink(String sinkName, LogSink sink) { + UpdateSinkRequest request = + UpdateSinkRequest.newBuilder().setSinkName(sinkName).setSink(sink).build(); + + return updateSink(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD - see instructions at the top of the file for editing. + /** + * Creates or updates a sink. + * + * + * + * + * @param request The request object containing all of the parameters for the API call. + */ + public LogSink updateSink(UpdateSinkRequest request) { + return updateSinkCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD - see instructions at the top of the file for editing. + /** + * Creates or updates a sink. + * + * + * + */ + public ApiCallable updateSinkCallable() { + return updateSinkCallable; + } + + // ----- deleteSink ----- + + // AUTO-GENERATED DOCUMENTATION AND METHOD - see instructions at the top of the file for editing. + /** + * Deletes a sink. + * + * + * + * + * @param sinkName The resource name of the sink to delete. + * Example: `"projects/my-project-id/sinks/my-sink-id"`. + */ + public void deleteSink(String sinkName) { + DeleteSinkRequest request = DeleteSinkRequest.newBuilder().setSinkName(sinkName).build(); + + deleteSink(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD - see instructions at the top of the file for editing. + /** + * Deletes a sink. + * + * + * + * + * @param request The request object containing all of the parameters for the API call. + */ + private void deleteSink(DeleteSinkRequest request) { + deleteSinkCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD - see instructions at the top of the file for editing. + /** + * Deletes a sink. + * + * + * + */ + public ApiCallable deleteSinkCallable() { + return deleteSinkCallable; + } + + // ======== + // Cleanup + // ======== + + /** + * Initiates an orderly shutdown in which preexisting calls continue but new calls are immediately + * cancelled. + * + * + * + */ + @Override + public void close() throws Exception { + for (AutoCloseable closeable : closeables) { + closeable.close(); + } + } + + // ======== + // Manually-added methods: add custom (non-generated) methods after this point. + // ======== + +} diff --git a/gcloud-java-logging/baseline/src/main/java/com/google/gcloud/logging/spi/v2/ConfigServiceV2Settings.java b/gcloud-java-logging/baseline/src/main/java/com/google/gcloud/logging/spi/v2/ConfigServiceV2Settings.java new file mode 100644 index 000000000000..b1248421141f --- /dev/null +++ b/gcloud-java-logging/baseline/src/main/java/com/google/gcloud/logging/spi/v2/ConfigServiceV2Settings.java @@ -0,0 +1,289 @@ +/* + * Copyright 2016 Google Inc. All Rights Reserved. + * + * 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. + */ + +/* + * EDITING INSTRUCTIONS + * This file was generated from the file + * https://github.com/google/googleapis/blob/master/google/logging/v2/logging_config.proto + * and updates to that file get reflected here through a refresh process. + * For the short term, the refresh process will only be runnable by Google engineers. + * Manual additions are allowed because the refresh process performs + * a 3-way merge in order to preserve those manual additions. In order to not + * break the refresh process, only certain types of modifications are + * allowed. + * + * Allowed modifications - currently these are the only types allowed: + * 1. New methods (these should be added to the end of the class) + * 2. New imports + * 3. Additional documentation between "manual edit" demarcations + * + * Happy editing! + */ + +package com.google.gcloud.logging.spi.v2; + +import com.google.api.gax.core.BackoffParams; +import com.google.api.gax.core.ConnectionSettings; +import com.google.api.gax.core.RetryParams; +import com.google.api.gax.grpc.ApiCallSettings; +import com.google.api.gax.grpc.ApiCallable.ApiCallableBuilder; +import com.google.api.gax.grpc.ApiCallable.PageStreamingApiCallableBuilder; +import com.google.api.gax.grpc.PageDescriptor; +import com.google.api.gax.grpc.ServiceApiSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import com.google.logging.v2.ConfigServiceV2Grpc; +import com.google.logging.v2.CreateSinkRequest; +import com.google.logging.v2.DeleteSinkRequest; +import com.google.logging.v2.GetSinkRequest; +import com.google.logging.v2.ListSinksRequest; +import com.google.logging.v2.ListSinksResponse; +import com.google.logging.v2.LogSink; +import com.google.logging.v2.UpdateSinkRequest; +import com.google.protobuf.Empty; +import io.grpc.Status; + +// Manually-added imports: add custom (non-generated) imports after this point. + +// AUTO-GENERATED DOCUMENTATION AND CLASS - see instructions at the top of the file for editing. +@javax.annotation.Generated("by GAPIC") +public class ConfigServiceV2Settings extends ServiceApiSettings { + + // ========= + // Constants + // ========= + + /** + * The default address of the service. + * + * + * + */ + public static final String DEFAULT_SERVICE_ADDRESS = "logging.googleapis.com"; + + /** + * The default port of the service. + * + * + * + */ + public static final int DEFAULT_SERVICE_PORT = 443; + + /** + * The default scopes of the service. + */ + public static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder() + .add("https://www.googleapis.com/auth/logging.write") + .add("https://www.googleapis.com/auth/logging.admin") + .add("https://www.googleapis.com/auth/logging.read") + .add("https://www.googleapis.com/auth/cloud-platform.read-only") + .add("https://www.googleapis.com/auth/cloud-platform") + .build(); + + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + Sets.immutableEnumSet( + Lists.newArrayList( + Status.Code.DEADLINE_EXCEEDED, Status.Code.UNAVAILABLE))); + definitions.put("non_idempotent", Sets.immutableEnumSet(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetryParams params = null; + params = + RetryParams.newBuilder() + .setRetryBackoff( + BackoffParams.newBuilder() + .setInitialDelayMillis(100L) + .setDelayMultiplier(1.2) + .setMaxDelayMillis(1000L) + .build()) + .setTimeoutBackoff( + BackoffParams.newBuilder() + .setInitialDelayMillis(300L) + .setDelayMultiplier(1.3) + .setMaxDelayMillis(3000L) + .build()) + .setTotalTimeout(30000L) + .build(); + definitions.put("default", params); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + private static class MethodBuilders { + private final PageStreamingApiCallableBuilder + listSinksMethod; + private final ApiCallableBuilder getSinkMethod; + private final ApiCallableBuilder createSinkMethod; + private final ApiCallableBuilder updateSinkMethod; + private final ApiCallableBuilder deleteSinkMethod; + private final ImmutableList allMethods; + + public MethodBuilders() { + listSinksMethod = + new PageStreamingApiCallableBuilder<>( + ConfigServiceV2Grpc.METHOD_LIST_SINKS, LIST_SINKS_PAGE_STR_DESC); + listSinksMethod.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")); + listSinksMethod.setRetryParams(RETRY_PARAM_DEFINITIONS.get("default")); + + getSinkMethod = new ApiCallableBuilder<>(ConfigServiceV2Grpc.METHOD_GET_SINK); + getSinkMethod.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")); + getSinkMethod.setRetryParams(RETRY_PARAM_DEFINITIONS.get("default")); + + createSinkMethod = new ApiCallableBuilder<>(ConfigServiceV2Grpc.METHOD_CREATE_SINK); + createSinkMethod.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")); + createSinkMethod.setRetryParams(RETRY_PARAM_DEFINITIONS.get("default")); + + updateSinkMethod = new ApiCallableBuilder<>(ConfigServiceV2Grpc.METHOD_UPDATE_SINK); + updateSinkMethod.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")); + updateSinkMethod.setRetryParams(RETRY_PARAM_DEFINITIONS.get("default")); + + deleteSinkMethod = new ApiCallableBuilder<>(ConfigServiceV2Grpc.METHOD_DELETE_SINK); + deleteSinkMethod.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")); + deleteSinkMethod.setRetryParams(RETRY_PARAM_DEFINITIONS.get("default")); + + allMethods = + ImmutableList.builder() + .add( + listSinksMethod, + getSinkMethod, + createSinkMethod, + updateSinkMethod, + deleteSinkMethod) + .build(); + } + } + + private final MethodBuilders methods; + + // =============== + // Factory Methods + // =============== + + /** + * Constructs an instance of ConfigServiceV2Settings with default settings. + * + * + * + */ + public static ConfigServiceV2Settings create() { + ConfigServiceV2Settings settings = new ConfigServiceV2Settings(new MethodBuilders()); + settings.provideChannelWith( + ConnectionSettings.builder() + .setServiceAddress(DEFAULT_SERVICE_ADDRESS) + .setPort(DEFAULT_SERVICE_PORT) + .provideCredentialsWith(DEFAULT_SERVICE_SCOPES) + .build()); + return settings; + } + + /** + * Constructs an instance of ConfigServiceV2Settings with default settings. This is protected so + * that it easy to make a subclass, but otherwise, the static factory methods should be preferred. + * + * + * + */ + protected ConfigServiceV2Settings(MethodBuilders methods) { + super(methods.allMethods); + this.methods = methods; + } + + /** + * Returns the PageStreamingApiCallableBuilder for the API method listSinks. + * + * + * + */ + public PageStreamingApiCallableBuilder + listSinksMethod() { + return methods.listSinksMethod; + } + + /** + * Returns the ApiCallableBuilder for the API method getSink. + * + * + * + */ + public ApiCallableBuilder getSinkMethod() { + return methods.getSinkMethod; + } + + /** + * Returns the ApiCallableBuilder for the API method createSink. + * + * + * + */ + public ApiCallableBuilder createSinkMethod() { + return methods.createSinkMethod; + } + + /** + * Returns the ApiCallableBuilder for the API method updateSink. + * + * + * + */ + public ApiCallableBuilder updateSinkMethod() { + return methods.updateSinkMethod; + } + + /** + * Returns the ApiCallableBuilder for the API method deleteSink. + * + * + * + */ + public ApiCallableBuilder deleteSinkMethod() { + return methods.deleteSinkMethod; + } + + private static PageDescriptor + LIST_SINKS_PAGE_STR_DESC = + new PageDescriptor() { + @Override + public Object emptyToken() { + return ""; + } + + @Override + public ListSinksRequest injectToken(ListSinksRequest payload, Object token) { + return ListSinksRequest.newBuilder(payload).setPageToken((String) token).build(); + } + + @Override + public Object extractNextToken(ListSinksResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListSinksResponse payload) { + return payload.getSinksList(); + } + }; +} diff --git a/gcloud-java-logging/baseline/src/main/java/com/google/gcloud/logging/spi/v2/LoggingServiceV2Api.java b/gcloud-java-logging/baseline/src/main/java/com/google/gcloud/logging/spi/v2/LoggingServiceV2Api.java new file mode 100644 index 000000000000..cebdeeb1ef1c --- /dev/null +++ b/gcloud-java-logging/baseline/src/main/java/com/google/gcloud/logging/spi/v2/LoggingServiceV2Api.java @@ -0,0 +1,506 @@ +/* + * Copyright 2016 Google Inc. All Rights Reserved. + * + * 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. + */ + +/* + * EDITING INSTRUCTIONS + * This file was generated from the file + * https://github.com/google/googleapis/blob/master/google/logging/v2/logging.proto + * and updates to that file get reflected here through a refresh process. + * For the short term, the refresh process will only be runnable by Google engineers. + * Manual additions are allowed because the refresh process performs + * a 3-way merge in order to preserve those manual additions. In order to not + * break the refresh process, only certain types of modifications are + * allowed. + * + * Allowed modifications - currently these are the only types allowed: + * 1. New methods (these should be added to the end of the class) + * 2. New imports + * 3. Additional documentation between "manual edit" demarcations + * + * Happy editing! + */ + +package com.google.gcloud.logging.spi.v2; + +import com.google.api.MonitoredResource; +import com.google.api.MonitoredResourceDescriptor; +import com.google.api.gax.grpc.ApiCallable; +import com.google.api.gax.protobuf.PathTemplate; +import com.google.logging.v2.DeleteLogRequest; +import com.google.logging.v2.ListLogEntriesRequest; +import com.google.logging.v2.ListLogEntriesResponse; +import com.google.logging.v2.ListMonitoredResourceDescriptorsRequest; +import com.google.logging.v2.ListMonitoredResourceDescriptorsResponse; +import com.google.logging.v2.LogEntry; +import com.google.logging.v2.ReadLogEntriesRequest; +import com.google.logging.v2.ReadLogEntriesResponse; +import com.google.logging.v2.WriteLogEntriesRequest; +import com.google.logging.v2.WriteLogEntriesResponse; +import com.google.protobuf.Empty; +import io.grpc.ManagedChannel; +import java.io.Closeable; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +// Manually-added imports: add custom (non-generated) imports after this point. + +// AUTO-GENERATED DOCUMENTATION AND SERVICE - see instructions at the top of the file for editing. +/** + * Service Description: Service for ingesting and querying logs. + * + * + * + */ +@javax.annotation.Generated("by GAPIC") +public class LoggingServiceV2Api implements AutoCloseable { + + public static class ResourceNames { + private ResourceNames() {} + + // ======================= + // ResourceNames Constants + // ======================= + + /** + * A PathTemplate representing the fully-qualified path to represent + * a log resource. + * + * + * + */ + private static final PathTemplate LOG_PATH_TEMPLATE = + PathTemplate.create("projects/{project}/logs/{log}"); + + // ============================== + // Resource Name Helper Functions + // ============================== + + /** + * Formats a string containing the fully-qualified path to represent + * a log resource. + * + * + * + */ + public static final String formatLogPath(String project, String log) { + return LOG_PATH_TEMPLATE.instantiate("project", project, "log", log); + } + + /** + * Parses the project from the given fully-qualified path which + * represents a log resource. + * + * + * + */ + public static final String parseProjectFromLogPath(String logPath) { + return LOG_PATH_TEMPLATE.parse(logPath).get("project"); + } + + /** + * Parses the log from the given fully-qualified path which + * represents a log resource. + * + * + * + */ + public static final String parseLogFromLogPath(String logPath) { + return LOG_PATH_TEMPLATE.parse(logPath).get("log"); + } + } + + // ======== + // Members + // ======== + + private final ManagedChannel channel; + private final List closeables = new ArrayList<>(); + + private final ApiCallable deleteLogCallable; + private final ApiCallable + writeLogEntriesCallable; + private final ApiCallable listLogEntriesCallable; + private final ApiCallable> + listLogEntriesIterableCallable; + private final ApiCallable readLogEntriesCallable; + private final ApiCallable> + readLogEntriesIterableCallable; + private final ApiCallable< + ListMonitoredResourceDescriptorsRequest, ListMonitoredResourceDescriptorsResponse> + listMonitoredResourceDescriptorsCallable; + private final ApiCallable< + ListMonitoredResourceDescriptorsRequest, Iterable> + listMonitoredResourceDescriptorsIterableCallable; + + // =============== + // Factory Methods + // =============== + + /** + * Constructs an instance of LoggingServiceV2Api with default settings. + * + * + * + */ + public static LoggingServiceV2Api create() throws IOException { + return create(LoggingServiceV2Settings.create()); + } + + /** + * Constructs an instance of LoggingServiceV2Api, using the given settings. The channels are + * created based on the settings passed in, or defaults for any settings that are not set. + * + * + * + */ + public static LoggingServiceV2Api create(LoggingServiceV2Settings settings) throws IOException { + return new LoggingServiceV2Api(settings); + } + + /** + * Constructs an instance of LoggingServiceV2Api, using the given settings. This is protected so + * that it easy to make a subclass, but otherwise, the static factory methods should be preferred. + * + * + * + */ + protected LoggingServiceV2Api(LoggingServiceV2Settings settings) throws IOException { + this.channel = settings.getChannel(); + + this.deleteLogCallable = settings.deleteLogMethod().build(settings); + this.writeLogEntriesCallable = settings.writeLogEntriesMethod().build(settings); + this.listLogEntriesCallable = settings.listLogEntriesMethod().build(settings); + this.listLogEntriesIterableCallable = + settings.listLogEntriesMethod().buildPageStreaming(settings); + this.readLogEntriesCallable = settings.readLogEntriesMethod().build(settings); + this.readLogEntriesIterableCallable = + settings.readLogEntriesMethod().buildPageStreaming(settings); + this.listMonitoredResourceDescriptorsCallable = + settings.listMonitoredResourceDescriptorsMethod().build(settings); + this.listMonitoredResourceDescriptorsIterableCallable = + settings.listMonitoredResourceDescriptorsMethod().buildPageStreaming(settings); + + closeables.add( + new Closeable() { + @Override + public void close() throws IOException { + channel.shutdown(); + } + }); + } + + // ============= + // Service Calls + // ============= + + // ----- deleteLog ----- + + // AUTO-GENERATED DOCUMENTATION AND METHOD - see instructions at the top of the file for editing. + /** + * Deletes a log and all its log entries. + * The log will reappear if it receives new entries. + * + * + * + * + * @param logName Required. The resource name of the log to delete. Example: + * `"projects/my-project/logs/syslog"`. + */ + public void deleteLog(String logName) { + DeleteLogRequest request = DeleteLogRequest.newBuilder().setLogName(logName).build(); + + deleteLog(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD - see instructions at the top of the file for editing. + /** + * Deletes a log and all its log entries. + * The log will reappear if it receives new entries. + * + * + * + * + * @param request The request object containing all of the parameters for the API call. + */ + private void deleteLog(DeleteLogRequest request) { + deleteLogCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD - see instructions at the top of the file for editing. + /** + * Deletes a log and all its log entries. + * The log will reappear if it receives new entries. + * + * + * + */ + public ApiCallable deleteLogCallable() { + return deleteLogCallable; + } + + // ----- writeLogEntries ----- + + // AUTO-GENERATED DOCUMENTATION AND METHOD - see instructions at the top of the file for editing. + /** + * Writes log entries to Cloud Logging. + * All log entries in Cloud Logging are written by this method. + * + * + * + * + * @param logName Optional. A default log resource name for those log entries in `entries` + * that do not specify their own `logName`. Example: + * `"projects/my-project/logs/syslog"`. See + * [LogEntry][google.logging.v2.LogEntry]. + * @param resource Optional. A default monitored resource for those log entries in `entries` + * that do not specify their own `resource`. + * @param labels Optional. User-defined `key:value` items that are added to + * the `labels` field of each log entry in `entries`, except when a log + * entry specifies its own 'key:value' item with the same key. + * Example: `{ "size": "large", "color":"red" }` + * @param entries Required. The log entries to write. The log entries must have values for + * all required fields. + */ + public WriteLogEntriesResponse writeLogEntries( + String logName, + MonitoredResource resource, + Map labels, + List entries) { + WriteLogEntriesRequest request = + WriteLogEntriesRequest.newBuilder() + .setLogName(logName) + .setResource(resource) + .putAllLabels(labels) + .addAllEntries(entries) + .build(); + + return writeLogEntries(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD - see instructions at the top of the file for editing. + /** + * Writes log entries to Cloud Logging. + * All log entries in Cloud Logging are written by this method. + * + * + * + * + * @param request The request object containing all of the parameters for the API call. + */ + public WriteLogEntriesResponse writeLogEntries(WriteLogEntriesRequest request) { + return writeLogEntriesCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD - see instructions at the top of the file for editing. + /** + * Writes log entries to Cloud Logging. + * All log entries in Cloud Logging are written by this method. + * + * + * + */ + public ApiCallable writeLogEntriesCallable() { + return writeLogEntriesCallable; + } + + // ----- listLogEntries ----- + + // AUTO-GENERATED DOCUMENTATION AND METHOD - see instructions at the top of the file for editing. + /** + * Lists log entries. + * Use this method to examine log entries from Cloud Logging. + * See [Exporting Logs](/logging/docs/export) for other ways to copy + * log entries out of Cloud Logging. + * + * + * + */ + public Iterable listLogEntries(List projectIds, String filter, String orderBy) { + ListLogEntriesRequest request = + ListLogEntriesRequest.newBuilder() + .addAllProjectIds(projectIds) + .setFilter(filter) + .setOrderBy(orderBy) + .build(); + return listLogEntries(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD - see instructions at the top of the file for editing. + /** + * Lists log entries. + * Use this method to examine log entries from Cloud Logging. + * See [Exporting Logs](/logging/docs/export) for other ways to copy + * log entries out of Cloud Logging. + * + * + * + * + * @param request The request object containing all of the parameters for the API call. + */ + public Iterable listLogEntries(ListLogEntriesRequest request) { + return listLogEntriesIterableCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD - see instructions at the top of the file for editing. + /** + * Lists log entries. + * Use this method to examine log entries from Cloud Logging. + * See [Exporting Logs](/logging/docs/export) for other ways to copy + * log entries out of Cloud Logging. + * + * + * + */ + public ApiCallable> listLogEntriesIterableCallable() { + return listLogEntriesIterableCallable; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD - see instructions at the top of the file for editing. + /** + * Lists log entries. + * Use this method to examine log entries from Cloud Logging. + * See [Exporting Logs](/logging/docs/export) for other ways to copy + * log entries out of Cloud Logging. + * + * + * + */ + public ApiCallable listLogEntriesCallable() { + return listLogEntriesCallable; + } + + // ----- readLogEntries ----- + + // AUTO-GENERATED DOCUMENTATION AND METHOD - see instructions at the top of the file for editing. + /** + * Streaming read of log entries. Similar to `List`, this method is intended + * for a large volume of log entries. + * + * + * + */ + public Iterable readLogEntries(List projectIds, String filter, String orderBy) { + ReadLogEntriesRequest request = + ReadLogEntriesRequest.newBuilder() + .addAllProjectIds(projectIds) + .setFilter(filter) + .setOrderBy(orderBy) + .build(); + return readLogEntries(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD - see instructions at the top of the file for editing. + /** + * Streaming read of log entries. Similar to `List`, this method is intended + * for a large volume of log entries. + * + * + * + * + * @param request The request object containing all of the parameters for the API call. + */ + public Iterable readLogEntries(ReadLogEntriesRequest request) { + return readLogEntriesIterableCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD - see instructions at the top of the file for editing. + /** + * Streaming read of log entries. Similar to `List`, this method is intended + * for a large volume of log entries. + * + * + * + */ + public ApiCallable> readLogEntriesIterableCallable() { + return readLogEntriesIterableCallable; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD - see instructions at the top of the file for editing. + /** + * Streaming read of log entries. Similar to `List`, this method is intended + * for a large volume of log entries. + * + * + * + */ + public ApiCallable readLogEntriesCallable() { + return readLogEntriesCallable; + } + + // ----- listMonitoredResourceDescriptors ----- + + // AUTO-GENERATED DOCUMENTATION AND METHOD - see instructions at the top of the file for editing. + /** + * Lists monitored resource descriptors that are used by Cloud Logging. + * + * + * + * + * @param request The request object containing all of the parameters for the API call. + */ + public Iterable listMonitoredResourceDescriptors( + ListMonitoredResourceDescriptorsRequest request) { + return listMonitoredResourceDescriptorsIterableCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD - see instructions at the top of the file for editing. + /** + * Lists monitored resource descriptors that are used by Cloud Logging. + * + * + * + */ + public ApiCallable> + listMonitoredResourceDescriptorsIterableCallable() { + return listMonitoredResourceDescriptorsIterableCallable; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD - see instructions at the top of the file for editing. + /** + * Lists monitored resource descriptors that are used by Cloud Logging. + * + * + * + */ + public ApiCallable< + ListMonitoredResourceDescriptorsRequest, ListMonitoredResourceDescriptorsResponse> + listMonitoredResourceDescriptorsCallable() { + return listMonitoredResourceDescriptorsCallable; + } + + // ======== + // Cleanup + // ======== + + /** + * Initiates an orderly shutdown in which preexisting calls continue but new calls are immediately + * cancelled. + * + * + * + */ + @Override + public void close() throws Exception { + for (AutoCloseable closeable : closeables) { + closeable.close(); + } + } + + // ======== + // Manually-added methods: add custom (non-generated) methods after this point. + // ======== + +} diff --git a/gcloud-java-logging/baseline/src/main/java/com/google/gcloud/logging/spi/v2/LoggingServiceV2Settings.java b/gcloud-java-logging/baseline/src/main/java/com/google/gcloud/logging/spi/v2/LoggingServiceV2Settings.java new file mode 100644 index 000000000000..b5e633f8cc6d --- /dev/null +++ b/gcloud-java-logging/baseline/src/main/java/com/google/gcloud/logging/spi/v2/LoggingServiceV2Settings.java @@ -0,0 +1,371 @@ +/* + * Copyright 2016 Google Inc. All Rights Reserved. + * + * 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. + */ + +/* + * EDITING INSTRUCTIONS + * This file was generated from the file + * https://github.com/google/googleapis/blob/master/google/logging/v2/logging.proto + * and updates to that file get reflected here through a refresh process. + * For the short term, the refresh process will only be runnable by Google engineers. + * Manual additions are allowed because the refresh process performs + * a 3-way merge in order to preserve those manual additions. In order to not + * break the refresh process, only certain types of modifications are + * allowed. + * + * Allowed modifications - currently these are the only types allowed: + * 1. New methods (these should be added to the end of the class) + * 2. New imports + * 3. Additional documentation between "manual edit" demarcations + * + * Happy editing! + */ + +package com.google.gcloud.logging.spi.v2; + +import com.google.api.MonitoredResourceDescriptor; +import com.google.api.gax.core.BackoffParams; +import com.google.api.gax.core.ConnectionSettings; +import com.google.api.gax.core.RetryParams; +import com.google.api.gax.grpc.ApiCallSettings; +import com.google.api.gax.grpc.ApiCallable.ApiCallableBuilder; +import com.google.api.gax.grpc.ApiCallable.PageStreamingApiCallableBuilder; +import com.google.api.gax.grpc.PageDescriptor; +import com.google.api.gax.grpc.ServiceApiSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import com.google.logging.v2.DeleteLogRequest; +import com.google.logging.v2.ListLogEntriesRequest; +import com.google.logging.v2.ListLogEntriesResponse; +import com.google.logging.v2.ListMonitoredResourceDescriptorsRequest; +import com.google.logging.v2.ListMonitoredResourceDescriptorsResponse; +import com.google.logging.v2.LogEntry; +import com.google.logging.v2.LoggingServiceV2Grpc; +import com.google.logging.v2.ReadLogEntriesRequest; +import com.google.logging.v2.ReadLogEntriesResponse; +import com.google.logging.v2.WriteLogEntriesRequest; +import com.google.logging.v2.WriteLogEntriesResponse; +import com.google.protobuf.Empty; +import io.grpc.Status; + +// Manually-added imports: add custom (non-generated) imports after this point. + +// AUTO-GENERATED DOCUMENTATION AND CLASS - see instructions at the top of the file for editing. +@javax.annotation.Generated("by GAPIC") +public class LoggingServiceV2Settings extends ServiceApiSettings { + + // ========= + // Constants + // ========= + + /** + * The default address of the service. + * + * + * + */ + public static final String DEFAULT_SERVICE_ADDRESS = "logging.googleapis.com"; + + /** + * The default port of the service. + * + * + * + */ + public static final int DEFAULT_SERVICE_PORT = 443; + + /** + * The default scopes of the service. + */ + public static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder() + .add("https://www.googleapis.com/auth/logging.write") + .add("https://www.googleapis.com/auth/logging.admin") + .add("https://www.googleapis.com/auth/logging.read") + .add("https://www.googleapis.com/auth/cloud-platform.read-only") + .add("https://www.googleapis.com/auth/cloud-platform") + .build(); + + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + Sets.immutableEnumSet( + Lists.newArrayList( + Status.Code.DEADLINE_EXCEEDED, Status.Code.UNAVAILABLE))); + definitions.put("non_idempotent", Sets.immutableEnumSet(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetryParams params = null; + params = + RetryParams.newBuilder() + .setRetryBackoff( + BackoffParams.newBuilder() + .setInitialDelayMillis(100L) + .setDelayMultiplier(1.2) + .setMaxDelayMillis(1000L) + .build()) + .setTimeoutBackoff( + BackoffParams.newBuilder() + .setInitialDelayMillis(300L) + .setDelayMultiplier(1.3) + .setMaxDelayMillis(3000L) + .build()) + .setTotalTimeout(30000L) + .build(); + definitions.put("default", params); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + private static class MethodBuilders { + private final ApiCallableBuilder deleteLogMethod; + private final ApiCallableBuilder + writeLogEntriesMethod; + private final PageStreamingApiCallableBuilder< + ListLogEntriesRequest, ListLogEntriesResponse, LogEntry> + listLogEntriesMethod; + private final PageStreamingApiCallableBuilder< + ReadLogEntriesRequest, ReadLogEntriesResponse, LogEntry> + readLogEntriesMethod; + private final PageStreamingApiCallableBuilder< + ListMonitoredResourceDescriptorsRequest, ListMonitoredResourceDescriptorsResponse, + MonitoredResourceDescriptor> + listMonitoredResourceDescriptorsMethod; + private final ImmutableList allMethods; + + public MethodBuilders() { + deleteLogMethod = new ApiCallableBuilder<>(LoggingServiceV2Grpc.METHOD_DELETE_LOG); + deleteLogMethod.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")); + deleteLogMethod.setRetryParams(RETRY_PARAM_DEFINITIONS.get("default")); + + writeLogEntriesMethod = + new ApiCallableBuilder<>(LoggingServiceV2Grpc.METHOD_WRITE_LOG_ENTRIES); + writeLogEntriesMethod.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")); + writeLogEntriesMethod.setRetryParams(RETRY_PARAM_DEFINITIONS.get("default")); + + listLogEntriesMethod = + new PageStreamingApiCallableBuilder<>( + LoggingServiceV2Grpc.METHOD_LIST_LOG_ENTRIES, LIST_LOG_ENTRIES_PAGE_STR_DESC); + listLogEntriesMethod.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")); + listLogEntriesMethod.setRetryParams(RETRY_PARAM_DEFINITIONS.get("default")); + + readLogEntriesMethod = + new PageStreamingApiCallableBuilder<>( + LoggingServiceV2Grpc.METHOD_READ_LOG_ENTRIES, READ_LOG_ENTRIES_PAGE_STR_DESC); + readLogEntriesMethod.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")); + readLogEntriesMethod.setRetryParams(RETRY_PARAM_DEFINITIONS.get("default")); + + listMonitoredResourceDescriptorsMethod = + new PageStreamingApiCallableBuilder<>( + LoggingServiceV2Grpc.METHOD_LIST_MONITORED_RESOURCE_DESCRIPTORS, + LIST_MONITORED_RESOURCE_DESCRIPTORS_PAGE_STR_DESC); + listMonitoredResourceDescriptorsMethod.setRetryableCodes( + RETRYABLE_CODE_DEFINITIONS.get("idempotent")); + listMonitoredResourceDescriptorsMethod.setRetryParams(RETRY_PARAM_DEFINITIONS.get("default")); + + allMethods = + ImmutableList.builder() + .add( + deleteLogMethod, + writeLogEntriesMethod, + listLogEntriesMethod, + readLogEntriesMethod, + listMonitoredResourceDescriptorsMethod) + .build(); + } + } + + private final MethodBuilders methods; + + // =============== + // Factory Methods + // =============== + + /** + * Constructs an instance of LoggingServiceV2Settings with default settings. + * + * + * + */ + public static LoggingServiceV2Settings create() { + LoggingServiceV2Settings settings = new LoggingServiceV2Settings(new MethodBuilders()); + settings.provideChannelWith( + ConnectionSettings.builder() + .setServiceAddress(DEFAULT_SERVICE_ADDRESS) + .setPort(DEFAULT_SERVICE_PORT) + .provideCredentialsWith(DEFAULT_SERVICE_SCOPES) + .build()); + return settings; + } + + /** + * Constructs an instance of LoggingServiceV2Settings with default settings. This is protected so + * that it easy to make a subclass, but otherwise, the static factory methods should be preferred. + * + * + * + */ + protected LoggingServiceV2Settings(MethodBuilders methods) { + super(methods.allMethods); + this.methods = methods; + } + + /** + * Returns the ApiCallableBuilder for the API method deleteLog. + * + * + * + */ + public ApiCallableBuilder deleteLogMethod() { + return methods.deleteLogMethod; + } + + /** + * Returns the ApiCallableBuilder for the API method writeLogEntries. + * + * + * + */ + public ApiCallableBuilder + writeLogEntriesMethod() { + return methods.writeLogEntriesMethod; + } + + /** + * Returns the PageStreamingApiCallableBuilder for the API method listLogEntries. + * + * + * + */ + public PageStreamingApiCallableBuilder + listLogEntriesMethod() { + return methods.listLogEntriesMethod; + } + + /** + * Returns the PageStreamingApiCallableBuilder for the API method readLogEntries. + * + * + * + */ + public PageStreamingApiCallableBuilder + readLogEntriesMethod() { + return methods.readLogEntriesMethod; + } + + /** + * Returns the PageStreamingApiCallableBuilder for the API method + * listMonitoredResourceDescriptors. + * + * + * + */ + public PageStreamingApiCallableBuilder< + ListMonitoredResourceDescriptorsRequest, ListMonitoredResourceDescriptorsResponse, + MonitoredResourceDescriptor> + listMonitoredResourceDescriptorsMethod() { + return methods.listMonitoredResourceDescriptorsMethod; + } + + private static PageDescriptor + LIST_LOG_ENTRIES_PAGE_STR_DESC = + new PageDescriptor() { + @Override + public Object emptyToken() { + return ""; + } + + @Override + public ListLogEntriesRequest injectToken(ListLogEntriesRequest payload, Object token) { + return ListLogEntriesRequest.newBuilder(payload).setPageToken((String) token).build(); + } + + @Override + public Object extractNextToken(ListLogEntriesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLogEntriesResponse payload) { + return payload.getEntriesList(); + } + }; + + private static PageDescriptor + READ_LOG_ENTRIES_PAGE_STR_DESC = + new PageDescriptor() { + @Override + public Object emptyToken() { + return ""; + } + + @Override + public ReadLogEntriesRequest injectToken(ReadLogEntriesRequest payload, Object token) { + return ReadLogEntriesRequest.newBuilder(payload) + .setResumeToken((String) token) + .build(); + } + + @Override + public Object extractNextToken(ReadLogEntriesResponse payload) { + return payload.getResumeToken(); + } + + @Override + public Iterable extractResources(ReadLogEntriesResponse payload) { + return payload.getEntriesList(); + } + }; + + private static PageDescriptor< + ListMonitoredResourceDescriptorsRequest, ListMonitoredResourceDescriptorsResponse, + MonitoredResourceDescriptor> + LIST_MONITORED_RESOURCE_DESCRIPTORS_PAGE_STR_DESC = + new PageDescriptor< + ListMonitoredResourceDescriptorsRequest, ListMonitoredResourceDescriptorsResponse, + MonitoredResourceDescriptor>() { + @Override + public Object emptyToken() { + return ""; + } + + @Override + public ListMonitoredResourceDescriptorsRequest injectToken( + ListMonitoredResourceDescriptorsRequest payload, Object token) { + return ListMonitoredResourceDescriptorsRequest.newBuilder(payload) + .setPageToken((String) token) + .build(); + } + + @Override + public Object extractNextToken(ListMonitoredResourceDescriptorsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + ListMonitoredResourceDescriptorsResponse payload) { + return payload.getResourceDescriptorsList(); + } + }; +} diff --git a/gcloud-java-logging/baseline/src/main/java/com/google/gcloud/logging/spi/v2/MetricsServiceV2Api.java b/gcloud-java-logging/baseline/src/main/java/com/google/gcloud/logging/spi/v2/MetricsServiceV2Api.java new file mode 100644 index 000000000000..0352e5ff8786 --- /dev/null +++ b/gcloud-java-logging/baseline/src/main/java/com/google/gcloud/logging/spi/v2/MetricsServiceV2Api.java @@ -0,0 +1,477 @@ +/* + * Copyright 2016 Google Inc. All Rights Reserved. + * + * 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. + */ + +/* + * EDITING INSTRUCTIONS + * This file was generated from the file + * https://github.com/google/googleapis/blob/master/google/logging/v2/logging_metrics.proto + * and updates to that file get reflected here through a refresh process. + * For the short term, the refresh process will only be runnable by Google engineers. + * Manual additions are allowed because the refresh process performs + * a 3-way merge in order to preserve those manual additions. In order to not + * break the refresh process, only certain types of modifications are + * allowed. + * + * Allowed modifications - currently these are the only types allowed: + * 1. New methods (these should be added to the end of the class) + * 2. New imports + * 3. Additional documentation between "manual edit" demarcations + * + * Happy editing! + */ + +package com.google.gcloud.logging.spi.v2; + +import com.google.api.gax.grpc.ApiCallable; +import com.google.api.gax.protobuf.PathTemplate; +import com.google.logging.v2.CreateLogMetricRequest; +import com.google.logging.v2.DeleteLogMetricRequest; +import com.google.logging.v2.GetLogMetricRequest; +import com.google.logging.v2.ListLogMetricsRequest; +import com.google.logging.v2.ListLogMetricsResponse; +import com.google.logging.v2.LogMetric; +import com.google.logging.v2.UpdateLogMetricRequest; +import com.google.protobuf.Empty; +import io.grpc.ManagedChannel; +import java.io.Closeable; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +// Manually-added imports: add custom (non-generated) imports after this point. + +// AUTO-GENERATED DOCUMENTATION AND SERVICE - see instructions at the top of the file for editing. +/** + * Service Description: See src/api/google/logging/v1/logging.proto for documentation + * + * + * + */ +@javax.annotation.Generated("by GAPIC") +public class MetricsServiceV2Api implements AutoCloseable { + + public static class ResourceNames { + private ResourceNames() {} + + // ======================= + // ResourceNames Constants + // ======================= + + /** + * A PathTemplate representing the fully-qualified path to represent + * a project resource. + * + * + * + */ + private static final PathTemplate PROJECT_PATH_TEMPLATE = + PathTemplate.create("projects/{project}"); + + /** + * A PathTemplate representing the fully-qualified path to represent + * a metric resource. + * + * + * + */ + private static final PathTemplate METRIC_PATH_TEMPLATE = + PathTemplate.create("projects/{project}/metrics/{metric}"); + + // ============================== + // Resource Name Helper Functions + // ============================== + + /** + * Formats a string containing the fully-qualified path to represent + * a project resource. + * + * + * + */ + public static final String formatProjectPath(String project) { + return PROJECT_PATH_TEMPLATE.instantiate("project", project); + } + + /** + * Formats a string containing the fully-qualified path to represent + * a metric resource. + * + * + * + */ + public static final String formatMetricPath(String project, String metric) { + return METRIC_PATH_TEMPLATE.instantiate("project", project, "metric", metric); + } + + /** + * Parses the project from the given fully-qualified path which + * represents a project resource. + * + * + * + */ + public static final String parseProjectFromProjectPath(String projectPath) { + return PROJECT_PATH_TEMPLATE.parse(projectPath).get("project"); + } + + /** + * Parses the project from the given fully-qualified path which + * represents a metric resource. + * + * + * + */ + public static final String parseProjectFromMetricPath(String metricPath) { + return METRIC_PATH_TEMPLATE.parse(metricPath).get("project"); + } + + /** + * Parses the metric from the given fully-qualified path which + * represents a metric resource. + * + * + * + */ + public static final String parseMetricFromMetricPath(String metricPath) { + return METRIC_PATH_TEMPLATE.parse(metricPath).get("metric"); + } + } + + // ======== + // Members + // ======== + + private final ManagedChannel channel; + private final List closeables = new ArrayList<>(); + + private final ApiCallable listLogMetricsCallable; + private final ApiCallable> + listLogMetricsIterableCallable; + private final ApiCallable getLogMetricCallable; + private final ApiCallable createLogMetricCallable; + private final ApiCallable updateLogMetricCallable; + private final ApiCallable deleteLogMetricCallable; + + // =============== + // Factory Methods + // =============== + + /** + * Constructs an instance of MetricsServiceV2Api with default settings. + * + * + * + */ + public static MetricsServiceV2Api create() throws IOException { + return create(MetricsServiceV2Settings.create()); + } + + /** + * Constructs an instance of MetricsServiceV2Api, using the given settings. The channels are + * created based on the settings passed in, or defaults for any settings that are not set. + * + * + * + */ + public static MetricsServiceV2Api create(MetricsServiceV2Settings settings) throws IOException { + return new MetricsServiceV2Api(settings); + } + + /** + * Constructs an instance of MetricsServiceV2Api, using the given settings. This is protected so + * that it easy to make a subclass, but otherwise, the static factory methods should be preferred. + * + * + * + */ + protected MetricsServiceV2Api(MetricsServiceV2Settings settings) throws IOException { + this.channel = settings.getChannel(); + + this.listLogMetricsCallable = settings.listLogMetricsMethod().build(settings); + this.listLogMetricsIterableCallable = + settings.listLogMetricsMethod().buildPageStreaming(settings); + this.getLogMetricCallable = settings.getLogMetricMethod().build(settings); + this.createLogMetricCallable = settings.createLogMetricMethod().build(settings); + this.updateLogMetricCallable = settings.updateLogMetricMethod().build(settings); + this.deleteLogMetricCallable = settings.deleteLogMetricMethod().build(settings); + + closeables.add( + new Closeable() { + @Override + public void close() throws IOException { + channel.shutdown(); + } + }); + } + + // ============= + // Service Calls + // ============= + + // ----- listLogMetrics ----- + + // AUTO-GENERATED DOCUMENTATION AND METHOD - see instructions at the top of the file for editing. + /** + * Lists logs-based metrics. + * + * + * + */ + public Iterable listLogMetrics(String projectName) { + ListLogMetricsRequest request = + ListLogMetricsRequest.newBuilder().setProjectName(projectName).build(); + return listLogMetrics(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD - see instructions at the top of the file for editing. + /** + * Lists logs-based metrics. + * + * + * + * + * @param request The request object containing all of the parameters for the API call. + */ + public Iterable listLogMetrics(ListLogMetricsRequest request) { + return listLogMetricsIterableCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD - see instructions at the top of the file for editing. + /** + * Lists logs-based metrics. + * + * + * + */ + public ApiCallable> listLogMetricsIterableCallable() { + return listLogMetricsIterableCallable; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD - see instructions at the top of the file for editing. + /** + * Lists logs-based metrics. + * + * + * + */ + public ApiCallable listLogMetricsCallable() { + return listLogMetricsCallable; + } + + // ----- getLogMetric ----- + + // AUTO-GENERATED DOCUMENTATION AND METHOD - see instructions at the top of the file for editing. + /** + * Gets a logs-based metric. + * + * + * + * + * @param metricName The resource name of the desired metric. + * Example: `"projects/my-project-id/metrics/my-metric-id"`. + */ + public LogMetric getLogMetric(String metricName) { + GetLogMetricRequest request = + GetLogMetricRequest.newBuilder().setMetricName(metricName).build(); + + return getLogMetric(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD - see instructions at the top of the file for editing. + /** + * Gets a logs-based metric. + * + * + * + * + * @param request The request object containing all of the parameters for the API call. + */ + private LogMetric getLogMetric(GetLogMetricRequest request) { + return getLogMetricCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD - see instructions at the top of the file for editing. + /** + * Gets a logs-based metric. + * + * + * + */ + public ApiCallable getLogMetricCallable() { + return getLogMetricCallable; + } + + // ----- createLogMetric ----- + + // AUTO-GENERATED DOCUMENTATION AND METHOD - see instructions at the top of the file for editing. + /** + * Creates a logs-based metric. + * + * + * + * + * @param projectName 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 metric The new logs-based metric, which must not have an identifier that + * already exists. + */ + public LogMetric createLogMetric(String projectName, LogMetric metric) { + CreateLogMetricRequest request = + CreateLogMetricRequest.newBuilder().setProjectName(projectName).setMetric(metric).build(); + + return createLogMetric(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD - see instructions at the top of the file for editing. + /** + * Creates a logs-based metric. + * + * + * + * + * @param request The request object containing all of the parameters for the API call. + */ + public LogMetric createLogMetric(CreateLogMetricRequest request) { + return createLogMetricCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD - see instructions at the top of the file for editing. + /** + * Creates a logs-based metric. + * + * + * + */ + public ApiCallable createLogMetricCallable() { + return createLogMetricCallable; + } + + // ----- updateLogMetric ----- + + // AUTO-GENERATED DOCUMENTATION AND METHOD - see instructions at the top of the file for editing. + /** + * Creates or updates a logs-based metric. + * + * + * + * + * @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 metric The updated metric, whose name must be the same as the + * metric identifier in `metricName`. If `metricName` does not + * exist, then a new metric is created. + */ + public LogMetric updateLogMetric(String metricName, LogMetric metric) { + UpdateLogMetricRequest request = + UpdateLogMetricRequest.newBuilder().setMetricName(metricName).setMetric(metric).build(); + + return updateLogMetric(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD - see instructions at the top of the file for editing. + /** + * Creates or updates a logs-based metric. + * + * + * + * + * @param request The request object containing all of the parameters for the API call. + */ + public LogMetric updateLogMetric(UpdateLogMetricRequest request) { + return updateLogMetricCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD - see instructions at the top of the file for editing. + /** + * Creates or updates a logs-based metric. + * + * + * + */ + public ApiCallable updateLogMetricCallable() { + return updateLogMetricCallable; + } + + // ----- deleteLogMetric ----- + + // AUTO-GENERATED DOCUMENTATION AND METHOD - see instructions at the top of the file for editing. + /** + * Deletes a logs-based metric. + * + * + * + * + * @param metricName The resource name of the metric to delete. + * Example: `"projects/my-project-id/metrics/my-metric-id"`. + */ + public void deleteLogMetric(String metricName) { + DeleteLogMetricRequest request = + DeleteLogMetricRequest.newBuilder().setMetricName(metricName).build(); + + deleteLogMetric(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD - see instructions at the top of the file for editing. + /** + * Deletes a logs-based metric. + * + * + * + * + * @param request The request object containing all of the parameters for the API call. + */ + private void deleteLogMetric(DeleteLogMetricRequest request) { + deleteLogMetricCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD - see instructions at the top of the file for editing. + /** + * Deletes a logs-based metric. + * + * + * + */ + public ApiCallable deleteLogMetricCallable() { + return deleteLogMetricCallable; + } + + // ======== + // Cleanup + // ======== + + /** + * Initiates an orderly shutdown in which preexisting calls continue but new calls are immediately + * cancelled. + * + * + * + */ + @Override + public void close() throws Exception { + for (AutoCloseable closeable : closeables) { + closeable.close(); + } + } + + // ======== + // Manually-added methods: add custom (non-generated) methods after this point. + // ======== + +} diff --git a/gcloud-java-logging/baseline/src/main/java/com/google/gcloud/logging/spi/v2/MetricsServiceV2Settings.java b/gcloud-java-logging/baseline/src/main/java/com/google/gcloud/logging/spi/v2/MetricsServiceV2Settings.java new file mode 100644 index 000000000000..6035b2a5a53c --- /dev/null +++ b/gcloud-java-logging/baseline/src/main/java/com/google/gcloud/logging/spi/v2/MetricsServiceV2Settings.java @@ -0,0 +1,293 @@ +/* + * Copyright 2016 Google Inc. All Rights Reserved. + * + * 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. + */ + +/* + * EDITING INSTRUCTIONS + * This file was generated from the file + * https://github.com/google/googleapis/blob/master/google/logging/v2/logging_metrics.proto + * and updates to that file get reflected here through a refresh process. + * For the short term, the refresh process will only be runnable by Google engineers. + * Manual additions are allowed because the refresh process performs + * a 3-way merge in order to preserve those manual additions. In order to not + * break the refresh process, only certain types of modifications are + * allowed. + * + * Allowed modifications - currently these are the only types allowed: + * 1. New methods (these should be added to the end of the class) + * 2. New imports + * 3. Additional documentation between "manual edit" demarcations + * + * Happy editing! + */ + +package com.google.gcloud.logging.spi.v2; + +import com.google.api.gax.core.BackoffParams; +import com.google.api.gax.core.ConnectionSettings; +import com.google.api.gax.core.RetryParams; +import com.google.api.gax.grpc.ApiCallSettings; +import com.google.api.gax.grpc.ApiCallable.ApiCallableBuilder; +import com.google.api.gax.grpc.ApiCallable.PageStreamingApiCallableBuilder; +import com.google.api.gax.grpc.PageDescriptor; +import com.google.api.gax.grpc.ServiceApiSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import com.google.logging.v2.CreateLogMetricRequest; +import com.google.logging.v2.DeleteLogMetricRequest; +import com.google.logging.v2.GetLogMetricRequest; +import com.google.logging.v2.ListLogMetricsRequest; +import com.google.logging.v2.ListLogMetricsResponse; +import com.google.logging.v2.LogMetric; +import com.google.logging.v2.MetricsServiceV2Grpc; +import com.google.logging.v2.UpdateLogMetricRequest; +import com.google.protobuf.Empty; +import io.grpc.Status; + +// Manually-added imports: add custom (non-generated) imports after this point. + +// AUTO-GENERATED DOCUMENTATION AND CLASS - see instructions at the top of the file for editing. +@javax.annotation.Generated("by GAPIC") +public class MetricsServiceV2Settings extends ServiceApiSettings { + + // ========= + // Constants + // ========= + + /** + * The default address of the service. + * + * + * + */ + public static final String DEFAULT_SERVICE_ADDRESS = "logging.googleapis.com"; + + /** + * The default port of the service. + * + * + * + */ + public static final int DEFAULT_SERVICE_PORT = 443; + + /** + * The default scopes of the service. + */ + public static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder() + .add("https://www.googleapis.com/auth/logging.write") + .add("https://www.googleapis.com/auth/logging.admin") + .add("https://www.googleapis.com/auth/logging.read") + .add("https://www.googleapis.com/auth/cloud-platform.read-only") + .add("https://www.googleapis.com/auth/cloud-platform") + .build(); + + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + Sets.immutableEnumSet( + Lists.newArrayList( + Status.Code.DEADLINE_EXCEEDED, Status.Code.UNAVAILABLE))); + definitions.put("non_idempotent", Sets.immutableEnumSet(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetryParams params = null; + params = + RetryParams.newBuilder() + .setRetryBackoff( + BackoffParams.newBuilder() + .setInitialDelayMillis(100L) + .setDelayMultiplier(1.2) + .setMaxDelayMillis(1000L) + .build()) + .setTimeoutBackoff( + BackoffParams.newBuilder() + .setInitialDelayMillis(300L) + .setDelayMultiplier(1.3) + .setMaxDelayMillis(3000L) + .build()) + .setTotalTimeout(30000L) + .build(); + definitions.put("default", params); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + private static class MethodBuilders { + private final PageStreamingApiCallableBuilder< + ListLogMetricsRequest, ListLogMetricsResponse, LogMetric> + listLogMetricsMethod; + private final ApiCallableBuilder getLogMetricMethod; + private final ApiCallableBuilder createLogMetricMethod; + private final ApiCallableBuilder updateLogMetricMethod; + private final ApiCallableBuilder deleteLogMetricMethod; + private final ImmutableList allMethods; + + public MethodBuilders() { + listLogMetricsMethod = + new PageStreamingApiCallableBuilder<>( + MetricsServiceV2Grpc.METHOD_LIST_LOG_METRICS, LIST_LOG_METRICS_PAGE_STR_DESC); + listLogMetricsMethod.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")); + listLogMetricsMethod.setRetryParams(RETRY_PARAM_DEFINITIONS.get("default")); + + getLogMetricMethod = new ApiCallableBuilder<>(MetricsServiceV2Grpc.METHOD_GET_LOG_METRIC); + getLogMetricMethod.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")); + getLogMetricMethod.setRetryParams(RETRY_PARAM_DEFINITIONS.get("default")); + + createLogMetricMethod = + new ApiCallableBuilder<>(MetricsServiceV2Grpc.METHOD_CREATE_LOG_METRIC); + createLogMetricMethod.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")); + createLogMetricMethod.setRetryParams(RETRY_PARAM_DEFINITIONS.get("default")); + + updateLogMetricMethod = + new ApiCallableBuilder<>(MetricsServiceV2Grpc.METHOD_UPDATE_LOG_METRIC); + updateLogMetricMethod.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")); + updateLogMetricMethod.setRetryParams(RETRY_PARAM_DEFINITIONS.get("default")); + + deleteLogMetricMethod = + new ApiCallableBuilder<>(MetricsServiceV2Grpc.METHOD_DELETE_LOG_METRIC); + deleteLogMetricMethod.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")); + deleteLogMetricMethod.setRetryParams(RETRY_PARAM_DEFINITIONS.get("default")); + + allMethods = + ImmutableList.builder() + .add( + listLogMetricsMethod, + getLogMetricMethod, + createLogMetricMethod, + updateLogMetricMethod, + deleteLogMetricMethod) + .build(); + } + } + + private final MethodBuilders methods; + + // =============== + // Factory Methods + // =============== + + /** + * Constructs an instance of MetricsServiceV2Settings with default settings. + * + * + * + */ + public static MetricsServiceV2Settings create() { + MetricsServiceV2Settings settings = new MetricsServiceV2Settings(new MethodBuilders()); + settings.provideChannelWith( + ConnectionSettings.builder() + .setServiceAddress(DEFAULT_SERVICE_ADDRESS) + .setPort(DEFAULT_SERVICE_PORT) + .provideCredentialsWith(DEFAULT_SERVICE_SCOPES) + .build()); + return settings; + } + + /** + * Constructs an instance of MetricsServiceV2Settings with default settings. This is protected so + * that it easy to make a subclass, but otherwise, the static factory methods should be preferred. + * + * + * + */ + protected MetricsServiceV2Settings(MethodBuilders methods) { + super(methods.allMethods); + this.methods = methods; + } + + /** + * Returns the PageStreamingApiCallableBuilder for the API method listLogMetrics. + * + * + * + */ + public PageStreamingApiCallableBuilder + listLogMetricsMethod() { + return methods.listLogMetricsMethod; + } + + /** + * Returns the ApiCallableBuilder for the API method getLogMetric. + * + * + * + */ + public ApiCallableBuilder getLogMetricMethod() { + return methods.getLogMetricMethod; + } + + /** + * Returns the ApiCallableBuilder for the API method createLogMetric. + * + * + * + */ + public ApiCallableBuilder createLogMetricMethod() { + return methods.createLogMetricMethod; + } + + /** + * Returns the ApiCallableBuilder for the API method updateLogMetric. + * + * + * + */ + public ApiCallableBuilder updateLogMetricMethod() { + return methods.updateLogMetricMethod; + } + + /** + * Returns the ApiCallableBuilder for the API method deleteLogMetric. + * + * + * + */ + public ApiCallableBuilder deleteLogMetricMethod() { + return methods.deleteLogMetricMethod; + } + + private static PageDescriptor + LIST_LOG_METRICS_PAGE_STR_DESC = + new PageDescriptor() { + @Override + public Object emptyToken() { + return ""; + } + + @Override + public ListLogMetricsRequest injectToken(ListLogMetricsRequest payload, Object token) { + return ListLogMetricsRequest.newBuilder(payload).setPageToken((String) token).build(); + } + + @Override + public Object extractNextToken(ListLogMetricsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLogMetricsResponse payload) { + return payload.getMetricsList(); + } + }; +} diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/type/HttpRequest.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/type/HttpRequest.java deleted file mode 100644 index fa61d3d297d4..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/type/HttpRequest.java +++ /dev/null @@ -1,1478 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/logging/type/http_request.proto - -package com.google.logging.type; - -/** - * Protobuf type {@code google.logging.type.HttpRequest} - * - *
- * A common proto for logging HTTP requests.
- * 
- */ -public final class HttpRequest extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:google.logging.type.HttpRequest) - HttpRequestOrBuilder { - // Use HttpRequest.newBuilder() to construct. - private HttpRequest(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - private HttpRequest() { - requestMethod_ = ""; - requestUrl_ = ""; - requestSize_ = 0L; - status_ = 0; - responseSize_ = 0L; - userAgent_ = ""; - remoteIp_ = ""; - referer_ = ""; - cacheHit_ = false; - validatedWithOriginServer_ = false; - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); - } - private HttpRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) { - this(); - int mutable_bitField0_ = 0; - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!input.skipField(tag)) { - done = true; - } - break; - } - case 10: { - String s = input.readStringRequireUtf8(); - - requestMethod_ = s; - break; - } - case 18: { - String s = input.readStringRequireUtf8(); - - requestUrl_ = s; - break; - } - case 24: { - - requestSize_ = input.readInt64(); - break; - } - case 32: { - - status_ = input.readInt32(); - break; - } - case 40: { - - responseSize_ = input.readInt64(); - break; - } - case 50: { - String s = input.readStringRequireUtf8(); - - userAgent_ = s; - break; - } - case 58: { - String s = input.readStringRequireUtf8(); - - remoteIp_ = s; - break; - } - case 66: { - String s = input.readStringRequireUtf8(); - - referer_ = s; - break; - } - case 72: { - - cacheHit_ = input.readBool(); - break; - } - case 80: { - - validatedWithOriginServer_ = input.readBool(); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw new RuntimeException(e.setUnfinishedMessage(this)); - } catch (java.io.IOException e) { - throw new RuntimeException( - new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this)); - } finally { - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.logging.type.HttpRequestProto.internal_static_google_logging_type_HttpRequest_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.logging.type.HttpRequestProto.internal_static_google_logging_type_HttpRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.logging.type.HttpRequest.class, com.google.logging.type.HttpRequest.Builder.class); - } - - public static final int REQUEST_METHOD_FIELD_NUMBER = 1; - private volatile java.lang.Object requestMethod_; - /** - * optional string request_method = 1; - * - *
-   * Request method, such as `GET`, `HEAD`, `PUT` or `POST`.
-   * 
- */ - public java.lang.String getRequestMethod() { - java.lang.Object ref = requestMethod_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - requestMethod_ = s; - return s; - } - } - /** - * optional string request_method = 1; - * - *
-   * Request method, such as `GET`, `HEAD`, `PUT` or `POST`.
-   * 
- */ - public com.google.protobuf.ByteString - getRequestMethodBytes() { - java.lang.Object ref = requestMethod_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - requestMethod_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int REQUEST_URL_FIELD_NUMBER = 2; - private volatile java.lang.Object requestUrl_; - /** - * optional string request_url = 2; - * - *
-   * Contains the scheme (http|https), the host name, the path and the query
-   * portion of the URL that was requested.
-   * 
- */ - public java.lang.String getRequestUrl() { - java.lang.Object ref = requestUrl_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - requestUrl_ = s; - return s; - } - } - /** - * optional string request_url = 2; - * - *
-   * Contains the scheme (http|https), the host name, the path and the query
-   * portion of the URL that was requested.
-   * 
- */ - public com.google.protobuf.ByteString - getRequestUrlBytes() { - java.lang.Object ref = requestUrl_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - requestUrl_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int REQUEST_SIZE_FIELD_NUMBER = 3; - private long requestSize_; - /** - * optional int64 request_size = 3; - * - *
-   * Size of the HTTP request message in bytes, including request headers and
-   * the request body.
-   * 
- */ - public long getRequestSize() { - return requestSize_; - } - - public static final int STATUS_FIELD_NUMBER = 4; - private int status_; - /** - * optional int32 status = 4; - * - *
-   * A response code indicates the status of response, e.g., 200.
-   * 
- */ - public int getStatus() { - return status_; - } - - public static final int RESPONSE_SIZE_FIELD_NUMBER = 5; - private long responseSize_; - /** - * optional int64 response_size = 5; - * - *
-   * Size of the HTTP response message in bytes sent back to the client,
-   * including response headers and response body.
-   * 
- */ - public long getResponseSize() { - return responseSize_; - } - - public static final int USER_AGENT_FIELD_NUMBER = 6; - private volatile java.lang.Object userAgent_; - /** - * optional string user_agent = 6; - * - *
-   * User agent sent by the client, e.g., "Mozilla/4.0 (compatible; MSIE 6.0;
-   * Windows 98; Q312461; .NET CLR 1.0.3705)".
-   * 
- */ - public java.lang.String getUserAgent() { - java.lang.Object ref = userAgent_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - userAgent_ = s; - return s; - } - } - /** - * optional string user_agent = 6; - * - *
-   * User agent sent by the client, e.g., "Mozilla/4.0 (compatible; MSIE 6.0;
-   * Windows 98; Q312461; .NET CLR 1.0.3705)".
-   * 
- */ - public com.google.protobuf.ByteString - getUserAgentBytes() { - java.lang.Object ref = userAgent_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - userAgent_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int REMOTE_IP_FIELD_NUMBER = 7; - private volatile java.lang.Object remoteIp_; - /** - * optional string remote_ip = 7; - * - *
-   * IP address of the client who issues the HTTP request. Could be either IPv4
-   * or IPv6.
-   * 
- */ - public java.lang.String getRemoteIp() { - java.lang.Object ref = remoteIp_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - remoteIp_ = s; - return s; - } - } - /** - * optional string remote_ip = 7; - * - *
-   * IP address of the client who issues the HTTP request. Could be either IPv4
-   * or IPv6.
-   * 
- */ - public com.google.protobuf.ByteString - getRemoteIpBytes() { - java.lang.Object ref = remoteIp_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - remoteIp_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int REFERER_FIELD_NUMBER = 8; - private volatile java.lang.Object referer_; - /** - * optional string referer = 8; - * - *
-   * Referer (a.k.a. referrer) URL of request, as defined in
-   * http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html.
-   * 
- */ - public java.lang.String getReferer() { - java.lang.Object ref = referer_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - referer_ = s; - return s; - } - } - /** - * optional string referer = 8; - * - *
-   * Referer (a.k.a. referrer) URL of request, as defined in
-   * http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html.
-   * 
- */ - public com.google.protobuf.ByteString - getRefererBytes() { - java.lang.Object ref = referer_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - referer_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CACHE_HIT_FIELD_NUMBER = 9; - private boolean cacheHit_; - /** - * optional bool cache_hit = 9; - * - *
-   * Whether or not an entity was served from cache
-   * (with or without validation).
-   * 
- */ - public boolean getCacheHit() { - return cacheHit_; - } - - public static final int VALIDATED_WITH_ORIGIN_SERVER_FIELD_NUMBER = 10; - private boolean validatedWithOriginServer_; - /** - * optional bool validated_with_origin_server = 10; - * - *
-   * Whether or not the response was validated with the origin server before
-   * being served from cache. This field is only meaningful if cache_hit is
-   * True.
-   * 
- */ - public boolean getValidatedWithOriginServer() { - return validatedWithOriginServer_; - } - - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getRequestMethodBytes().isEmpty()) { - com.google.protobuf.GeneratedMessage.writeString(output, 1, requestMethod_); - } - if (!getRequestUrlBytes().isEmpty()) { - com.google.protobuf.GeneratedMessage.writeString(output, 2, requestUrl_); - } - if (requestSize_ != 0L) { - output.writeInt64(3, requestSize_); - } - if (status_ != 0) { - output.writeInt32(4, status_); - } - if (responseSize_ != 0L) { - output.writeInt64(5, responseSize_); - } - if (!getUserAgentBytes().isEmpty()) { - com.google.protobuf.GeneratedMessage.writeString(output, 6, userAgent_); - } - if (!getRemoteIpBytes().isEmpty()) { - com.google.protobuf.GeneratedMessage.writeString(output, 7, remoteIp_); - } - if (!getRefererBytes().isEmpty()) { - com.google.protobuf.GeneratedMessage.writeString(output, 8, referer_); - } - if (cacheHit_ != false) { - output.writeBool(9, cacheHit_); - } - if (validatedWithOriginServer_ != false) { - output.writeBool(10, validatedWithOriginServer_); - } - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getRequestMethodBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessage.computeStringSize(1, requestMethod_); - } - if (!getRequestUrlBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessage.computeStringSize(2, requestUrl_); - } - if (requestSize_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(3, requestSize_); - } - if (status_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(4, status_); - } - if (responseSize_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(5, responseSize_); - } - if (!getUserAgentBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessage.computeStringSize(6, userAgent_); - } - if (!getRemoteIpBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessage.computeStringSize(7, remoteIp_); - } - if (!getRefererBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessage.computeStringSize(8, referer_); - } - if (cacheHit_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(9, cacheHit_); - } - if (validatedWithOriginServer_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(10, validatedWithOriginServer_); - } - memoizedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - public static com.google.logging.type.HttpRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.logging.type.HttpRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.logging.type.HttpRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.logging.type.HttpRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.logging.type.HttpRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.google.logging.type.HttpRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static com.google.logging.type.HttpRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static com.google.logging.type.HttpRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static com.google.logging.type.HttpRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.google.logging.type.HttpRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.logging.type.HttpRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code google.logging.type.HttpRequest} - * - *
-   * A common proto for logging HTTP requests.
-   * 
- */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:google.logging.type.HttpRequest) - com.google.logging.type.HttpRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.logging.type.HttpRequestProto.internal_static_google_logging_type_HttpRequest_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.logging.type.HttpRequestProto.internal_static_google_logging_type_HttpRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.logging.type.HttpRequest.class, com.google.logging.type.HttpRequest.Builder.class); - } - - // Construct using com.google.logging.type.HttpRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - public Builder clear() { - super.clear(); - requestMethod_ = ""; - - requestUrl_ = ""; - - requestSize_ = 0L; - - status_ = 0; - - responseSize_ = 0L; - - userAgent_ = ""; - - remoteIp_ = ""; - - referer_ = ""; - - cacheHit_ = false; - - validatedWithOriginServer_ = false; - - return this; - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.logging.type.HttpRequestProto.internal_static_google_logging_type_HttpRequest_descriptor; - } - - public com.google.logging.type.HttpRequest getDefaultInstanceForType() { - return com.google.logging.type.HttpRequest.getDefaultInstance(); - } - - public com.google.logging.type.HttpRequest build() { - com.google.logging.type.HttpRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.google.logging.type.HttpRequest buildPartial() { - com.google.logging.type.HttpRequest result = new com.google.logging.type.HttpRequest(this); - result.requestMethod_ = requestMethod_; - result.requestUrl_ = requestUrl_; - result.requestSize_ = requestSize_; - result.status_ = status_; - result.responseSize_ = responseSize_; - result.userAgent_ = userAgent_; - result.remoteIp_ = remoteIp_; - result.referer_ = referer_; - result.cacheHit_ = cacheHit_; - result.validatedWithOriginServer_ = validatedWithOriginServer_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.logging.type.HttpRequest) { - return mergeFrom((com.google.logging.type.HttpRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.logging.type.HttpRequest other) { - if (other == com.google.logging.type.HttpRequest.getDefaultInstance()) return this; - if (!other.getRequestMethod().isEmpty()) { - requestMethod_ = other.requestMethod_; - onChanged(); - } - if (!other.getRequestUrl().isEmpty()) { - requestUrl_ = other.requestUrl_; - onChanged(); - } - if (other.getRequestSize() != 0L) { - setRequestSize(other.getRequestSize()); - } - if (other.getStatus() != 0) { - setStatus(other.getStatus()); - } - if (other.getResponseSize() != 0L) { - setResponseSize(other.getResponseSize()); - } - if (!other.getUserAgent().isEmpty()) { - userAgent_ = other.userAgent_; - onChanged(); - } - if (!other.getRemoteIp().isEmpty()) { - remoteIp_ = other.remoteIp_; - onChanged(); - } - if (!other.getReferer().isEmpty()) { - referer_ = other.referer_; - onChanged(); - } - if (other.getCacheHit() != false) { - setCacheHit(other.getCacheHit()); - } - if (other.getValidatedWithOriginServer() != false) { - setValidatedWithOriginServer(other.getValidatedWithOriginServer()); - } - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.logging.type.HttpRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.logging.type.HttpRequest) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object requestMethod_ = ""; - /** - * optional string request_method = 1; - * - *
-     * Request method, such as `GET`, `HEAD`, `PUT` or `POST`.
-     * 
- */ - public java.lang.String getRequestMethod() { - java.lang.Object ref = requestMethod_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - requestMethod_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string request_method = 1; - * - *
-     * Request method, such as `GET`, `HEAD`, `PUT` or `POST`.
-     * 
- */ - public com.google.protobuf.ByteString - getRequestMethodBytes() { - java.lang.Object ref = requestMethod_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - requestMethod_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string request_method = 1; - * - *
-     * Request method, such as `GET`, `HEAD`, `PUT` or `POST`.
-     * 
- */ - public Builder setRequestMethod( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - requestMethod_ = value; - onChanged(); - return this; - } - /** - * optional string request_method = 1; - * - *
-     * Request method, such as `GET`, `HEAD`, `PUT` or `POST`.
-     * 
- */ - public Builder clearRequestMethod() { - - requestMethod_ = getDefaultInstance().getRequestMethod(); - onChanged(); - return this; - } - /** - * optional string request_method = 1; - * - *
-     * Request method, such as `GET`, `HEAD`, `PUT` or `POST`.
-     * 
- */ - public Builder setRequestMethodBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - requestMethod_ = value; - onChanged(); - return this; - } - - private java.lang.Object requestUrl_ = ""; - /** - * optional string request_url = 2; - * - *
-     * Contains the scheme (http|https), the host name, the path and the query
-     * portion of the URL that was requested.
-     * 
- */ - public java.lang.String getRequestUrl() { - java.lang.Object ref = requestUrl_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - requestUrl_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string request_url = 2; - * - *
-     * Contains the scheme (http|https), the host name, the path and the query
-     * portion of the URL that was requested.
-     * 
- */ - public com.google.protobuf.ByteString - getRequestUrlBytes() { - java.lang.Object ref = requestUrl_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - requestUrl_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string request_url = 2; - * - *
-     * Contains the scheme (http|https), the host name, the path and the query
-     * portion of the URL that was requested.
-     * 
- */ - public Builder setRequestUrl( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - requestUrl_ = value; - onChanged(); - return this; - } - /** - * optional string request_url = 2; - * - *
-     * Contains the scheme (http|https), the host name, the path and the query
-     * portion of the URL that was requested.
-     * 
- */ - public Builder clearRequestUrl() { - - requestUrl_ = getDefaultInstance().getRequestUrl(); - onChanged(); - return this; - } - /** - * optional string request_url = 2; - * - *
-     * Contains the scheme (http|https), the host name, the path and the query
-     * portion of the URL that was requested.
-     * 
- */ - public Builder setRequestUrlBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - requestUrl_ = value; - onChanged(); - return this; - } - - private long requestSize_ ; - /** - * optional int64 request_size = 3; - * - *
-     * Size of the HTTP request message in bytes, including request headers and
-     * the request body.
-     * 
- */ - public long getRequestSize() { - return requestSize_; - } - /** - * optional int64 request_size = 3; - * - *
-     * Size of the HTTP request message in bytes, including request headers and
-     * the request body.
-     * 
- */ - public Builder setRequestSize(long value) { - - requestSize_ = value; - onChanged(); - return this; - } - /** - * optional int64 request_size = 3; - * - *
-     * Size of the HTTP request message in bytes, including request headers and
-     * the request body.
-     * 
- */ - public Builder clearRequestSize() { - - requestSize_ = 0L; - onChanged(); - return this; - } - - private int status_ ; - /** - * optional int32 status = 4; - * - *
-     * A response code indicates the status of response, e.g., 200.
-     * 
- */ - public int getStatus() { - return status_; - } - /** - * optional int32 status = 4; - * - *
-     * A response code indicates the status of response, e.g., 200.
-     * 
- */ - public Builder setStatus(int value) { - - status_ = value; - onChanged(); - return this; - } - /** - * optional int32 status = 4; - * - *
-     * A response code indicates the status of response, e.g., 200.
-     * 
- */ - public Builder clearStatus() { - - status_ = 0; - onChanged(); - return this; - } - - private long responseSize_ ; - /** - * optional int64 response_size = 5; - * - *
-     * Size of the HTTP response message in bytes sent back to the client,
-     * including response headers and response body.
-     * 
- */ - public long getResponseSize() { - return responseSize_; - } - /** - * optional int64 response_size = 5; - * - *
-     * Size of the HTTP response message in bytes sent back to the client,
-     * including response headers and response body.
-     * 
- */ - public Builder setResponseSize(long value) { - - responseSize_ = value; - onChanged(); - return this; - } - /** - * optional int64 response_size = 5; - * - *
-     * Size of the HTTP response message in bytes sent back to the client,
-     * including response headers and response body.
-     * 
- */ - public Builder clearResponseSize() { - - responseSize_ = 0L; - onChanged(); - return this; - } - - private java.lang.Object userAgent_ = ""; - /** - * optional string user_agent = 6; - * - *
-     * User agent sent by the client, e.g., "Mozilla/4.0 (compatible; MSIE 6.0;
-     * Windows 98; Q312461; .NET CLR 1.0.3705)".
-     * 
- */ - public java.lang.String getUserAgent() { - java.lang.Object ref = userAgent_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - userAgent_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string user_agent = 6; - * - *
-     * User agent sent by the client, e.g., "Mozilla/4.0 (compatible; MSIE 6.0;
-     * Windows 98; Q312461; .NET CLR 1.0.3705)".
-     * 
- */ - public com.google.protobuf.ByteString - getUserAgentBytes() { - java.lang.Object ref = userAgent_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - userAgent_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string user_agent = 6; - * - *
-     * User agent sent by the client, e.g., "Mozilla/4.0 (compatible; MSIE 6.0;
-     * Windows 98; Q312461; .NET CLR 1.0.3705)".
-     * 
- */ - public Builder setUserAgent( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - userAgent_ = value; - onChanged(); - return this; - } - /** - * optional string user_agent = 6; - * - *
-     * User agent sent by the client, e.g., "Mozilla/4.0 (compatible; MSIE 6.0;
-     * Windows 98; Q312461; .NET CLR 1.0.3705)".
-     * 
- */ - public Builder clearUserAgent() { - - userAgent_ = getDefaultInstance().getUserAgent(); - onChanged(); - return this; - } - /** - * optional string user_agent = 6; - * - *
-     * User agent sent by the client, e.g., "Mozilla/4.0 (compatible; MSIE 6.0;
-     * Windows 98; Q312461; .NET CLR 1.0.3705)".
-     * 
- */ - public Builder setUserAgentBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - userAgent_ = value; - onChanged(); - return this; - } - - private java.lang.Object remoteIp_ = ""; - /** - * optional string remote_ip = 7; - * - *
-     * IP address of the client who issues the HTTP request. Could be either IPv4
-     * or IPv6.
-     * 
- */ - public java.lang.String getRemoteIp() { - java.lang.Object ref = remoteIp_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - remoteIp_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string remote_ip = 7; - * - *
-     * IP address of the client who issues the HTTP request. Could be either IPv4
-     * or IPv6.
-     * 
- */ - public com.google.protobuf.ByteString - getRemoteIpBytes() { - java.lang.Object ref = remoteIp_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - remoteIp_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string remote_ip = 7; - * - *
-     * IP address of the client who issues the HTTP request. Could be either IPv4
-     * or IPv6.
-     * 
- */ - public Builder setRemoteIp( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - remoteIp_ = value; - onChanged(); - return this; - } - /** - * optional string remote_ip = 7; - * - *
-     * IP address of the client who issues the HTTP request. Could be either IPv4
-     * or IPv6.
-     * 
- */ - public Builder clearRemoteIp() { - - remoteIp_ = getDefaultInstance().getRemoteIp(); - onChanged(); - return this; - } - /** - * optional string remote_ip = 7; - * - *
-     * IP address of the client who issues the HTTP request. Could be either IPv4
-     * or IPv6.
-     * 
- */ - public Builder setRemoteIpBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - remoteIp_ = value; - onChanged(); - return this; - } - - private java.lang.Object referer_ = ""; - /** - * optional string referer = 8; - * - *
-     * Referer (a.k.a. referrer) URL of request, as defined in
-     * http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html.
-     * 
- */ - public java.lang.String getReferer() { - java.lang.Object ref = referer_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - referer_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string referer = 8; - * - *
-     * Referer (a.k.a. referrer) URL of request, as defined in
-     * http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html.
-     * 
- */ - public com.google.protobuf.ByteString - getRefererBytes() { - java.lang.Object ref = referer_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - referer_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string referer = 8; - * - *
-     * Referer (a.k.a. referrer) URL of request, as defined in
-     * http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html.
-     * 
- */ - public Builder setReferer( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - referer_ = value; - onChanged(); - return this; - } - /** - * optional string referer = 8; - * - *
-     * Referer (a.k.a. referrer) URL of request, as defined in
-     * http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html.
-     * 
- */ - public Builder clearReferer() { - - referer_ = getDefaultInstance().getReferer(); - onChanged(); - return this; - } - /** - * optional string referer = 8; - * - *
-     * Referer (a.k.a. referrer) URL of request, as defined in
-     * http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html.
-     * 
- */ - public Builder setRefererBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - referer_ = value; - onChanged(); - return this; - } - - private boolean cacheHit_ ; - /** - * optional bool cache_hit = 9; - * - *
-     * Whether or not an entity was served from cache
-     * (with or without validation).
-     * 
- */ - public boolean getCacheHit() { - return cacheHit_; - } - /** - * optional bool cache_hit = 9; - * - *
-     * Whether or not an entity was served from cache
-     * (with or without validation).
-     * 
- */ - public Builder setCacheHit(boolean value) { - - cacheHit_ = value; - onChanged(); - return this; - } - /** - * optional bool cache_hit = 9; - * - *
-     * Whether or not an entity was served from cache
-     * (with or without validation).
-     * 
- */ - public Builder clearCacheHit() { - - cacheHit_ = false; - onChanged(); - return this; - } - - private boolean validatedWithOriginServer_ ; - /** - * optional bool validated_with_origin_server = 10; - * - *
-     * Whether or not the response was validated with the origin server before
-     * being served from cache. This field is only meaningful if cache_hit is
-     * True.
-     * 
- */ - public boolean getValidatedWithOriginServer() { - return validatedWithOriginServer_; - } - /** - * optional bool validated_with_origin_server = 10; - * - *
-     * Whether or not the response was validated with the origin server before
-     * being served from cache. This field is only meaningful if cache_hit is
-     * True.
-     * 
- */ - public Builder setValidatedWithOriginServer(boolean value) { - - validatedWithOriginServer_ = value; - onChanged(); - return this; - } - /** - * optional bool validated_with_origin_server = 10; - * - *
-     * Whether or not the response was validated with the origin server before
-     * being served from cache. This field is only meaningful if cache_hit is
-     * True.
-     * 
- */ - public Builder clearValidatedWithOriginServer() { - - validatedWithOriginServer_ = false; - onChanged(); - return this; - } - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - - // @@protoc_insertion_point(builder_scope:google.logging.type.HttpRequest) - } - - // @@protoc_insertion_point(class_scope:google.logging.type.HttpRequest) - private static final com.google.logging.type.HttpRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.logging.type.HttpRequest(); - } - - public static com.google.logging.type.HttpRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - public HttpRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - try { - return new HttpRequest(input, extensionRegistry); - } catch (RuntimeException e) { - if (e.getCause() instanceof - com.google.protobuf.InvalidProtocolBufferException) { - throw (com.google.protobuf.InvalidProtocolBufferException) - e.getCause(); - } - throw e; - } - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public com.google.logging.type.HttpRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/type/HttpRequestOrBuilder.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/type/HttpRequestOrBuilder.java deleted file mode 100644 index c89c1863f697..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/type/HttpRequestOrBuilder.java +++ /dev/null @@ -1,157 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/logging/type/http_request.proto - -package com.google.logging.type; - -public interface HttpRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.logging.type.HttpRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * optional string request_method = 1; - * - *
-   * Request method, such as `GET`, `HEAD`, `PUT` or `POST`.
-   * 
- */ - java.lang.String getRequestMethod(); - /** - * optional string request_method = 1; - * - *
-   * Request method, such as `GET`, `HEAD`, `PUT` or `POST`.
-   * 
- */ - com.google.protobuf.ByteString - getRequestMethodBytes(); - - /** - * optional string request_url = 2; - * - *
-   * Contains the scheme (http|https), the host name, the path and the query
-   * portion of the URL that was requested.
-   * 
- */ - java.lang.String getRequestUrl(); - /** - * optional string request_url = 2; - * - *
-   * Contains the scheme (http|https), the host name, the path and the query
-   * portion of the URL that was requested.
-   * 
- */ - com.google.protobuf.ByteString - getRequestUrlBytes(); - - /** - * optional int64 request_size = 3; - * - *
-   * Size of the HTTP request message in bytes, including request headers and
-   * the request body.
-   * 
- */ - long getRequestSize(); - - /** - * optional int32 status = 4; - * - *
-   * A response code indicates the status of response, e.g., 200.
-   * 
- */ - int getStatus(); - - /** - * optional int64 response_size = 5; - * - *
-   * Size of the HTTP response message in bytes sent back to the client,
-   * including response headers and response body.
-   * 
- */ - long getResponseSize(); - - /** - * optional string user_agent = 6; - * - *
-   * User agent sent by the client, e.g., "Mozilla/4.0 (compatible; MSIE 6.0;
-   * Windows 98; Q312461; .NET CLR 1.0.3705)".
-   * 
- */ - java.lang.String getUserAgent(); - /** - * optional string user_agent = 6; - * - *
-   * User agent sent by the client, e.g., "Mozilla/4.0 (compatible; MSIE 6.0;
-   * Windows 98; Q312461; .NET CLR 1.0.3705)".
-   * 
- */ - com.google.protobuf.ByteString - getUserAgentBytes(); - - /** - * optional string remote_ip = 7; - * - *
-   * IP address of the client who issues the HTTP request. Could be either IPv4
-   * or IPv6.
-   * 
- */ - java.lang.String getRemoteIp(); - /** - * optional string remote_ip = 7; - * - *
-   * IP address of the client who issues the HTTP request. Could be either IPv4
-   * or IPv6.
-   * 
- */ - com.google.protobuf.ByteString - getRemoteIpBytes(); - - /** - * optional string referer = 8; - * - *
-   * Referer (a.k.a. referrer) URL of request, as defined in
-   * http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html.
-   * 
- */ - java.lang.String getReferer(); - /** - * optional string referer = 8; - * - *
-   * Referer (a.k.a. referrer) URL of request, as defined in
-   * http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html.
-   * 
- */ - com.google.protobuf.ByteString - getRefererBytes(); - - /** - * optional bool cache_hit = 9; - * - *
-   * Whether or not an entity was served from cache
-   * (with or without validation).
-   * 
- */ - boolean getCacheHit(); - - /** - * optional bool validated_with_origin_server = 10; - * - *
-   * Whether or not the response was validated with the origin server before
-   * being served from cache. This field is only meaningful if cache_hit is
-   * True.
-   * 
- */ - boolean getValidatedWithOriginServer(); -} diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/type/HttpRequestProto.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/type/HttpRequestProto.java deleted file mode 100644 index 8c21f4a9c355..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/type/HttpRequestProto.java +++ /dev/null @@ -1,56 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/logging/type/http_request.proto - -package com.google.logging.type; - -public final class HttpRequestProto { - private HttpRequestProto() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - } - static com.google.protobuf.Descriptors.Descriptor - internal_static_google_logging_type_HttpRequest_descriptor; - static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_google_logging_type_HttpRequest_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n&google/logging/type/http_request.proto" + - "\022\023google.logging.type\"\350\001\n\013HttpRequest\022\026\n" + - "\016request_method\030\001 \001(\t\022\023\n\013request_url\030\002 \001" + - "(\t\022\024\n\014request_size\030\003 \001(\003\022\016\n\006status\030\004 \001(\005" + - "\022\025\n\rresponse_size\030\005 \001(\003\022\022\n\nuser_agent\030\006 " + - "\001(\t\022\021\n\tremote_ip\030\007 \001(\t\022\017\n\007referer\030\010 \001(\t\022" + - "\021\n\tcache_hit\030\t \001(\010\022$\n\034validated_with_ori" + - "gin_server\030\n \001(\010B-\n\027com.google.logging.t" + - "ypeB\020HttpRequestProtoP\001b\006proto3" - }; - com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = - new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { - public com.google.protobuf.ExtensionRegistry assignDescriptors( - com.google.protobuf.Descriptors.FileDescriptor root) { - descriptor = root; - return null; - } - }; - com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }, assigner); - internal_static_google_logging_type_HttpRequest_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_google_logging_type_HttpRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_google_logging_type_HttpRequest_descriptor, - new java.lang.String[] { "RequestMethod", "RequestUrl", "RequestSize", "Status", "ResponseSize", "UserAgent", "RemoteIp", "Referer", "CacheHit", "ValidatedWithOriginServer", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/type/LogSeverity.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/type/LogSeverity.java deleted file mode 100644 index bfb7f0635dad..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/type/LogSeverity.java +++ /dev/null @@ -1,245 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/logging/type/log_severity.proto - -package com.google.logging.type; - -/** - * Protobuf enum {@code google.logging.type.LogSeverity} - * - *
- * The severity of the event described in a log entry.  These guideline severity
- * levels are ordered, with numerically smaller levels treated as less severe
- * than numerically larger levels. If the source of the log entries uses a
- * different set of severity levels, the client should select the closest
- * corresponding `LogSeverity` value. For example, Java's FINE, FINER, and
- * FINEST levels might all map to `LogSeverity.DEBUG`. If the original severity
- * code must be preserved, it can be stored in the payload.
- * 
- */ -public enum LogSeverity - implements com.google.protobuf.ProtocolMessageEnum { - /** - * DEFAULT = 0; - * - *
-   * The log entry has no assigned severity level.
-   * 
- */ - DEFAULT(0, 0), - /** - * DEBUG = 100; - * - *
-   * Debug or trace information.
-   * 
- */ - DEBUG(1, 100), - /** - * INFO = 200; - * - *
-   * Routine information, such as ongoing status or performance.
-   * 
- */ - INFO(2, 200), - /** - * NOTICE = 300; - * - *
-   * Normal but significant events, such as start up, shut down, or
-   * configuration.
-   * 
- */ - NOTICE(3, 300), - /** - * WARNING = 400; - * - *
-   * Warning events might cause problems.
-   * 
- */ - WARNING(4, 400), - /** - * ERROR = 500; - * - *
-   * Error events are likely to cause problems.
-   * 
- */ - ERROR(5, 500), - /** - * CRITICAL = 600; - * - *
-   * Critical events cause more severe problems or brief outages.
-   * 
- */ - CRITICAL(6, 600), - /** - * ALERT = 700; - * - *
-   * A person must take an action immediately.
-   * 
- */ - ALERT(7, 700), - /** - * EMERGENCY = 800; - * - *
-   * One or more systems are unusable.
-   * 
- */ - EMERGENCY(8, 800), - UNRECOGNIZED(-1, -1), - ; - - /** - * DEFAULT = 0; - * - *
-   * The log entry has no assigned severity level.
-   * 
- */ - public static final int DEFAULT_VALUE = 0; - /** - * DEBUG = 100; - * - *
-   * Debug or trace information.
-   * 
- */ - public static final int DEBUG_VALUE = 100; - /** - * INFO = 200; - * - *
-   * Routine information, such as ongoing status or performance.
-   * 
- */ - public static final int INFO_VALUE = 200; - /** - * NOTICE = 300; - * - *
-   * Normal but significant events, such as start up, shut down, or
-   * configuration.
-   * 
- */ - public static final int NOTICE_VALUE = 300; - /** - * WARNING = 400; - * - *
-   * Warning events might cause problems.
-   * 
- */ - public static final int WARNING_VALUE = 400; - /** - * ERROR = 500; - * - *
-   * Error events are likely to cause problems.
-   * 
- */ - public static final int ERROR_VALUE = 500; - /** - * CRITICAL = 600; - * - *
-   * Critical events cause more severe problems or brief outages.
-   * 
- */ - public static final int CRITICAL_VALUE = 600; - /** - * ALERT = 700; - * - *
-   * A person must take an action immediately.
-   * 
- */ - public static final int ALERT_VALUE = 700; - /** - * EMERGENCY = 800; - * - *
-   * One or more systems are unusable.
-   * 
- */ - public static final int EMERGENCY_VALUE = 800; - - - public final int getNumber() { - if (index == -1) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - public static LogSeverity valueOf(int value) { - switch (value) { - case 0: return DEFAULT; - case 100: return DEBUG; - case 200: return INFO; - case 300: return NOTICE; - case 400: return WARNING; - case 500: return ERROR; - case 600: return CRITICAL; - case 700: return ALERT; - case 800: return EMERGENCY; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - LogSeverity> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public LogSeverity findValueByNumber(int number) { - return LogSeverity.valueOf(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor - getValueDescriptor() { - return getDescriptor().getValues().get(index); - } - public final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptorForType() { - return getDescriptor(); - } - public static final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptor() { - return com.google.logging.type.LogSeverityProto.getDescriptor() - .getEnumTypes().get(0); - } - - private static final LogSeverity[] VALUES = values(); - - public static LogSeverity valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "EnumValueDescriptor is not for this type."); - } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } - return VALUES[desc.getIndex()]; - } - - private final int index; - private final int value; - - private LogSeverity(int index, int value) { - this.index = index; - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:google.logging.type.LogSeverity) -} - diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/type/LogSeverityProto.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/type/LogSeverityProto.java deleted file mode 100644 index aaad0508e345..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/type/LogSeverityProto.java +++ /dev/null @@ -1,43 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/logging/type/log_severity.proto - -package com.google.logging.type; - -public final class LogSeverityProto { - private LogSeverityProto() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - } - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n&google/logging/type/log_severity.proto" + - "\022\023google.logging.type*\202\001\n\013LogSeverity\022\013\n" + - "\007DEFAULT\020\000\022\t\n\005DEBUG\020d\022\t\n\004INFO\020\310\001\022\013\n\006NOTI" + - "CE\020\254\002\022\014\n\007WARNING\020\220\003\022\n\n\005ERROR\020\364\003\022\r\n\010CRITI" + - "CAL\020\330\004\022\n\n\005ALERT\020\274\005\022\016\n\tEMERGENCY\020\240\006B-\n\027co" + - "m.google.logging.typeB\020LogSeverityProtoP" + - "\001b\006proto3" - }; - com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = - new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { - public com.google.protobuf.ExtensionRegistry assignDescriptors( - com.google.protobuf.Descriptors.FileDescriptor root) { - descriptor = root; - return null; - } - }; - com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }, assigner); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ConfigServiceV2Grpc.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ConfigServiceV2Grpc.java deleted file mode 100644 index 908932183558..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ConfigServiceV2Grpc.java +++ /dev/null @@ -1,356 +0,0 @@ -package com.google.logging.v2; - -import static io.grpc.stub.ClientCalls.asyncUnaryCall; -import static io.grpc.stub.ClientCalls.asyncServerStreamingCall; -import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; -import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall; -import static io.grpc.stub.ClientCalls.blockingUnaryCall; -import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; -import static io.grpc.stub.ClientCalls.futureUnaryCall; -import static io.grpc.MethodDescriptor.generateFullMethodName; -import static io.grpc.stub.ServerCalls.asyncUnaryCall; -import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; -import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; -import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; - -@javax.annotation.Generated("by gRPC proto compiler") -public class ConfigServiceV2Grpc { - - private ConfigServiceV2Grpc() {} - - public static final String SERVICE_NAME = "google.logging.v2.ConfigServiceV2"; - - // Static method descriptors that strictly reflect the proto. - @io.grpc.ExperimentalApi - public static final io.grpc.MethodDescriptor METHOD_LIST_SINKS = - io.grpc.MethodDescriptor.create( - io.grpc.MethodDescriptor.MethodType.UNARY, - generateFullMethodName( - "google.logging.v2.ConfigServiceV2", "ListSinks"), - io.grpc.protobuf.ProtoUtils.marshaller(com.google.logging.v2.ListSinksRequest.getDefaultInstance()), - io.grpc.protobuf.ProtoUtils.marshaller(com.google.logging.v2.ListSinksResponse.getDefaultInstance())); - @io.grpc.ExperimentalApi - public static final io.grpc.MethodDescriptor METHOD_GET_SINK = - io.grpc.MethodDescriptor.create( - io.grpc.MethodDescriptor.MethodType.UNARY, - generateFullMethodName( - "google.logging.v2.ConfigServiceV2", "GetSink"), - io.grpc.protobuf.ProtoUtils.marshaller(com.google.logging.v2.GetSinkRequest.getDefaultInstance()), - io.grpc.protobuf.ProtoUtils.marshaller(com.google.logging.v2.LogSink.getDefaultInstance())); - @io.grpc.ExperimentalApi - public static final io.grpc.MethodDescriptor METHOD_CREATE_SINK = - io.grpc.MethodDescriptor.create( - io.grpc.MethodDescriptor.MethodType.UNARY, - generateFullMethodName( - "google.logging.v2.ConfigServiceV2", "CreateSink"), - io.grpc.protobuf.ProtoUtils.marshaller(com.google.logging.v2.CreateSinkRequest.getDefaultInstance()), - io.grpc.protobuf.ProtoUtils.marshaller(com.google.logging.v2.LogSink.getDefaultInstance())); - @io.grpc.ExperimentalApi - public static final io.grpc.MethodDescriptor METHOD_UPDATE_SINK = - io.grpc.MethodDescriptor.create( - io.grpc.MethodDescriptor.MethodType.UNARY, - generateFullMethodName( - "google.logging.v2.ConfigServiceV2", "UpdateSink"), - io.grpc.protobuf.ProtoUtils.marshaller(com.google.logging.v2.UpdateSinkRequest.getDefaultInstance()), - io.grpc.protobuf.ProtoUtils.marshaller(com.google.logging.v2.LogSink.getDefaultInstance())); - @io.grpc.ExperimentalApi - public static final io.grpc.MethodDescriptor METHOD_DELETE_SINK = - io.grpc.MethodDescriptor.create( - io.grpc.MethodDescriptor.MethodType.UNARY, - generateFullMethodName( - "google.logging.v2.ConfigServiceV2", "DeleteSink"), - io.grpc.protobuf.ProtoUtils.marshaller(com.google.logging.v2.DeleteSinkRequest.getDefaultInstance()), - io.grpc.protobuf.ProtoUtils.marshaller(com.google.protobuf.Empty.getDefaultInstance())); - - public static ConfigServiceV2Stub newStub(io.grpc.Channel channel) { - return new ConfigServiceV2Stub(channel); - } - - public static ConfigServiceV2BlockingStub newBlockingStub( - io.grpc.Channel channel) { - return new ConfigServiceV2BlockingStub(channel); - } - - public static ConfigServiceV2FutureStub newFutureStub( - io.grpc.Channel channel) { - return new ConfigServiceV2FutureStub(channel); - } - - public static interface ConfigServiceV2 { - - public void listSinks(com.google.logging.v2.ListSinksRequest request, - io.grpc.stub.StreamObserver responseObserver); - - public void getSink(com.google.logging.v2.GetSinkRequest request, - io.grpc.stub.StreamObserver responseObserver); - - public void createSink(com.google.logging.v2.CreateSinkRequest request, - io.grpc.stub.StreamObserver responseObserver); - - public void updateSink(com.google.logging.v2.UpdateSinkRequest request, - io.grpc.stub.StreamObserver responseObserver); - - public void deleteSink(com.google.logging.v2.DeleteSinkRequest request, - io.grpc.stub.StreamObserver responseObserver); - } - - public static interface ConfigServiceV2BlockingClient { - - public com.google.logging.v2.ListSinksResponse listSinks(com.google.logging.v2.ListSinksRequest request); - - public com.google.logging.v2.LogSink getSink(com.google.logging.v2.GetSinkRequest request); - - public com.google.logging.v2.LogSink createSink(com.google.logging.v2.CreateSinkRequest request); - - public com.google.logging.v2.LogSink updateSink(com.google.logging.v2.UpdateSinkRequest request); - - public com.google.protobuf.Empty deleteSink(com.google.logging.v2.DeleteSinkRequest request); - } - - public static interface ConfigServiceV2FutureClient { - - public com.google.common.util.concurrent.ListenableFuture listSinks( - com.google.logging.v2.ListSinksRequest request); - - public com.google.common.util.concurrent.ListenableFuture getSink( - com.google.logging.v2.GetSinkRequest request); - - public com.google.common.util.concurrent.ListenableFuture createSink( - com.google.logging.v2.CreateSinkRequest request); - - public com.google.common.util.concurrent.ListenableFuture updateSink( - com.google.logging.v2.UpdateSinkRequest request); - - public com.google.common.util.concurrent.ListenableFuture deleteSink( - com.google.logging.v2.DeleteSinkRequest request); - } - - public static class ConfigServiceV2Stub extends io.grpc.stub.AbstractStub - implements ConfigServiceV2 { - private ConfigServiceV2Stub(io.grpc.Channel channel) { - super(channel); - } - - private ConfigServiceV2Stub(io.grpc.Channel channel, - io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected ConfigServiceV2Stub build(io.grpc.Channel channel, - io.grpc.CallOptions callOptions) { - return new ConfigServiceV2Stub(channel, callOptions); - } - - @java.lang.Override - public void listSinks(com.google.logging.v2.ListSinksRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( - getChannel().newCall(METHOD_LIST_SINKS, getCallOptions()), request, responseObserver); - } - - @java.lang.Override - public void getSink(com.google.logging.v2.GetSinkRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( - getChannel().newCall(METHOD_GET_SINK, getCallOptions()), request, responseObserver); - } - - @java.lang.Override - public void createSink(com.google.logging.v2.CreateSinkRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( - getChannel().newCall(METHOD_CREATE_SINK, getCallOptions()), request, responseObserver); - } - - @java.lang.Override - public void updateSink(com.google.logging.v2.UpdateSinkRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( - getChannel().newCall(METHOD_UPDATE_SINK, getCallOptions()), request, responseObserver); - } - - @java.lang.Override - public void deleteSink(com.google.logging.v2.DeleteSinkRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( - getChannel().newCall(METHOD_DELETE_SINK, getCallOptions()), request, responseObserver); - } - } - - public static class ConfigServiceV2BlockingStub extends io.grpc.stub.AbstractStub - implements ConfigServiceV2BlockingClient { - private ConfigServiceV2BlockingStub(io.grpc.Channel channel) { - super(channel); - } - - private ConfigServiceV2BlockingStub(io.grpc.Channel channel, - io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected ConfigServiceV2BlockingStub build(io.grpc.Channel channel, - io.grpc.CallOptions callOptions) { - return new ConfigServiceV2BlockingStub(channel, callOptions); - } - - @java.lang.Override - public com.google.logging.v2.ListSinksResponse listSinks(com.google.logging.v2.ListSinksRequest request) { - return blockingUnaryCall( - getChannel().newCall(METHOD_LIST_SINKS, getCallOptions()), request); - } - - @java.lang.Override - public com.google.logging.v2.LogSink getSink(com.google.logging.v2.GetSinkRequest request) { - return blockingUnaryCall( - getChannel().newCall(METHOD_GET_SINK, getCallOptions()), request); - } - - @java.lang.Override - public com.google.logging.v2.LogSink createSink(com.google.logging.v2.CreateSinkRequest request) { - return blockingUnaryCall( - getChannel().newCall(METHOD_CREATE_SINK, getCallOptions()), request); - } - - @java.lang.Override - public com.google.logging.v2.LogSink updateSink(com.google.logging.v2.UpdateSinkRequest request) { - return blockingUnaryCall( - getChannel().newCall(METHOD_UPDATE_SINK, getCallOptions()), request); - } - - @java.lang.Override - public com.google.protobuf.Empty deleteSink(com.google.logging.v2.DeleteSinkRequest request) { - return blockingUnaryCall( - getChannel().newCall(METHOD_DELETE_SINK, getCallOptions()), request); - } - } - - public static class ConfigServiceV2FutureStub extends io.grpc.stub.AbstractStub - implements ConfigServiceV2FutureClient { - private ConfigServiceV2FutureStub(io.grpc.Channel channel) { - super(channel); - } - - private ConfigServiceV2FutureStub(io.grpc.Channel channel, - io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected ConfigServiceV2FutureStub build(io.grpc.Channel channel, - io.grpc.CallOptions callOptions) { - return new ConfigServiceV2FutureStub(channel, callOptions); - } - - @java.lang.Override - public com.google.common.util.concurrent.ListenableFuture listSinks( - com.google.logging.v2.ListSinksRequest request) { - return futureUnaryCall( - getChannel().newCall(METHOD_LIST_SINKS, getCallOptions()), request); - } - - @java.lang.Override - public com.google.common.util.concurrent.ListenableFuture getSink( - com.google.logging.v2.GetSinkRequest request) { - return futureUnaryCall( - getChannel().newCall(METHOD_GET_SINK, getCallOptions()), request); - } - - @java.lang.Override - public com.google.common.util.concurrent.ListenableFuture createSink( - com.google.logging.v2.CreateSinkRequest request) { - return futureUnaryCall( - getChannel().newCall(METHOD_CREATE_SINK, getCallOptions()), request); - } - - @java.lang.Override - public com.google.common.util.concurrent.ListenableFuture updateSink( - com.google.logging.v2.UpdateSinkRequest request) { - return futureUnaryCall( - getChannel().newCall(METHOD_UPDATE_SINK, getCallOptions()), request); - } - - @java.lang.Override - public com.google.common.util.concurrent.ListenableFuture deleteSink( - com.google.logging.v2.DeleteSinkRequest request) { - return futureUnaryCall( - getChannel().newCall(METHOD_DELETE_SINK, getCallOptions()), request); - } - } - - public static io.grpc.ServerServiceDefinition bindService( - final ConfigServiceV2 serviceImpl) { - return io.grpc.ServerServiceDefinition.builder(SERVICE_NAME) - .addMethod( - METHOD_LIST_SINKS, - asyncUnaryCall( - new io.grpc.stub.ServerCalls.UnaryMethod< - com.google.logging.v2.ListSinksRequest, - com.google.logging.v2.ListSinksResponse>() { - @java.lang.Override - public void invoke( - com.google.logging.v2.ListSinksRequest request, - io.grpc.stub.StreamObserver responseObserver) { - serviceImpl.listSinks(request, responseObserver); - } - })) - .addMethod( - METHOD_GET_SINK, - asyncUnaryCall( - new io.grpc.stub.ServerCalls.UnaryMethod< - com.google.logging.v2.GetSinkRequest, - com.google.logging.v2.LogSink>() { - @java.lang.Override - public void invoke( - com.google.logging.v2.GetSinkRequest request, - io.grpc.stub.StreamObserver responseObserver) { - serviceImpl.getSink(request, responseObserver); - } - })) - .addMethod( - METHOD_CREATE_SINK, - asyncUnaryCall( - new io.grpc.stub.ServerCalls.UnaryMethod< - com.google.logging.v2.CreateSinkRequest, - com.google.logging.v2.LogSink>() { - @java.lang.Override - public void invoke( - com.google.logging.v2.CreateSinkRequest request, - io.grpc.stub.StreamObserver responseObserver) { - serviceImpl.createSink(request, responseObserver); - } - })) - .addMethod( - METHOD_UPDATE_SINK, - asyncUnaryCall( - new io.grpc.stub.ServerCalls.UnaryMethod< - com.google.logging.v2.UpdateSinkRequest, - com.google.logging.v2.LogSink>() { - @java.lang.Override - public void invoke( - com.google.logging.v2.UpdateSinkRequest request, - io.grpc.stub.StreamObserver responseObserver) { - serviceImpl.updateSink(request, responseObserver); - } - })) - .addMethod( - METHOD_DELETE_SINK, - asyncUnaryCall( - new io.grpc.stub.ServerCalls.UnaryMethod< - com.google.logging.v2.DeleteSinkRequest, - com.google.protobuf.Empty>() { - @java.lang.Override - public void invoke( - com.google.logging.v2.DeleteSinkRequest request, - io.grpc.stub.StreamObserver responseObserver) { - serviceImpl.deleteSink(request, responseObserver); - } - })).build(); - } -} diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/CreateLogMetricRequest.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/CreateLogMetricRequest.java deleted file mode 100644 index aa5238715d12..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/CreateLogMetricRequest.java +++ /dev/null @@ -1,722 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/logging/v2/logging_metrics.proto - -package com.google.logging.v2; - -/** - * Protobuf type {@code google.logging.v2.CreateLogMetricRequest} - * - *
- * The parameters to CreateLogMetric.
- * 
- */ -public final class CreateLogMetricRequest extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:google.logging.v2.CreateLogMetricRequest) - CreateLogMetricRequestOrBuilder { - // Use CreateLogMetricRequest.newBuilder() to construct. - private CreateLogMetricRequest(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - private CreateLogMetricRequest() { - projectName_ = ""; - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); - } - private CreateLogMetricRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) { - this(); - int mutable_bitField0_ = 0; - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!input.skipField(tag)) { - done = true; - } - break; - } - case 10: { - String s = input.readStringRequireUtf8(); - - projectName_ = s; - break; - } - case 18: { - com.google.logging.v2.LogMetric.Builder subBuilder = null; - if (metric_ != null) { - subBuilder = metric_.toBuilder(); - } - metric_ = input.readMessage(com.google.logging.v2.LogMetric.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(metric_); - metric_ = subBuilder.buildPartial(); - } - - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw new RuntimeException(e.setUnfinishedMessage(this)); - } catch (java.io.IOException e) { - throw new RuntimeException( - new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this)); - } finally { - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.logging.v2.LoggingMetrics.internal_static_google_logging_v2_CreateLogMetricRequest_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.logging.v2.LoggingMetrics.internal_static_google_logging_v2_CreateLogMetricRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.logging.v2.CreateLogMetricRequest.class, com.google.logging.v2.CreateLogMetricRequest.Builder.class); - } - - public static final int PROJECT_NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object projectName_; - /** - * optional string project_name = 1; - * - *
-   * 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 getProjectName() { - java.lang.Object ref = projectName_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - projectName_ = s; - return s; - } - } - /** - * optional string project_name = 1; - * - *
-   * 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 com.google.protobuf.ByteString - getProjectNameBytes() { - java.lang.Object ref = projectName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - projectName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int METRIC_FIELD_NUMBER = 2; - private com.google.logging.v2.LogMetric metric_; - /** - * optional .google.logging.v2.LogMetric metric = 2; - * - *
-   * The new logs-based metric, which must not have an identifier that
-   * already exists.
-   * 
- */ - public boolean hasMetric() { - return metric_ != null; - } - /** - * optional .google.logging.v2.LogMetric metric = 2; - * - *
-   * The new logs-based metric, which must not have an identifier that
-   * already exists.
-   * 
- */ - public com.google.logging.v2.LogMetric getMetric() { - return metric_ == null ? com.google.logging.v2.LogMetric.getDefaultInstance() : metric_; - } - /** - * optional .google.logging.v2.LogMetric metric = 2; - * - *
-   * The new logs-based metric, which must not have an identifier that
-   * already exists.
-   * 
- */ - public com.google.logging.v2.LogMetricOrBuilder getMetricOrBuilder() { - return getMetric(); - } - - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getProjectNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessage.writeString(output, 1, projectName_); - } - if (metric_ != null) { - output.writeMessage(2, getMetric()); - } - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getProjectNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessage.computeStringSize(1, projectName_); - } - if (metric_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getMetric()); - } - memoizedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - public static com.google.logging.v2.CreateLogMetricRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.logging.v2.CreateLogMetricRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.logging.v2.CreateLogMetricRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.logging.v2.CreateLogMetricRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.logging.v2.CreateLogMetricRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.google.logging.v2.CreateLogMetricRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static com.google.logging.v2.CreateLogMetricRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static com.google.logging.v2.CreateLogMetricRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static com.google.logging.v2.CreateLogMetricRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.google.logging.v2.CreateLogMetricRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.logging.v2.CreateLogMetricRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code google.logging.v2.CreateLogMetricRequest} - * - *
-   * The parameters to CreateLogMetric.
-   * 
- */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:google.logging.v2.CreateLogMetricRequest) - com.google.logging.v2.CreateLogMetricRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.logging.v2.LoggingMetrics.internal_static_google_logging_v2_CreateLogMetricRequest_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.logging.v2.LoggingMetrics.internal_static_google_logging_v2_CreateLogMetricRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.logging.v2.CreateLogMetricRequest.class, com.google.logging.v2.CreateLogMetricRequest.Builder.class); - } - - // Construct using com.google.logging.v2.CreateLogMetricRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - public Builder clear() { - super.clear(); - projectName_ = ""; - - if (metricBuilder_ == null) { - metric_ = null; - } else { - metric_ = null; - metricBuilder_ = null; - } - return this; - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.logging.v2.LoggingMetrics.internal_static_google_logging_v2_CreateLogMetricRequest_descriptor; - } - - public com.google.logging.v2.CreateLogMetricRequest getDefaultInstanceForType() { - return com.google.logging.v2.CreateLogMetricRequest.getDefaultInstance(); - } - - public com.google.logging.v2.CreateLogMetricRequest build() { - com.google.logging.v2.CreateLogMetricRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.google.logging.v2.CreateLogMetricRequest buildPartial() { - com.google.logging.v2.CreateLogMetricRequest result = new com.google.logging.v2.CreateLogMetricRequest(this); - result.projectName_ = projectName_; - if (metricBuilder_ == null) { - result.metric_ = metric_; - } else { - result.metric_ = metricBuilder_.build(); - } - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.logging.v2.CreateLogMetricRequest) { - return mergeFrom((com.google.logging.v2.CreateLogMetricRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.logging.v2.CreateLogMetricRequest other) { - if (other == com.google.logging.v2.CreateLogMetricRequest.getDefaultInstance()) return this; - if (!other.getProjectName().isEmpty()) { - projectName_ = other.projectName_; - onChanged(); - } - if (other.hasMetric()) { - mergeMetric(other.getMetric()); - } - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.logging.v2.CreateLogMetricRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.logging.v2.CreateLogMetricRequest) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object projectName_ = ""; - /** - * optional string project_name = 1; - * - *
-     * 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 getProjectName() { - java.lang.Object ref = projectName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - projectName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string project_name = 1; - * - *
-     * 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 com.google.protobuf.ByteString - getProjectNameBytes() { - java.lang.Object ref = projectName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - projectName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string project_name = 1; - * - *
-     * 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 Builder setProjectName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - projectName_ = value; - onChanged(); - return this; - } - /** - * optional string project_name = 1; - * - *
-     * 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 Builder clearProjectName() { - - projectName_ = getDefaultInstance().getProjectName(); - onChanged(); - return this; - } - /** - * optional string project_name = 1; - * - *
-     * 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 Builder setProjectNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - projectName_ = value; - onChanged(); - return this; - } - - private com.google.logging.v2.LogMetric metric_ = null; - private com.google.protobuf.SingleFieldBuilder< - com.google.logging.v2.LogMetric, com.google.logging.v2.LogMetric.Builder, com.google.logging.v2.LogMetricOrBuilder> metricBuilder_; - /** - * optional .google.logging.v2.LogMetric metric = 2; - * - *
-     * The new logs-based metric, which must not have an identifier that
-     * already exists.
-     * 
- */ - public boolean hasMetric() { - return metricBuilder_ != null || metric_ != null; - } - /** - * optional .google.logging.v2.LogMetric metric = 2; - * - *
-     * The new logs-based metric, which must not have an identifier that
-     * already exists.
-     * 
- */ - public com.google.logging.v2.LogMetric getMetric() { - if (metricBuilder_ == null) { - return metric_ == null ? com.google.logging.v2.LogMetric.getDefaultInstance() : metric_; - } else { - return metricBuilder_.getMessage(); - } - } - /** - * optional .google.logging.v2.LogMetric metric = 2; - * - *
-     * The new logs-based metric, which must not have an identifier that
-     * already exists.
-     * 
- */ - public Builder setMetric(com.google.logging.v2.LogMetric value) { - if (metricBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - metric_ = value; - onChanged(); - } else { - metricBuilder_.setMessage(value); - } - - return this; - } - /** - * optional .google.logging.v2.LogMetric metric = 2; - * - *
-     * The new logs-based metric, which must not have an identifier that
-     * already exists.
-     * 
- */ - public Builder setMetric( - com.google.logging.v2.LogMetric.Builder builderForValue) { - if (metricBuilder_ == null) { - metric_ = builderForValue.build(); - onChanged(); - } else { - metricBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * optional .google.logging.v2.LogMetric metric = 2; - * - *
-     * The new logs-based metric, which must not have an identifier that
-     * already exists.
-     * 
- */ - public Builder mergeMetric(com.google.logging.v2.LogMetric value) { - if (metricBuilder_ == null) { - if (metric_ != null) { - metric_ = - com.google.logging.v2.LogMetric.newBuilder(metric_).mergeFrom(value).buildPartial(); - } else { - metric_ = value; - } - onChanged(); - } else { - metricBuilder_.mergeFrom(value); - } - - return this; - } - /** - * optional .google.logging.v2.LogMetric metric = 2; - * - *
-     * The new logs-based metric, which must not have an identifier that
-     * already exists.
-     * 
- */ - public Builder clearMetric() { - if (metricBuilder_ == null) { - metric_ = null; - onChanged(); - } else { - metric_ = null; - metricBuilder_ = null; - } - - return this; - } - /** - * optional .google.logging.v2.LogMetric metric = 2; - * - *
-     * The new logs-based metric, which must not have an identifier that
-     * already exists.
-     * 
- */ - public com.google.logging.v2.LogMetric.Builder getMetricBuilder() { - - onChanged(); - return getMetricFieldBuilder().getBuilder(); - } - /** - * optional .google.logging.v2.LogMetric metric = 2; - * - *
-     * The new logs-based metric, which must not have an identifier that
-     * already exists.
-     * 
- */ - public com.google.logging.v2.LogMetricOrBuilder getMetricOrBuilder() { - if (metricBuilder_ != null) { - return metricBuilder_.getMessageOrBuilder(); - } else { - return metric_ == null ? - com.google.logging.v2.LogMetric.getDefaultInstance() : metric_; - } - } - /** - * optional .google.logging.v2.LogMetric metric = 2; - * - *
-     * The new logs-based metric, which must not have an identifier that
-     * already exists.
-     * 
- */ - private com.google.protobuf.SingleFieldBuilder< - com.google.logging.v2.LogMetric, com.google.logging.v2.LogMetric.Builder, com.google.logging.v2.LogMetricOrBuilder> - getMetricFieldBuilder() { - if (metricBuilder_ == null) { - metricBuilder_ = new com.google.protobuf.SingleFieldBuilder< - com.google.logging.v2.LogMetric, com.google.logging.v2.LogMetric.Builder, com.google.logging.v2.LogMetricOrBuilder>( - getMetric(), - getParentForChildren(), - isClean()); - metric_ = null; - } - return metricBuilder_; - } - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - - // @@protoc_insertion_point(builder_scope:google.logging.v2.CreateLogMetricRequest) - } - - // @@protoc_insertion_point(class_scope:google.logging.v2.CreateLogMetricRequest) - private static final com.google.logging.v2.CreateLogMetricRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.logging.v2.CreateLogMetricRequest(); - } - - public static com.google.logging.v2.CreateLogMetricRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - public CreateLogMetricRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - try { - return new CreateLogMetricRequest(input, extensionRegistry); - } catch (RuntimeException e) { - if (e.getCause() instanceof - com.google.protobuf.InvalidProtocolBufferException) { - throw (com.google.protobuf.InvalidProtocolBufferException) - e.getCause(); - } - throw e; - } - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public com.google.logging.v2.CreateLogMetricRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/CreateLogMetricRequestOrBuilder.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/CreateLogMetricRequestOrBuilder.java deleted file mode 100644 index b0c0d6103503..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/CreateLogMetricRequestOrBuilder.java +++ /dev/null @@ -1,59 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/logging/v2/logging_metrics.proto - -package com.google.logging.v2; - -public interface CreateLogMetricRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.logging.v2.CreateLogMetricRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * optional string project_name = 1; - * - *
-   * 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.
-   * 
- */ - java.lang.String getProjectName(); - /** - * optional string project_name = 1; - * - *
-   * 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.protobuf.ByteString - getProjectNameBytes(); - - /** - * optional .google.logging.v2.LogMetric metric = 2; - * - *
-   * The new logs-based metric, which must not have an identifier that
-   * already exists.
-   * 
- */ - boolean hasMetric(); - /** - * optional .google.logging.v2.LogMetric metric = 2; - * - *
-   * The new logs-based metric, which must not have an identifier that
-   * already exists.
-   * 
- */ - com.google.logging.v2.LogMetric getMetric(); - /** - * optional .google.logging.v2.LogMetric metric = 2; - * - *
-   * The new logs-based metric, which must not have an identifier that
-   * already exists.
-   * 
- */ - com.google.logging.v2.LogMetricOrBuilder getMetricOrBuilder(); -} diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/CreateSinkRequest.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/CreateSinkRequest.java deleted file mode 100644 index 3eeb01d2435c..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/CreateSinkRequest.java +++ /dev/null @@ -1,722 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/logging/v2/logging_config.proto - -package com.google.logging.v2; - -/** - * Protobuf type {@code google.logging.v2.CreateSinkRequest} - * - *
- * The parameters to `CreateSink`.
- * 
- */ -public final class CreateSinkRequest extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:google.logging.v2.CreateSinkRequest) - CreateSinkRequestOrBuilder { - // Use CreateSinkRequest.newBuilder() to construct. - private CreateSinkRequest(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - private CreateSinkRequest() { - projectName_ = ""; - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); - } - private CreateSinkRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) { - this(); - int mutable_bitField0_ = 0; - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!input.skipField(tag)) { - done = true; - } - break; - } - case 10: { - String s = input.readStringRequireUtf8(); - - projectName_ = s; - break; - } - case 18: { - com.google.logging.v2.LogSink.Builder subBuilder = null; - if (sink_ != null) { - subBuilder = sink_.toBuilder(); - } - sink_ = input.readMessage(com.google.logging.v2.LogSink.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(sink_); - sink_ = subBuilder.buildPartial(); - } - - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw new RuntimeException(e.setUnfinishedMessage(this)); - } catch (java.io.IOException e) { - throw new RuntimeException( - new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this)); - } finally { - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.logging.v2.LoggingConfig.internal_static_google_logging_v2_CreateSinkRequest_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.logging.v2.LoggingConfig.internal_static_google_logging_v2_CreateSinkRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.logging.v2.CreateSinkRequest.class, com.google.logging.v2.CreateSinkRequest.Builder.class); - } - - public static final int PROJECT_NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object projectName_; - /** - * optional string project_name = 1; - * - *
-   * The resource name of the project in which to create the sink.
-   * Example: `"projects/my-project-id"`.
-   * The new sink must be provided in the request.
-   * 
- */ - public java.lang.String getProjectName() { - java.lang.Object ref = projectName_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - projectName_ = s; - return s; - } - } - /** - * optional string project_name = 1; - * - *
-   * The resource name of the project in which to create the sink.
-   * Example: `"projects/my-project-id"`.
-   * The new sink must be provided in the request.
-   * 
- */ - public com.google.protobuf.ByteString - getProjectNameBytes() { - java.lang.Object ref = projectName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - projectName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int SINK_FIELD_NUMBER = 2; - private com.google.logging.v2.LogSink sink_; - /** - * optional .google.logging.v2.LogSink sink = 2; - * - *
-   * The new sink, which must not have an identifier that already
-   * exists.
-   * 
- */ - public boolean hasSink() { - return sink_ != null; - } - /** - * optional .google.logging.v2.LogSink sink = 2; - * - *
-   * The new sink, which must not have an identifier that already
-   * exists.
-   * 
- */ - public com.google.logging.v2.LogSink getSink() { - return sink_ == null ? com.google.logging.v2.LogSink.getDefaultInstance() : sink_; - } - /** - * optional .google.logging.v2.LogSink sink = 2; - * - *
-   * The new sink, which must not have an identifier that already
-   * exists.
-   * 
- */ - public com.google.logging.v2.LogSinkOrBuilder getSinkOrBuilder() { - return getSink(); - } - - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getProjectNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessage.writeString(output, 1, projectName_); - } - if (sink_ != null) { - output.writeMessage(2, getSink()); - } - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getProjectNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessage.computeStringSize(1, projectName_); - } - if (sink_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getSink()); - } - memoizedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - public static com.google.logging.v2.CreateSinkRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.logging.v2.CreateSinkRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.logging.v2.CreateSinkRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.logging.v2.CreateSinkRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.logging.v2.CreateSinkRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.google.logging.v2.CreateSinkRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static com.google.logging.v2.CreateSinkRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static com.google.logging.v2.CreateSinkRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static com.google.logging.v2.CreateSinkRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.google.logging.v2.CreateSinkRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.logging.v2.CreateSinkRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code google.logging.v2.CreateSinkRequest} - * - *
-   * The parameters to `CreateSink`.
-   * 
- */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:google.logging.v2.CreateSinkRequest) - com.google.logging.v2.CreateSinkRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.logging.v2.LoggingConfig.internal_static_google_logging_v2_CreateSinkRequest_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.logging.v2.LoggingConfig.internal_static_google_logging_v2_CreateSinkRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.logging.v2.CreateSinkRequest.class, com.google.logging.v2.CreateSinkRequest.Builder.class); - } - - // Construct using com.google.logging.v2.CreateSinkRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - public Builder clear() { - super.clear(); - projectName_ = ""; - - if (sinkBuilder_ == null) { - sink_ = null; - } else { - sink_ = null; - sinkBuilder_ = null; - } - return this; - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.logging.v2.LoggingConfig.internal_static_google_logging_v2_CreateSinkRequest_descriptor; - } - - public com.google.logging.v2.CreateSinkRequest getDefaultInstanceForType() { - return com.google.logging.v2.CreateSinkRequest.getDefaultInstance(); - } - - public com.google.logging.v2.CreateSinkRequest build() { - com.google.logging.v2.CreateSinkRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.google.logging.v2.CreateSinkRequest buildPartial() { - com.google.logging.v2.CreateSinkRequest result = new com.google.logging.v2.CreateSinkRequest(this); - result.projectName_ = projectName_; - if (sinkBuilder_ == null) { - result.sink_ = sink_; - } else { - result.sink_ = sinkBuilder_.build(); - } - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.logging.v2.CreateSinkRequest) { - return mergeFrom((com.google.logging.v2.CreateSinkRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.logging.v2.CreateSinkRequest other) { - if (other == com.google.logging.v2.CreateSinkRequest.getDefaultInstance()) return this; - if (!other.getProjectName().isEmpty()) { - projectName_ = other.projectName_; - onChanged(); - } - if (other.hasSink()) { - mergeSink(other.getSink()); - } - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.logging.v2.CreateSinkRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.logging.v2.CreateSinkRequest) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object projectName_ = ""; - /** - * optional string project_name = 1; - * - *
-     * The resource name of the project in which to create the sink.
-     * Example: `"projects/my-project-id"`.
-     * The new sink must be provided in the request.
-     * 
- */ - public java.lang.String getProjectName() { - java.lang.Object ref = projectName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - projectName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string project_name = 1; - * - *
-     * The resource name of the project in which to create the sink.
-     * Example: `"projects/my-project-id"`.
-     * The new sink must be provided in the request.
-     * 
- */ - public com.google.protobuf.ByteString - getProjectNameBytes() { - java.lang.Object ref = projectName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - projectName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string project_name = 1; - * - *
-     * The resource name of the project in which to create the sink.
-     * Example: `"projects/my-project-id"`.
-     * The new sink must be provided in the request.
-     * 
- */ - public Builder setProjectName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - projectName_ = value; - onChanged(); - return this; - } - /** - * optional string project_name = 1; - * - *
-     * The resource name of the project in which to create the sink.
-     * Example: `"projects/my-project-id"`.
-     * The new sink must be provided in the request.
-     * 
- */ - public Builder clearProjectName() { - - projectName_ = getDefaultInstance().getProjectName(); - onChanged(); - return this; - } - /** - * optional string project_name = 1; - * - *
-     * The resource name of the project in which to create the sink.
-     * Example: `"projects/my-project-id"`.
-     * The new sink must be provided in the request.
-     * 
- */ - public Builder setProjectNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - projectName_ = value; - onChanged(); - return this; - } - - private com.google.logging.v2.LogSink sink_ = null; - private com.google.protobuf.SingleFieldBuilder< - com.google.logging.v2.LogSink, com.google.logging.v2.LogSink.Builder, com.google.logging.v2.LogSinkOrBuilder> sinkBuilder_; - /** - * optional .google.logging.v2.LogSink sink = 2; - * - *
-     * The new sink, which must not have an identifier that already
-     * exists.
-     * 
- */ - public boolean hasSink() { - return sinkBuilder_ != null || sink_ != null; - } - /** - * optional .google.logging.v2.LogSink sink = 2; - * - *
-     * The new sink, which must not have an identifier that already
-     * exists.
-     * 
- */ - public com.google.logging.v2.LogSink getSink() { - if (sinkBuilder_ == null) { - return sink_ == null ? com.google.logging.v2.LogSink.getDefaultInstance() : sink_; - } else { - return sinkBuilder_.getMessage(); - } - } - /** - * optional .google.logging.v2.LogSink sink = 2; - * - *
-     * The new sink, which must not have an identifier that already
-     * exists.
-     * 
- */ - public Builder setSink(com.google.logging.v2.LogSink value) { - if (sinkBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - sink_ = value; - onChanged(); - } else { - sinkBuilder_.setMessage(value); - } - - return this; - } - /** - * optional .google.logging.v2.LogSink sink = 2; - * - *
-     * The new sink, which must not have an identifier that already
-     * exists.
-     * 
- */ - public Builder setSink( - com.google.logging.v2.LogSink.Builder builderForValue) { - if (sinkBuilder_ == null) { - sink_ = builderForValue.build(); - onChanged(); - } else { - sinkBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * optional .google.logging.v2.LogSink sink = 2; - * - *
-     * The new sink, which must not have an identifier that already
-     * exists.
-     * 
- */ - public Builder mergeSink(com.google.logging.v2.LogSink value) { - if (sinkBuilder_ == null) { - if (sink_ != null) { - sink_ = - com.google.logging.v2.LogSink.newBuilder(sink_).mergeFrom(value).buildPartial(); - } else { - sink_ = value; - } - onChanged(); - } else { - sinkBuilder_.mergeFrom(value); - } - - return this; - } - /** - * optional .google.logging.v2.LogSink sink = 2; - * - *
-     * The new sink, which must not have an identifier that already
-     * exists.
-     * 
- */ - public Builder clearSink() { - if (sinkBuilder_ == null) { - sink_ = null; - onChanged(); - } else { - sink_ = null; - sinkBuilder_ = null; - } - - return this; - } - /** - * optional .google.logging.v2.LogSink sink = 2; - * - *
-     * The new sink, which must not have an identifier that already
-     * exists.
-     * 
- */ - public com.google.logging.v2.LogSink.Builder getSinkBuilder() { - - onChanged(); - return getSinkFieldBuilder().getBuilder(); - } - /** - * optional .google.logging.v2.LogSink sink = 2; - * - *
-     * The new sink, which must not have an identifier that already
-     * exists.
-     * 
- */ - public com.google.logging.v2.LogSinkOrBuilder getSinkOrBuilder() { - if (sinkBuilder_ != null) { - return sinkBuilder_.getMessageOrBuilder(); - } else { - return sink_ == null ? - com.google.logging.v2.LogSink.getDefaultInstance() : sink_; - } - } - /** - * optional .google.logging.v2.LogSink sink = 2; - * - *
-     * The new sink, which must not have an identifier that already
-     * exists.
-     * 
- */ - private com.google.protobuf.SingleFieldBuilder< - com.google.logging.v2.LogSink, com.google.logging.v2.LogSink.Builder, com.google.logging.v2.LogSinkOrBuilder> - getSinkFieldBuilder() { - if (sinkBuilder_ == null) { - sinkBuilder_ = new com.google.protobuf.SingleFieldBuilder< - com.google.logging.v2.LogSink, com.google.logging.v2.LogSink.Builder, com.google.logging.v2.LogSinkOrBuilder>( - getSink(), - getParentForChildren(), - isClean()); - sink_ = null; - } - return sinkBuilder_; - } - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - - // @@protoc_insertion_point(builder_scope:google.logging.v2.CreateSinkRequest) - } - - // @@protoc_insertion_point(class_scope:google.logging.v2.CreateSinkRequest) - private static final com.google.logging.v2.CreateSinkRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.logging.v2.CreateSinkRequest(); - } - - public static com.google.logging.v2.CreateSinkRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - public CreateSinkRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - try { - return new CreateSinkRequest(input, extensionRegistry); - } catch (RuntimeException e) { - if (e.getCause() instanceof - com.google.protobuf.InvalidProtocolBufferException) { - throw (com.google.protobuf.InvalidProtocolBufferException) - e.getCause(); - } - throw e; - } - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public com.google.logging.v2.CreateSinkRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/CreateSinkRequestOrBuilder.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/CreateSinkRequestOrBuilder.java deleted file mode 100644 index 682d3ffb8b1e..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/CreateSinkRequestOrBuilder.java +++ /dev/null @@ -1,59 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/logging/v2/logging_config.proto - -package com.google.logging.v2; - -public interface CreateSinkRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.logging.v2.CreateSinkRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * optional string project_name = 1; - * - *
-   * The resource name of the project in which to create the sink.
-   * Example: `"projects/my-project-id"`.
-   * The new sink must be provided in the request.
-   * 
- */ - java.lang.String getProjectName(); - /** - * optional string project_name = 1; - * - *
-   * The resource name of the project in which to create the sink.
-   * Example: `"projects/my-project-id"`.
-   * The new sink must be provided in the request.
-   * 
- */ - com.google.protobuf.ByteString - getProjectNameBytes(); - - /** - * optional .google.logging.v2.LogSink sink = 2; - * - *
-   * The new sink, which must not have an identifier that already
-   * exists.
-   * 
- */ - boolean hasSink(); - /** - * optional .google.logging.v2.LogSink sink = 2; - * - *
-   * The new sink, which must not have an identifier that already
-   * exists.
-   * 
- */ - com.google.logging.v2.LogSink getSink(); - /** - * optional .google.logging.v2.LogSink sink = 2; - * - *
-   * The new sink, which must not have an identifier that already
-   * exists.
-   * 
- */ - com.google.logging.v2.LogSinkOrBuilder getSinkOrBuilder(); -} diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/DeleteLogMetricRequest.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/DeleteLogMetricRequest.java deleted file mode 100644 index a41bb1d27285..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/DeleteLogMetricRequest.java +++ /dev/null @@ -1,483 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/logging/v2/logging_metrics.proto - -package com.google.logging.v2; - -/** - * Protobuf type {@code google.logging.v2.DeleteLogMetricRequest} - * - *
- * The parameters to DeleteLogMetric.
- * 
- */ -public final class DeleteLogMetricRequest extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:google.logging.v2.DeleteLogMetricRequest) - DeleteLogMetricRequestOrBuilder { - // Use DeleteLogMetricRequest.newBuilder() to construct. - private DeleteLogMetricRequest(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - private DeleteLogMetricRequest() { - metricName_ = ""; - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); - } - private DeleteLogMetricRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) { - this(); - int mutable_bitField0_ = 0; - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!input.skipField(tag)) { - done = true; - } - break; - } - case 10: { - String s = input.readStringRequireUtf8(); - - metricName_ = s; - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw new RuntimeException(e.setUnfinishedMessage(this)); - } catch (java.io.IOException e) { - throw new RuntimeException( - new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this)); - } finally { - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.logging.v2.LoggingMetrics.internal_static_google_logging_v2_DeleteLogMetricRequest_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.logging.v2.LoggingMetrics.internal_static_google_logging_v2_DeleteLogMetricRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.logging.v2.DeleteLogMetricRequest.class, com.google.logging.v2.DeleteLogMetricRequest.Builder.class); - } - - public static final int METRIC_NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object metricName_; - /** - * optional string metric_name = 1; - * - *
-   * The resource name of the metric to delete.
-   * Example: `"projects/my-project-id/metrics/my-metric-id"`.
-   * 
- */ - public java.lang.String getMetricName() { - java.lang.Object ref = metricName_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - metricName_ = s; - return s; - } - } - /** - * optional string metric_name = 1; - * - *
-   * The resource name of the metric to delete.
-   * Example: `"projects/my-project-id/metrics/my-metric-id"`.
-   * 
- */ - public com.google.protobuf.ByteString - getMetricNameBytes() { - java.lang.Object ref = metricName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - metricName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getMetricNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessage.writeString(output, 1, metricName_); - } - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getMetricNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessage.computeStringSize(1, metricName_); - } - memoizedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - public static com.google.logging.v2.DeleteLogMetricRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.logging.v2.DeleteLogMetricRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.logging.v2.DeleteLogMetricRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.logging.v2.DeleteLogMetricRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.logging.v2.DeleteLogMetricRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.google.logging.v2.DeleteLogMetricRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static com.google.logging.v2.DeleteLogMetricRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static com.google.logging.v2.DeleteLogMetricRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static com.google.logging.v2.DeleteLogMetricRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.google.logging.v2.DeleteLogMetricRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.logging.v2.DeleteLogMetricRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code google.logging.v2.DeleteLogMetricRequest} - * - *
-   * The parameters to DeleteLogMetric.
-   * 
- */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:google.logging.v2.DeleteLogMetricRequest) - com.google.logging.v2.DeleteLogMetricRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.logging.v2.LoggingMetrics.internal_static_google_logging_v2_DeleteLogMetricRequest_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.logging.v2.LoggingMetrics.internal_static_google_logging_v2_DeleteLogMetricRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.logging.v2.DeleteLogMetricRequest.class, com.google.logging.v2.DeleteLogMetricRequest.Builder.class); - } - - // Construct using com.google.logging.v2.DeleteLogMetricRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - public Builder clear() { - super.clear(); - metricName_ = ""; - - return this; - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.logging.v2.LoggingMetrics.internal_static_google_logging_v2_DeleteLogMetricRequest_descriptor; - } - - public com.google.logging.v2.DeleteLogMetricRequest getDefaultInstanceForType() { - return com.google.logging.v2.DeleteLogMetricRequest.getDefaultInstance(); - } - - public com.google.logging.v2.DeleteLogMetricRequest build() { - com.google.logging.v2.DeleteLogMetricRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.google.logging.v2.DeleteLogMetricRequest buildPartial() { - com.google.logging.v2.DeleteLogMetricRequest result = new com.google.logging.v2.DeleteLogMetricRequest(this); - result.metricName_ = metricName_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.logging.v2.DeleteLogMetricRequest) { - return mergeFrom((com.google.logging.v2.DeleteLogMetricRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.logging.v2.DeleteLogMetricRequest other) { - if (other == com.google.logging.v2.DeleteLogMetricRequest.getDefaultInstance()) return this; - if (!other.getMetricName().isEmpty()) { - metricName_ = other.metricName_; - onChanged(); - } - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.logging.v2.DeleteLogMetricRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.logging.v2.DeleteLogMetricRequest) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object metricName_ = ""; - /** - * optional string metric_name = 1; - * - *
-     * The resource name of the metric to delete.
-     * Example: `"projects/my-project-id/metrics/my-metric-id"`.
-     * 
- */ - public java.lang.String getMetricName() { - java.lang.Object ref = metricName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - metricName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string metric_name = 1; - * - *
-     * The resource name of the metric to delete.
-     * Example: `"projects/my-project-id/metrics/my-metric-id"`.
-     * 
- */ - public com.google.protobuf.ByteString - getMetricNameBytes() { - java.lang.Object ref = metricName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - metricName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string metric_name = 1; - * - *
-     * The resource name of the metric to delete.
-     * Example: `"projects/my-project-id/metrics/my-metric-id"`.
-     * 
- */ - public Builder setMetricName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - metricName_ = value; - onChanged(); - return this; - } - /** - * optional string metric_name = 1; - * - *
-     * The resource name of the metric to delete.
-     * Example: `"projects/my-project-id/metrics/my-metric-id"`.
-     * 
- */ - public Builder clearMetricName() { - - metricName_ = getDefaultInstance().getMetricName(); - onChanged(); - return this; - } - /** - * optional string metric_name = 1; - * - *
-     * The resource name of the metric to delete.
-     * Example: `"projects/my-project-id/metrics/my-metric-id"`.
-     * 
- */ - public Builder setMetricNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - metricName_ = value; - onChanged(); - return this; - } - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - - // @@protoc_insertion_point(builder_scope:google.logging.v2.DeleteLogMetricRequest) - } - - // @@protoc_insertion_point(class_scope:google.logging.v2.DeleteLogMetricRequest) - private static final com.google.logging.v2.DeleteLogMetricRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.logging.v2.DeleteLogMetricRequest(); - } - - public static com.google.logging.v2.DeleteLogMetricRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - public DeleteLogMetricRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - try { - return new DeleteLogMetricRequest(input, extensionRegistry); - } catch (RuntimeException e) { - if (e.getCause() instanceof - com.google.protobuf.InvalidProtocolBufferException) { - throw (com.google.protobuf.InvalidProtocolBufferException) - e.getCause(); - } - throw e; - } - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public com.google.logging.v2.DeleteLogMetricRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/DeleteLogMetricRequestOrBuilder.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/DeleteLogMetricRequestOrBuilder.java deleted file mode 100644 index 8a9f333d1d03..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/DeleteLogMetricRequestOrBuilder.java +++ /dev/null @@ -1,29 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/logging/v2/logging_metrics.proto - -package com.google.logging.v2; - -public interface DeleteLogMetricRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.logging.v2.DeleteLogMetricRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * optional string metric_name = 1; - * - *
-   * The resource name of the metric to delete.
-   * Example: `"projects/my-project-id/metrics/my-metric-id"`.
-   * 
- */ - java.lang.String getMetricName(); - /** - * optional string metric_name = 1; - * - *
-   * The resource name of the metric to delete.
-   * Example: `"projects/my-project-id/metrics/my-metric-id"`.
-   * 
- */ - com.google.protobuf.ByteString - getMetricNameBytes(); -} diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/DeleteLogRequest.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/DeleteLogRequest.java deleted file mode 100644 index b27fd4cbd02f..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/DeleteLogRequest.java +++ /dev/null @@ -1,483 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/logging/v2/logging.proto - -package com.google.logging.v2; - -/** - * Protobuf type {@code google.logging.v2.DeleteLogRequest} - * - *
- * The parameters to DeleteLog.
- * 
- */ -public final class DeleteLogRequest extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:google.logging.v2.DeleteLogRequest) - DeleteLogRequestOrBuilder { - // Use DeleteLogRequest.newBuilder() to construct. - private DeleteLogRequest(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - private DeleteLogRequest() { - logName_ = ""; - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); - } - private DeleteLogRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) { - this(); - int mutable_bitField0_ = 0; - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!input.skipField(tag)) { - done = true; - } - break; - } - case 10: { - String s = input.readStringRequireUtf8(); - - logName_ = s; - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw new RuntimeException(e.setUnfinishedMessage(this)); - } catch (java.io.IOException e) { - throw new RuntimeException( - new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this)); - } finally { - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_DeleteLogRequest_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_DeleteLogRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.logging.v2.DeleteLogRequest.class, com.google.logging.v2.DeleteLogRequest.Builder.class); - } - - public static final int LOG_NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object logName_; - /** - * optional string log_name = 1; - * - *
-   * Required. The resource name of the log to delete.  Example:
-   * `"projects/my-project/logs/syslog"`.
-   * 
- */ - public java.lang.String getLogName() { - java.lang.Object ref = logName_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - logName_ = s; - return s; - } - } - /** - * optional string log_name = 1; - * - *
-   * Required. The resource name of the log to delete.  Example:
-   * `"projects/my-project/logs/syslog"`.
-   * 
- */ - public com.google.protobuf.ByteString - getLogNameBytes() { - java.lang.Object ref = logName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - logName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getLogNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessage.writeString(output, 1, logName_); - } - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getLogNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessage.computeStringSize(1, logName_); - } - memoizedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - public static com.google.logging.v2.DeleteLogRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.logging.v2.DeleteLogRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.logging.v2.DeleteLogRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.logging.v2.DeleteLogRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.logging.v2.DeleteLogRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.google.logging.v2.DeleteLogRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static com.google.logging.v2.DeleteLogRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static com.google.logging.v2.DeleteLogRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static com.google.logging.v2.DeleteLogRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.google.logging.v2.DeleteLogRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.logging.v2.DeleteLogRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code google.logging.v2.DeleteLogRequest} - * - *
-   * The parameters to DeleteLog.
-   * 
- */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:google.logging.v2.DeleteLogRequest) - com.google.logging.v2.DeleteLogRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_DeleteLogRequest_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_DeleteLogRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.logging.v2.DeleteLogRequest.class, com.google.logging.v2.DeleteLogRequest.Builder.class); - } - - // Construct using com.google.logging.v2.DeleteLogRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - public Builder clear() { - super.clear(); - logName_ = ""; - - return this; - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_DeleteLogRequest_descriptor; - } - - public com.google.logging.v2.DeleteLogRequest getDefaultInstanceForType() { - return com.google.logging.v2.DeleteLogRequest.getDefaultInstance(); - } - - public com.google.logging.v2.DeleteLogRequest build() { - com.google.logging.v2.DeleteLogRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.google.logging.v2.DeleteLogRequest buildPartial() { - com.google.logging.v2.DeleteLogRequest result = new com.google.logging.v2.DeleteLogRequest(this); - result.logName_ = logName_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.logging.v2.DeleteLogRequest) { - return mergeFrom((com.google.logging.v2.DeleteLogRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.logging.v2.DeleteLogRequest other) { - if (other == com.google.logging.v2.DeleteLogRequest.getDefaultInstance()) return this; - if (!other.getLogName().isEmpty()) { - logName_ = other.logName_; - onChanged(); - } - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.logging.v2.DeleteLogRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.logging.v2.DeleteLogRequest) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object logName_ = ""; - /** - * optional string log_name = 1; - * - *
-     * Required. The resource name of the log to delete.  Example:
-     * `"projects/my-project/logs/syslog"`.
-     * 
- */ - public java.lang.String getLogName() { - java.lang.Object ref = logName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - logName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string log_name = 1; - * - *
-     * Required. The resource name of the log to delete.  Example:
-     * `"projects/my-project/logs/syslog"`.
-     * 
- */ - public com.google.protobuf.ByteString - getLogNameBytes() { - java.lang.Object ref = logName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - logName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string log_name = 1; - * - *
-     * Required. The resource name of the log to delete.  Example:
-     * `"projects/my-project/logs/syslog"`.
-     * 
- */ - public Builder setLogName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - logName_ = value; - onChanged(); - return this; - } - /** - * optional string log_name = 1; - * - *
-     * Required. The resource name of the log to delete.  Example:
-     * `"projects/my-project/logs/syslog"`.
-     * 
- */ - public Builder clearLogName() { - - logName_ = getDefaultInstance().getLogName(); - onChanged(); - return this; - } - /** - * optional string log_name = 1; - * - *
-     * Required. The resource name of the log to delete.  Example:
-     * `"projects/my-project/logs/syslog"`.
-     * 
- */ - public Builder setLogNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - logName_ = value; - onChanged(); - return this; - } - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - - // @@protoc_insertion_point(builder_scope:google.logging.v2.DeleteLogRequest) - } - - // @@protoc_insertion_point(class_scope:google.logging.v2.DeleteLogRequest) - private static final com.google.logging.v2.DeleteLogRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.logging.v2.DeleteLogRequest(); - } - - public static com.google.logging.v2.DeleteLogRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - public DeleteLogRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - try { - return new DeleteLogRequest(input, extensionRegistry); - } catch (RuntimeException e) { - if (e.getCause() instanceof - com.google.protobuf.InvalidProtocolBufferException) { - throw (com.google.protobuf.InvalidProtocolBufferException) - e.getCause(); - } - throw e; - } - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public com.google.logging.v2.DeleteLogRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/DeleteLogRequestOrBuilder.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/DeleteLogRequestOrBuilder.java deleted file mode 100644 index a647aa68759c..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/DeleteLogRequestOrBuilder.java +++ /dev/null @@ -1,29 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/logging/v2/logging.proto - -package com.google.logging.v2; - -public interface DeleteLogRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.logging.v2.DeleteLogRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * optional string log_name = 1; - * - *
-   * Required. The resource name of the log to delete.  Example:
-   * `"projects/my-project/logs/syslog"`.
-   * 
- */ - java.lang.String getLogName(); - /** - * optional string log_name = 1; - * - *
-   * Required. The resource name of the log to delete.  Example:
-   * `"projects/my-project/logs/syslog"`.
-   * 
- */ - com.google.protobuf.ByteString - getLogNameBytes(); -} diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/DeleteSinkRequest.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/DeleteSinkRequest.java deleted file mode 100644 index c8c100ac0ab9..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/DeleteSinkRequest.java +++ /dev/null @@ -1,483 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/logging/v2/logging_config.proto - -package com.google.logging.v2; - -/** - * Protobuf type {@code google.logging.v2.DeleteSinkRequest} - * - *
- * The parameters to `DeleteSink`.
- * 
- */ -public final class DeleteSinkRequest extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:google.logging.v2.DeleteSinkRequest) - DeleteSinkRequestOrBuilder { - // Use DeleteSinkRequest.newBuilder() to construct. - private DeleteSinkRequest(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - private DeleteSinkRequest() { - sinkName_ = ""; - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); - } - private DeleteSinkRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) { - this(); - int mutable_bitField0_ = 0; - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!input.skipField(tag)) { - done = true; - } - break; - } - case 10: { - String s = input.readStringRequireUtf8(); - - sinkName_ = s; - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw new RuntimeException(e.setUnfinishedMessage(this)); - } catch (java.io.IOException e) { - throw new RuntimeException( - new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this)); - } finally { - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.logging.v2.LoggingConfig.internal_static_google_logging_v2_DeleteSinkRequest_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.logging.v2.LoggingConfig.internal_static_google_logging_v2_DeleteSinkRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.logging.v2.DeleteSinkRequest.class, com.google.logging.v2.DeleteSinkRequest.Builder.class); - } - - public static final int SINK_NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object sinkName_; - /** - * optional string sink_name = 1; - * - *
-   * The resource name of the sink to delete.
-   * Example: `"projects/my-project-id/sinks/my-sink-id"`.
-   * 
- */ - public java.lang.String getSinkName() { - java.lang.Object ref = sinkName_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - sinkName_ = s; - return s; - } - } - /** - * optional string sink_name = 1; - * - *
-   * The resource name of the sink to delete.
-   * Example: `"projects/my-project-id/sinks/my-sink-id"`.
-   * 
- */ - public com.google.protobuf.ByteString - getSinkNameBytes() { - java.lang.Object ref = sinkName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - sinkName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getSinkNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessage.writeString(output, 1, sinkName_); - } - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getSinkNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessage.computeStringSize(1, sinkName_); - } - memoizedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - public static com.google.logging.v2.DeleteSinkRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.logging.v2.DeleteSinkRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.logging.v2.DeleteSinkRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.logging.v2.DeleteSinkRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.logging.v2.DeleteSinkRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.google.logging.v2.DeleteSinkRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static com.google.logging.v2.DeleteSinkRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static com.google.logging.v2.DeleteSinkRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static com.google.logging.v2.DeleteSinkRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.google.logging.v2.DeleteSinkRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.logging.v2.DeleteSinkRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code google.logging.v2.DeleteSinkRequest} - * - *
-   * The parameters to `DeleteSink`.
-   * 
- */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:google.logging.v2.DeleteSinkRequest) - com.google.logging.v2.DeleteSinkRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.logging.v2.LoggingConfig.internal_static_google_logging_v2_DeleteSinkRequest_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.logging.v2.LoggingConfig.internal_static_google_logging_v2_DeleteSinkRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.logging.v2.DeleteSinkRequest.class, com.google.logging.v2.DeleteSinkRequest.Builder.class); - } - - // Construct using com.google.logging.v2.DeleteSinkRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - public Builder clear() { - super.clear(); - sinkName_ = ""; - - return this; - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.logging.v2.LoggingConfig.internal_static_google_logging_v2_DeleteSinkRequest_descriptor; - } - - public com.google.logging.v2.DeleteSinkRequest getDefaultInstanceForType() { - return com.google.logging.v2.DeleteSinkRequest.getDefaultInstance(); - } - - public com.google.logging.v2.DeleteSinkRequest build() { - com.google.logging.v2.DeleteSinkRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.google.logging.v2.DeleteSinkRequest buildPartial() { - com.google.logging.v2.DeleteSinkRequest result = new com.google.logging.v2.DeleteSinkRequest(this); - result.sinkName_ = sinkName_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.logging.v2.DeleteSinkRequest) { - return mergeFrom((com.google.logging.v2.DeleteSinkRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.logging.v2.DeleteSinkRequest other) { - if (other == com.google.logging.v2.DeleteSinkRequest.getDefaultInstance()) return this; - if (!other.getSinkName().isEmpty()) { - sinkName_ = other.sinkName_; - onChanged(); - } - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.logging.v2.DeleteSinkRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.logging.v2.DeleteSinkRequest) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object sinkName_ = ""; - /** - * optional string sink_name = 1; - * - *
-     * The resource name of the sink to delete.
-     * Example: `"projects/my-project-id/sinks/my-sink-id"`.
-     * 
- */ - public java.lang.String getSinkName() { - java.lang.Object ref = sinkName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - sinkName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string sink_name = 1; - * - *
-     * The resource name of the sink to delete.
-     * Example: `"projects/my-project-id/sinks/my-sink-id"`.
-     * 
- */ - public com.google.protobuf.ByteString - getSinkNameBytes() { - java.lang.Object ref = sinkName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - sinkName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string sink_name = 1; - * - *
-     * The resource name of the sink to delete.
-     * Example: `"projects/my-project-id/sinks/my-sink-id"`.
-     * 
- */ - public Builder setSinkName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - sinkName_ = value; - onChanged(); - return this; - } - /** - * optional string sink_name = 1; - * - *
-     * The resource name of the sink to delete.
-     * Example: `"projects/my-project-id/sinks/my-sink-id"`.
-     * 
- */ - public Builder clearSinkName() { - - sinkName_ = getDefaultInstance().getSinkName(); - onChanged(); - return this; - } - /** - * optional string sink_name = 1; - * - *
-     * The resource name of the sink to delete.
-     * Example: `"projects/my-project-id/sinks/my-sink-id"`.
-     * 
- */ - public Builder setSinkNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - sinkName_ = value; - onChanged(); - return this; - } - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - - // @@protoc_insertion_point(builder_scope:google.logging.v2.DeleteSinkRequest) - } - - // @@protoc_insertion_point(class_scope:google.logging.v2.DeleteSinkRequest) - private static final com.google.logging.v2.DeleteSinkRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.logging.v2.DeleteSinkRequest(); - } - - public static com.google.logging.v2.DeleteSinkRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - public DeleteSinkRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - try { - return new DeleteSinkRequest(input, extensionRegistry); - } catch (RuntimeException e) { - if (e.getCause() instanceof - com.google.protobuf.InvalidProtocolBufferException) { - throw (com.google.protobuf.InvalidProtocolBufferException) - e.getCause(); - } - throw e; - } - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public com.google.logging.v2.DeleteSinkRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/DeleteSinkRequestOrBuilder.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/DeleteSinkRequestOrBuilder.java deleted file mode 100644 index 48db090deeac..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/DeleteSinkRequestOrBuilder.java +++ /dev/null @@ -1,29 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/logging/v2/logging_config.proto - -package com.google.logging.v2; - -public interface DeleteSinkRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.logging.v2.DeleteSinkRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * optional string sink_name = 1; - * - *
-   * The resource name of the sink to delete.
-   * Example: `"projects/my-project-id/sinks/my-sink-id"`.
-   * 
- */ - java.lang.String getSinkName(); - /** - * optional string sink_name = 1; - * - *
-   * The resource name of the sink to delete.
-   * Example: `"projects/my-project-id/sinks/my-sink-id"`.
-   * 
- */ - com.google.protobuf.ByteString - getSinkNameBytes(); -} diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/GetLogMetricRequest.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/GetLogMetricRequest.java deleted file mode 100644 index 21f08c3011f3..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/GetLogMetricRequest.java +++ /dev/null @@ -1,483 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/logging/v2/logging_metrics.proto - -package com.google.logging.v2; - -/** - * Protobuf type {@code google.logging.v2.GetLogMetricRequest} - * - *
- * The parameters to GetLogMetric.
- * 
- */ -public final class GetLogMetricRequest extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:google.logging.v2.GetLogMetricRequest) - GetLogMetricRequestOrBuilder { - // Use GetLogMetricRequest.newBuilder() to construct. - private GetLogMetricRequest(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - private GetLogMetricRequest() { - metricName_ = ""; - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); - } - private GetLogMetricRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) { - this(); - int mutable_bitField0_ = 0; - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!input.skipField(tag)) { - done = true; - } - break; - } - case 10: { - String s = input.readStringRequireUtf8(); - - metricName_ = s; - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw new RuntimeException(e.setUnfinishedMessage(this)); - } catch (java.io.IOException e) { - throw new RuntimeException( - new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this)); - } finally { - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.logging.v2.LoggingMetrics.internal_static_google_logging_v2_GetLogMetricRequest_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.logging.v2.LoggingMetrics.internal_static_google_logging_v2_GetLogMetricRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.logging.v2.GetLogMetricRequest.class, com.google.logging.v2.GetLogMetricRequest.Builder.class); - } - - public static final int METRIC_NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object metricName_; - /** - * optional string metric_name = 1; - * - *
-   * The resource name of the desired metric.
-   * Example: `"projects/my-project-id/metrics/my-metric-id"`.
-   * 
- */ - public java.lang.String getMetricName() { - java.lang.Object ref = metricName_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - metricName_ = s; - return s; - } - } - /** - * optional string metric_name = 1; - * - *
-   * The resource name of the desired metric.
-   * Example: `"projects/my-project-id/metrics/my-metric-id"`.
-   * 
- */ - public com.google.protobuf.ByteString - getMetricNameBytes() { - java.lang.Object ref = metricName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - metricName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getMetricNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessage.writeString(output, 1, metricName_); - } - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getMetricNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessage.computeStringSize(1, metricName_); - } - memoizedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - public static com.google.logging.v2.GetLogMetricRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.logging.v2.GetLogMetricRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.logging.v2.GetLogMetricRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.logging.v2.GetLogMetricRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.logging.v2.GetLogMetricRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.google.logging.v2.GetLogMetricRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static com.google.logging.v2.GetLogMetricRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static com.google.logging.v2.GetLogMetricRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static com.google.logging.v2.GetLogMetricRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.google.logging.v2.GetLogMetricRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.logging.v2.GetLogMetricRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code google.logging.v2.GetLogMetricRequest} - * - *
-   * The parameters to GetLogMetric.
-   * 
- */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:google.logging.v2.GetLogMetricRequest) - com.google.logging.v2.GetLogMetricRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.logging.v2.LoggingMetrics.internal_static_google_logging_v2_GetLogMetricRequest_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.logging.v2.LoggingMetrics.internal_static_google_logging_v2_GetLogMetricRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.logging.v2.GetLogMetricRequest.class, com.google.logging.v2.GetLogMetricRequest.Builder.class); - } - - // Construct using com.google.logging.v2.GetLogMetricRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - public Builder clear() { - super.clear(); - metricName_ = ""; - - return this; - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.logging.v2.LoggingMetrics.internal_static_google_logging_v2_GetLogMetricRequest_descriptor; - } - - public com.google.logging.v2.GetLogMetricRequest getDefaultInstanceForType() { - return com.google.logging.v2.GetLogMetricRequest.getDefaultInstance(); - } - - public com.google.logging.v2.GetLogMetricRequest build() { - com.google.logging.v2.GetLogMetricRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.google.logging.v2.GetLogMetricRequest buildPartial() { - com.google.logging.v2.GetLogMetricRequest result = new com.google.logging.v2.GetLogMetricRequest(this); - result.metricName_ = metricName_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.logging.v2.GetLogMetricRequest) { - return mergeFrom((com.google.logging.v2.GetLogMetricRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.logging.v2.GetLogMetricRequest other) { - if (other == com.google.logging.v2.GetLogMetricRequest.getDefaultInstance()) return this; - if (!other.getMetricName().isEmpty()) { - metricName_ = other.metricName_; - onChanged(); - } - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.logging.v2.GetLogMetricRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.logging.v2.GetLogMetricRequest) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object metricName_ = ""; - /** - * optional string metric_name = 1; - * - *
-     * The resource name of the desired metric.
-     * Example: `"projects/my-project-id/metrics/my-metric-id"`.
-     * 
- */ - public java.lang.String getMetricName() { - java.lang.Object ref = metricName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - metricName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string metric_name = 1; - * - *
-     * The resource name of the desired metric.
-     * Example: `"projects/my-project-id/metrics/my-metric-id"`.
-     * 
- */ - public com.google.protobuf.ByteString - getMetricNameBytes() { - java.lang.Object ref = metricName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - metricName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string metric_name = 1; - * - *
-     * The resource name of the desired metric.
-     * Example: `"projects/my-project-id/metrics/my-metric-id"`.
-     * 
- */ - public Builder setMetricName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - metricName_ = value; - onChanged(); - return this; - } - /** - * optional string metric_name = 1; - * - *
-     * The resource name of the desired metric.
-     * Example: `"projects/my-project-id/metrics/my-metric-id"`.
-     * 
- */ - public Builder clearMetricName() { - - metricName_ = getDefaultInstance().getMetricName(); - onChanged(); - return this; - } - /** - * optional string metric_name = 1; - * - *
-     * The resource name of the desired metric.
-     * Example: `"projects/my-project-id/metrics/my-metric-id"`.
-     * 
- */ - public Builder setMetricNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - metricName_ = value; - onChanged(); - return this; - } - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - - // @@protoc_insertion_point(builder_scope:google.logging.v2.GetLogMetricRequest) - } - - // @@protoc_insertion_point(class_scope:google.logging.v2.GetLogMetricRequest) - private static final com.google.logging.v2.GetLogMetricRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.logging.v2.GetLogMetricRequest(); - } - - public static com.google.logging.v2.GetLogMetricRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - public GetLogMetricRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - try { - return new GetLogMetricRequest(input, extensionRegistry); - } catch (RuntimeException e) { - if (e.getCause() instanceof - com.google.protobuf.InvalidProtocolBufferException) { - throw (com.google.protobuf.InvalidProtocolBufferException) - e.getCause(); - } - throw e; - } - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public com.google.logging.v2.GetLogMetricRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/GetLogMetricRequestOrBuilder.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/GetLogMetricRequestOrBuilder.java deleted file mode 100644 index 4c4a07d8919a..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/GetLogMetricRequestOrBuilder.java +++ /dev/null @@ -1,29 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/logging/v2/logging_metrics.proto - -package com.google.logging.v2; - -public interface GetLogMetricRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.logging.v2.GetLogMetricRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * optional string metric_name = 1; - * - *
-   * The resource name of the desired metric.
-   * Example: `"projects/my-project-id/metrics/my-metric-id"`.
-   * 
- */ - java.lang.String getMetricName(); - /** - * optional string metric_name = 1; - * - *
-   * The resource name of the desired metric.
-   * Example: `"projects/my-project-id/metrics/my-metric-id"`.
-   * 
- */ - com.google.protobuf.ByteString - getMetricNameBytes(); -} diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/GetSinkRequest.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/GetSinkRequest.java deleted file mode 100644 index 18899f0f7898..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/GetSinkRequest.java +++ /dev/null @@ -1,483 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/logging/v2/logging_config.proto - -package com.google.logging.v2; - -/** - * Protobuf type {@code google.logging.v2.GetSinkRequest} - * - *
- * The parameters to `GetSink`.
- * 
- */ -public final class GetSinkRequest extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:google.logging.v2.GetSinkRequest) - GetSinkRequestOrBuilder { - // Use GetSinkRequest.newBuilder() to construct. - private GetSinkRequest(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - private GetSinkRequest() { - sinkName_ = ""; - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); - } - private GetSinkRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) { - this(); - int mutable_bitField0_ = 0; - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!input.skipField(tag)) { - done = true; - } - break; - } - case 10: { - String s = input.readStringRequireUtf8(); - - sinkName_ = s; - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw new RuntimeException(e.setUnfinishedMessage(this)); - } catch (java.io.IOException e) { - throw new RuntimeException( - new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this)); - } finally { - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.logging.v2.LoggingConfig.internal_static_google_logging_v2_GetSinkRequest_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.logging.v2.LoggingConfig.internal_static_google_logging_v2_GetSinkRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.logging.v2.GetSinkRequest.class, com.google.logging.v2.GetSinkRequest.Builder.class); - } - - public static final int SINK_NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object sinkName_; - /** - * optional string sink_name = 1; - * - *
-   * The resource name of the sink to return.
-   * Example: `"projects/my-project-id/sinks/my-sink-id"`.
-   * 
- */ - public java.lang.String getSinkName() { - java.lang.Object ref = sinkName_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - sinkName_ = s; - return s; - } - } - /** - * optional string sink_name = 1; - * - *
-   * The resource name of the sink to return.
-   * Example: `"projects/my-project-id/sinks/my-sink-id"`.
-   * 
- */ - public com.google.protobuf.ByteString - getSinkNameBytes() { - java.lang.Object ref = sinkName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - sinkName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getSinkNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessage.writeString(output, 1, sinkName_); - } - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getSinkNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessage.computeStringSize(1, sinkName_); - } - memoizedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - public static com.google.logging.v2.GetSinkRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.logging.v2.GetSinkRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.logging.v2.GetSinkRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.logging.v2.GetSinkRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.logging.v2.GetSinkRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.google.logging.v2.GetSinkRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static com.google.logging.v2.GetSinkRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static com.google.logging.v2.GetSinkRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static com.google.logging.v2.GetSinkRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.google.logging.v2.GetSinkRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.logging.v2.GetSinkRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code google.logging.v2.GetSinkRequest} - * - *
-   * The parameters to `GetSink`.
-   * 
- */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:google.logging.v2.GetSinkRequest) - com.google.logging.v2.GetSinkRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.logging.v2.LoggingConfig.internal_static_google_logging_v2_GetSinkRequest_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.logging.v2.LoggingConfig.internal_static_google_logging_v2_GetSinkRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.logging.v2.GetSinkRequest.class, com.google.logging.v2.GetSinkRequest.Builder.class); - } - - // Construct using com.google.logging.v2.GetSinkRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - public Builder clear() { - super.clear(); - sinkName_ = ""; - - return this; - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.logging.v2.LoggingConfig.internal_static_google_logging_v2_GetSinkRequest_descriptor; - } - - public com.google.logging.v2.GetSinkRequest getDefaultInstanceForType() { - return com.google.logging.v2.GetSinkRequest.getDefaultInstance(); - } - - public com.google.logging.v2.GetSinkRequest build() { - com.google.logging.v2.GetSinkRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.google.logging.v2.GetSinkRequest buildPartial() { - com.google.logging.v2.GetSinkRequest result = new com.google.logging.v2.GetSinkRequest(this); - result.sinkName_ = sinkName_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.logging.v2.GetSinkRequest) { - return mergeFrom((com.google.logging.v2.GetSinkRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.logging.v2.GetSinkRequest other) { - if (other == com.google.logging.v2.GetSinkRequest.getDefaultInstance()) return this; - if (!other.getSinkName().isEmpty()) { - sinkName_ = other.sinkName_; - onChanged(); - } - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.logging.v2.GetSinkRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.logging.v2.GetSinkRequest) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object sinkName_ = ""; - /** - * optional string sink_name = 1; - * - *
-     * The resource name of the sink to return.
-     * Example: `"projects/my-project-id/sinks/my-sink-id"`.
-     * 
- */ - public java.lang.String getSinkName() { - java.lang.Object ref = sinkName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - sinkName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string sink_name = 1; - * - *
-     * The resource name of the sink to return.
-     * Example: `"projects/my-project-id/sinks/my-sink-id"`.
-     * 
- */ - public com.google.protobuf.ByteString - getSinkNameBytes() { - java.lang.Object ref = sinkName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - sinkName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string sink_name = 1; - * - *
-     * The resource name of the sink to return.
-     * Example: `"projects/my-project-id/sinks/my-sink-id"`.
-     * 
- */ - public Builder setSinkName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - sinkName_ = value; - onChanged(); - return this; - } - /** - * optional string sink_name = 1; - * - *
-     * The resource name of the sink to return.
-     * Example: `"projects/my-project-id/sinks/my-sink-id"`.
-     * 
- */ - public Builder clearSinkName() { - - sinkName_ = getDefaultInstance().getSinkName(); - onChanged(); - return this; - } - /** - * optional string sink_name = 1; - * - *
-     * The resource name of the sink to return.
-     * Example: `"projects/my-project-id/sinks/my-sink-id"`.
-     * 
- */ - public Builder setSinkNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - sinkName_ = value; - onChanged(); - return this; - } - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - - // @@protoc_insertion_point(builder_scope:google.logging.v2.GetSinkRequest) - } - - // @@protoc_insertion_point(class_scope:google.logging.v2.GetSinkRequest) - private static final com.google.logging.v2.GetSinkRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.logging.v2.GetSinkRequest(); - } - - public static com.google.logging.v2.GetSinkRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - public GetSinkRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - try { - return new GetSinkRequest(input, extensionRegistry); - } catch (RuntimeException e) { - if (e.getCause() instanceof - com.google.protobuf.InvalidProtocolBufferException) { - throw (com.google.protobuf.InvalidProtocolBufferException) - e.getCause(); - } - throw e; - } - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public com.google.logging.v2.GetSinkRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/GetSinkRequestOrBuilder.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/GetSinkRequestOrBuilder.java deleted file mode 100644 index 76bce80841a5..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/GetSinkRequestOrBuilder.java +++ /dev/null @@ -1,29 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/logging/v2/logging_config.proto - -package com.google.logging.v2; - -public interface GetSinkRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.logging.v2.GetSinkRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * optional string sink_name = 1; - * - *
-   * The resource name of the sink to return.
-   * Example: `"projects/my-project-id/sinks/my-sink-id"`.
-   * 
- */ - java.lang.String getSinkName(); - /** - * optional string sink_name = 1; - * - *
-   * The resource name of the sink to return.
-   * Example: `"projects/my-project-id/sinks/my-sink-id"`.
-   * 
- */ - com.google.protobuf.ByteString - getSinkNameBytes(); -} diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListLogEntriesRequest.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListLogEntriesRequest.java deleted file mode 100644 index 0c092432cd05..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListLogEntriesRequest.java +++ /dev/null @@ -1,1182 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/logging/v2/logging.proto - -package com.google.logging.v2; - -/** - * Protobuf type {@code google.logging.v2.ListLogEntriesRequest} - * - *
- * The parameters to `ListLogEntries`.
- * 
- */ -public final class ListLogEntriesRequest extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:google.logging.v2.ListLogEntriesRequest) - ListLogEntriesRequestOrBuilder { - // Use ListLogEntriesRequest.newBuilder() to construct. - private ListLogEntriesRequest(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - private ListLogEntriesRequest() { - projectIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; - filter_ = ""; - orderBy_ = ""; - pageSize_ = 0; - pageToken_ = ""; - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); - } - private ListLogEntriesRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) { - this(); - int mutable_bitField0_ = 0; - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!input.skipField(tag)) { - done = true; - } - break; - } - case 10: { - String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - projectIds_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - projectIds_.add(s); - break; - } - case 18: { - String s = input.readStringRequireUtf8(); - - filter_ = s; - break; - } - case 26: { - String s = input.readStringRequireUtf8(); - - orderBy_ = s; - break; - } - case 32: { - - pageSize_ = input.readInt32(); - break; - } - case 42: { - String s = input.readStringRequireUtf8(); - - pageToken_ = s; - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw new RuntimeException(e.setUnfinishedMessage(this)); - } catch (java.io.IOException e) { - throw new RuntimeException( - new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this)); - } finally { - if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - projectIds_ = projectIds_.getUnmodifiableView(); - } - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_ListLogEntriesRequest_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_ListLogEntriesRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.logging.v2.ListLogEntriesRequest.class, com.google.logging.v2.ListLogEntriesRequest.Builder.class); - } - - private int bitField0_; - public static final int PROJECT_IDS_FIELD_NUMBER = 1; - private com.google.protobuf.LazyStringList projectIds_; - /** - * repeated string project_ids = 1; - * - *
-   * Required. One or more project IDs or project numbers from which to retrieve
-   * log entries.  Examples of a project ID: `"my-project-1A"`, `"1234567890"`.
-   * 
- */ - public com.google.protobuf.ProtocolStringList - getProjectIdsList() { - return projectIds_; - } - /** - * repeated string project_ids = 1; - * - *
-   * Required. One or more project IDs or project numbers from which to retrieve
-   * log entries.  Examples of a project ID: `"my-project-1A"`, `"1234567890"`.
-   * 
- */ - public int getProjectIdsCount() { - return projectIds_.size(); - } - /** - * repeated string project_ids = 1; - * - *
-   * Required. One or more project IDs or project numbers from which to retrieve
-   * log entries.  Examples of a project ID: `"my-project-1A"`, `"1234567890"`.
-   * 
- */ - public java.lang.String getProjectIds(int index) { - return projectIds_.get(index); - } - /** - * repeated string project_ids = 1; - * - *
-   * Required. One or more project IDs or project numbers from which to retrieve
-   * log entries.  Examples of a project ID: `"my-project-1A"`, `"1234567890"`.
-   * 
- */ - public com.google.protobuf.ByteString - getProjectIdsBytes(int index) { - return projectIds_.getByteString(index); - } - - public static final int FILTER_FIELD_NUMBER = 2; - private volatile java.lang.Object filter_; - /** - * optional string filter = 2; - * - *
-   * Optional. An [advanced logs filter](/logging/docs/view/advanced_filters).
-   * The filter is compared against all log entries in the projects specified by
-   * `projectIds`.  Only entries that match the filter are retrieved.  An empty
-   * filter matches all log entries.
-   * 
- */ - public java.lang.String getFilter() { - java.lang.Object ref = filter_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - filter_ = s; - return s; - } - } - /** - * optional string filter = 2; - * - *
-   * Optional. An [advanced logs filter](/logging/docs/view/advanced_filters).
-   * The filter is compared against all log entries in the projects specified by
-   * `projectIds`.  Only entries that match the filter are retrieved.  An empty
-   * filter matches all log entries.
-   * 
- */ - public com.google.protobuf.ByteString - getFilterBytes() { - java.lang.Object ref = filter_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - filter_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ORDER_BY_FIELD_NUMBER = 3; - private volatile java.lang.Object orderBy_; - /** - * optional string order_by = 3; - * - *
-   * Optional. How the results should be sorted.  Presently, the only permitted
-   * values are `"timestamp"` (default) and `"timestamp desc"`.  The first
-   * option returns entries in order of increasing values of
-   * `LogEntry.timestamp` (oldest first), and the second option returns entries
-   * in order of decreasing timestamps (newest first).  Entries with equal
-   * timestamps are returned in order of `LogEntry.insertId`.
-   * 
- */ - public java.lang.String getOrderBy() { - java.lang.Object ref = orderBy_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - orderBy_ = s; - return s; - } - } - /** - * optional string order_by = 3; - * - *
-   * Optional. How the results should be sorted.  Presently, the only permitted
-   * values are `"timestamp"` (default) and `"timestamp desc"`.  The first
-   * option returns entries in order of increasing values of
-   * `LogEntry.timestamp` (oldest first), and the second option returns entries
-   * in order of decreasing timestamps (newest first).  Entries with equal
-   * timestamps are returned in order of `LogEntry.insertId`.
-   * 
- */ - public com.google.protobuf.ByteString - getOrderByBytes() { - java.lang.Object ref = orderBy_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - orderBy_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PAGE_SIZE_FIELD_NUMBER = 4; - private int pageSize_; - /** - * optional int32 page_size = 4; - * - *
-   * Optional. The maximum number of results to return from this request.  Fewer
-   * results might be returned. You must check for the 'nextPageToken` result to
-   * determine if additional results are available, which you can retrieve by
-   * passing the `nextPageToken` value in the `pageToken` parameter to the next
-   * request.
-   * 
- */ - public int getPageSize() { - return pageSize_; - } - - public static final int PAGE_TOKEN_FIELD_NUMBER = 5; - private volatile java.lang.Object pageToken_; - /** - * optional string page_token = 5; - * - *
-   * Optional. If the `pageToken` request parameter is supplied, then the next
-   * page of results in the set are retrieved.  The `pageToken` parameter must
-   * be set with the value of the `nextPageToken` result parameter from the
-   * previous request.  The values of `projectIds`, `filter`, and `orderBy` must
-   * be the same as in the previous request.
-   * 
- */ - public java.lang.String getPageToken() { - java.lang.Object ref = pageToken_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - pageToken_ = s; - return s; - } - } - /** - * optional string page_token = 5; - * - *
-   * Optional. If the `pageToken` request parameter is supplied, then the next
-   * page of results in the set are retrieved.  The `pageToken` parameter must
-   * be set with the value of the `nextPageToken` result parameter from the
-   * previous request.  The values of `projectIds`, `filter`, and `orderBy` must
-   * be the same as in the previous request.
-   * 
- */ - public com.google.protobuf.ByteString - getPageTokenBytes() { - java.lang.Object ref = pageToken_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - pageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < projectIds_.size(); i++) { - com.google.protobuf.GeneratedMessage.writeString(output, 1, projectIds_.getRaw(i)); - } - if (!getFilterBytes().isEmpty()) { - com.google.protobuf.GeneratedMessage.writeString(output, 2, filter_); - } - if (!getOrderByBytes().isEmpty()) { - com.google.protobuf.GeneratedMessage.writeString(output, 3, orderBy_); - } - if (pageSize_ != 0) { - output.writeInt32(4, pageSize_); - } - if (!getPageTokenBytes().isEmpty()) { - com.google.protobuf.GeneratedMessage.writeString(output, 5, pageToken_); - } - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - for (int i = 0; i < projectIds_.size(); i++) { - dataSize += computeStringSizeNoTag(projectIds_.getRaw(i)); - } - size += dataSize; - size += 1 * getProjectIdsList().size(); - } - if (!getFilterBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessage.computeStringSize(2, filter_); - } - if (!getOrderByBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessage.computeStringSize(3, orderBy_); - } - if (pageSize_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(4, pageSize_); - } - if (!getPageTokenBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessage.computeStringSize(5, pageToken_); - } - memoizedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - public static com.google.logging.v2.ListLogEntriesRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.logging.v2.ListLogEntriesRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.logging.v2.ListLogEntriesRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.logging.v2.ListLogEntriesRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.logging.v2.ListLogEntriesRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.google.logging.v2.ListLogEntriesRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static com.google.logging.v2.ListLogEntriesRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static com.google.logging.v2.ListLogEntriesRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static com.google.logging.v2.ListLogEntriesRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.google.logging.v2.ListLogEntriesRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.logging.v2.ListLogEntriesRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code google.logging.v2.ListLogEntriesRequest} - * - *
-   * The parameters to `ListLogEntries`.
-   * 
- */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:google.logging.v2.ListLogEntriesRequest) - com.google.logging.v2.ListLogEntriesRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_ListLogEntriesRequest_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_ListLogEntriesRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.logging.v2.ListLogEntriesRequest.class, com.google.logging.v2.ListLogEntriesRequest.Builder.class); - } - - // Construct using com.google.logging.v2.ListLogEntriesRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - public Builder clear() { - super.clear(); - projectIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - filter_ = ""; - - orderBy_ = ""; - - pageSize_ = 0; - - pageToken_ = ""; - - return this; - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_ListLogEntriesRequest_descriptor; - } - - public com.google.logging.v2.ListLogEntriesRequest getDefaultInstanceForType() { - return com.google.logging.v2.ListLogEntriesRequest.getDefaultInstance(); - } - - public com.google.logging.v2.ListLogEntriesRequest build() { - com.google.logging.v2.ListLogEntriesRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.google.logging.v2.ListLogEntriesRequest buildPartial() { - com.google.logging.v2.ListLogEntriesRequest result = new com.google.logging.v2.ListLogEntriesRequest(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - projectIds_ = projectIds_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.projectIds_ = projectIds_; - result.filter_ = filter_; - result.orderBy_ = orderBy_; - result.pageSize_ = pageSize_; - result.pageToken_ = pageToken_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.logging.v2.ListLogEntriesRequest) { - return mergeFrom((com.google.logging.v2.ListLogEntriesRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.logging.v2.ListLogEntriesRequest other) { - if (other == com.google.logging.v2.ListLogEntriesRequest.getDefaultInstance()) return this; - if (!other.projectIds_.isEmpty()) { - if (projectIds_.isEmpty()) { - projectIds_ = other.projectIds_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureProjectIdsIsMutable(); - projectIds_.addAll(other.projectIds_); - } - onChanged(); - } - if (!other.getFilter().isEmpty()) { - filter_ = other.filter_; - onChanged(); - } - if (!other.getOrderBy().isEmpty()) { - orderBy_ = other.orderBy_; - onChanged(); - } - if (other.getPageSize() != 0) { - setPageSize(other.getPageSize()); - } - if (!other.getPageToken().isEmpty()) { - pageToken_ = other.pageToken_; - onChanged(); - } - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.logging.v2.ListLogEntriesRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.logging.v2.ListLogEntriesRequest) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private com.google.protobuf.LazyStringList projectIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureProjectIdsIsMutable() { - if (!((bitField0_ & 0x00000001) == 0x00000001)) { - projectIds_ = new com.google.protobuf.LazyStringArrayList(projectIds_); - bitField0_ |= 0x00000001; - } - } - /** - * repeated string project_ids = 1; - * - *
-     * Required. One or more project IDs or project numbers from which to retrieve
-     * log entries.  Examples of a project ID: `"my-project-1A"`, `"1234567890"`.
-     * 
- */ - public com.google.protobuf.ProtocolStringList - getProjectIdsList() { - return projectIds_.getUnmodifiableView(); - } - /** - * repeated string project_ids = 1; - * - *
-     * Required. One or more project IDs or project numbers from which to retrieve
-     * log entries.  Examples of a project ID: `"my-project-1A"`, `"1234567890"`.
-     * 
- */ - public int getProjectIdsCount() { - return projectIds_.size(); - } - /** - * repeated string project_ids = 1; - * - *
-     * Required. One or more project IDs or project numbers from which to retrieve
-     * log entries.  Examples of a project ID: `"my-project-1A"`, `"1234567890"`.
-     * 
- */ - public java.lang.String getProjectIds(int index) { - return projectIds_.get(index); - } - /** - * repeated string project_ids = 1; - * - *
-     * Required. One or more project IDs or project numbers from which to retrieve
-     * log entries.  Examples of a project ID: `"my-project-1A"`, `"1234567890"`.
-     * 
- */ - public com.google.protobuf.ByteString - getProjectIdsBytes(int index) { - return projectIds_.getByteString(index); - } - /** - * repeated string project_ids = 1; - * - *
-     * Required. One or more project IDs or project numbers from which to retrieve
-     * log entries.  Examples of a project ID: `"my-project-1A"`, `"1234567890"`.
-     * 
- */ - public Builder setProjectIds( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureProjectIdsIsMutable(); - projectIds_.set(index, value); - onChanged(); - return this; - } - /** - * repeated string project_ids = 1; - * - *
-     * Required. One or more project IDs or project numbers from which to retrieve
-     * log entries.  Examples of a project ID: `"my-project-1A"`, `"1234567890"`.
-     * 
- */ - public Builder addProjectIds( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureProjectIdsIsMutable(); - projectIds_.add(value); - onChanged(); - return this; - } - /** - * repeated string project_ids = 1; - * - *
-     * Required. One or more project IDs or project numbers from which to retrieve
-     * log entries.  Examples of a project ID: `"my-project-1A"`, `"1234567890"`.
-     * 
- */ - public Builder addAllProjectIds( - java.lang.Iterable values) { - ensureProjectIdsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, projectIds_); - onChanged(); - return this; - } - /** - * repeated string project_ids = 1; - * - *
-     * Required. One or more project IDs or project numbers from which to retrieve
-     * log entries.  Examples of a project ID: `"my-project-1A"`, `"1234567890"`.
-     * 
- */ - public Builder clearProjectIds() { - projectIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * repeated string project_ids = 1; - * - *
-     * Required. One or more project IDs or project numbers from which to retrieve
-     * log entries.  Examples of a project ID: `"my-project-1A"`, `"1234567890"`.
-     * 
- */ - public Builder addProjectIdsBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureProjectIdsIsMutable(); - projectIds_.add(value); - onChanged(); - return this; - } - - private java.lang.Object filter_ = ""; - /** - * optional string filter = 2; - * - *
-     * Optional. An [advanced logs filter](/logging/docs/view/advanced_filters).
-     * The filter is compared against all log entries in the projects specified by
-     * `projectIds`.  Only entries that match the filter are retrieved.  An empty
-     * filter matches all log entries.
-     * 
- */ - public java.lang.String getFilter() { - java.lang.Object ref = filter_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - filter_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string filter = 2; - * - *
-     * Optional. An [advanced logs filter](/logging/docs/view/advanced_filters).
-     * The filter is compared against all log entries in the projects specified by
-     * `projectIds`.  Only entries that match the filter are retrieved.  An empty
-     * filter matches all log entries.
-     * 
- */ - public com.google.protobuf.ByteString - getFilterBytes() { - java.lang.Object ref = filter_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - filter_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string filter = 2; - * - *
-     * Optional. An [advanced logs filter](/logging/docs/view/advanced_filters).
-     * The filter is compared against all log entries in the projects specified by
-     * `projectIds`.  Only entries that match the filter are retrieved.  An empty
-     * filter matches all log entries.
-     * 
- */ - public Builder setFilter( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - filter_ = value; - onChanged(); - return this; - } - /** - * optional string filter = 2; - * - *
-     * Optional. An [advanced logs filter](/logging/docs/view/advanced_filters).
-     * The filter is compared against all log entries in the projects specified by
-     * `projectIds`.  Only entries that match the filter are retrieved.  An empty
-     * filter matches all log entries.
-     * 
- */ - public Builder clearFilter() { - - filter_ = getDefaultInstance().getFilter(); - onChanged(); - return this; - } - /** - * optional string filter = 2; - * - *
-     * Optional. An [advanced logs filter](/logging/docs/view/advanced_filters).
-     * The filter is compared against all log entries in the projects specified by
-     * `projectIds`.  Only entries that match the filter are retrieved.  An empty
-     * filter matches all log entries.
-     * 
- */ - public Builder setFilterBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - filter_ = value; - onChanged(); - return this; - } - - private java.lang.Object orderBy_ = ""; - /** - * optional string order_by = 3; - * - *
-     * Optional. How the results should be sorted.  Presently, the only permitted
-     * values are `"timestamp"` (default) and `"timestamp desc"`.  The first
-     * option returns entries in order of increasing values of
-     * `LogEntry.timestamp` (oldest first), and the second option returns entries
-     * in order of decreasing timestamps (newest first).  Entries with equal
-     * timestamps are returned in order of `LogEntry.insertId`.
-     * 
- */ - public java.lang.String getOrderBy() { - java.lang.Object ref = orderBy_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - orderBy_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string order_by = 3; - * - *
-     * Optional. How the results should be sorted.  Presently, the only permitted
-     * values are `"timestamp"` (default) and `"timestamp desc"`.  The first
-     * option returns entries in order of increasing values of
-     * `LogEntry.timestamp` (oldest first), and the second option returns entries
-     * in order of decreasing timestamps (newest first).  Entries with equal
-     * timestamps are returned in order of `LogEntry.insertId`.
-     * 
- */ - public com.google.protobuf.ByteString - getOrderByBytes() { - java.lang.Object ref = orderBy_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - orderBy_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string order_by = 3; - * - *
-     * Optional. How the results should be sorted.  Presently, the only permitted
-     * values are `"timestamp"` (default) and `"timestamp desc"`.  The first
-     * option returns entries in order of increasing values of
-     * `LogEntry.timestamp` (oldest first), and the second option returns entries
-     * in order of decreasing timestamps (newest first).  Entries with equal
-     * timestamps are returned in order of `LogEntry.insertId`.
-     * 
- */ - public Builder setOrderBy( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - orderBy_ = value; - onChanged(); - return this; - } - /** - * optional string order_by = 3; - * - *
-     * Optional. How the results should be sorted.  Presently, the only permitted
-     * values are `"timestamp"` (default) and `"timestamp desc"`.  The first
-     * option returns entries in order of increasing values of
-     * `LogEntry.timestamp` (oldest first), and the second option returns entries
-     * in order of decreasing timestamps (newest first).  Entries with equal
-     * timestamps are returned in order of `LogEntry.insertId`.
-     * 
- */ - public Builder clearOrderBy() { - - orderBy_ = getDefaultInstance().getOrderBy(); - onChanged(); - return this; - } - /** - * optional string order_by = 3; - * - *
-     * Optional. How the results should be sorted.  Presently, the only permitted
-     * values are `"timestamp"` (default) and `"timestamp desc"`.  The first
-     * option returns entries in order of increasing values of
-     * `LogEntry.timestamp` (oldest first), and the second option returns entries
-     * in order of decreasing timestamps (newest first).  Entries with equal
-     * timestamps are returned in order of `LogEntry.insertId`.
-     * 
- */ - public Builder setOrderByBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - orderBy_ = value; - onChanged(); - return this; - } - - private int pageSize_ ; - /** - * optional int32 page_size = 4; - * - *
-     * Optional. The maximum number of results to return from this request.  Fewer
-     * results might be returned. You must check for the 'nextPageToken` result to
-     * determine if additional results are available, which you can retrieve by
-     * passing the `nextPageToken` value in the `pageToken` parameter to the next
-     * request.
-     * 
- */ - public int getPageSize() { - return pageSize_; - } - /** - * optional int32 page_size = 4; - * - *
-     * Optional. The maximum number of results to return from this request.  Fewer
-     * results might be returned. You must check for the 'nextPageToken` result to
-     * determine if additional results are available, which you can retrieve by
-     * passing the `nextPageToken` value in the `pageToken` parameter to the next
-     * request.
-     * 
- */ - public Builder setPageSize(int value) { - - pageSize_ = value; - onChanged(); - return this; - } - /** - * optional int32 page_size = 4; - * - *
-     * Optional. The maximum number of results to return from this request.  Fewer
-     * results might be returned. You must check for the 'nextPageToken` result to
-     * determine if additional results are available, which you can retrieve by
-     * passing the `nextPageToken` value in the `pageToken` parameter to the next
-     * request.
-     * 
- */ - public Builder clearPageSize() { - - pageSize_ = 0; - onChanged(); - return this; - } - - private java.lang.Object pageToken_ = ""; - /** - * optional string page_token = 5; - * - *
-     * Optional. If the `pageToken` request parameter is supplied, then the next
-     * page of results in the set are retrieved.  The `pageToken` parameter must
-     * be set with the value of the `nextPageToken` result parameter from the
-     * previous request.  The values of `projectIds`, `filter`, and `orderBy` must
-     * be the same as in the previous request.
-     * 
- */ - public java.lang.String getPageToken() { - java.lang.Object ref = pageToken_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - pageToken_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string page_token = 5; - * - *
-     * Optional. If the `pageToken` request parameter is supplied, then the next
-     * page of results in the set are retrieved.  The `pageToken` parameter must
-     * be set with the value of the `nextPageToken` result parameter from the
-     * previous request.  The values of `projectIds`, `filter`, and `orderBy` must
-     * be the same as in the previous request.
-     * 
- */ - public com.google.protobuf.ByteString - getPageTokenBytes() { - java.lang.Object ref = pageToken_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - pageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string page_token = 5; - * - *
-     * Optional. If the `pageToken` request parameter is supplied, then the next
-     * page of results in the set are retrieved.  The `pageToken` parameter must
-     * be set with the value of the `nextPageToken` result parameter from the
-     * previous request.  The values of `projectIds`, `filter`, and `orderBy` must
-     * be the same as in the previous request.
-     * 
- */ - public Builder setPageToken( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - pageToken_ = value; - onChanged(); - return this; - } - /** - * optional string page_token = 5; - * - *
-     * Optional. If the `pageToken` request parameter is supplied, then the next
-     * page of results in the set are retrieved.  The `pageToken` parameter must
-     * be set with the value of the `nextPageToken` result parameter from the
-     * previous request.  The values of `projectIds`, `filter`, and `orderBy` must
-     * be the same as in the previous request.
-     * 
- */ - public Builder clearPageToken() { - - pageToken_ = getDefaultInstance().getPageToken(); - onChanged(); - return this; - } - /** - * optional string page_token = 5; - * - *
-     * Optional. If the `pageToken` request parameter is supplied, then the next
-     * page of results in the set are retrieved.  The `pageToken` parameter must
-     * be set with the value of the `nextPageToken` result parameter from the
-     * previous request.  The values of `projectIds`, `filter`, and `orderBy` must
-     * be the same as in the previous request.
-     * 
- */ - public Builder setPageTokenBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - pageToken_ = value; - onChanged(); - return this; - } - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - - // @@protoc_insertion_point(builder_scope:google.logging.v2.ListLogEntriesRequest) - } - - // @@protoc_insertion_point(class_scope:google.logging.v2.ListLogEntriesRequest) - private static final com.google.logging.v2.ListLogEntriesRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.logging.v2.ListLogEntriesRequest(); - } - - public static com.google.logging.v2.ListLogEntriesRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - public ListLogEntriesRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - try { - return new ListLogEntriesRequest(input, extensionRegistry); - } catch (RuntimeException e) { - if (e.getCause() instanceof - com.google.protobuf.InvalidProtocolBufferException) { - throw (com.google.protobuf.InvalidProtocolBufferException) - e.getCause(); - } - throw e; - } - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public com.google.logging.v2.ListLogEntriesRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListLogEntriesRequestOrBuilder.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListLogEntriesRequestOrBuilder.java deleted file mode 100644 index 9b10254aaf5d..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListLogEntriesRequestOrBuilder.java +++ /dev/null @@ -1,139 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/logging/v2/logging.proto - -package com.google.logging.v2; - -public interface ListLogEntriesRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.logging.v2.ListLogEntriesRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated string project_ids = 1; - * - *
-   * Required. One or more project IDs or project numbers from which to retrieve
-   * log entries.  Examples of a project ID: `"my-project-1A"`, `"1234567890"`.
-   * 
- */ - com.google.protobuf.ProtocolStringList - getProjectIdsList(); - /** - * repeated string project_ids = 1; - * - *
-   * Required. One or more project IDs or project numbers from which to retrieve
-   * log entries.  Examples of a project ID: `"my-project-1A"`, `"1234567890"`.
-   * 
- */ - int getProjectIdsCount(); - /** - * repeated string project_ids = 1; - * - *
-   * Required. One or more project IDs or project numbers from which to retrieve
-   * log entries.  Examples of a project ID: `"my-project-1A"`, `"1234567890"`.
-   * 
- */ - java.lang.String getProjectIds(int index); - /** - * repeated string project_ids = 1; - * - *
-   * Required. One or more project IDs or project numbers from which to retrieve
-   * log entries.  Examples of a project ID: `"my-project-1A"`, `"1234567890"`.
-   * 
- */ - com.google.protobuf.ByteString - getProjectIdsBytes(int index); - - /** - * optional string filter = 2; - * - *
-   * Optional. An [advanced logs filter](/logging/docs/view/advanced_filters).
-   * The filter is compared against all log entries in the projects specified by
-   * `projectIds`.  Only entries that match the filter are retrieved.  An empty
-   * filter matches all log entries.
-   * 
- */ - java.lang.String getFilter(); - /** - * optional string filter = 2; - * - *
-   * Optional. An [advanced logs filter](/logging/docs/view/advanced_filters).
-   * The filter is compared against all log entries in the projects specified by
-   * `projectIds`.  Only entries that match the filter are retrieved.  An empty
-   * filter matches all log entries.
-   * 
- */ - com.google.protobuf.ByteString - getFilterBytes(); - - /** - * optional string order_by = 3; - * - *
-   * Optional. How the results should be sorted.  Presently, the only permitted
-   * values are `"timestamp"` (default) and `"timestamp desc"`.  The first
-   * option returns entries in order of increasing values of
-   * `LogEntry.timestamp` (oldest first), and the second option returns entries
-   * in order of decreasing timestamps (newest first).  Entries with equal
-   * timestamps are returned in order of `LogEntry.insertId`.
-   * 
- */ - java.lang.String getOrderBy(); - /** - * optional string order_by = 3; - * - *
-   * Optional. How the results should be sorted.  Presently, the only permitted
-   * values are `"timestamp"` (default) and `"timestamp desc"`.  The first
-   * option returns entries in order of increasing values of
-   * `LogEntry.timestamp` (oldest first), and the second option returns entries
-   * in order of decreasing timestamps (newest first).  Entries with equal
-   * timestamps are returned in order of `LogEntry.insertId`.
-   * 
- */ - com.google.protobuf.ByteString - getOrderByBytes(); - - /** - * optional int32 page_size = 4; - * - *
-   * Optional. The maximum number of results to return from this request.  Fewer
-   * results might be returned. You must check for the 'nextPageToken` result to
-   * determine if additional results are available, which you can retrieve by
-   * passing the `nextPageToken` value in the `pageToken` parameter to the next
-   * request.
-   * 
- */ - int getPageSize(); - - /** - * optional string page_token = 5; - * - *
-   * Optional. If the `pageToken` request parameter is supplied, then the next
-   * page of results in the set are retrieved.  The `pageToken` parameter must
-   * be set with the value of the `nextPageToken` result parameter from the
-   * previous request.  The values of `projectIds`, `filter`, and `orderBy` must
-   * be the same as in the previous request.
-   * 
- */ - java.lang.String getPageToken(); - /** - * optional string page_token = 5; - * - *
-   * Optional. If the `pageToken` request parameter is supplied, then the next
-   * page of results in the set are retrieved.  The `pageToken` parameter must
-   * be set with the value of the `nextPageToken` result parameter from the
-   * previous request.  The values of `projectIds`, `filter`, and `orderBy` must
-   * be the same as in the previous request.
-   * 
- */ - com.google.protobuf.ByteString - getPageTokenBytes(); -} diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListLogEntriesResponse.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListLogEntriesResponse.java deleted file mode 100644 index 9974ae132ae1..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListLogEntriesResponse.java +++ /dev/null @@ -1,923 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/logging/v2/logging.proto - -package com.google.logging.v2; - -/** - * Protobuf type {@code google.logging.v2.ListLogEntriesResponse} - * - *
- * Result returned from `ListLogEntries`.
- * 
- */ -public final class ListLogEntriesResponse extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:google.logging.v2.ListLogEntriesResponse) - ListLogEntriesResponseOrBuilder { - // Use ListLogEntriesResponse.newBuilder() to construct. - private ListLogEntriesResponse(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - private ListLogEntriesResponse() { - entries_ = java.util.Collections.emptyList(); - nextPageToken_ = ""; - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); - } - private ListLogEntriesResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) { - this(); - int mutable_bitField0_ = 0; - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!input.skipField(tag)) { - done = true; - } - break; - } - case 10: { - if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - entries_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - entries_.add(input.readMessage(com.google.logging.v2.LogEntry.parser(), extensionRegistry)); - break; - } - case 18: { - String s = input.readStringRequireUtf8(); - - nextPageToken_ = s; - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw new RuntimeException(e.setUnfinishedMessage(this)); - } catch (java.io.IOException e) { - throw new RuntimeException( - new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this)); - } finally { - if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - entries_ = java.util.Collections.unmodifiableList(entries_); - } - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_ListLogEntriesResponse_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_ListLogEntriesResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.logging.v2.ListLogEntriesResponse.class, com.google.logging.v2.ListLogEntriesResponse.Builder.class); - } - - private int bitField0_; - public static final int ENTRIES_FIELD_NUMBER = 1; - private java.util.List entries_; - /** - * repeated .google.logging.v2.LogEntry entries = 1; - * - *
-   * A list of log entries.
-   * 
- */ - public java.util.List getEntriesList() { - return entries_; - } - /** - * repeated .google.logging.v2.LogEntry entries = 1; - * - *
-   * A list of log entries.
-   * 
- */ - public java.util.List - getEntriesOrBuilderList() { - return entries_; - } - /** - * repeated .google.logging.v2.LogEntry entries = 1; - * - *
-   * A list of log entries.
-   * 
- */ - public int getEntriesCount() { - return entries_.size(); - } - /** - * repeated .google.logging.v2.LogEntry entries = 1; - * - *
-   * A list of log entries.
-   * 
- */ - public com.google.logging.v2.LogEntry getEntries(int index) { - return entries_.get(index); - } - /** - * repeated .google.logging.v2.LogEntry entries = 1; - * - *
-   * A list of log entries.
-   * 
- */ - public com.google.logging.v2.LogEntryOrBuilder getEntriesOrBuilder( - int index) { - return entries_.get(index); - } - - public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; - private volatile java.lang.Object nextPageToken_; - /** - * optional string next_page_token = 2; - * - *
-   * If there are more results than were returned, then `nextPageToken` is
-   * given a value in the response.  To get the next batch of results, call
-   * this method again using the value of `nextPageToken` as `pageToken`.
-   * 
- */ - public java.lang.String getNextPageToken() { - java.lang.Object ref = nextPageToken_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - nextPageToken_ = s; - return s; - } - } - /** - * optional string next_page_token = 2; - * - *
-   * If there are more results than were returned, then `nextPageToken` is
-   * given a value in the response.  To get the next batch of results, call
-   * this method again using the value of `nextPageToken` as `pageToken`.
-   * 
- */ - public com.google.protobuf.ByteString - getNextPageTokenBytes() { - java.lang.Object ref = nextPageToken_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - nextPageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < entries_.size(); i++) { - output.writeMessage(1, entries_.get(i)); - } - if (!getNextPageTokenBytes().isEmpty()) { - com.google.protobuf.GeneratedMessage.writeString(output, 2, nextPageToken_); - } - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < entries_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, entries_.get(i)); - } - if (!getNextPageTokenBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessage.computeStringSize(2, nextPageToken_); - } - memoizedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - public static com.google.logging.v2.ListLogEntriesResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.logging.v2.ListLogEntriesResponse parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.logging.v2.ListLogEntriesResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.logging.v2.ListLogEntriesResponse parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.logging.v2.ListLogEntriesResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.google.logging.v2.ListLogEntriesResponse parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static com.google.logging.v2.ListLogEntriesResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static com.google.logging.v2.ListLogEntriesResponse parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static com.google.logging.v2.ListLogEntriesResponse parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.google.logging.v2.ListLogEntriesResponse parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.logging.v2.ListLogEntriesResponse prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code google.logging.v2.ListLogEntriesResponse} - * - *
-   * Result returned from `ListLogEntries`.
-   * 
- */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:google.logging.v2.ListLogEntriesResponse) - com.google.logging.v2.ListLogEntriesResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_ListLogEntriesResponse_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_ListLogEntriesResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.logging.v2.ListLogEntriesResponse.class, com.google.logging.v2.ListLogEntriesResponse.Builder.class); - } - - // Construct using com.google.logging.v2.ListLogEntriesResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - getEntriesFieldBuilder(); - } - } - public Builder clear() { - super.clear(); - if (entriesBuilder_ == null) { - entries_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - entriesBuilder_.clear(); - } - nextPageToken_ = ""; - - return this; - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_ListLogEntriesResponse_descriptor; - } - - public com.google.logging.v2.ListLogEntriesResponse getDefaultInstanceForType() { - return com.google.logging.v2.ListLogEntriesResponse.getDefaultInstance(); - } - - public com.google.logging.v2.ListLogEntriesResponse build() { - com.google.logging.v2.ListLogEntriesResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.google.logging.v2.ListLogEntriesResponse buildPartial() { - com.google.logging.v2.ListLogEntriesResponse result = new com.google.logging.v2.ListLogEntriesResponse(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (entriesBuilder_ == null) { - if (((bitField0_ & 0x00000001) == 0x00000001)) { - entries_ = java.util.Collections.unmodifiableList(entries_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.entries_ = entries_; - } else { - result.entries_ = entriesBuilder_.build(); - } - result.nextPageToken_ = nextPageToken_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.logging.v2.ListLogEntriesResponse) { - return mergeFrom((com.google.logging.v2.ListLogEntriesResponse)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.logging.v2.ListLogEntriesResponse other) { - if (other == com.google.logging.v2.ListLogEntriesResponse.getDefaultInstance()) return this; - if (entriesBuilder_ == null) { - if (!other.entries_.isEmpty()) { - if (entries_.isEmpty()) { - entries_ = other.entries_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureEntriesIsMutable(); - entries_.addAll(other.entries_); - } - onChanged(); - } - } else { - if (!other.entries_.isEmpty()) { - if (entriesBuilder_.isEmpty()) { - entriesBuilder_.dispose(); - entriesBuilder_ = null; - entries_ = other.entries_; - bitField0_ = (bitField0_ & ~0x00000001); - entriesBuilder_ = - com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? - getEntriesFieldBuilder() : null; - } else { - entriesBuilder_.addAllMessages(other.entries_); - } - } - } - if (!other.getNextPageToken().isEmpty()) { - nextPageToken_ = other.nextPageToken_; - onChanged(); - } - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.logging.v2.ListLogEntriesResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.logging.v2.ListLogEntriesResponse) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List entries_ = - java.util.Collections.emptyList(); - private void ensureEntriesIsMutable() { - if (!((bitField0_ & 0x00000001) == 0x00000001)) { - entries_ = new java.util.ArrayList(entries_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilder< - com.google.logging.v2.LogEntry, com.google.logging.v2.LogEntry.Builder, com.google.logging.v2.LogEntryOrBuilder> entriesBuilder_; - - /** - * repeated .google.logging.v2.LogEntry entries = 1; - * - *
-     * A list of log entries.
-     * 
- */ - public java.util.List getEntriesList() { - if (entriesBuilder_ == null) { - return java.util.Collections.unmodifiableList(entries_); - } else { - return entriesBuilder_.getMessageList(); - } - } - /** - * repeated .google.logging.v2.LogEntry entries = 1; - * - *
-     * A list of log entries.
-     * 
- */ - public int getEntriesCount() { - if (entriesBuilder_ == null) { - return entries_.size(); - } else { - return entriesBuilder_.getCount(); - } - } - /** - * repeated .google.logging.v2.LogEntry entries = 1; - * - *
-     * A list of log entries.
-     * 
- */ - public com.google.logging.v2.LogEntry getEntries(int index) { - if (entriesBuilder_ == null) { - return entries_.get(index); - } else { - return entriesBuilder_.getMessage(index); - } - } - /** - * repeated .google.logging.v2.LogEntry entries = 1; - * - *
-     * A list of log entries.
-     * 
- */ - public Builder setEntries( - int index, com.google.logging.v2.LogEntry value) { - if (entriesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEntriesIsMutable(); - entries_.set(index, value); - onChanged(); - } else { - entriesBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .google.logging.v2.LogEntry entries = 1; - * - *
-     * A list of log entries.
-     * 
- */ - public Builder setEntries( - int index, com.google.logging.v2.LogEntry.Builder builderForValue) { - if (entriesBuilder_ == null) { - ensureEntriesIsMutable(); - entries_.set(index, builderForValue.build()); - onChanged(); - } else { - entriesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .google.logging.v2.LogEntry entries = 1; - * - *
-     * A list of log entries.
-     * 
- */ - public Builder addEntries(com.google.logging.v2.LogEntry value) { - if (entriesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEntriesIsMutable(); - entries_.add(value); - onChanged(); - } else { - entriesBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .google.logging.v2.LogEntry entries = 1; - * - *
-     * A list of log entries.
-     * 
- */ - public Builder addEntries( - int index, com.google.logging.v2.LogEntry value) { - if (entriesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEntriesIsMutable(); - entries_.add(index, value); - onChanged(); - } else { - entriesBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .google.logging.v2.LogEntry entries = 1; - * - *
-     * A list of log entries.
-     * 
- */ - public Builder addEntries( - com.google.logging.v2.LogEntry.Builder builderForValue) { - if (entriesBuilder_ == null) { - ensureEntriesIsMutable(); - entries_.add(builderForValue.build()); - onChanged(); - } else { - entriesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .google.logging.v2.LogEntry entries = 1; - * - *
-     * A list of log entries.
-     * 
- */ - public Builder addEntries( - int index, com.google.logging.v2.LogEntry.Builder builderForValue) { - if (entriesBuilder_ == null) { - ensureEntriesIsMutable(); - entries_.add(index, builderForValue.build()); - onChanged(); - } else { - entriesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .google.logging.v2.LogEntry entries = 1; - * - *
-     * A list of log entries.
-     * 
- */ - public Builder addAllEntries( - java.lang.Iterable values) { - if (entriesBuilder_ == null) { - ensureEntriesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, entries_); - onChanged(); - } else { - entriesBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .google.logging.v2.LogEntry entries = 1; - * - *
-     * A list of log entries.
-     * 
- */ - public Builder clearEntries() { - if (entriesBuilder_ == null) { - entries_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - entriesBuilder_.clear(); - } - return this; - } - /** - * repeated .google.logging.v2.LogEntry entries = 1; - * - *
-     * A list of log entries.
-     * 
- */ - public Builder removeEntries(int index) { - if (entriesBuilder_ == null) { - ensureEntriesIsMutable(); - entries_.remove(index); - onChanged(); - } else { - entriesBuilder_.remove(index); - } - return this; - } - /** - * repeated .google.logging.v2.LogEntry entries = 1; - * - *
-     * A list of log entries.
-     * 
- */ - public com.google.logging.v2.LogEntry.Builder getEntriesBuilder( - int index) { - return getEntriesFieldBuilder().getBuilder(index); - } - /** - * repeated .google.logging.v2.LogEntry entries = 1; - * - *
-     * A list of log entries.
-     * 
- */ - public com.google.logging.v2.LogEntryOrBuilder getEntriesOrBuilder( - int index) { - if (entriesBuilder_ == null) { - return entries_.get(index); } else { - return entriesBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .google.logging.v2.LogEntry entries = 1; - * - *
-     * A list of log entries.
-     * 
- */ - public java.util.List - getEntriesOrBuilderList() { - if (entriesBuilder_ != null) { - return entriesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(entries_); - } - } - /** - * repeated .google.logging.v2.LogEntry entries = 1; - * - *
-     * A list of log entries.
-     * 
- */ - public com.google.logging.v2.LogEntry.Builder addEntriesBuilder() { - return getEntriesFieldBuilder().addBuilder( - com.google.logging.v2.LogEntry.getDefaultInstance()); - } - /** - * repeated .google.logging.v2.LogEntry entries = 1; - * - *
-     * A list of log entries.
-     * 
- */ - public com.google.logging.v2.LogEntry.Builder addEntriesBuilder( - int index) { - return getEntriesFieldBuilder().addBuilder( - index, com.google.logging.v2.LogEntry.getDefaultInstance()); - } - /** - * repeated .google.logging.v2.LogEntry entries = 1; - * - *
-     * A list of log entries.
-     * 
- */ - public java.util.List - getEntriesBuilderList() { - return getEntriesFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilder< - com.google.logging.v2.LogEntry, com.google.logging.v2.LogEntry.Builder, com.google.logging.v2.LogEntryOrBuilder> - getEntriesFieldBuilder() { - if (entriesBuilder_ == null) { - entriesBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< - com.google.logging.v2.LogEntry, com.google.logging.v2.LogEntry.Builder, com.google.logging.v2.LogEntryOrBuilder>( - entries_, - ((bitField0_ & 0x00000001) == 0x00000001), - getParentForChildren(), - isClean()); - entries_ = null; - } - return entriesBuilder_; - } - - private java.lang.Object nextPageToken_ = ""; - /** - * optional string next_page_token = 2; - * - *
-     * If there are more results than were returned, then `nextPageToken` is
-     * given a value in the response.  To get the next batch of results, call
-     * this method again using the value of `nextPageToken` as `pageToken`.
-     * 
- */ - public java.lang.String getNextPageToken() { - java.lang.Object ref = nextPageToken_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - nextPageToken_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string next_page_token = 2; - * - *
-     * If there are more results than were returned, then `nextPageToken` is
-     * given a value in the response.  To get the next batch of results, call
-     * this method again using the value of `nextPageToken` as `pageToken`.
-     * 
- */ - public com.google.protobuf.ByteString - getNextPageTokenBytes() { - java.lang.Object ref = nextPageToken_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - nextPageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string next_page_token = 2; - * - *
-     * If there are more results than were returned, then `nextPageToken` is
-     * given a value in the response.  To get the next batch of results, call
-     * this method again using the value of `nextPageToken` as `pageToken`.
-     * 
- */ - public Builder setNextPageToken( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - nextPageToken_ = value; - onChanged(); - return this; - } - /** - * optional string next_page_token = 2; - * - *
-     * If there are more results than were returned, then `nextPageToken` is
-     * given a value in the response.  To get the next batch of results, call
-     * this method again using the value of `nextPageToken` as `pageToken`.
-     * 
- */ - public Builder clearNextPageToken() { - - nextPageToken_ = getDefaultInstance().getNextPageToken(); - onChanged(); - return this; - } - /** - * optional string next_page_token = 2; - * - *
-     * If there are more results than were returned, then `nextPageToken` is
-     * given a value in the response.  To get the next batch of results, call
-     * this method again using the value of `nextPageToken` as `pageToken`.
-     * 
- */ - public Builder setNextPageTokenBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - nextPageToken_ = value; - onChanged(); - return this; - } - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - - // @@protoc_insertion_point(builder_scope:google.logging.v2.ListLogEntriesResponse) - } - - // @@protoc_insertion_point(class_scope:google.logging.v2.ListLogEntriesResponse) - private static final com.google.logging.v2.ListLogEntriesResponse DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.logging.v2.ListLogEntriesResponse(); - } - - public static com.google.logging.v2.ListLogEntriesResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - public ListLogEntriesResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - try { - return new ListLogEntriesResponse(input, extensionRegistry); - } catch (RuntimeException e) { - if (e.getCause() instanceof - com.google.protobuf.InvalidProtocolBufferException) { - throw (com.google.protobuf.InvalidProtocolBufferException) - e.getCause(); - } - throw e; - } - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public com.google.logging.v2.ListLogEntriesResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListLogEntriesResponseOrBuilder.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListLogEntriesResponseOrBuilder.java deleted file mode 100644 index 781993075527..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListLogEntriesResponseOrBuilder.java +++ /dev/null @@ -1,75 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/logging/v2/logging.proto - -package com.google.logging.v2; - -public interface ListLogEntriesResponseOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.logging.v2.ListLogEntriesResponse) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .google.logging.v2.LogEntry entries = 1; - * - *
-   * A list of log entries.
-   * 
- */ - java.util.List - getEntriesList(); - /** - * repeated .google.logging.v2.LogEntry entries = 1; - * - *
-   * A list of log entries.
-   * 
- */ - com.google.logging.v2.LogEntry getEntries(int index); - /** - * repeated .google.logging.v2.LogEntry entries = 1; - * - *
-   * A list of log entries.
-   * 
- */ - int getEntriesCount(); - /** - * repeated .google.logging.v2.LogEntry entries = 1; - * - *
-   * A list of log entries.
-   * 
- */ - java.util.List - getEntriesOrBuilderList(); - /** - * repeated .google.logging.v2.LogEntry entries = 1; - * - *
-   * A list of log entries.
-   * 
- */ - com.google.logging.v2.LogEntryOrBuilder getEntriesOrBuilder( - int index); - - /** - * optional string next_page_token = 2; - * - *
-   * If there are more results than were returned, then `nextPageToken` is
-   * given a value in the response.  To get the next batch of results, call
-   * this method again using the value of `nextPageToken` as `pageToken`.
-   * 
- */ - java.lang.String getNextPageToken(); - /** - * optional string next_page_token = 2; - * - *
-   * If there are more results than were returned, then `nextPageToken` is
-   * given a value in the response.  To get the next batch of results, call
-   * this method again using the value of `nextPageToken` as `pageToken`.
-   * 
- */ - com.google.protobuf.ByteString - getNextPageTokenBytes(); -} diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListLogMetricsRequest.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListLogMetricsRequest.java deleted file mode 100644 index 7bae460529dc..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListLogMetricsRequest.java +++ /dev/null @@ -1,748 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/logging/v2/logging_metrics.proto - -package com.google.logging.v2; - -/** - * Protobuf type {@code google.logging.v2.ListLogMetricsRequest} - * - *
- * The parameters to ListLogMetrics.
- * 
- */ -public final class ListLogMetricsRequest extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:google.logging.v2.ListLogMetricsRequest) - ListLogMetricsRequestOrBuilder { - // Use ListLogMetricsRequest.newBuilder() to construct. - private ListLogMetricsRequest(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - private ListLogMetricsRequest() { - projectName_ = ""; - pageToken_ = ""; - pageSize_ = 0; - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); - } - private ListLogMetricsRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) { - this(); - int mutable_bitField0_ = 0; - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!input.skipField(tag)) { - done = true; - } - break; - } - case 10: { - String s = input.readStringRequireUtf8(); - - projectName_ = s; - break; - } - case 18: { - String s = input.readStringRequireUtf8(); - - pageToken_ = s; - break; - } - case 24: { - - pageSize_ = input.readInt32(); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw new RuntimeException(e.setUnfinishedMessage(this)); - } catch (java.io.IOException e) { - throw new RuntimeException( - new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this)); - } finally { - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.logging.v2.LoggingMetrics.internal_static_google_logging_v2_ListLogMetricsRequest_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.logging.v2.LoggingMetrics.internal_static_google_logging_v2_ListLogMetricsRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.logging.v2.ListLogMetricsRequest.class, com.google.logging.v2.ListLogMetricsRequest.Builder.class); - } - - public static final int PROJECT_NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object projectName_; - /** - * optional string project_name = 1; - * - *
-   * Required. The resource name for the project whose metrics are wanted.
-   * Example: `"projects/my-project-id"`.
-   * 
- */ - public java.lang.String getProjectName() { - java.lang.Object ref = projectName_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - projectName_ = s; - return s; - } - } - /** - * optional string project_name = 1; - * - *
-   * Required. The resource name for the project whose metrics are wanted.
-   * Example: `"projects/my-project-id"`.
-   * 
- */ - public com.google.protobuf.ByteString - getProjectNameBytes() { - java.lang.Object ref = projectName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - projectName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PAGE_TOKEN_FIELD_NUMBER = 2; - private volatile java.lang.Object pageToken_; - /** - * optional string page_token = 2; - * - *
-   * Optional. If the `pageToken` request parameter is supplied, then the next
-   * page of results in the set are retrieved.  The `pageToken` parameter must
-   * be set with the value of the `nextPageToken` result parameter from the
-   * previous request.  The value of `projectName` must
-   * be the same as in the previous request.
-   * 
- */ - public java.lang.String getPageToken() { - java.lang.Object ref = pageToken_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - pageToken_ = s; - return s; - } - } - /** - * optional string page_token = 2; - * - *
-   * Optional. If the `pageToken` request parameter is supplied, then the next
-   * page of results in the set are retrieved.  The `pageToken` parameter must
-   * be set with the value of the `nextPageToken` result parameter from the
-   * previous request.  The value of `projectName` must
-   * be the same as in the previous request.
-   * 
- */ - public com.google.protobuf.ByteString - getPageTokenBytes() { - java.lang.Object ref = pageToken_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - pageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PAGE_SIZE_FIELD_NUMBER = 3; - private int pageSize_; - /** - * optional int32 page_size = 3; - * - *
-   * Optional. The maximum number of results to return from this request.  Fewer
-   * results might be returned. You must check for the 'nextPageToken` result to
-   * determine if additional results are available, which you can retrieve by
-   * passing the `nextPageToken` value in the `pageToken` parameter to the next
-   * request.
-   * 
- */ - public int getPageSize() { - return pageSize_; - } - - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getProjectNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessage.writeString(output, 1, projectName_); - } - if (!getPageTokenBytes().isEmpty()) { - com.google.protobuf.GeneratedMessage.writeString(output, 2, pageToken_); - } - if (pageSize_ != 0) { - output.writeInt32(3, pageSize_); - } - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getProjectNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessage.computeStringSize(1, projectName_); - } - if (!getPageTokenBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessage.computeStringSize(2, pageToken_); - } - if (pageSize_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(3, pageSize_); - } - memoizedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - public static com.google.logging.v2.ListLogMetricsRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.logging.v2.ListLogMetricsRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.logging.v2.ListLogMetricsRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.logging.v2.ListLogMetricsRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.logging.v2.ListLogMetricsRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.google.logging.v2.ListLogMetricsRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static com.google.logging.v2.ListLogMetricsRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static com.google.logging.v2.ListLogMetricsRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static com.google.logging.v2.ListLogMetricsRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.google.logging.v2.ListLogMetricsRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.logging.v2.ListLogMetricsRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code google.logging.v2.ListLogMetricsRequest} - * - *
-   * The parameters to ListLogMetrics.
-   * 
- */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:google.logging.v2.ListLogMetricsRequest) - com.google.logging.v2.ListLogMetricsRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.logging.v2.LoggingMetrics.internal_static_google_logging_v2_ListLogMetricsRequest_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.logging.v2.LoggingMetrics.internal_static_google_logging_v2_ListLogMetricsRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.logging.v2.ListLogMetricsRequest.class, com.google.logging.v2.ListLogMetricsRequest.Builder.class); - } - - // Construct using com.google.logging.v2.ListLogMetricsRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - public Builder clear() { - super.clear(); - projectName_ = ""; - - pageToken_ = ""; - - pageSize_ = 0; - - return this; - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.logging.v2.LoggingMetrics.internal_static_google_logging_v2_ListLogMetricsRequest_descriptor; - } - - public com.google.logging.v2.ListLogMetricsRequest getDefaultInstanceForType() { - return com.google.logging.v2.ListLogMetricsRequest.getDefaultInstance(); - } - - public com.google.logging.v2.ListLogMetricsRequest build() { - com.google.logging.v2.ListLogMetricsRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.google.logging.v2.ListLogMetricsRequest buildPartial() { - com.google.logging.v2.ListLogMetricsRequest result = new com.google.logging.v2.ListLogMetricsRequest(this); - result.projectName_ = projectName_; - result.pageToken_ = pageToken_; - result.pageSize_ = pageSize_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.logging.v2.ListLogMetricsRequest) { - return mergeFrom((com.google.logging.v2.ListLogMetricsRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.logging.v2.ListLogMetricsRequest other) { - if (other == com.google.logging.v2.ListLogMetricsRequest.getDefaultInstance()) return this; - if (!other.getProjectName().isEmpty()) { - projectName_ = other.projectName_; - onChanged(); - } - if (!other.getPageToken().isEmpty()) { - pageToken_ = other.pageToken_; - onChanged(); - } - if (other.getPageSize() != 0) { - setPageSize(other.getPageSize()); - } - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.logging.v2.ListLogMetricsRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.logging.v2.ListLogMetricsRequest) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object projectName_ = ""; - /** - * optional string project_name = 1; - * - *
-     * Required. The resource name for the project whose metrics are wanted.
-     * Example: `"projects/my-project-id"`.
-     * 
- */ - public java.lang.String getProjectName() { - java.lang.Object ref = projectName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - projectName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string project_name = 1; - * - *
-     * Required. The resource name for the project whose metrics are wanted.
-     * Example: `"projects/my-project-id"`.
-     * 
- */ - public com.google.protobuf.ByteString - getProjectNameBytes() { - java.lang.Object ref = projectName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - projectName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string project_name = 1; - * - *
-     * Required. The resource name for the project whose metrics are wanted.
-     * Example: `"projects/my-project-id"`.
-     * 
- */ - public Builder setProjectName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - projectName_ = value; - onChanged(); - return this; - } - /** - * optional string project_name = 1; - * - *
-     * Required. The resource name for the project whose metrics are wanted.
-     * Example: `"projects/my-project-id"`.
-     * 
- */ - public Builder clearProjectName() { - - projectName_ = getDefaultInstance().getProjectName(); - onChanged(); - return this; - } - /** - * optional string project_name = 1; - * - *
-     * Required. The resource name for the project whose metrics are wanted.
-     * Example: `"projects/my-project-id"`.
-     * 
- */ - public Builder setProjectNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - projectName_ = value; - onChanged(); - return this; - } - - private java.lang.Object pageToken_ = ""; - /** - * optional string page_token = 2; - * - *
-     * Optional. If the `pageToken` request parameter is supplied, then the next
-     * page of results in the set are retrieved.  The `pageToken` parameter must
-     * be set with the value of the `nextPageToken` result parameter from the
-     * previous request.  The value of `projectName` must
-     * be the same as in the previous request.
-     * 
- */ - public java.lang.String getPageToken() { - java.lang.Object ref = pageToken_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - pageToken_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string page_token = 2; - * - *
-     * Optional. If the `pageToken` request parameter is supplied, then the next
-     * page of results in the set are retrieved.  The `pageToken` parameter must
-     * be set with the value of the `nextPageToken` result parameter from the
-     * previous request.  The value of `projectName` must
-     * be the same as in the previous request.
-     * 
- */ - public com.google.protobuf.ByteString - getPageTokenBytes() { - java.lang.Object ref = pageToken_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - pageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string page_token = 2; - * - *
-     * Optional. If the `pageToken` request parameter is supplied, then the next
-     * page of results in the set are retrieved.  The `pageToken` parameter must
-     * be set with the value of the `nextPageToken` result parameter from the
-     * previous request.  The value of `projectName` must
-     * be the same as in the previous request.
-     * 
- */ - public Builder setPageToken( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - pageToken_ = value; - onChanged(); - return this; - } - /** - * optional string page_token = 2; - * - *
-     * Optional. If the `pageToken` request parameter is supplied, then the next
-     * page of results in the set are retrieved.  The `pageToken` parameter must
-     * be set with the value of the `nextPageToken` result parameter from the
-     * previous request.  The value of `projectName` must
-     * be the same as in the previous request.
-     * 
- */ - public Builder clearPageToken() { - - pageToken_ = getDefaultInstance().getPageToken(); - onChanged(); - return this; - } - /** - * optional string page_token = 2; - * - *
-     * Optional. If the `pageToken` request parameter is supplied, then the next
-     * page of results in the set are retrieved.  The `pageToken` parameter must
-     * be set with the value of the `nextPageToken` result parameter from the
-     * previous request.  The value of `projectName` must
-     * be the same as in the previous request.
-     * 
- */ - public Builder setPageTokenBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - pageToken_ = value; - onChanged(); - return this; - } - - private int pageSize_ ; - /** - * optional int32 page_size = 3; - * - *
-     * Optional. The maximum number of results to return from this request.  Fewer
-     * results might be returned. You must check for the 'nextPageToken` result to
-     * determine if additional results are available, which you can retrieve by
-     * passing the `nextPageToken` value in the `pageToken` parameter to the next
-     * request.
-     * 
- */ - public int getPageSize() { - return pageSize_; - } - /** - * optional int32 page_size = 3; - * - *
-     * Optional. The maximum number of results to return from this request.  Fewer
-     * results might be returned. You must check for the 'nextPageToken` result to
-     * determine if additional results are available, which you can retrieve by
-     * passing the `nextPageToken` value in the `pageToken` parameter to the next
-     * request.
-     * 
- */ - public Builder setPageSize(int value) { - - pageSize_ = value; - onChanged(); - return this; - } - /** - * optional int32 page_size = 3; - * - *
-     * Optional. The maximum number of results to return from this request.  Fewer
-     * results might be returned. You must check for the 'nextPageToken` result to
-     * determine if additional results are available, which you can retrieve by
-     * passing the `nextPageToken` value in the `pageToken` parameter to the next
-     * request.
-     * 
- */ - public Builder clearPageSize() { - - pageSize_ = 0; - onChanged(); - return this; - } - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - - // @@protoc_insertion_point(builder_scope:google.logging.v2.ListLogMetricsRequest) - } - - // @@protoc_insertion_point(class_scope:google.logging.v2.ListLogMetricsRequest) - private static final com.google.logging.v2.ListLogMetricsRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.logging.v2.ListLogMetricsRequest(); - } - - public static com.google.logging.v2.ListLogMetricsRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - public ListLogMetricsRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - try { - return new ListLogMetricsRequest(input, extensionRegistry); - } catch (RuntimeException e) { - if (e.getCause() instanceof - com.google.protobuf.InvalidProtocolBufferException) { - throw (com.google.protobuf.InvalidProtocolBufferException) - e.getCause(); - } - throw e; - } - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public com.google.logging.v2.ListLogMetricsRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListLogMetricsRequestOrBuilder.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListLogMetricsRequestOrBuilder.java deleted file mode 100644 index c393cc4186d4..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListLogMetricsRequestOrBuilder.java +++ /dev/null @@ -1,68 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/logging/v2/logging_metrics.proto - -package com.google.logging.v2; - -public interface ListLogMetricsRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.logging.v2.ListLogMetricsRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * optional string project_name = 1; - * - *
-   * Required. The resource name for the project whose metrics are wanted.
-   * Example: `"projects/my-project-id"`.
-   * 
- */ - java.lang.String getProjectName(); - /** - * optional string project_name = 1; - * - *
-   * Required. The resource name for the project whose metrics are wanted.
-   * Example: `"projects/my-project-id"`.
-   * 
- */ - com.google.protobuf.ByteString - getProjectNameBytes(); - - /** - * optional string page_token = 2; - * - *
-   * Optional. If the `pageToken` request parameter is supplied, then the next
-   * page of results in the set are retrieved.  The `pageToken` parameter must
-   * be set with the value of the `nextPageToken` result parameter from the
-   * previous request.  The value of `projectName` must
-   * be the same as in the previous request.
-   * 
- */ - java.lang.String getPageToken(); - /** - * optional string page_token = 2; - * - *
-   * Optional. If the `pageToken` request parameter is supplied, then the next
-   * page of results in the set are retrieved.  The `pageToken` parameter must
-   * be set with the value of the `nextPageToken` result parameter from the
-   * previous request.  The value of `projectName` must
-   * be the same as in the previous request.
-   * 
- */ - com.google.protobuf.ByteString - getPageTokenBytes(); - - /** - * optional int32 page_size = 3; - * - *
-   * Optional. The maximum number of results to return from this request.  Fewer
-   * results might be returned. You must check for the 'nextPageToken` result to
-   * determine if additional results are available, which you can retrieve by
-   * passing the `nextPageToken` value in the `pageToken` parameter to the next
-   * request.
-   * 
- */ - int getPageSize(); -} diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListLogMetricsResponse.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListLogMetricsResponse.java deleted file mode 100644 index 2cebbb193b82..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListLogMetricsResponse.java +++ /dev/null @@ -1,923 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/logging/v2/logging_metrics.proto - -package com.google.logging.v2; - -/** - * Protobuf type {@code google.logging.v2.ListLogMetricsResponse} - * - *
- * Result returned from ListLogMetrics.
- * 
- */ -public final class ListLogMetricsResponse extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:google.logging.v2.ListLogMetricsResponse) - ListLogMetricsResponseOrBuilder { - // Use ListLogMetricsResponse.newBuilder() to construct. - private ListLogMetricsResponse(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - private ListLogMetricsResponse() { - metrics_ = java.util.Collections.emptyList(); - nextPageToken_ = ""; - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); - } - private ListLogMetricsResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) { - this(); - int mutable_bitField0_ = 0; - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!input.skipField(tag)) { - done = true; - } - break; - } - case 10: { - if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - metrics_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - metrics_.add(input.readMessage(com.google.logging.v2.LogMetric.parser(), extensionRegistry)); - break; - } - case 18: { - String s = input.readStringRequireUtf8(); - - nextPageToken_ = s; - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw new RuntimeException(e.setUnfinishedMessage(this)); - } catch (java.io.IOException e) { - throw new RuntimeException( - new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this)); - } finally { - if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - metrics_ = java.util.Collections.unmodifiableList(metrics_); - } - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.logging.v2.LoggingMetrics.internal_static_google_logging_v2_ListLogMetricsResponse_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.logging.v2.LoggingMetrics.internal_static_google_logging_v2_ListLogMetricsResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.logging.v2.ListLogMetricsResponse.class, com.google.logging.v2.ListLogMetricsResponse.Builder.class); - } - - private int bitField0_; - public static final int METRICS_FIELD_NUMBER = 1; - private java.util.List metrics_; - /** - * repeated .google.logging.v2.LogMetric metrics = 1; - * - *
-   * A list of logs-based metrics.
-   * 
- */ - public java.util.List getMetricsList() { - return metrics_; - } - /** - * repeated .google.logging.v2.LogMetric metrics = 1; - * - *
-   * A list of logs-based metrics.
-   * 
- */ - public java.util.List - getMetricsOrBuilderList() { - return metrics_; - } - /** - * repeated .google.logging.v2.LogMetric metrics = 1; - * - *
-   * A list of logs-based metrics.
-   * 
- */ - public int getMetricsCount() { - return metrics_.size(); - } - /** - * repeated .google.logging.v2.LogMetric metrics = 1; - * - *
-   * A list of logs-based metrics.
-   * 
- */ - public com.google.logging.v2.LogMetric getMetrics(int index) { - return metrics_.get(index); - } - /** - * repeated .google.logging.v2.LogMetric metrics = 1; - * - *
-   * A list of logs-based metrics.
-   * 
- */ - public com.google.logging.v2.LogMetricOrBuilder getMetricsOrBuilder( - int index) { - return metrics_.get(index); - } - - public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; - private volatile java.lang.Object nextPageToken_; - /** - * optional string next_page_token = 2; - * - *
-   * If there are more results than were returned, then `nextPageToken` is given
-   * a value in the response.  To get the next batch of results, call this
-   * method again using the value of `nextPageToken` as `pageToken`.
-   * 
- */ - public java.lang.String getNextPageToken() { - java.lang.Object ref = nextPageToken_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - nextPageToken_ = s; - return s; - } - } - /** - * optional string next_page_token = 2; - * - *
-   * If there are more results than were returned, then `nextPageToken` is given
-   * a value in the response.  To get the next batch of results, call this
-   * method again using the value of `nextPageToken` as `pageToken`.
-   * 
- */ - public com.google.protobuf.ByteString - getNextPageTokenBytes() { - java.lang.Object ref = nextPageToken_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - nextPageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < metrics_.size(); i++) { - output.writeMessage(1, metrics_.get(i)); - } - if (!getNextPageTokenBytes().isEmpty()) { - com.google.protobuf.GeneratedMessage.writeString(output, 2, nextPageToken_); - } - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < metrics_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, metrics_.get(i)); - } - if (!getNextPageTokenBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessage.computeStringSize(2, nextPageToken_); - } - memoizedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - public static com.google.logging.v2.ListLogMetricsResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.logging.v2.ListLogMetricsResponse parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.logging.v2.ListLogMetricsResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.logging.v2.ListLogMetricsResponse parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.logging.v2.ListLogMetricsResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.google.logging.v2.ListLogMetricsResponse parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static com.google.logging.v2.ListLogMetricsResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static com.google.logging.v2.ListLogMetricsResponse parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static com.google.logging.v2.ListLogMetricsResponse parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.google.logging.v2.ListLogMetricsResponse parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.logging.v2.ListLogMetricsResponse prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code google.logging.v2.ListLogMetricsResponse} - * - *
-   * Result returned from ListLogMetrics.
-   * 
- */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:google.logging.v2.ListLogMetricsResponse) - com.google.logging.v2.ListLogMetricsResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.logging.v2.LoggingMetrics.internal_static_google_logging_v2_ListLogMetricsResponse_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.logging.v2.LoggingMetrics.internal_static_google_logging_v2_ListLogMetricsResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.logging.v2.ListLogMetricsResponse.class, com.google.logging.v2.ListLogMetricsResponse.Builder.class); - } - - // Construct using com.google.logging.v2.ListLogMetricsResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - getMetricsFieldBuilder(); - } - } - public Builder clear() { - super.clear(); - if (metricsBuilder_ == null) { - metrics_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - metricsBuilder_.clear(); - } - nextPageToken_ = ""; - - return this; - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.logging.v2.LoggingMetrics.internal_static_google_logging_v2_ListLogMetricsResponse_descriptor; - } - - public com.google.logging.v2.ListLogMetricsResponse getDefaultInstanceForType() { - return com.google.logging.v2.ListLogMetricsResponse.getDefaultInstance(); - } - - public com.google.logging.v2.ListLogMetricsResponse build() { - com.google.logging.v2.ListLogMetricsResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.google.logging.v2.ListLogMetricsResponse buildPartial() { - com.google.logging.v2.ListLogMetricsResponse result = new com.google.logging.v2.ListLogMetricsResponse(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (metricsBuilder_ == null) { - if (((bitField0_ & 0x00000001) == 0x00000001)) { - metrics_ = java.util.Collections.unmodifiableList(metrics_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.metrics_ = metrics_; - } else { - result.metrics_ = metricsBuilder_.build(); - } - result.nextPageToken_ = nextPageToken_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.logging.v2.ListLogMetricsResponse) { - return mergeFrom((com.google.logging.v2.ListLogMetricsResponse)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.logging.v2.ListLogMetricsResponse other) { - if (other == com.google.logging.v2.ListLogMetricsResponse.getDefaultInstance()) return this; - if (metricsBuilder_ == null) { - if (!other.metrics_.isEmpty()) { - if (metrics_.isEmpty()) { - metrics_ = other.metrics_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureMetricsIsMutable(); - metrics_.addAll(other.metrics_); - } - onChanged(); - } - } else { - if (!other.metrics_.isEmpty()) { - if (metricsBuilder_.isEmpty()) { - metricsBuilder_.dispose(); - metricsBuilder_ = null; - metrics_ = other.metrics_; - bitField0_ = (bitField0_ & ~0x00000001); - metricsBuilder_ = - com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? - getMetricsFieldBuilder() : null; - } else { - metricsBuilder_.addAllMessages(other.metrics_); - } - } - } - if (!other.getNextPageToken().isEmpty()) { - nextPageToken_ = other.nextPageToken_; - onChanged(); - } - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.logging.v2.ListLogMetricsResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.logging.v2.ListLogMetricsResponse) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List metrics_ = - java.util.Collections.emptyList(); - private void ensureMetricsIsMutable() { - if (!((bitField0_ & 0x00000001) == 0x00000001)) { - metrics_ = new java.util.ArrayList(metrics_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilder< - com.google.logging.v2.LogMetric, com.google.logging.v2.LogMetric.Builder, com.google.logging.v2.LogMetricOrBuilder> metricsBuilder_; - - /** - * repeated .google.logging.v2.LogMetric metrics = 1; - * - *
-     * A list of logs-based metrics.
-     * 
- */ - public java.util.List getMetricsList() { - if (metricsBuilder_ == null) { - return java.util.Collections.unmodifiableList(metrics_); - } else { - return metricsBuilder_.getMessageList(); - } - } - /** - * repeated .google.logging.v2.LogMetric metrics = 1; - * - *
-     * A list of logs-based metrics.
-     * 
- */ - public int getMetricsCount() { - if (metricsBuilder_ == null) { - return metrics_.size(); - } else { - return metricsBuilder_.getCount(); - } - } - /** - * repeated .google.logging.v2.LogMetric metrics = 1; - * - *
-     * A list of logs-based metrics.
-     * 
- */ - public com.google.logging.v2.LogMetric getMetrics(int index) { - if (metricsBuilder_ == null) { - return metrics_.get(index); - } else { - return metricsBuilder_.getMessage(index); - } - } - /** - * repeated .google.logging.v2.LogMetric metrics = 1; - * - *
-     * A list of logs-based metrics.
-     * 
- */ - public Builder setMetrics( - int index, com.google.logging.v2.LogMetric value) { - if (metricsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureMetricsIsMutable(); - metrics_.set(index, value); - onChanged(); - } else { - metricsBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .google.logging.v2.LogMetric metrics = 1; - * - *
-     * A list of logs-based metrics.
-     * 
- */ - public Builder setMetrics( - int index, com.google.logging.v2.LogMetric.Builder builderForValue) { - if (metricsBuilder_ == null) { - ensureMetricsIsMutable(); - metrics_.set(index, builderForValue.build()); - onChanged(); - } else { - metricsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .google.logging.v2.LogMetric metrics = 1; - * - *
-     * A list of logs-based metrics.
-     * 
- */ - public Builder addMetrics(com.google.logging.v2.LogMetric value) { - if (metricsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureMetricsIsMutable(); - metrics_.add(value); - onChanged(); - } else { - metricsBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .google.logging.v2.LogMetric metrics = 1; - * - *
-     * A list of logs-based metrics.
-     * 
- */ - public Builder addMetrics( - int index, com.google.logging.v2.LogMetric value) { - if (metricsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureMetricsIsMutable(); - metrics_.add(index, value); - onChanged(); - } else { - metricsBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .google.logging.v2.LogMetric metrics = 1; - * - *
-     * A list of logs-based metrics.
-     * 
- */ - public Builder addMetrics( - com.google.logging.v2.LogMetric.Builder builderForValue) { - if (metricsBuilder_ == null) { - ensureMetricsIsMutable(); - metrics_.add(builderForValue.build()); - onChanged(); - } else { - metricsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .google.logging.v2.LogMetric metrics = 1; - * - *
-     * A list of logs-based metrics.
-     * 
- */ - public Builder addMetrics( - int index, com.google.logging.v2.LogMetric.Builder builderForValue) { - if (metricsBuilder_ == null) { - ensureMetricsIsMutable(); - metrics_.add(index, builderForValue.build()); - onChanged(); - } else { - metricsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .google.logging.v2.LogMetric metrics = 1; - * - *
-     * A list of logs-based metrics.
-     * 
- */ - public Builder addAllMetrics( - java.lang.Iterable values) { - if (metricsBuilder_ == null) { - ensureMetricsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, metrics_); - onChanged(); - } else { - metricsBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .google.logging.v2.LogMetric metrics = 1; - * - *
-     * A list of logs-based metrics.
-     * 
- */ - public Builder clearMetrics() { - if (metricsBuilder_ == null) { - metrics_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - metricsBuilder_.clear(); - } - return this; - } - /** - * repeated .google.logging.v2.LogMetric metrics = 1; - * - *
-     * A list of logs-based metrics.
-     * 
- */ - public Builder removeMetrics(int index) { - if (metricsBuilder_ == null) { - ensureMetricsIsMutable(); - metrics_.remove(index); - onChanged(); - } else { - metricsBuilder_.remove(index); - } - return this; - } - /** - * repeated .google.logging.v2.LogMetric metrics = 1; - * - *
-     * A list of logs-based metrics.
-     * 
- */ - public com.google.logging.v2.LogMetric.Builder getMetricsBuilder( - int index) { - return getMetricsFieldBuilder().getBuilder(index); - } - /** - * repeated .google.logging.v2.LogMetric metrics = 1; - * - *
-     * A list of logs-based metrics.
-     * 
- */ - public com.google.logging.v2.LogMetricOrBuilder getMetricsOrBuilder( - int index) { - if (metricsBuilder_ == null) { - return metrics_.get(index); } else { - return metricsBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .google.logging.v2.LogMetric metrics = 1; - * - *
-     * A list of logs-based metrics.
-     * 
- */ - public java.util.List - getMetricsOrBuilderList() { - if (metricsBuilder_ != null) { - return metricsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(metrics_); - } - } - /** - * repeated .google.logging.v2.LogMetric metrics = 1; - * - *
-     * A list of logs-based metrics.
-     * 
- */ - public com.google.logging.v2.LogMetric.Builder addMetricsBuilder() { - return getMetricsFieldBuilder().addBuilder( - com.google.logging.v2.LogMetric.getDefaultInstance()); - } - /** - * repeated .google.logging.v2.LogMetric metrics = 1; - * - *
-     * A list of logs-based metrics.
-     * 
- */ - public com.google.logging.v2.LogMetric.Builder addMetricsBuilder( - int index) { - return getMetricsFieldBuilder().addBuilder( - index, com.google.logging.v2.LogMetric.getDefaultInstance()); - } - /** - * repeated .google.logging.v2.LogMetric metrics = 1; - * - *
-     * A list of logs-based metrics.
-     * 
- */ - public java.util.List - getMetricsBuilderList() { - return getMetricsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilder< - com.google.logging.v2.LogMetric, com.google.logging.v2.LogMetric.Builder, com.google.logging.v2.LogMetricOrBuilder> - getMetricsFieldBuilder() { - if (metricsBuilder_ == null) { - metricsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< - com.google.logging.v2.LogMetric, com.google.logging.v2.LogMetric.Builder, com.google.logging.v2.LogMetricOrBuilder>( - metrics_, - ((bitField0_ & 0x00000001) == 0x00000001), - getParentForChildren(), - isClean()); - metrics_ = null; - } - return metricsBuilder_; - } - - private java.lang.Object nextPageToken_ = ""; - /** - * optional string next_page_token = 2; - * - *
-     * If there are more results than were returned, then `nextPageToken` is given
-     * a value in the response.  To get the next batch of results, call this
-     * method again using the value of `nextPageToken` as `pageToken`.
-     * 
- */ - public java.lang.String getNextPageToken() { - java.lang.Object ref = nextPageToken_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - nextPageToken_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string next_page_token = 2; - * - *
-     * If there are more results than were returned, then `nextPageToken` is given
-     * a value in the response.  To get the next batch of results, call this
-     * method again using the value of `nextPageToken` as `pageToken`.
-     * 
- */ - public com.google.protobuf.ByteString - getNextPageTokenBytes() { - java.lang.Object ref = nextPageToken_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - nextPageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string next_page_token = 2; - * - *
-     * If there are more results than were returned, then `nextPageToken` is given
-     * a value in the response.  To get the next batch of results, call this
-     * method again using the value of `nextPageToken` as `pageToken`.
-     * 
- */ - public Builder setNextPageToken( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - nextPageToken_ = value; - onChanged(); - return this; - } - /** - * optional string next_page_token = 2; - * - *
-     * If there are more results than were returned, then `nextPageToken` is given
-     * a value in the response.  To get the next batch of results, call this
-     * method again using the value of `nextPageToken` as `pageToken`.
-     * 
- */ - public Builder clearNextPageToken() { - - nextPageToken_ = getDefaultInstance().getNextPageToken(); - onChanged(); - return this; - } - /** - * optional string next_page_token = 2; - * - *
-     * If there are more results than were returned, then `nextPageToken` is given
-     * a value in the response.  To get the next batch of results, call this
-     * method again using the value of `nextPageToken` as `pageToken`.
-     * 
- */ - public Builder setNextPageTokenBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - nextPageToken_ = value; - onChanged(); - return this; - } - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - - // @@protoc_insertion_point(builder_scope:google.logging.v2.ListLogMetricsResponse) - } - - // @@protoc_insertion_point(class_scope:google.logging.v2.ListLogMetricsResponse) - private static final com.google.logging.v2.ListLogMetricsResponse DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.logging.v2.ListLogMetricsResponse(); - } - - public static com.google.logging.v2.ListLogMetricsResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - public ListLogMetricsResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - try { - return new ListLogMetricsResponse(input, extensionRegistry); - } catch (RuntimeException e) { - if (e.getCause() instanceof - com.google.protobuf.InvalidProtocolBufferException) { - throw (com.google.protobuf.InvalidProtocolBufferException) - e.getCause(); - } - throw e; - } - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public com.google.logging.v2.ListLogMetricsResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListLogMetricsResponseOrBuilder.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListLogMetricsResponseOrBuilder.java deleted file mode 100644 index 64a6a9d2c5d5..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListLogMetricsResponseOrBuilder.java +++ /dev/null @@ -1,75 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/logging/v2/logging_metrics.proto - -package com.google.logging.v2; - -public interface ListLogMetricsResponseOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.logging.v2.ListLogMetricsResponse) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .google.logging.v2.LogMetric metrics = 1; - * - *
-   * A list of logs-based metrics.
-   * 
- */ - java.util.List - getMetricsList(); - /** - * repeated .google.logging.v2.LogMetric metrics = 1; - * - *
-   * A list of logs-based metrics.
-   * 
- */ - com.google.logging.v2.LogMetric getMetrics(int index); - /** - * repeated .google.logging.v2.LogMetric metrics = 1; - * - *
-   * A list of logs-based metrics.
-   * 
- */ - int getMetricsCount(); - /** - * repeated .google.logging.v2.LogMetric metrics = 1; - * - *
-   * A list of logs-based metrics.
-   * 
- */ - java.util.List - getMetricsOrBuilderList(); - /** - * repeated .google.logging.v2.LogMetric metrics = 1; - * - *
-   * A list of logs-based metrics.
-   * 
- */ - com.google.logging.v2.LogMetricOrBuilder getMetricsOrBuilder( - int index); - - /** - * optional string next_page_token = 2; - * - *
-   * If there are more results than were returned, then `nextPageToken` is given
-   * a value in the response.  To get the next batch of results, call this
-   * method again using the value of `nextPageToken` as `pageToken`.
-   * 
- */ - java.lang.String getNextPageToken(); - /** - * optional string next_page_token = 2; - * - *
-   * If there are more results than were returned, then `nextPageToken` is given
-   * a value in the response.  To get the next batch of results, call this
-   * method again using the value of `nextPageToken` as `pageToken`.
-   * 
- */ - com.google.protobuf.ByteString - getNextPageTokenBytes(); -} diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListMonitoredResourceDescriptorsRequest.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListMonitoredResourceDescriptorsRequest.java deleted file mode 100644 index 414a42a309d4..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListMonitoredResourceDescriptorsRequest.java +++ /dev/null @@ -1,583 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/logging/v2/logging.proto - -package com.google.logging.v2; - -/** - * Protobuf type {@code google.logging.v2.ListMonitoredResourceDescriptorsRequest} - * - *
- * The parameters to ListMonitoredResourceDescriptors
- * 
- */ -public final class ListMonitoredResourceDescriptorsRequest extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:google.logging.v2.ListMonitoredResourceDescriptorsRequest) - ListMonitoredResourceDescriptorsRequestOrBuilder { - // Use ListMonitoredResourceDescriptorsRequest.newBuilder() to construct. - private ListMonitoredResourceDescriptorsRequest(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - private ListMonitoredResourceDescriptorsRequest() { - pageSize_ = 0; - pageToken_ = ""; - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); - } - private ListMonitoredResourceDescriptorsRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) { - this(); - int mutable_bitField0_ = 0; - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!input.skipField(tag)) { - done = true; - } - break; - } - case 8: { - - pageSize_ = input.readInt32(); - break; - } - case 18: { - String s = input.readStringRequireUtf8(); - - pageToken_ = s; - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw new RuntimeException(e.setUnfinishedMessage(this)); - } catch (java.io.IOException e) { - throw new RuntimeException( - new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this)); - } finally { - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_ListMonitoredResourceDescriptorsRequest_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_ListMonitoredResourceDescriptorsRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.logging.v2.ListMonitoredResourceDescriptorsRequest.class, com.google.logging.v2.ListMonitoredResourceDescriptorsRequest.Builder.class); - } - - public static final int PAGE_SIZE_FIELD_NUMBER = 1; - private int pageSize_; - /** - * optional int32 page_size = 1; - * - *
-   * Optional. The maximum number of results to return from this request.  Fewer
-   * results might be returned. You must check for the 'nextPageToken` result to
-   * determine if additional results are available, which you can retrieve by
-   * passing the `nextPageToken` value in the `pageToken` parameter to the next
-   * request.
-   * 
- */ - public int getPageSize() { - return pageSize_; - } - - public static final int PAGE_TOKEN_FIELD_NUMBER = 2; - private volatile java.lang.Object pageToken_; - /** - * optional string page_token = 2; - * - *
-   * Optional. If the `pageToken` request parameter is supplied, then the next
-   * page of results in the set are retrieved.  The `pageToken` parameter must
-   * be set with the value of the `nextPageToken` result parameter from the
-   * previous request.
-   * 
- */ - public java.lang.String getPageToken() { - java.lang.Object ref = pageToken_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - pageToken_ = s; - return s; - } - } - /** - * optional string page_token = 2; - * - *
-   * Optional. If the `pageToken` request parameter is supplied, then the next
-   * page of results in the set are retrieved.  The `pageToken` parameter must
-   * be set with the value of the `nextPageToken` result parameter from the
-   * previous request.
-   * 
- */ - public com.google.protobuf.ByteString - getPageTokenBytes() { - java.lang.Object ref = pageToken_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - pageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (pageSize_ != 0) { - output.writeInt32(1, pageSize_); - } - if (!getPageTokenBytes().isEmpty()) { - com.google.protobuf.GeneratedMessage.writeString(output, 2, pageToken_); - } - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (pageSize_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(1, pageSize_); - } - if (!getPageTokenBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessage.computeStringSize(2, pageToken_); - } - memoizedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - public static com.google.logging.v2.ListMonitoredResourceDescriptorsRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.logging.v2.ListMonitoredResourceDescriptorsRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.logging.v2.ListMonitoredResourceDescriptorsRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.logging.v2.ListMonitoredResourceDescriptorsRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.logging.v2.ListMonitoredResourceDescriptorsRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.google.logging.v2.ListMonitoredResourceDescriptorsRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static com.google.logging.v2.ListMonitoredResourceDescriptorsRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static com.google.logging.v2.ListMonitoredResourceDescriptorsRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static com.google.logging.v2.ListMonitoredResourceDescriptorsRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.google.logging.v2.ListMonitoredResourceDescriptorsRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.logging.v2.ListMonitoredResourceDescriptorsRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code google.logging.v2.ListMonitoredResourceDescriptorsRequest} - * - *
-   * The parameters to ListMonitoredResourceDescriptors
-   * 
- */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:google.logging.v2.ListMonitoredResourceDescriptorsRequest) - com.google.logging.v2.ListMonitoredResourceDescriptorsRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_ListMonitoredResourceDescriptorsRequest_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_ListMonitoredResourceDescriptorsRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.logging.v2.ListMonitoredResourceDescriptorsRequest.class, com.google.logging.v2.ListMonitoredResourceDescriptorsRequest.Builder.class); - } - - // Construct using com.google.logging.v2.ListMonitoredResourceDescriptorsRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - public Builder clear() { - super.clear(); - pageSize_ = 0; - - pageToken_ = ""; - - return this; - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_ListMonitoredResourceDescriptorsRequest_descriptor; - } - - public com.google.logging.v2.ListMonitoredResourceDescriptorsRequest getDefaultInstanceForType() { - return com.google.logging.v2.ListMonitoredResourceDescriptorsRequest.getDefaultInstance(); - } - - public com.google.logging.v2.ListMonitoredResourceDescriptorsRequest build() { - com.google.logging.v2.ListMonitoredResourceDescriptorsRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.google.logging.v2.ListMonitoredResourceDescriptorsRequest buildPartial() { - com.google.logging.v2.ListMonitoredResourceDescriptorsRequest result = new com.google.logging.v2.ListMonitoredResourceDescriptorsRequest(this); - result.pageSize_ = pageSize_; - result.pageToken_ = pageToken_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.logging.v2.ListMonitoredResourceDescriptorsRequest) { - return mergeFrom((com.google.logging.v2.ListMonitoredResourceDescriptorsRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.logging.v2.ListMonitoredResourceDescriptorsRequest other) { - if (other == com.google.logging.v2.ListMonitoredResourceDescriptorsRequest.getDefaultInstance()) return this; - if (other.getPageSize() != 0) { - setPageSize(other.getPageSize()); - } - if (!other.getPageToken().isEmpty()) { - pageToken_ = other.pageToken_; - onChanged(); - } - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.logging.v2.ListMonitoredResourceDescriptorsRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.logging.v2.ListMonitoredResourceDescriptorsRequest) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int pageSize_ ; - /** - * optional int32 page_size = 1; - * - *
-     * Optional. The maximum number of results to return from this request.  Fewer
-     * results might be returned. You must check for the 'nextPageToken` result to
-     * determine if additional results are available, which you can retrieve by
-     * passing the `nextPageToken` value in the `pageToken` parameter to the next
-     * request.
-     * 
- */ - public int getPageSize() { - return pageSize_; - } - /** - * optional int32 page_size = 1; - * - *
-     * Optional. The maximum number of results to return from this request.  Fewer
-     * results might be returned. You must check for the 'nextPageToken` result to
-     * determine if additional results are available, which you can retrieve by
-     * passing the `nextPageToken` value in the `pageToken` parameter to the next
-     * request.
-     * 
- */ - public Builder setPageSize(int value) { - - pageSize_ = value; - onChanged(); - return this; - } - /** - * optional int32 page_size = 1; - * - *
-     * Optional. The maximum number of results to return from this request.  Fewer
-     * results might be returned. You must check for the 'nextPageToken` result to
-     * determine if additional results are available, which you can retrieve by
-     * passing the `nextPageToken` value in the `pageToken` parameter to the next
-     * request.
-     * 
- */ - public Builder clearPageSize() { - - pageSize_ = 0; - onChanged(); - return this; - } - - private java.lang.Object pageToken_ = ""; - /** - * optional string page_token = 2; - * - *
-     * Optional. If the `pageToken` request parameter is supplied, then the next
-     * page of results in the set are retrieved.  The `pageToken` parameter must
-     * be set with the value of the `nextPageToken` result parameter from the
-     * previous request.
-     * 
- */ - public java.lang.String getPageToken() { - java.lang.Object ref = pageToken_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - pageToken_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string page_token = 2; - * - *
-     * Optional. If the `pageToken` request parameter is supplied, then the next
-     * page of results in the set are retrieved.  The `pageToken` parameter must
-     * be set with the value of the `nextPageToken` result parameter from the
-     * previous request.
-     * 
- */ - public com.google.protobuf.ByteString - getPageTokenBytes() { - java.lang.Object ref = pageToken_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - pageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string page_token = 2; - * - *
-     * Optional. If the `pageToken` request parameter is supplied, then the next
-     * page of results in the set are retrieved.  The `pageToken` parameter must
-     * be set with the value of the `nextPageToken` result parameter from the
-     * previous request.
-     * 
- */ - public Builder setPageToken( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - pageToken_ = value; - onChanged(); - return this; - } - /** - * optional string page_token = 2; - * - *
-     * Optional. If the `pageToken` request parameter is supplied, then the next
-     * page of results in the set are retrieved.  The `pageToken` parameter must
-     * be set with the value of the `nextPageToken` result parameter from the
-     * previous request.
-     * 
- */ - public Builder clearPageToken() { - - pageToken_ = getDefaultInstance().getPageToken(); - onChanged(); - return this; - } - /** - * optional string page_token = 2; - * - *
-     * Optional. If the `pageToken` request parameter is supplied, then the next
-     * page of results in the set are retrieved.  The `pageToken` parameter must
-     * be set with the value of the `nextPageToken` result parameter from the
-     * previous request.
-     * 
- */ - public Builder setPageTokenBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - pageToken_ = value; - onChanged(); - return this; - } - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - - // @@protoc_insertion_point(builder_scope:google.logging.v2.ListMonitoredResourceDescriptorsRequest) - } - - // @@protoc_insertion_point(class_scope:google.logging.v2.ListMonitoredResourceDescriptorsRequest) - private static final com.google.logging.v2.ListMonitoredResourceDescriptorsRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.logging.v2.ListMonitoredResourceDescriptorsRequest(); - } - - public static com.google.logging.v2.ListMonitoredResourceDescriptorsRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - public ListMonitoredResourceDescriptorsRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - try { - return new ListMonitoredResourceDescriptorsRequest(input, extensionRegistry); - } catch (RuntimeException e) { - if (e.getCause() instanceof - com.google.protobuf.InvalidProtocolBufferException) { - throw (com.google.protobuf.InvalidProtocolBufferException) - e.getCause(); - } - throw e; - } - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public com.google.logging.v2.ListMonitoredResourceDescriptorsRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListMonitoredResourceDescriptorsRequestOrBuilder.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListMonitoredResourceDescriptorsRequestOrBuilder.java deleted file mode 100644 index 81e37b7b2294..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListMonitoredResourceDescriptorsRequestOrBuilder.java +++ /dev/null @@ -1,46 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/logging/v2/logging.proto - -package com.google.logging.v2; - -public interface ListMonitoredResourceDescriptorsRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.logging.v2.ListMonitoredResourceDescriptorsRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * optional int32 page_size = 1; - * - *
-   * Optional. The maximum number of results to return from this request.  Fewer
-   * results might be returned. You must check for the 'nextPageToken` result to
-   * determine if additional results are available, which you can retrieve by
-   * passing the `nextPageToken` value in the `pageToken` parameter to the next
-   * request.
-   * 
- */ - int getPageSize(); - - /** - * optional string page_token = 2; - * - *
-   * Optional. If the `pageToken` request parameter is supplied, then the next
-   * page of results in the set are retrieved.  The `pageToken` parameter must
-   * be set with the value of the `nextPageToken` result parameter from the
-   * previous request.
-   * 
- */ - java.lang.String getPageToken(); - /** - * optional string page_token = 2; - * - *
-   * Optional. If the `pageToken` request parameter is supplied, then the next
-   * page of results in the set are retrieved.  The `pageToken` parameter must
-   * be set with the value of the `nextPageToken` result parameter from the
-   * previous request.
-   * 
- */ - com.google.protobuf.ByteString - getPageTokenBytes(); -} diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListMonitoredResourceDescriptorsResponse.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListMonitoredResourceDescriptorsResponse.java deleted file mode 100644 index 2a22b7fd3109..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListMonitoredResourceDescriptorsResponse.java +++ /dev/null @@ -1,923 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/logging/v2/logging.proto - -package com.google.logging.v2; - -/** - * Protobuf type {@code google.logging.v2.ListMonitoredResourceDescriptorsResponse} - * - *
- * Result returned from ListMonitoredResourceDescriptors.
- * 
- */ -public final class ListMonitoredResourceDescriptorsResponse extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:google.logging.v2.ListMonitoredResourceDescriptorsResponse) - ListMonitoredResourceDescriptorsResponseOrBuilder { - // Use ListMonitoredResourceDescriptorsResponse.newBuilder() to construct. - private ListMonitoredResourceDescriptorsResponse(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - private ListMonitoredResourceDescriptorsResponse() { - resourceDescriptors_ = java.util.Collections.emptyList(); - nextPageToken_ = ""; - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); - } - private ListMonitoredResourceDescriptorsResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) { - this(); - int mutable_bitField0_ = 0; - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!input.skipField(tag)) { - done = true; - } - break; - } - case 10: { - if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - resourceDescriptors_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - resourceDescriptors_.add(input.readMessage(com.google.api.MonitoredResourceDescriptor.parser(), extensionRegistry)); - break; - } - case 18: { - String s = input.readStringRequireUtf8(); - - nextPageToken_ = s; - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw new RuntimeException(e.setUnfinishedMessage(this)); - } catch (java.io.IOException e) { - throw new RuntimeException( - new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this)); - } finally { - if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - resourceDescriptors_ = java.util.Collections.unmodifiableList(resourceDescriptors_); - } - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_ListMonitoredResourceDescriptorsResponse_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_ListMonitoredResourceDescriptorsResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.logging.v2.ListMonitoredResourceDescriptorsResponse.class, com.google.logging.v2.ListMonitoredResourceDescriptorsResponse.Builder.class); - } - - private int bitField0_; - public static final int RESOURCE_DESCRIPTORS_FIELD_NUMBER = 1; - private java.util.List resourceDescriptors_; - /** - * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; - * - *
-   * A list of resource descriptors.
-   * 
- */ - public java.util.List getResourceDescriptorsList() { - return resourceDescriptors_; - } - /** - * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; - * - *
-   * A list of resource descriptors.
-   * 
- */ - public java.util.List - getResourceDescriptorsOrBuilderList() { - return resourceDescriptors_; - } - /** - * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; - * - *
-   * A list of resource descriptors.
-   * 
- */ - public int getResourceDescriptorsCount() { - return resourceDescriptors_.size(); - } - /** - * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; - * - *
-   * A list of resource descriptors.
-   * 
- */ - public com.google.api.MonitoredResourceDescriptor getResourceDescriptors(int index) { - return resourceDescriptors_.get(index); - } - /** - * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; - * - *
-   * A list of resource descriptors.
-   * 
- */ - public com.google.api.MonitoredResourceDescriptorOrBuilder getResourceDescriptorsOrBuilder( - int index) { - return resourceDescriptors_.get(index); - } - - public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; - private volatile java.lang.Object nextPageToken_; - /** - * optional string next_page_token = 2; - * - *
-   * If there are more results than were returned, then `nextPageToken` is
-   * returned in the response.  To get the next batch of results, call this
-   * method again using the value of `nextPageToken` as `pageToken`.
-   * 
- */ - public java.lang.String getNextPageToken() { - java.lang.Object ref = nextPageToken_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - nextPageToken_ = s; - return s; - } - } - /** - * optional string next_page_token = 2; - * - *
-   * If there are more results than were returned, then `nextPageToken` is
-   * returned in the response.  To get the next batch of results, call this
-   * method again using the value of `nextPageToken` as `pageToken`.
-   * 
- */ - public com.google.protobuf.ByteString - getNextPageTokenBytes() { - java.lang.Object ref = nextPageToken_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - nextPageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < resourceDescriptors_.size(); i++) { - output.writeMessage(1, resourceDescriptors_.get(i)); - } - if (!getNextPageTokenBytes().isEmpty()) { - com.google.protobuf.GeneratedMessage.writeString(output, 2, nextPageToken_); - } - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < resourceDescriptors_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, resourceDescriptors_.get(i)); - } - if (!getNextPageTokenBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessage.computeStringSize(2, nextPageToken_); - } - memoizedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - public static com.google.logging.v2.ListMonitoredResourceDescriptorsResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.logging.v2.ListMonitoredResourceDescriptorsResponse parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.logging.v2.ListMonitoredResourceDescriptorsResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.logging.v2.ListMonitoredResourceDescriptorsResponse parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.logging.v2.ListMonitoredResourceDescriptorsResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.google.logging.v2.ListMonitoredResourceDescriptorsResponse parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static com.google.logging.v2.ListMonitoredResourceDescriptorsResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static com.google.logging.v2.ListMonitoredResourceDescriptorsResponse parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static com.google.logging.v2.ListMonitoredResourceDescriptorsResponse parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.google.logging.v2.ListMonitoredResourceDescriptorsResponse parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.logging.v2.ListMonitoredResourceDescriptorsResponse prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code google.logging.v2.ListMonitoredResourceDescriptorsResponse} - * - *
-   * Result returned from ListMonitoredResourceDescriptors.
-   * 
- */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:google.logging.v2.ListMonitoredResourceDescriptorsResponse) - com.google.logging.v2.ListMonitoredResourceDescriptorsResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_ListMonitoredResourceDescriptorsResponse_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_ListMonitoredResourceDescriptorsResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.logging.v2.ListMonitoredResourceDescriptorsResponse.class, com.google.logging.v2.ListMonitoredResourceDescriptorsResponse.Builder.class); - } - - // Construct using com.google.logging.v2.ListMonitoredResourceDescriptorsResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - getResourceDescriptorsFieldBuilder(); - } - } - public Builder clear() { - super.clear(); - if (resourceDescriptorsBuilder_ == null) { - resourceDescriptors_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - resourceDescriptorsBuilder_.clear(); - } - nextPageToken_ = ""; - - return this; - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_ListMonitoredResourceDescriptorsResponse_descriptor; - } - - public com.google.logging.v2.ListMonitoredResourceDescriptorsResponse getDefaultInstanceForType() { - return com.google.logging.v2.ListMonitoredResourceDescriptorsResponse.getDefaultInstance(); - } - - public com.google.logging.v2.ListMonitoredResourceDescriptorsResponse build() { - com.google.logging.v2.ListMonitoredResourceDescriptorsResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.google.logging.v2.ListMonitoredResourceDescriptorsResponse buildPartial() { - com.google.logging.v2.ListMonitoredResourceDescriptorsResponse result = new com.google.logging.v2.ListMonitoredResourceDescriptorsResponse(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (resourceDescriptorsBuilder_ == null) { - if (((bitField0_ & 0x00000001) == 0x00000001)) { - resourceDescriptors_ = java.util.Collections.unmodifiableList(resourceDescriptors_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.resourceDescriptors_ = resourceDescriptors_; - } else { - result.resourceDescriptors_ = resourceDescriptorsBuilder_.build(); - } - result.nextPageToken_ = nextPageToken_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.logging.v2.ListMonitoredResourceDescriptorsResponse) { - return mergeFrom((com.google.logging.v2.ListMonitoredResourceDescriptorsResponse)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.logging.v2.ListMonitoredResourceDescriptorsResponse other) { - if (other == com.google.logging.v2.ListMonitoredResourceDescriptorsResponse.getDefaultInstance()) return this; - if (resourceDescriptorsBuilder_ == null) { - if (!other.resourceDescriptors_.isEmpty()) { - if (resourceDescriptors_.isEmpty()) { - resourceDescriptors_ = other.resourceDescriptors_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureResourceDescriptorsIsMutable(); - resourceDescriptors_.addAll(other.resourceDescriptors_); - } - onChanged(); - } - } else { - if (!other.resourceDescriptors_.isEmpty()) { - if (resourceDescriptorsBuilder_.isEmpty()) { - resourceDescriptorsBuilder_.dispose(); - resourceDescriptorsBuilder_ = null; - resourceDescriptors_ = other.resourceDescriptors_; - bitField0_ = (bitField0_ & ~0x00000001); - resourceDescriptorsBuilder_ = - com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? - getResourceDescriptorsFieldBuilder() : null; - } else { - resourceDescriptorsBuilder_.addAllMessages(other.resourceDescriptors_); - } - } - } - if (!other.getNextPageToken().isEmpty()) { - nextPageToken_ = other.nextPageToken_; - onChanged(); - } - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.logging.v2.ListMonitoredResourceDescriptorsResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.logging.v2.ListMonitoredResourceDescriptorsResponse) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List resourceDescriptors_ = - java.util.Collections.emptyList(); - private void ensureResourceDescriptorsIsMutable() { - if (!((bitField0_ & 0x00000001) == 0x00000001)) { - resourceDescriptors_ = new java.util.ArrayList(resourceDescriptors_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilder< - com.google.api.MonitoredResourceDescriptor, com.google.api.MonitoredResourceDescriptor.Builder, com.google.api.MonitoredResourceDescriptorOrBuilder> resourceDescriptorsBuilder_; - - /** - * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; - * - *
-     * A list of resource descriptors.
-     * 
- */ - public java.util.List getResourceDescriptorsList() { - if (resourceDescriptorsBuilder_ == null) { - return java.util.Collections.unmodifiableList(resourceDescriptors_); - } else { - return resourceDescriptorsBuilder_.getMessageList(); - } - } - /** - * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; - * - *
-     * A list of resource descriptors.
-     * 
- */ - public int getResourceDescriptorsCount() { - if (resourceDescriptorsBuilder_ == null) { - return resourceDescriptors_.size(); - } else { - return resourceDescriptorsBuilder_.getCount(); - } - } - /** - * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; - * - *
-     * A list of resource descriptors.
-     * 
- */ - public com.google.api.MonitoredResourceDescriptor getResourceDescriptors(int index) { - if (resourceDescriptorsBuilder_ == null) { - return resourceDescriptors_.get(index); - } else { - return resourceDescriptorsBuilder_.getMessage(index); - } - } - /** - * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; - * - *
-     * A list of resource descriptors.
-     * 
- */ - public Builder setResourceDescriptors( - int index, com.google.api.MonitoredResourceDescriptor value) { - if (resourceDescriptorsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResourceDescriptorsIsMutable(); - resourceDescriptors_.set(index, value); - onChanged(); - } else { - resourceDescriptorsBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; - * - *
-     * A list of resource descriptors.
-     * 
- */ - public Builder setResourceDescriptors( - int index, com.google.api.MonitoredResourceDescriptor.Builder builderForValue) { - if (resourceDescriptorsBuilder_ == null) { - ensureResourceDescriptorsIsMutable(); - resourceDescriptors_.set(index, builderForValue.build()); - onChanged(); - } else { - resourceDescriptorsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; - * - *
-     * A list of resource descriptors.
-     * 
- */ - public Builder addResourceDescriptors(com.google.api.MonitoredResourceDescriptor value) { - if (resourceDescriptorsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResourceDescriptorsIsMutable(); - resourceDescriptors_.add(value); - onChanged(); - } else { - resourceDescriptorsBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; - * - *
-     * A list of resource descriptors.
-     * 
- */ - public Builder addResourceDescriptors( - int index, com.google.api.MonitoredResourceDescriptor value) { - if (resourceDescriptorsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResourceDescriptorsIsMutable(); - resourceDescriptors_.add(index, value); - onChanged(); - } else { - resourceDescriptorsBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; - * - *
-     * A list of resource descriptors.
-     * 
- */ - public Builder addResourceDescriptors( - com.google.api.MonitoredResourceDescriptor.Builder builderForValue) { - if (resourceDescriptorsBuilder_ == null) { - ensureResourceDescriptorsIsMutable(); - resourceDescriptors_.add(builderForValue.build()); - onChanged(); - } else { - resourceDescriptorsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; - * - *
-     * A list of resource descriptors.
-     * 
- */ - public Builder addResourceDescriptors( - int index, com.google.api.MonitoredResourceDescriptor.Builder builderForValue) { - if (resourceDescriptorsBuilder_ == null) { - ensureResourceDescriptorsIsMutable(); - resourceDescriptors_.add(index, builderForValue.build()); - onChanged(); - } else { - resourceDescriptorsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; - * - *
-     * A list of resource descriptors.
-     * 
- */ - public Builder addAllResourceDescriptors( - java.lang.Iterable values) { - if (resourceDescriptorsBuilder_ == null) { - ensureResourceDescriptorsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, resourceDescriptors_); - onChanged(); - } else { - resourceDescriptorsBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; - * - *
-     * A list of resource descriptors.
-     * 
- */ - public Builder clearResourceDescriptors() { - if (resourceDescriptorsBuilder_ == null) { - resourceDescriptors_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - resourceDescriptorsBuilder_.clear(); - } - return this; - } - /** - * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; - * - *
-     * A list of resource descriptors.
-     * 
- */ - public Builder removeResourceDescriptors(int index) { - if (resourceDescriptorsBuilder_ == null) { - ensureResourceDescriptorsIsMutable(); - resourceDescriptors_.remove(index); - onChanged(); - } else { - resourceDescriptorsBuilder_.remove(index); - } - return this; - } - /** - * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; - * - *
-     * A list of resource descriptors.
-     * 
- */ - public com.google.api.MonitoredResourceDescriptor.Builder getResourceDescriptorsBuilder( - int index) { - return getResourceDescriptorsFieldBuilder().getBuilder(index); - } - /** - * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; - * - *
-     * A list of resource descriptors.
-     * 
- */ - public com.google.api.MonitoredResourceDescriptorOrBuilder getResourceDescriptorsOrBuilder( - int index) { - if (resourceDescriptorsBuilder_ == null) { - return resourceDescriptors_.get(index); } else { - return resourceDescriptorsBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; - * - *
-     * A list of resource descriptors.
-     * 
- */ - public java.util.List - getResourceDescriptorsOrBuilderList() { - if (resourceDescriptorsBuilder_ != null) { - return resourceDescriptorsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(resourceDescriptors_); - } - } - /** - * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; - * - *
-     * A list of resource descriptors.
-     * 
- */ - public com.google.api.MonitoredResourceDescriptor.Builder addResourceDescriptorsBuilder() { - return getResourceDescriptorsFieldBuilder().addBuilder( - com.google.api.MonitoredResourceDescriptor.getDefaultInstance()); - } - /** - * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; - * - *
-     * A list of resource descriptors.
-     * 
- */ - public com.google.api.MonitoredResourceDescriptor.Builder addResourceDescriptorsBuilder( - int index) { - return getResourceDescriptorsFieldBuilder().addBuilder( - index, com.google.api.MonitoredResourceDescriptor.getDefaultInstance()); - } - /** - * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; - * - *
-     * A list of resource descriptors.
-     * 
- */ - public java.util.List - getResourceDescriptorsBuilderList() { - return getResourceDescriptorsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilder< - com.google.api.MonitoredResourceDescriptor, com.google.api.MonitoredResourceDescriptor.Builder, com.google.api.MonitoredResourceDescriptorOrBuilder> - getResourceDescriptorsFieldBuilder() { - if (resourceDescriptorsBuilder_ == null) { - resourceDescriptorsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< - com.google.api.MonitoredResourceDescriptor, com.google.api.MonitoredResourceDescriptor.Builder, com.google.api.MonitoredResourceDescriptorOrBuilder>( - resourceDescriptors_, - ((bitField0_ & 0x00000001) == 0x00000001), - getParentForChildren(), - isClean()); - resourceDescriptors_ = null; - } - return resourceDescriptorsBuilder_; - } - - private java.lang.Object nextPageToken_ = ""; - /** - * optional string next_page_token = 2; - * - *
-     * If there are more results than were returned, then `nextPageToken` is
-     * returned in the response.  To get the next batch of results, call this
-     * method again using the value of `nextPageToken` as `pageToken`.
-     * 
- */ - public java.lang.String getNextPageToken() { - java.lang.Object ref = nextPageToken_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - nextPageToken_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string next_page_token = 2; - * - *
-     * If there are more results than were returned, then `nextPageToken` is
-     * returned in the response.  To get the next batch of results, call this
-     * method again using the value of `nextPageToken` as `pageToken`.
-     * 
- */ - public com.google.protobuf.ByteString - getNextPageTokenBytes() { - java.lang.Object ref = nextPageToken_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - nextPageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string next_page_token = 2; - * - *
-     * If there are more results than were returned, then `nextPageToken` is
-     * returned in the response.  To get the next batch of results, call this
-     * method again using the value of `nextPageToken` as `pageToken`.
-     * 
- */ - public Builder setNextPageToken( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - nextPageToken_ = value; - onChanged(); - return this; - } - /** - * optional string next_page_token = 2; - * - *
-     * If there are more results than were returned, then `nextPageToken` is
-     * returned in the response.  To get the next batch of results, call this
-     * method again using the value of `nextPageToken` as `pageToken`.
-     * 
- */ - public Builder clearNextPageToken() { - - nextPageToken_ = getDefaultInstance().getNextPageToken(); - onChanged(); - return this; - } - /** - * optional string next_page_token = 2; - * - *
-     * If there are more results than were returned, then `nextPageToken` is
-     * returned in the response.  To get the next batch of results, call this
-     * method again using the value of `nextPageToken` as `pageToken`.
-     * 
- */ - public Builder setNextPageTokenBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - nextPageToken_ = value; - onChanged(); - return this; - } - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - - // @@protoc_insertion_point(builder_scope:google.logging.v2.ListMonitoredResourceDescriptorsResponse) - } - - // @@protoc_insertion_point(class_scope:google.logging.v2.ListMonitoredResourceDescriptorsResponse) - private static final com.google.logging.v2.ListMonitoredResourceDescriptorsResponse DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.logging.v2.ListMonitoredResourceDescriptorsResponse(); - } - - public static com.google.logging.v2.ListMonitoredResourceDescriptorsResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - public ListMonitoredResourceDescriptorsResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - try { - return new ListMonitoredResourceDescriptorsResponse(input, extensionRegistry); - } catch (RuntimeException e) { - if (e.getCause() instanceof - com.google.protobuf.InvalidProtocolBufferException) { - throw (com.google.protobuf.InvalidProtocolBufferException) - e.getCause(); - } - throw e; - } - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public com.google.logging.v2.ListMonitoredResourceDescriptorsResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListMonitoredResourceDescriptorsResponseOrBuilder.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListMonitoredResourceDescriptorsResponseOrBuilder.java deleted file mode 100644 index f582b8256eca..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListMonitoredResourceDescriptorsResponseOrBuilder.java +++ /dev/null @@ -1,75 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/logging/v2/logging.proto - -package com.google.logging.v2; - -public interface ListMonitoredResourceDescriptorsResponseOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.logging.v2.ListMonitoredResourceDescriptorsResponse) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; - * - *
-   * A list of resource descriptors.
-   * 
- */ - java.util.List - getResourceDescriptorsList(); - /** - * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; - * - *
-   * A list of resource descriptors.
-   * 
- */ - com.google.api.MonitoredResourceDescriptor getResourceDescriptors(int index); - /** - * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; - * - *
-   * A list of resource descriptors.
-   * 
- */ - int getResourceDescriptorsCount(); - /** - * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; - * - *
-   * A list of resource descriptors.
-   * 
- */ - java.util.List - getResourceDescriptorsOrBuilderList(); - /** - * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; - * - *
-   * A list of resource descriptors.
-   * 
- */ - com.google.api.MonitoredResourceDescriptorOrBuilder getResourceDescriptorsOrBuilder( - int index); - - /** - * optional string next_page_token = 2; - * - *
-   * If there are more results than were returned, then `nextPageToken` is
-   * returned in the response.  To get the next batch of results, call this
-   * method again using the value of `nextPageToken` as `pageToken`.
-   * 
- */ - java.lang.String getNextPageToken(); - /** - * optional string next_page_token = 2; - * - *
-   * If there are more results than were returned, then `nextPageToken` is
-   * returned in the response.  To get the next batch of results, call this
-   * method again using the value of `nextPageToken` as `pageToken`.
-   * 
- */ - com.google.protobuf.ByteString - getNextPageTokenBytes(); -} diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListSinksRequest.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListSinksRequest.java deleted file mode 100644 index 3c1400d169ff..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListSinksRequest.java +++ /dev/null @@ -1,748 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/logging/v2/logging_config.proto - -package com.google.logging.v2; - -/** - * Protobuf type {@code google.logging.v2.ListSinksRequest} - * - *
- * The parameters to `ListSinks`.
- * 
- */ -public final class ListSinksRequest extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:google.logging.v2.ListSinksRequest) - ListSinksRequestOrBuilder { - // Use ListSinksRequest.newBuilder() to construct. - private ListSinksRequest(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - private ListSinksRequest() { - projectName_ = ""; - pageToken_ = ""; - pageSize_ = 0; - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); - } - private ListSinksRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) { - this(); - int mutable_bitField0_ = 0; - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!input.skipField(tag)) { - done = true; - } - break; - } - case 10: { - String s = input.readStringRequireUtf8(); - - projectName_ = s; - break; - } - case 18: { - String s = input.readStringRequireUtf8(); - - pageToken_ = s; - break; - } - case 24: { - - pageSize_ = input.readInt32(); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw new RuntimeException(e.setUnfinishedMessage(this)); - } catch (java.io.IOException e) { - throw new RuntimeException( - new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this)); - } finally { - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.logging.v2.LoggingConfig.internal_static_google_logging_v2_ListSinksRequest_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.logging.v2.LoggingConfig.internal_static_google_logging_v2_ListSinksRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.logging.v2.ListSinksRequest.class, com.google.logging.v2.ListSinksRequest.Builder.class); - } - - public static final int PROJECT_NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object projectName_; - /** - * optional string project_name = 1; - * - *
-   * Required. The resource name of the project owning the sinks.
-   * Example: `"projects/my-logging-project"`, `"projects/01234567890"`.
-   * 
- */ - public java.lang.String getProjectName() { - java.lang.Object ref = projectName_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - projectName_ = s; - return s; - } - } - /** - * optional string project_name = 1; - * - *
-   * Required. The resource name of the project owning the sinks.
-   * Example: `"projects/my-logging-project"`, `"projects/01234567890"`.
-   * 
- */ - public com.google.protobuf.ByteString - getProjectNameBytes() { - java.lang.Object ref = projectName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - projectName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PAGE_TOKEN_FIELD_NUMBER = 2; - private volatile java.lang.Object pageToken_; - /** - * optional string page_token = 2; - * - *
-   * Optional. If the `pageToken` request parameter is supplied, then the next
-   * page of results in the set are retrieved.  The `pageToken` parameter must
-   * be set with the value of the `nextPageToken` result parameter from the
-   * previous request. The value of `projectName` must be the same as in the
-   * previous request.
-   * 
- */ - public java.lang.String getPageToken() { - java.lang.Object ref = pageToken_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - pageToken_ = s; - return s; - } - } - /** - * optional string page_token = 2; - * - *
-   * Optional. If the `pageToken` request parameter is supplied, then the next
-   * page of results in the set are retrieved.  The `pageToken` parameter must
-   * be set with the value of the `nextPageToken` result parameter from the
-   * previous request. The value of `projectName` must be the same as in the
-   * previous request.
-   * 
- */ - public com.google.protobuf.ByteString - getPageTokenBytes() { - java.lang.Object ref = pageToken_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - pageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PAGE_SIZE_FIELD_NUMBER = 3; - private int pageSize_; - /** - * optional int32 page_size = 3; - * - *
-   * Optional. The maximum number of results to return from this request.  Fewer
-   * results might be returned. You must check for the 'nextPageToken` result to
-   * determine if additional results are available, which you can retrieve by
-   * passing the `nextPageToken` value in the `pageToken` parameter to the next
-   * request.
-   * 
- */ - public int getPageSize() { - return pageSize_; - } - - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getProjectNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessage.writeString(output, 1, projectName_); - } - if (!getPageTokenBytes().isEmpty()) { - com.google.protobuf.GeneratedMessage.writeString(output, 2, pageToken_); - } - if (pageSize_ != 0) { - output.writeInt32(3, pageSize_); - } - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getProjectNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessage.computeStringSize(1, projectName_); - } - if (!getPageTokenBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessage.computeStringSize(2, pageToken_); - } - if (pageSize_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(3, pageSize_); - } - memoizedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - public static com.google.logging.v2.ListSinksRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.logging.v2.ListSinksRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.logging.v2.ListSinksRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.logging.v2.ListSinksRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.logging.v2.ListSinksRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.google.logging.v2.ListSinksRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static com.google.logging.v2.ListSinksRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static com.google.logging.v2.ListSinksRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static com.google.logging.v2.ListSinksRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.google.logging.v2.ListSinksRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.logging.v2.ListSinksRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code google.logging.v2.ListSinksRequest} - * - *
-   * The parameters to `ListSinks`.
-   * 
- */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:google.logging.v2.ListSinksRequest) - com.google.logging.v2.ListSinksRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.logging.v2.LoggingConfig.internal_static_google_logging_v2_ListSinksRequest_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.logging.v2.LoggingConfig.internal_static_google_logging_v2_ListSinksRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.logging.v2.ListSinksRequest.class, com.google.logging.v2.ListSinksRequest.Builder.class); - } - - // Construct using com.google.logging.v2.ListSinksRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - public Builder clear() { - super.clear(); - projectName_ = ""; - - pageToken_ = ""; - - pageSize_ = 0; - - return this; - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.logging.v2.LoggingConfig.internal_static_google_logging_v2_ListSinksRequest_descriptor; - } - - public com.google.logging.v2.ListSinksRequest getDefaultInstanceForType() { - return com.google.logging.v2.ListSinksRequest.getDefaultInstance(); - } - - public com.google.logging.v2.ListSinksRequest build() { - com.google.logging.v2.ListSinksRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.google.logging.v2.ListSinksRequest buildPartial() { - com.google.logging.v2.ListSinksRequest result = new com.google.logging.v2.ListSinksRequest(this); - result.projectName_ = projectName_; - result.pageToken_ = pageToken_; - result.pageSize_ = pageSize_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.logging.v2.ListSinksRequest) { - return mergeFrom((com.google.logging.v2.ListSinksRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.logging.v2.ListSinksRequest other) { - if (other == com.google.logging.v2.ListSinksRequest.getDefaultInstance()) return this; - if (!other.getProjectName().isEmpty()) { - projectName_ = other.projectName_; - onChanged(); - } - if (!other.getPageToken().isEmpty()) { - pageToken_ = other.pageToken_; - onChanged(); - } - if (other.getPageSize() != 0) { - setPageSize(other.getPageSize()); - } - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.logging.v2.ListSinksRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.logging.v2.ListSinksRequest) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object projectName_ = ""; - /** - * optional string project_name = 1; - * - *
-     * Required. The resource name of the project owning the sinks.
-     * Example: `"projects/my-logging-project"`, `"projects/01234567890"`.
-     * 
- */ - public java.lang.String getProjectName() { - java.lang.Object ref = projectName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - projectName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string project_name = 1; - * - *
-     * Required. The resource name of the project owning the sinks.
-     * Example: `"projects/my-logging-project"`, `"projects/01234567890"`.
-     * 
- */ - public com.google.protobuf.ByteString - getProjectNameBytes() { - java.lang.Object ref = projectName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - projectName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string project_name = 1; - * - *
-     * Required. The resource name of the project owning the sinks.
-     * Example: `"projects/my-logging-project"`, `"projects/01234567890"`.
-     * 
- */ - public Builder setProjectName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - projectName_ = value; - onChanged(); - return this; - } - /** - * optional string project_name = 1; - * - *
-     * Required. The resource name of the project owning the sinks.
-     * Example: `"projects/my-logging-project"`, `"projects/01234567890"`.
-     * 
- */ - public Builder clearProjectName() { - - projectName_ = getDefaultInstance().getProjectName(); - onChanged(); - return this; - } - /** - * optional string project_name = 1; - * - *
-     * Required. The resource name of the project owning the sinks.
-     * Example: `"projects/my-logging-project"`, `"projects/01234567890"`.
-     * 
- */ - public Builder setProjectNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - projectName_ = value; - onChanged(); - return this; - } - - private java.lang.Object pageToken_ = ""; - /** - * optional string page_token = 2; - * - *
-     * Optional. If the `pageToken` request parameter is supplied, then the next
-     * page of results in the set are retrieved.  The `pageToken` parameter must
-     * be set with the value of the `nextPageToken` result parameter from the
-     * previous request. The value of `projectName` must be the same as in the
-     * previous request.
-     * 
- */ - public java.lang.String getPageToken() { - java.lang.Object ref = pageToken_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - pageToken_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string page_token = 2; - * - *
-     * Optional. If the `pageToken` request parameter is supplied, then the next
-     * page of results in the set are retrieved.  The `pageToken` parameter must
-     * be set with the value of the `nextPageToken` result parameter from the
-     * previous request. The value of `projectName` must be the same as in the
-     * previous request.
-     * 
- */ - public com.google.protobuf.ByteString - getPageTokenBytes() { - java.lang.Object ref = pageToken_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - pageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string page_token = 2; - * - *
-     * Optional. If the `pageToken` request parameter is supplied, then the next
-     * page of results in the set are retrieved.  The `pageToken` parameter must
-     * be set with the value of the `nextPageToken` result parameter from the
-     * previous request. The value of `projectName` must be the same as in the
-     * previous request.
-     * 
- */ - public Builder setPageToken( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - pageToken_ = value; - onChanged(); - return this; - } - /** - * optional string page_token = 2; - * - *
-     * Optional. If the `pageToken` request parameter is supplied, then the next
-     * page of results in the set are retrieved.  The `pageToken` parameter must
-     * be set with the value of the `nextPageToken` result parameter from the
-     * previous request. The value of `projectName` must be the same as in the
-     * previous request.
-     * 
- */ - public Builder clearPageToken() { - - pageToken_ = getDefaultInstance().getPageToken(); - onChanged(); - return this; - } - /** - * optional string page_token = 2; - * - *
-     * Optional. If the `pageToken` request parameter is supplied, then the next
-     * page of results in the set are retrieved.  The `pageToken` parameter must
-     * be set with the value of the `nextPageToken` result parameter from the
-     * previous request. The value of `projectName` must be the same as in the
-     * previous request.
-     * 
- */ - public Builder setPageTokenBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - pageToken_ = value; - onChanged(); - return this; - } - - private int pageSize_ ; - /** - * optional int32 page_size = 3; - * - *
-     * Optional. The maximum number of results to return from this request.  Fewer
-     * results might be returned. You must check for the 'nextPageToken` result to
-     * determine if additional results are available, which you can retrieve by
-     * passing the `nextPageToken` value in the `pageToken` parameter to the next
-     * request.
-     * 
- */ - public int getPageSize() { - return pageSize_; - } - /** - * optional int32 page_size = 3; - * - *
-     * Optional. The maximum number of results to return from this request.  Fewer
-     * results might be returned. You must check for the 'nextPageToken` result to
-     * determine if additional results are available, which you can retrieve by
-     * passing the `nextPageToken` value in the `pageToken` parameter to the next
-     * request.
-     * 
- */ - public Builder setPageSize(int value) { - - pageSize_ = value; - onChanged(); - return this; - } - /** - * optional int32 page_size = 3; - * - *
-     * Optional. The maximum number of results to return from this request.  Fewer
-     * results might be returned. You must check for the 'nextPageToken` result to
-     * determine if additional results are available, which you can retrieve by
-     * passing the `nextPageToken` value in the `pageToken` parameter to the next
-     * request.
-     * 
- */ - public Builder clearPageSize() { - - pageSize_ = 0; - onChanged(); - return this; - } - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - - // @@protoc_insertion_point(builder_scope:google.logging.v2.ListSinksRequest) - } - - // @@protoc_insertion_point(class_scope:google.logging.v2.ListSinksRequest) - private static final com.google.logging.v2.ListSinksRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.logging.v2.ListSinksRequest(); - } - - public static com.google.logging.v2.ListSinksRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - public ListSinksRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - try { - return new ListSinksRequest(input, extensionRegistry); - } catch (RuntimeException e) { - if (e.getCause() instanceof - com.google.protobuf.InvalidProtocolBufferException) { - throw (com.google.protobuf.InvalidProtocolBufferException) - e.getCause(); - } - throw e; - } - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public com.google.logging.v2.ListSinksRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListSinksRequestOrBuilder.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListSinksRequestOrBuilder.java deleted file mode 100644 index 906d04b854f1..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListSinksRequestOrBuilder.java +++ /dev/null @@ -1,68 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/logging/v2/logging_config.proto - -package com.google.logging.v2; - -public interface ListSinksRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.logging.v2.ListSinksRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * optional string project_name = 1; - * - *
-   * Required. The resource name of the project owning the sinks.
-   * Example: `"projects/my-logging-project"`, `"projects/01234567890"`.
-   * 
- */ - java.lang.String getProjectName(); - /** - * optional string project_name = 1; - * - *
-   * Required. The resource name of the project owning the sinks.
-   * Example: `"projects/my-logging-project"`, `"projects/01234567890"`.
-   * 
- */ - com.google.protobuf.ByteString - getProjectNameBytes(); - - /** - * optional string page_token = 2; - * - *
-   * Optional. If the `pageToken` request parameter is supplied, then the next
-   * page of results in the set are retrieved.  The `pageToken` parameter must
-   * be set with the value of the `nextPageToken` result parameter from the
-   * previous request. The value of `projectName` must be the same as in the
-   * previous request.
-   * 
- */ - java.lang.String getPageToken(); - /** - * optional string page_token = 2; - * - *
-   * Optional. If the `pageToken` request parameter is supplied, then the next
-   * page of results in the set are retrieved.  The `pageToken` parameter must
-   * be set with the value of the `nextPageToken` result parameter from the
-   * previous request. The value of `projectName` must be the same as in the
-   * previous request.
-   * 
- */ - com.google.protobuf.ByteString - getPageTokenBytes(); - - /** - * optional int32 page_size = 3; - * - *
-   * Optional. The maximum number of results to return from this request.  Fewer
-   * results might be returned. You must check for the 'nextPageToken` result to
-   * determine if additional results are available, which you can retrieve by
-   * passing the `nextPageToken` value in the `pageToken` parameter to the next
-   * request.
-   * 
- */ - int getPageSize(); -} diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListSinksResponse.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListSinksResponse.java deleted file mode 100644 index 34fe7374d53c..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListSinksResponse.java +++ /dev/null @@ -1,923 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/logging/v2/logging_config.proto - -package com.google.logging.v2; - -/** - * Protobuf type {@code google.logging.v2.ListSinksResponse} - * - *
- * Result returned from `ListSinks`.
- * 
- */ -public final class ListSinksResponse extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:google.logging.v2.ListSinksResponse) - ListSinksResponseOrBuilder { - // Use ListSinksResponse.newBuilder() to construct. - private ListSinksResponse(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - private ListSinksResponse() { - sinks_ = java.util.Collections.emptyList(); - nextPageToken_ = ""; - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); - } - private ListSinksResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) { - this(); - int mutable_bitField0_ = 0; - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!input.skipField(tag)) { - done = true; - } - break; - } - case 10: { - if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - sinks_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - sinks_.add(input.readMessage(com.google.logging.v2.LogSink.parser(), extensionRegistry)); - break; - } - case 18: { - String s = input.readStringRequireUtf8(); - - nextPageToken_ = s; - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw new RuntimeException(e.setUnfinishedMessage(this)); - } catch (java.io.IOException e) { - throw new RuntimeException( - new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this)); - } finally { - if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - sinks_ = java.util.Collections.unmodifiableList(sinks_); - } - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.logging.v2.LoggingConfig.internal_static_google_logging_v2_ListSinksResponse_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.logging.v2.LoggingConfig.internal_static_google_logging_v2_ListSinksResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.logging.v2.ListSinksResponse.class, com.google.logging.v2.ListSinksResponse.Builder.class); - } - - private int bitField0_; - public static final int SINKS_FIELD_NUMBER = 1; - private java.util.List sinks_; - /** - * repeated .google.logging.v2.LogSink sinks = 1; - * - *
-   * A list of sinks.
-   * 
- */ - public java.util.List getSinksList() { - return sinks_; - } - /** - * repeated .google.logging.v2.LogSink sinks = 1; - * - *
-   * A list of sinks.
-   * 
- */ - public java.util.List - getSinksOrBuilderList() { - return sinks_; - } - /** - * repeated .google.logging.v2.LogSink sinks = 1; - * - *
-   * A list of sinks.
-   * 
- */ - public int getSinksCount() { - return sinks_.size(); - } - /** - * repeated .google.logging.v2.LogSink sinks = 1; - * - *
-   * A list of sinks.
-   * 
- */ - public com.google.logging.v2.LogSink getSinks(int index) { - return sinks_.get(index); - } - /** - * repeated .google.logging.v2.LogSink sinks = 1; - * - *
-   * A list of sinks.
-   * 
- */ - public com.google.logging.v2.LogSinkOrBuilder getSinksOrBuilder( - int index) { - return sinks_.get(index); - } - - public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; - private volatile java.lang.Object nextPageToken_; - /** - * optional string next_page_token = 2; - * - *
-   * If there are more results than were returned, then `nextPageToken` is
-   * given a value in the response.  To get the next batch of results, call this
-   * method again using the value of `nextPageToken` as `pageToken`.
-   * 
- */ - public java.lang.String getNextPageToken() { - java.lang.Object ref = nextPageToken_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - nextPageToken_ = s; - return s; - } - } - /** - * optional string next_page_token = 2; - * - *
-   * If there are more results than were returned, then `nextPageToken` is
-   * given a value in the response.  To get the next batch of results, call this
-   * method again using the value of `nextPageToken` as `pageToken`.
-   * 
- */ - public com.google.protobuf.ByteString - getNextPageTokenBytes() { - java.lang.Object ref = nextPageToken_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - nextPageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < sinks_.size(); i++) { - output.writeMessage(1, sinks_.get(i)); - } - if (!getNextPageTokenBytes().isEmpty()) { - com.google.protobuf.GeneratedMessage.writeString(output, 2, nextPageToken_); - } - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < sinks_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, sinks_.get(i)); - } - if (!getNextPageTokenBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessage.computeStringSize(2, nextPageToken_); - } - memoizedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - public static com.google.logging.v2.ListSinksResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.logging.v2.ListSinksResponse parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.logging.v2.ListSinksResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.logging.v2.ListSinksResponse parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.logging.v2.ListSinksResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.google.logging.v2.ListSinksResponse parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static com.google.logging.v2.ListSinksResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static com.google.logging.v2.ListSinksResponse parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static com.google.logging.v2.ListSinksResponse parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.google.logging.v2.ListSinksResponse parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.logging.v2.ListSinksResponse prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code google.logging.v2.ListSinksResponse} - * - *
-   * Result returned from `ListSinks`.
-   * 
- */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:google.logging.v2.ListSinksResponse) - com.google.logging.v2.ListSinksResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.logging.v2.LoggingConfig.internal_static_google_logging_v2_ListSinksResponse_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.logging.v2.LoggingConfig.internal_static_google_logging_v2_ListSinksResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.logging.v2.ListSinksResponse.class, com.google.logging.v2.ListSinksResponse.Builder.class); - } - - // Construct using com.google.logging.v2.ListSinksResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - getSinksFieldBuilder(); - } - } - public Builder clear() { - super.clear(); - if (sinksBuilder_ == null) { - sinks_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - sinksBuilder_.clear(); - } - nextPageToken_ = ""; - - return this; - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.logging.v2.LoggingConfig.internal_static_google_logging_v2_ListSinksResponse_descriptor; - } - - public com.google.logging.v2.ListSinksResponse getDefaultInstanceForType() { - return com.google.logging.v2.ListSinksResponse.getDefaultInstance(); - } - - public com.google.logging.v2.ListSinksResponse build() { - com.google.logging.v2.ListSinksResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.google.logging.v2.ListSinksResponse buildPartial() { - com.google.logging.v2.ListSinksResponse result = new com.google.logging.v2.ListSinksResponse(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (sinksBuilder_ == null) { - if (((bitField0_ & 0x00000001) == 0x00000001)) { - sinks_ = java.util.Collections.unmodifiableList(sinks_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.sinks_ = sinks_; - } else { - result.sinks_ = sinksBuilder_.build(); - } - result.nextPageToken_ = nextPageToken_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.logging.v2.ListSinksResponse) { - return mergeFrom((com.google.logging.v2.ListSinksResponse)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.logging.v2.ListSinksResponse other) { - if (other == com.google.logging.v2.ListSinksResponse.getDefaultInstance()) return this; - if (sinksBuilder_ == null) { - if (!other.sinks_.isEmpty()) { - if (sinks_.isEmpty()) { - sinks_ = other.sinks_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureSinksIsMutable(); - sinks_.addAll(other.sinks_); - } - onChanged(); - } - } else { - if (!other.sinks_.isEmpty()) { - if (sinksBuilder_.isEmpty()) { - sinksBuilder_.dispose(); - sinksBuilder_ = null; - sinks_ = other.sinks_; - bitField0_ = (bitField0_ & ~0x00000001); - sinksBuilder_ = - com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? - getSinksFieldBuilder() : null; - } else { - sinksBuilder_.addAllMessages(other.sinks_); - } - } - } - if (!other.getNextPageToken().isEmpty()) { - nextPageToken_ = other.nextPageToken_; - onChanged(); - } - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.logging.v2.ListSinksResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.logging.v2.ListSinksResponse) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List sinks_ = - java.util.Collections.emptyList(); - private void ensureSinksIsMutable() { - if (!((bitField0_ & 0x00000001) == 0x00000001)) { - sinks_ = new java.util.ArrayList(sinks_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilder< - com.google.logging.v2.LogSink, com.google.logging.v2.LogSink.Builder, com.google.logging.v2.LogSinkOrBuilder> sinksBuilder_; - - /** - * repeated .google.logging.v2.LogSink sinks = 1; - * - *
-     * A list of sinks.
-     * 
- */ - public java.util.List getSinksList() { - if (sinksBuilder_ == null) { - return java.util.Collections.unmodifiableList(sinks_); - } else { - return sinksBuilder_.getMessageList(); - } - } - /** - * repeated .google.logging.v2.LogSink sinks = 1; - * - *
-     * A list of sinks.
-     * 
- */ - public int getSinksCount() { - if (sinksBuilder_ == null) { - return sinks_.size(); - } else { - return sinksBuilder_.getCount(); - } - } - /** - * repeated .google.logging.v2.LogSink sinks = 1; - * - *
-     * A list of sinks.
-     * 
- */ - public com.google.logging.v2.LogSink getSinks(int index) { - if (sinksBuilder_ == null) { - return sinks_.get(index); - } else { - return sinksBuilder_.getMessage(index); - } - } - /** - * repeated .google.logging.v2.LogSink sinks = 1; - * - *
-     * A list of sinks.
-     * 
- */ - public Builder setSinks( - int index, com.google.logging.v2.LogSink value) { - if (sinksBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSinksIsMutable(); - sinks_.set(index, value); - onChanged(); - } else { - sinksBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .google.logging.v2.LogSink sinks = 1; - * - *
-     * A list of sinks.
-     * 
- */ - public Builder setSinks( - int index, com.google.logging.v2.LogSink.Builder builderForValue) { - if (sinksBuilder_ == null) { - ensureSinksIsMutable(); - sinks_.set(index, builderForValue.build()); - onChanged(); - } else { - sinksBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .google.logging.v2.LogSink sinks = 1; - * - *
-     * A list of sinks.
-     * 
- */ - public Builder addSinks(com.google.logging.v2.LogSink value) { - if (sinksBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSinksIsMutable(); - sinks_.add(value); - onChanged(); - } else { - sinksBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .google.logging.v2.LogSink sinks = 1; - * - *
-     * A list of sinks.
-     * 
- */ - public Builder addSinks( - int index, com.google.logging.v2.LogSink value) { - if (sinksBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSinksIsMutable(); - sinks_.add(index, value); - onChanged(); - } else { - sinksBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .google.logging.v2.LogSink sinks = 1; - * - *
-     * A list of sinks.
-     * 
- */ - public Builder addSinks( - com.google.logging.v2.LogSink.Builder builderForValue) { - if (sinksBuilder_ == null) { - ensureSinksIsMutable(); - sinks_.add(builderForValue.build()); - onChanged(); - } else { - sinksBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .google.logging.v2.LogSink sinks = 1; - * - *
-     * A list of sinks.
-     * 
- */ - public Builder addSinks( - int index, com.google.logging.v2.LogSink.Builder builderForValue) { - if (sinksBuilder_ == null) { - ensureSinksIsMutable(); - sinks_.add(index, builderForValue.build()); - onChanged(); - } else { - sinksBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .google.logging.v2.LogSink sinks = 1; - * - *
-     * A list of sinks.
-     * 
- */ - public Builder addAllSinks( - java.lang.Iterable values) { - if (sinksBuilder_ == null) { - ensureSinksIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, sinks_); - onChanged(); - } else { - sinksBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .google.logging.v2.LogSink sinks = 1; - * - *
-     * A list of sinks.
-     * 
- */ - public Builder clearSinks() { - if (sinksBuilder_ == null) { - sinks_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - sinksBuilder_.clear(); - } - return this; - } - /** - * repeated .google.logging.v2.LogSink sinks = 1; - * - *
-     * A list of sinks.
-     * 
- */ - public Builder removeSinks(int index) { - if (sinksBuilder_ == null) { - ensureSinksIsMutable(); - sinks_.remove(index); - onChanged(); - } else { - sinksBuilder_.remove(index); - } - return this; - } - /** - * repeated .google.logging.v2.LogSink sinks = 1; - * - *
-     * A list of sinks.
-     * 
- */ - public com.google.logging.v2.LogSink.Builder getSinksBuilder( - int index) { - return getSinksFieldBuilder().getBuilder(index); - } - /** - * repeated .google.logging.v2.LogSink sinks = 1; - * - *
-     * A list of sinks.
-     * 
- */ - public com.google.logging.v2.LogSinkOrBuilder getSinksOrBuilder( - int index) { - if (sinksBuilder_ == null) { - return sinks_.get(index); } else { - return sinksBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .google.logging.v2.LogSink sinks = 1; - * - *
-     * A list of sinks.
-     * 
- */ - public java.util.List - getSinksOrBuilderList() { - if (sinksBuilder_ != null) { - return sinksBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(sinks_); - } - } - /** - * repeated .google.logging.v2.LogSink sinks = 1; - * - *
-     * A list of sinks.
-     * 
- */ - public com.google.logging.v2.LogSink.Builder addSinksBuilder() { - return getSinksFieldBuilder().addBuilder( - com.google.logging.v2.LogSink.getDefaultInstance()); - } - /** - * repeated .google.logging.v2.LogSink sinks = 1; - * - *
-     * A list of sinks.
-     * 
- */ - public com.google.logging.v2.LogSink.Builder addSinksBuilder( - int index) { - return getSinksFieldBuilder().addBuilder( - index, com.google.logging.v2.LogSink.getDefaultInstance()); - } - /** - * repeated .google.logging.v2.LogSink sinks = 1; - * - *
-     * A list of sinks.
-     * 
- */ - public java.util.List - getSinksBuilderList() { - return getSinksFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilder< - com.google.logging.v2.LogSink, com.google.logging.v2.LogSink.Builder, com.google.logging.v2.LogSinkOrBuilder> - getSinksFieldBuilder() { - if (sinksBuilder_ == null) { - sinksBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< - com.google.logging.v2.LogSink, com.google.logging.v2.LogSink.Builder, com.google.logging.v2.LogSinkOrBuilder>( - sinks_, - ((bitField0_ & 0x00000001) == 0x00000001), - getParentForChildren(), - isClean()); - sinks_ = null; - } - return sinksBuilder_; - } - - private java.lang.Object nextPageToken_ = ""; - /** - * optional string next_page_token = 2; - * - *
-     * If there are more results than were returned, then `nextPageToken` is
-     * given a value in the response.  To get the next batch of results, call this
-     * method again using the value of `nextPageToken` as `pageToken`.
-     * 
- */ - public java.lang.String getNextPageToken() { - java.lang.Object ref = nextPageToken_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - nextPageToken_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string next_page_token = 2; - * - *
-     * If there are more results than were returned, then `nextPageToken` is
-     * given a value in the response.  To get the next batch of results, call this
-     * method again using the value of `nextPageToken` as `pageToken`.
-     * 
- */ - public com.google.protobuf.ByteString - getNextPageTokenBytes() { - java.lang.Object ref = nextPageToken_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - nextPageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string next_page_token = 2; - * - *
-     * If there are more results than were returned, then `nextPageToken` is
-     * given a value in the response.  To get the next batch of results, call this
-     * method again using the value of `nextPageToken` as `pageToken`.
-     * 
- */ - public Builder setNextPageToken( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - nextPageToken_ = value; - onChanged(); - return this; - } - /** - * optional string next_page_token = 2; - * - *
-     * If there are more results than were returned, then `nextPageToken` is
-     * given a value in the response.  To get the next batch of results, call this
-     * method again using the value of `nextPageToken` as `pageToken`.
-     * 
- */ - public Builder clearNextPageToken() { - - nextPageToken_ = getDefaultInstance().getNextPageToken(); - onChanged(); - return this; - } - /** - * optional string next_page_token = 2; - * - *
-     * If there are more results than were returned, then `nextPageToken` is
-     * given a value in the response.  To get the next batch of results, call this
-     * method again using the value of `nextPageToken` as `pageToken`.
-     * 
- */ - public Builder setNextPageTokenBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - nextPageToken_ = value; - onChanged(); - return this; - } - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - - // @@protoc_insertion_point(builder_scope:google.logging.v2.ListSinksResponse) - } - - // @@protoc_insertion_point(class_scope:google.logging.v2.ListSinksResponse) - private static final com.google.logging.v2.ListSinksResponse DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.logging.v2.ListSinksResponse(); - } - - public static com.google.logging.v2.ListSinksResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - public ListSinksResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - try { - return new ListSinksResponse(input, extensionRegistry); - } catch (RuntimeException e) { - if (e.getCause() instanceof - com.google.protobuf.InvalidProtocolBufferException) { - throw (com.google.protobuf.InvalidProtocolBufferException) - e.getCause(); - } - throw e; - } - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public com.google.logging.v2.ListSinksResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListSinksResponseOrBuilder.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListSinksResponseOrBuilder.java deleted file mode 100644 index a3b19888ff59..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ListSinksResponseOrBuilder.java +++ /dev/null @@ -1,75 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/logging/v2/logging_config.proto - -package com.google.logging.v2; - -public interface ListSinksResponseOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.logging.v2.ListSinksResponse) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .google.logging.v2.LogSink sinks = 1; - * - *
-   * A list of sinks.
-   * 
- */ - java.util.List - getSinksList(); - /** - * repeated .google.logging.v2.LogSink sinks = 1; - * - *
-   * A list of sinks.
-   * 
- */ - com.google.logging.v2.LogSink getSinks(int index); - /** - * repeated .google.logging.v2.LogSink sinks = 1; - * - *
-   * A list of sinks.
-   * 
- */ - int getSinksCount(); - /** - * repeated .google.logging.v2.LogSink sinks = 1; - * - *
-   * A list of sinks.
-   * 
- */ - java.util.List - getSinksOrBuilderList(); - /** - * repeated .google.logging.v2.LogSink sinks = 1; - * - *
-   * A list of sinks.
-   * 
- */ - com.google.logging.v2.LogSinkOrBuilder getSinksOrBuilder( - int index); - - /** - * optional string next_page_token = 2; - * - *
-   * If there are more results than were returned, then `nextPageToken` is
-   * given a value in the response.  To get the next batch of results, call this
-   * method again using the value of `nextPageToken` as `pageToken`.
-   * 
- */ - java.lang.String getNextPageToken(); - /** - * optional string next_page_token = 2; - * - *
-   * If there are more results than were returned, then `nextPageToken` is
-   * given a value in the response.  To get the next batch of results, call this
-   * method again using the value of `nextPageToken` as `pageToken`.
-   * 
- */ - com.google.protobuf.ByteString - getNextPageTokenBytes(); -} diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/LogEntry.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/LogEntry.java deleted file mode 100644 index 960515d3c347..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/LogEntry.java +++ /dev/null @@ -1,2648 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/logging/v2/log_entry.proto - -package com.google.logging.v2; - -/** - * Protobuf type {@code google.logging.v2.LogEntry} - * - *
- * An individual entry in a log.
- * 
- */ -public final class LogEntry extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:google.logging.v2.LogEntry) - LogEntryOrBuilder { - // Use LogEntry.newBuilder() to construct. - private LogEntry(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - private LogEntry() { - logName_ = ""; - severity_ = 0; - insertId_ = ""; - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); - } - private LogEntry( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) { - this(); - int mutable_bitField0_ = 0; - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!input.skipField(tag)) { - done = true; - } - break; - } - case 18: { - com.google.protobuf.Any.Builder subBuilder = null; - if (payloadCase_ == 2) { - subBuilder = ((com.google.protobuf.Any) payload_).toBuilder(); - } - payload_ = - input.readMessage(com.google.protobuf.Any.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((com.google.protobuf.Any) payload_); - payload_ = subBuilder.buildPartial(); - } - payloadCase_ = 2; - break; - } - case 26: { - String s = input.readStringRequireUtf8(); - payloadCase_ = 3; - payload_ = s; - break; - } - case 34: { - String s = input.readStringRequireUtf8(); - - insertId_ = s; - break; - } - case 50: { - com.google.protobuf.Struct.Builder subBuilder = null; - if (payloadCase_ == 6) { - subBuilder = ((com.google.protobuf.Struct) payload_).toBuilder(); - } - payload_ = - input.readMessage(com.google.protobuf.Struct.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((com.google.protobuf.Struct) payload_); - payload_ = subBuilder.buildPartial(); - } - payloadCase_ = 6; - break; - } - case 58: { - com.google.logging.type.HttpRequest.Builder subBuilder = null; - if (httpRequest_ != null) { - subBuilder = httpRequest_.toBuilder(); - } - httpRequest_ = input.readMessage(com.google.logging.type.HttpRequest.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(httpRequest_); - httpRequest_ = subBuilder.buildPartial(); - } - - break; - } - case 66: { - com.google.api.MonitoredResource.Builder subBuilder = null; - if (resource_ != null) { - subBuilder = resource_.toBuilder(); - } - resource_ = input.readMessage(com.google.api.MonitoredResource.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(resource_); - resource_ = subBuilder.buildPartial(); - } - - break; - } - case 74: { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (timestamp_ != null) { - subBuilder = timestamp_.toBuilder(); - } - timestamp_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(timestamp_); - timestamp_ = subBuilder.buildPartial(); - } - - break; - } - case 80: { - int rawValue = input.readEnum(); - - severity_ = rawValue; - break; - } - case 90: { - if (!((mutable_bitField0_ & 0x00000200) == 0x00000200)) { - labels_ = com.google.protobuf.MapField.newMapField( - LabelsDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000200; - } - com.google.protobuf.MapEntry - labels = input.readMessage( - LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - labels_.getMutableMap().put(labels.getKey(), labels.getValue()); - break; - } - case 98: { - String s = input.readStringRequireUtf8(); - - logName_ = s; - break; - } - case 122: { - com.google.logging.v2.LogEntryOperation.Builder subBuilder = null; - if (operation_ != null) { - subBuilder = operation_.toBuilder(); - } - operation_ = input.readMessage(com.google.logging.v2.LogEntryOperation.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(operation_); - operation_ = subBuilder.buildPartial(); - } - - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw new RuntimeException(e.setUnfinishedMessage(this)); - } catch (java.io.IOException e) { - throw new RuntimeException( - new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this)); - } finally { - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.logging.v2.LogEntryProto.internal_static_google_logging_v2_LogEntry_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 11: - return internalGetLabels(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.logging.v2.LogEntryProto.internal_static_google_logging_v2_LogEntry_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.logging.v2.LogEntry.class, com.google.logging.v2.LogEntry.Builder.class); - } - - private int bitField0_; - private int payloadCase_ = 0; - private java.lang.Object payload_; - public enum PayloadCase - implements com.google.protobuf.Internal.EnumLite { - PROTO_PAYLOAD(2), - TEXT_PAYLOAD(3), - JSON_PAYLOAD(6), - PAYLOAD_NOT_SET(0); - private int value = 0; - private PayloadCase(int value) { - this.value = value; - } - public static PayloadCase valueOf(int value) { - switch (value) { - case 2: return PROTO_PAYLOAD; - case 3: return TEXT_PAYLOAD; - case 6: return JSON_PAYLOAD; - case 0: return PAYLOAD_NOT_SET; - default: throw new java.lang.IllegalArgumentException( - "Value is undefined for this oneof enum."); - } - } - public int getNumber() { - return this.value; - } - }; - - public PayloadCase - getPayloadCase() { - return PayloadCase.valueOf( - payloadCase_); - } - - public static final int LOG_NAME_FIELD_NUMBER = 12; - private volatile java.lang.Object logName_; - /** - * optional string log_name = 12; - * - *
-   * Required. The resource name of the log to which this log entry
-   * belongs. The format of the name is
-   * `projects/&lt;project-id&gt;/logs/&lt;log-id%gt;`.  Examples:
-   * `"projects/my-projectid/logs/syslog"`,
-   * `"projects/1234567890/logs/library.googleapis.com%2Fbook_log"`.
-   * The log ID part of resource name must be less than 512 characters
-   * long and can only include the following characters: upper and
-   * lower case alphanumeric characters: [A-Za-z0-9]; and punctuation
-   * characters: forward-slash, underscore, hyphen, and period.
-   * Forward-slash (`/`) characters in the log ID must be URL-encoded.
-   * 
- */ - public java.lang.String getLogName() { - java.lang.Object ref = logName_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - logName_ = s; - return s; - } - } - /** - * optional string log_name = 12; - * - *
-   * Required. The resource name of the log to which this log entry
-   * belongs. The format of the name is
-   * `projects/&lt;project-id&gt;/logs/&lt;log-id%gt;`.  Examples:
-   * `"projects/my-projectid/logs/syslog"`,
-   * `"projects/1234567890/logs/library.googleapis.com%2Fbook_log"`.
-   * The log ID part of resource name must be less than 512 characters
-   * long and can only include the following characters: upper and
-   * lower case alphanumeric characters: [A-Za-z0-9]; and punctuation
-   * characters: forward-slash, underscore, hyphen, and period.
-   * Forward-slash (`/`) characters in the log ID must be URL-encoded.
-   * 
- */ - public com.google.protobuf.ByteString - getLogNameBytes() { - java.lang.Object ref = logName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - logName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int RESOURCE_FIELD_NUMBER = 8; - private com.google.api.MonitoredResource resource_; - /** - * optional .google.api.MonitoredResource resource = 8; - * - *
-   * Required. The monitored resource associated with this log entry.
-   * Example: a log entry that reports a database error would be
-   * associated with the monitored resource designating the particular
-   * database that reported the error.
-   * 
- */ - public boolean hasResource() { - return resource_ != null; - } - /** - * optional .google.api.MonitoredResource resource = 8; - * - *
-   * Required. The monitored resource associated with this log entry.
-   * Example: a log entry that reports a database error would be
-   * associated with the monitored resource designating the particular
-   * database that reported the error.
-   * 
- */ - public com.google.api.MonitoredResource getResource() { - return resource_ == null ? com.google.api.MonitoredResource.getDefaultInstance() : resource_; - } - /** - * optional .google.api.MonitoredResource resource = 8; - * - *
-   * Required. The monitored resource associated with this log entry.
-   * Example: a log entry that reports a database error would be
-   * associated with the monitored resource designating the particular
-   * database that reported the error.
-   * 
- */ - public com.google.api.MonitoredResourceOrBuilder getResourceOrBuilder() { - return getResource(); - } - - public static final int PROTO_PAYLOAD_FIELD_NUMBER = 2; - /** - * optional .google.protobuf.Any proto_payload = 2; - * - *
-   * The log entry payload, represented as a protocol buffer.
-   * You can only use `protoPayload` values that belong to a set of approved
-   * types.
-   * 
- */ - public com.google.protobuf.Any getProtoPayload() { - if (payloadCase_ == 2) { - return (com.google.protobuf.Any) payload_; - } - return com.google.protobuf.Any.getDefaultInstance(); - } - /** - * optional .google.protobuf.Any proto_payload = 2; - * - *
-   * The log entry payload, represented as a protocol buffer.
-   * You can only use `protoPayload` values that belong to a set of approved
-   * types.
-   * 
- */ - public com.google.protobuf.AnyOrBuilder getProtoPayloadOrBuilder() { - if (payloadCase_ == 2) { - return (com.google.protobuf.Any) payload_; - } - return com.google.protobuf.Any.getDefaultInstance(); - } - - public static final int TEXT_PAYLOAD_FIELD_NUMBER = 3; - /** - * optional string text_payload = 3; - * - *
-   * The log entry payload, represented as a Unicode string (UTF-8).
-   * 
- */ - public java.lang.String getTextPayload() { - java.lang.Object ref = ""; - if (payloadCase_ == 3) { - ref = payload_; - } - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (payloadCase_ == 3) { - payload_ = s; - } - return s; - } - } - /** - * optional string text_payload = 3; - * - *
-   * The log entry payload, represented as a Unicode string (UTF-8).
-   * 
- */ - public com.google.protobuf.ByteString - getTextPayloadBytes() { - java.lang.Object ref = ""; - if (payloadCase_ == 3) { - ref = payload_; - } - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - if (payloadCase_ == 3) { - payload_ = b; - } - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int JSON_PAYLOAD_FIELD_NUMBER = 6; - /** - * optional .google.protobuf.Struct json_payload = 6; - * - *
-   * The log entry payload, represented as a structure that
-   * is expressed as a JSON object.
-   * 
- */ - public com.google.protobuf.Struct getJsonPayload() { - if (payloadCase_ == 6) { - return (com.google.protobuf.Struct) payload_; - } - return com.google.protobuf.Struct.getDefaultInstance(); - } - /** - * optional .google.protobuf.Struct json_payload = 6; - * - *
-   * The log entry payload, represented as a structure that
-   * is expressed as a JSON object.
-   * 
- */ - public com.google.protobuf.StructOrBuilder getJsonPayloadOrBuilder() { - if (payloadCase_ == 6) { - return (com.google.protobuf.Struct) payload_; - } - return com.google.protobuf.Struct.getDefaultInstance(); - } - - public static final int TIMESTAMP_FIELD_NUMBER = 9; - private com.google.protobuf.Timestamp timestamp_; - /** - * optional .google.protobuf.Timestamp timestamp = 9; - * - *
-   * Optional. The time the event described by the log entry occurred.  If
-   * omitted, Cloud Logging will use the time the log entry is written.
-   * 
- */ - public boolean hasTimestamp() { - return timestamp_ != null; - } - /** - * optional .google.protobuf.Timestamp timestamp = 9; - * - *
-   * Optional. The time the event described by the log entry occurred.  If
-   * omitted, Cloud Logging will use the time the log entry is written.
-   * 
- */ - public com.google.protobuf.Timestamp getTimestamp() { - return timestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : timestamp_; - } - /** - * optional .google.protobuf.Timestamp timestamp = 9; - * - *
-   * Optional. The time the event described by the log entry occurred.  If
-   * omitted, Cloud Logging will use the time the log entry is written.
-   * 
- */ - public com.google.protobuf.TimestampOrBuilder getTimestampOrBuilder() { - return getTimestamp(); - } - - public static final int SEVERITY_FIELD_NUMBER = 10; - private int severity_; - /** - * optional .google.logging.type.LogSeverity severity = 10; - * - *
-   * Optional. The severity of the log entry. The default value is
-   * `LogSeverity.DEFAULT`.
-   * 
- */ - public int getSeverityValue() { - return severity_; - } - /** - * optional .google.logging.type.LogSeverity severity = 10; - * - *
-   * Optional. The severity of the log entry. The default value is
-   * `LogSeverity.DEFAULT`.
-   * 
- */ - public com.google.logging.type.LogSeverity getSeverity() { - com.google.logging.type.LogSeverity result = com.google.logging.type.LogSeverity.valueOf(severity_); - return result == null ? com.google.logging.type.LogSeverity.UNRECOGNIZED : result; - } - - public static final int INSERT_ID_FIELD_NUMBER = 4; - private volatile java.lang.Object insertId_; - /** - * optional string insert_id = 4; - * - *
-   * Optional. A unique ID for the log entry. If you provide this field, the
-   * logging service considers other log entries in the same log with the same
-   * ID as duplicates which can be removed.
-   * If omitted, Cloud Logging will generate a unique ID for this log entry.
-   * 
- */ - public java.lang.String getInsertId() { - java.lang.Object ref = insertId_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - insertId_ = s; - return s; - } - } - /** - * optional string insert_id = 4; - * - *
-   * Optional. A unique ID for the log entry. If you provide this field, the
-   * logging service considers other log entries in the same log with the same
-   * ID as duplicates which can be removed.
-   * If omitted, Cloud Logging will generate a unique ID for this log entry.
-   * 
- */ - public com.google.protobuf.ByteString - getInsertIdBytes() { - java.lang.Object ref = insertId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - insertId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int HTTP_REQUEST_FIELD_NUMBER = 7; - private com.google.logging.type.HttpRequest httpRequest_; - /** - * optional .google.logging.type.HttpRequest http_request = 7; - * - *
-   * Optional. Information about the HTTP request associated with this log entry,
-   * if applicable.
-   * 
- */ - public boolean hasHttpRequest() { - return httpRequest_ != null; - } - /** - * optional .google.logging.type.HttpRequest http_request = 7; - * - *
-   * Optional. Information about the HTTP request associated with this log entry,
-   * if applicable.
-   * 
- */ - public com.google.logging.type.HttpRequest getHttpRequest() { - return httpRequest_ == null ? com.google.logging.type.HttpRequest.getDefaultInstance() : httpRequest_; - } - /** - * optional .google.logging.type.HttpRequest http_request = 7; - * - *
-   * Optional. Information about the HTTP request associated with this log entry,
-   * if applicable.
-   * 
- */ - public com.google.logging.type.HttpRequestOrBuilder getHttpRequestOrBuilder() { - return getHttpRequest(); - } - - public static final int LABELS_FIELD_NUMBER = 11; - private static final class LabelsDefaultEntryHolder { - static final com.google.protobuf.MapEntry< - java.lang.String, java.lang.String> defaultEntry = - com.google.protobuf.MapEntry - .newDefaultInstance( - com.google.logging.v2.LogEntryProto.internal_static_google_logging_v2_LogEntry_LabelsEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.STRING, - ""); - } - private com.google.protobuf.MapField< - java.lang.String, java.lang.String> labels_; - private com.google.protobuf.MapField - internalGetLabels() { - if (labels_ == null) { - return com.google.protobuf.MapField.emptyMapField( - LabelsDefaultEntryHolder.defaultEntry); - } - return labels_; - } - /** - * map<string, string> labels = 11; - * - *
-   * Optional. A set of user-defined (key, value) data that provides additional
-   * information about the log entry.
-   * 
- */ - - public java.util.Map getLabels() { - return internalGetLabels().getMap(); - } - - public static final int OPERATION_FIELD_NUMBER = 15; - private com.google.logging.v2.LogEntryOperation operation_; - /** - * optional .google.logging.v2.LogEntryOperation operation = 15; - * - *
-   * Optional. Information about an operation associated with the log entry, if
-   * applicable.
-   * 
- */ - public boolean hasOperation() { - return operation_ != null; - } - /** - * optional .google.logging.v2.LogEntryOperation operation = 15; - * - *
-   * Optional. Information about an operation associated with the log entry, if
-   * applicable.
-   * 
- */ - public com.google.logging.v2.LogEntryOperation getOperation() { - return operation_ == null ? com.google.logging.v2.LogEntryOperation.getDefaultInstance() : operation_; - } - /** - * optional .google.logging.v2.LogEntryOperation operation = 15; - * - *
-   * Optional. Information about an operation associated with the log entry, if
-   * applicable.
-   * 
- */ - public com.google.logging.v2.LogEntryOperationOrBuilder getOperationOrBuilder() { - return getOperation(); - } - - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (payloadCase_ == 2) { - output.writeMessage(2, (com.google.protobuf.Any) payload_); - } - if (payloadCase_ == 3) { - com.google.protobuf.GeneratedMessage.writeString(output, 3, payload_); - } - if (!getInsertIdBytes().isEmpty()) { - com.google.protobuf.GeneratedMessage.writeString(output, 4, insertId_); - } - if (payloadCase_ == 6) { - output.writeMessage(6, (com.google.protobuf.Struct) payload_); - } - if (httpRequest_ != null) { - output.writeMessage(7, getHttpRequest()); - } - if (resource_ != null) { - output.writeMessage(8, getResource()); - } - if (timestamp_ != null) { - output.writeMessage(9, getTimestamp()); - } - if (severity_ != com.google.logging.type.LogSeverity.DEFAULT.getNumber()) { - output.writeEnum(10, severity_); - } - for (java.util.Map.Entry entry - : internalGetLabels().getMap().entrySet()) { - com.google.protobuf.MapEntry - labels = LabelsDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - output.writeMessage(11, labels); - } - if (!getLogNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessage.writeString(output, 12, logName_); - } - if (operation_ != null) { - output.writeMessage(15, getOperation()); - } - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (payloadCase_ == 2) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, (com.google.protobuf.Any) payload_); - } - if (payloadCase_ == 3) { - size += com.google.protobuf.GeneratedMessage.computeStringSize(3, payload_); - } - if (!getInsertIdBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessage.computeStringSize(4, insertId_); - } - if (payloadCase_ == 6) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(6, (com.google.protobuf.Struct) payload_); - } - if (httpRequest_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(7, getHttpRequest()); - } - if (resource_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(8, getResource()); - } - if (timestamp_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(9, getTimestamp()); - } - if (severity_ != com.google.logging.type.LogSeverity.DEFAULT.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(10, severity_); - } - for (java.util.Map.Entry entry - : internalGetLabels().getMap().entrySet()) { - com.google.protobuf.MapEntry - labels = LabelsDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(11, labels); - } - if (!getLogNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessage.computeStringSize(12, logName_); - } - if (operation_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(15, getOperation()); - } - memoizedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - public static com.google.logging.v2.LogEntry parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.logging.v2.LogEntry parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.logging.v2.LogEntry parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.logging.v2.LogEntry parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.logging.v2.LogEntry parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.google.logging.v2.LogEntry parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static com.google.logging.v2.LogEntry parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static com.google.logging.v2.LogEntry parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static com.google.logging.v2.LogEntry parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.google.logging.v2.LogEntry parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.logging.v2.LogEntry prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code google.logging.v2.LogEntry} - * - *
-   * An individual entry in a log.
-   * 
- */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:google.logging.v2.LogEntry) - com.google.logging.v2.LogEntryOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.logging.v2.LogEntryProto.internal_static_google_logging_v2_LogEntry_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 11: - return internalGetLabels(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField( - int number) { - switch (number) { - case 11: - return internalGetMutableLabels(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.logging.v2.LogEntryProto.internal_static_google_logging_v2_LogEntry_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.logging.v2.LogEntry.class, com.google.logging.v2.LogEntry.Builder.class); - } - - // Construct using com.google.logging.v2.LogEntry.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - public Builder clear() { - super.clear(); - logName_ = ""; - - if (resourceBuilder_ == null) { - resource_ = null; - } else { - resource_ = null; - resourceBuilder_ = null; - } - if (timestampBuilder_ == null) { - timestamp_ = null; - } else { - timestamp_ = null; - timestampBuilder_ = null; - } - severity_ = 0; - - insertId_ = ""; - - if (httpRequestBuilder_ == null) { - httpRequest_ = null; - } else { - httpRequest_ = null; - httpRequestBuilder_ = null; - } - internalGetMutableLabels().clear(); - if (operationBuilder_ == null) { - operation_ = null; - } else { - operation_ = null; - operationBuilder_ = null; - } - payloadCase_ = 0; - payload_ = null; - return this; - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.logging.v2.LogEntryProto.internal_static_google_logging_v2_LogEntry_descriptor; - } - - public com.google.logging.v2.LogEntry getDefaultInstanceForType() { - return com.google.logging.v2.LogEntry.getDefaultInstance(); - } - - public com.google.logging.v2.LogEntry build() { - com.google.logging.v2.LogEntry result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.google.logging.v2.LogEntry buildPartial() { - com.google.logging.v2.LogEntry result = new com.google.logging.v2.LogEntry(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - result.logName_ = logName_; - if (resourceBuilder_ == null) { - result.resource_ = resource_; - } else { - result.resource_ = resourceBuilder_.build(); - } - if (payloadCase_ == 2) { - if (protoPayloadBuilder_ == null) { - result.payload_ = payload_; - } else { - result.payload_ = protoPayloadBuilder_.build(); - } - } - if (payloadCase_ == 3) { - result.payload_ = payload_; - } - if (payloadCase_ == 6) { - if (jsonPayloadBuilder_ == null) { - result.payload_ = payload_; - } else { - result.payload_ = jsonPayloadBuilder_.build(); - } - } - if (timestampBuilder_ == null) { - result.timestamp_ = timestamp_; - } else { - result.timestamp_ = timestampBuilder_.build(); - } - result.severity_ = severity_; - result.insertId_ = insertId_; - if (httpRequestBuilder_ == null) { - result.httpRequest_ = httpRequest_; - } else { - result.httpRequest_ = httpRequestBuilder_.build(); - } - result.labels_ = internalGetLabels(); - result.labels_.makeImmutable(); - if (operationBuilder_ == null) { - result.operation_ = operation_; - } else { - result.operation_ = operationBuilder_.build(); - } - result.bitField0_ = to_bitField0_; - result.payloadCase_ = payloadCase_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.logging.v2.LogEntry) { - return mergeFrom((com.google.logging.v2.LogEntry)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.logging.v2.LogEntry other) { - if (other == com.google.logging.v2.LogEntry.getDefaultInstance()) return this; - if (!other.getLogName().isEmpty()) { - logName_ = other.logName_; - onChanged(); - } - if (other.hasResource()) { - mergeResource(other.getResource()); - } - if (other.hasTimestamp()) { - mergeTimestamp(other.getTimestamp()); - } - if (other.severity_ != 0) { - setSeverityValue(other.getSeverityValue()); - } - if (!other.getInsertId().isEmpty()) { - insertId_ = other.insertId_; - onChanged(); - } - if (other.hasHttpRequest()) { - mergeHttpRequest(other.getHttpRequest()); - } - internalGetMutableLabels().mergeFrom( - other.internalGetLabels()); - if (other.hasOperation()) { - mergeOperation(other.getOperation()); - } - switch (other.getPayloadCase()) { - case PROTO_PAYLOAD: { - mergeProtoPayload(other.getProtoPayload()); - break; - } - case TEXT_PAYLOAD: { - payloadCase_ = 3; - payload_ = other.payload_; - onChanged(); - break; - } - case JSON_PAYLOAD: { - mergeJsonPayload(other.getJsonPayload()); - break; - } - case PAYLOAD_NOT_SET: { - break; - } - } - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.logging.v2.LogEntry parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.logging.v2.LogEntry) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int payloadCase_ = 0; - private java.lang.Object payload_; - public PayloadCase - getPayloadCase() { - return PayloadCase.valueOf( - payloadCase_); - } - - public Builder clearPayload() { - payloadCase_ = 0; - payload_ = null; - onChanged(); - return this; - } - - private int bitField0_; - - private java.lang.Object logName_ = ""; - /** - * optional string log_name = 12; - * - *
-     * Required. The resource name of the log to which this log entry
-     * belongs. The format of the name is
-     * `projects/&lt;project-id&gt;/logs/&lt;log-id%gt;`.  Examples:
-     * `"projects/my-projectid/logs/syslog"`,
-     * `"projects/1234567890/logs/library.googleapis.com%2Fbook_log"`.
-     * The log ID part of resource name must be less than 512 characters
-     * long and can only include the following characters: upper and
-     * lower case alphanumeric characters: [A-Za-z0-9]; and punctuation
-     * characters: forward-slash, underscore, hyphen, and period.
-     * Forward-slash (`/`) characters in the log ID must be URL-encoded.
-     * 
- */ - public java.lang.String getLogName() { - java.lang.Object ref = logName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - logName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string log_name = 12; - * - *
-     * Required. The resource name of the log to which this log entry
-     * belongs. The format of the name is
-     * `projects/&lt;project-id&gt;/logs/&lt;log-id%gt;`.  Examples:
-     * `"projects/my-projectid/logs/syslog"`,
-     * `"projects/1234567890/logs/library.googleapis.com%2Fbook_log"`.
-     * The log ID part of resource name must be less than 512 characters
-     * long and can only include the following characters: upper and
-     * lower case alphanumeric characters: [A-Za-z0-9]; and punctuation
-     * characters: forward-slash, underscore, hyphen, and period.
-     * Forward-slash (`/`) characters in the log ID must be URL-encoded.
-     * 
- */ - public com.google.protobuf.ByteString - getLogNameBytes() { - java.lang.Object ref = logName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - logName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string log_name = 12; - * - *
-     * Required. The resource name of the log to which this log entry
-     * belongs. The format of the name is
-     * `projects/&lt;project-id&gt;/logs/&lt;log-id%gt;`.  Examples:
-     * `"projects/my-projectid/logs/syslog"`,
-     * `"projects/1234567890/logs/library.googleapis.com%2Fbook_log"`.
-     * The log ID part of resource name must be less than 512 characters
-     * long and can only include the following characters: upper and
-     * lower case alphanumeric characters: [A-Za-z0-9]; and punctuation
-     * characters: forward-slash, underscore, hyphen, and period.
-     * Forward-slash (`/`) characters in the log ID must be URL-encoded.
-     * 
- */ - public Builder setLogName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - logName_ = value; - onChanged(); - return this; - } - /** - * optional string log_name = 12; - * - *
-     * Required. The resource name of the log to which this log entry
-     * belongs. The format of the name is
-     * `projects/&lt;project-id&gt;/logs/&lt;log-id%gt;`.  Examples:
-     * `"projects/my-projectid/logs/syslog"`,
-     * `"projects/1234567890/logs/library.googleapis.com%2Fbook_log"`.
-     * The log ID part of resource name must be less than 512 characters
-     * long and can only include the following characters: upper and
-     * lower case alphanumeric characters: [A-Za-z0-9]; and punctuation
-     * characters: forward-slash, underscore, hyphen, and period.
-     * Forward-slash (`/`) characters in the log ID must be URL-encoded.
-     * 
- */ - public Builder clearLogName() { - - logName_ = getDefaultInstance().getLogName(); - onChanged(); - return this; - } - /** - * optional string log_name = 12; - * - *
-     * Required. The resource name of the log to which this log entry
-     * belongs. The format of the name is
-     * `projects/&lt;project-id&gt;/logs/&lt;log-id%gt;`.  Examples:
-     * `"projects/my-projectid/logs/syslog"`,
-     * `"projects/1234567890/logs/library.googleapis.com%2Fbook_log"`.
-     * The log ID part of resource name must be less than 512 characters
-     * long and can only include the following characters: upper and
-     * lower case alphanumeric characters: [A-Za-z0-9]; and punctuation
-     * characters: forward-slash, underscore, hyphen, and period.
-     * Forward-slash (`/`) characters in the log ID must be URL-encoded.
-     * 
- */ - public Builder setLogNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - logName_ = value; - onChanged(); - return this; - } - - private com.google.api.MonitoredResource resource_ = null; - private com.google.protobuf.SingleFieldBuilder< - com.google.api.MonitoredResource, com.google.api.MonitoredResource.Builder, com.google.api.MonitoredResourceOrBuilder> resourceBuilder_; - /** - * optional .google.api.MonitoredResource resource = 8; - * - *
-     * Required. The monitored resource associated with this log entry.
-     * Example: a log entry that reports a database error would be
-     * associated with the monitored resource designating the particular
-     * database that reported the error.
-     * 
- */ - public boolean hasResource() { - return resourceBuilder_ != null || resource_ != null; - } - /** - * optional .google.api.MonitoredResource resource = 8; - * - *
-     * Required. The monitored resource associated with this log entry.
-     * Example: a log entry that reports a database error would be
-     * associated with the monitored resource designating the particular
-     * database that reported the error.
-     * 
- */ - public com.google.api.MonitoredResource getResource() { - if (resourceBuilder_ == null) { - return resource_ == null ? com.google.api.MonitoredResource.getDefaultInstance() : resource_; - } else { - return resourceBuilder_.getMessage(); - } - } - /** - * optional .google.api.MonitoredResource resource = 8; - * - *
-     * Required. The monitored resource associated with this log entry.
-     * Example: a log entry that reports a database error would be
-     * associated with the monitored resource designating the particular
-     * database that reported the error.
-     * 
- */ - public Builder setResource(com.google.api.MonitoredResource value) { - if (resourceBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - resource_ = value; - onChanged(); - } else { - resourceBuilder_.setMessage(value); - } - - return this; - } - /** - * optional .google.api.MonitoredResource resource = 8; - * - *
-     * Required. The monitored resource associated with this log entry.
-     * Example: a log entry that reports a database error would be
-     * associated with the monitored resource designating the particular
-     * database that reported the error.
-     * 
- */ - public Builder setResource( - com.google.api.MonitoredResource.Builder builderForValue) { - if (resourceBuilder_ == null) { - resource_ = builderForValue.build(); - onChanged(); - } else { - resourceBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * optional .google.api.MonitoredResource resource = 8; - * - *
-     * Required. The monitored resource associated with this log entry.
-     * Example: a log entry that reports a database error would be
-     * associated with the monitored resource designating the particular
-     * database that reported the error.
-     * 
- */ - public Builder mergeResource(com.google.api.MonitoredResource value) { - if (resourceBuilder_ == null) { - if (resource_ != null) { - resource_ = - com.google.api.MonitoredResource.newBuilder(resource_).mergeFrom(value).buildPartial(); - } else { - resource_ = value; - } - onChanged(); - } else { - resourceBuilder_.mergeFrom(value); - } - - return this; - } - /** - * optional .google.api.MonitoredResource resource = 8; - * - *
-     * Required. The monitored resource associated with this log entry.
-     * Example: a log entry that reports a database error would be
-     * associated with the monitored resource designating the particular
-     * database that reported the error.
-     * 
- */ - public Builder clearResource() { - if (resourceBuilder_ == null) { - resource_ = null; - onChanged(); - } else { - resource_ = null; - resourceBuilder_ = null; - } - - return this; - } - /** - * optional .google.api.MonitoredResource resource = 8; - * - *
-     * Required. The monitored resource associated with this log entry.
-     * Example: a log entry that reports a database error would be
-     * associated with the monitored resource designating the particular
-     * database that reported the error.
-     * 
- */ - public com.google.api.MonitoredResource.Builder getResourceBuilder() { - - onChanged(); - return getResourceFieldBuilder().getBuilder(); - } - /** - * optional .google.api.MonitoredResource resource = 8; - * - *
-     * Required. The monitored resource associated with this log entry.
-     * Example: a log entry that reports a database error would be
-     * associated with the monitored resource designating the particular
-     * database that reported the error.
-     * 
- */ - public com.google.api.MonitoredResourceOrBuilder getResourceOrBuilder() { - if (resourceBuilder_ != null) { - return resourceBuilder_.getMessageOrBuilder(); - } else { - return resource_ == null ? - com.google.api.MonitoredResource.getDefaultInstance() : resource_; - } - } - /** - * optional .google.api.MonitoredResource resource = 8; - * - *
-     * Required. The monitored resource associated with this log entry.
-     * Example: a log entry that reports a database error would be
-     * associated with the monitored resource designating the particular
-     * database that reported the error.
-     * 
- */ - private com.google.protobuf.SingleFieldBuilder< - com.google.api.MonitoredResource, com.google.api.MonitoredResource.Builder, com.google.api.MonitoredResourceOrBuilder> - getResourceFieldBuilder() { - if (resourceBuilder_ == null) { - resourceBuilder_ = new com.google.protobuf.SingleFieldBuilder< - com.google.api.MonitoredResource, com.google.api.MonitoredResource.Builder, com.google.api.MonitoredResourceOrBuilder>( - getResource(), - getParentForChildren(), - isClean()); - resource_ = null; - } - return resourceBuilder_; - } - - private com.google.protobuf.SingleFieldBuilder< - com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder> protoPayloadBuilder_; - /** - * optional .google.protobuf.Any proto_payload = 2; - * - *
-     * The log entry payload, represented as a protocol buffer.
-     * You can only use `protoPayload` values that belong to a set of approved
-     * types.
-     * 
- */ - public com.google.protobuf.Any getProtoPayload() { - if (protoPayloadBuilder_ == null) { - if (payloadCase_ == 2) { - return (com.google.protobuf.Any) payload_; - } - return com.google.protobuf.Any.getDefaultInstance(); - } else { - if (payloadCase_ == 2) { - return protoPayloadBuilder_.getMessage(); - } - return com.google.protobuf.Any.getDefaultInstance(); - } - } - /** - * optional .google.protobuf.Any proto_payload = 2; - * - *
-     * The log entry payload, represented as a protocol buffer.
-     * You can only use `protoPayload` values that belong to a set of approved
-     * types.
-     * 
- */ - public Builder setProtoPayload(com.google.protobuf.Any value) { - if (protoPayloadBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - payload_ = value; - onChanged(); - } else { - protoPayloadBuilder_.setMessage(value); - } - payloadCase_ = 2; - return this; - } - /** - * optional .google.protobuf.Any proto_payload = 2; - * - *
-     * The log entry payload, represented as a protocol buffer.
-     * You can only use `protoPayload` values that belong to a set of approved
-     * types.
-     * 
- */ - public Builder setProtoPayload( - com.google.protobuf.Any.Builder builderForValue) { - if (protoPayloadBuilder_ == null) { - payload_ = builderForValue.build(); - onChanged(); - } else { - protoPayloadBuilder_.setMessage(builderForValue.build()); - } - payloadCase_ = 2; - return this; - } - /** - * optional .google.protobuf.Any proto_payload = 2; - * - *
-     * The log entry payload, represented as a protocol buffer.
-     * You can only use `protoPayload` values that belong to a set of approved
-     * types.
-     * 
- */ - public Builder mergeProtoPayload(com.google.protobuf.Any value) { - if (protoPayloadBuilder_ == null) { - if (payloadCase_ == 2 && - payload_ != com.google.protobuf.Any.getDefaultInstance()) { - payload_ = com.google.protobuf.Any.newBuilder((com.google.protobuf.Any) payload_) - .mergeFrom(value).buildPartial(); - } else { - payload_ = value; - } - onChanged(); - } else { - if (payloadCase_ == 2) { - protoPayloadBuilder_.mergeFrom(value); - } - protoPayloadBuilder_.setMessage(value); - } - payloadCase_ = 2; - return this; - } - /** - * optional .google.protobuf.Any proto_payload = 2; - * - *
-     * The log entry payload, represented as a protocol buffer.
-     * You can only use `protoPayload` values that belong to a set of approved
-     * types.
-     * 
- */ - public Builder clearProtoPayload() { - if (protoPayloadBuilder_ == null) { - if (payloadCase_ == 2) { - payloadCase_ = 0; - payload_ = null; - onChanged(); - } - } else { - if (payloadCase_ == 2) { - payloadCase_ = 0; - payload_ = null; - } - protoPayloadBuilder_.clear(); - } - return this; - } - /** - * optional .google.protobuf.Any proto_payload = 2; - * - *
-     * The log entry payload, represented as a protocol buffer.
-     * You can only use `protoPayload` values that belong to a set of approved
-     * types.
-     * 
- */ - public com.google.protobuf.Any.Builder getProtoPayloadBuilder() { - return getProtoPayloadFieldBuilder().getBuilder(); - } - /** - * optional .google.protobuf.Any proto_payload = 2; - * - *
-     * The log entry payload, represented as a protocol buffer.
-     * You can only use `protoPayload` values that belong to a set of approved
-     * types.
-     * 
- */ - public com.google.protobuf.AnyOrBuilder getProtoPayloadOrBuilder() { - if ((payloadCase_ == 2) && (protoPayloadBuilder_ != null)) { - return protoPayloadBuilder_.getMessageOrBuilder(); - } else { - if (payloadCase_ == 2) { - return (com.google.protobuf.Any) payload_; - } - return com.google.protobuf.Any.getDefaultInstance(); - } - } - /** - * optional .google.protobuf.Any proto_payload = 2; - * - *
-     * The log entry payload, represented as a protocol buffer.
-     * You can only use `protoPayload` values that belong to a set of approved
-     * types.
-     * 
- */ - private com.google.protobuf.SingleFieldBuilder< - com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder> - getProtoPayloadFieldBuilder() { - if (protoPayloadBuilder_ == null) { - if (!(payloadCase_ == 2)) { - payload_ = com.google.protobuf.Any.getDefaultInstance(); - } - protoPayloadBuilder_ = new com.google.protobuf.SingleFieldBuilder< - com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder>( - (com.google.protobuf.Any) payload_, - getParentForChildren(), - isClean()); - payload_ = null; - } - payloadCase_ = 2; - onChanged();; - return protoPayloadBuilder_; - } - - /** - * optional string text_payload = 3; - * - *
-     * The log entry payload, represented as a Unicode string (UTF-8).
-     * 
- */ - public java.lang.String getTextPayload() { - java.lang.Object ref = ""; - if (payloadCase_ == 3) { - ref = payload_; - } - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (payloadCase_ == 3) { - payload_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string text_payload = 3; - * - *
-     * The log entry payload, represented as a Unicode string (UTF-8).
-     * 
- */ - public com.google.protobuf.ByteString - getTextPayloadBytes() { - java.lang.Object ref = ""; - if (payloadCase_ == 3) { - ref = payload_; - } - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - if (payloadCase_ == 3) { - payload_ = b; - } - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string text_payload = 3; - * - *
-     * The log entry payload, represented as a Unicode string (UTF-8).
-     * 
- */ - public Builder setTextPayload( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - payloadCase_ = 3; - payload_ = value; - onChanged(); - return this; - } - /** - * optional string text_payload = 3; - * - *
-     * The log entry payload, represented as a Unicode string (UTF-8).
-     * 
- */ - public Builder clearTextPayload() { - if (payloadCase_ == 3) { - payloadCase_ = 0; - payload_ = null; - onChanged(); - } - return this; - } - /** - * optional string text_payload = 3; - * - *
-     * The log entry payload, represented as a Unicode string (UTF-8).
-     * 
- */ - public Builder setTextPayloadBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - payloadCase_ = 3; - payload_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.SingleFieldBuilder< - com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> jsonPayloadBuilder_; - /** - * optional .google.protobuf.Struct json_payload = 6; - * - *
-     * The log entry payload, represented as a structure that
-     * is expressed as a JSON object.
-     * 
- */ - public com.google.protobuf.Struct getJsonPayload() { - if (jsonPayloadBuilder_ == null) { - if (payloadCase_ == 6) { - return (com.google.protobuf.Struct) payload_; - } - return com.google.protobuf.Struct.getDefaultInstance(); - } else { - if (payloadCase_ == 6) { - return jsonPayloadBuilder_.getMessage(); - } - return com.google.protobuf.Struct.getDefaultInstance(); - } - } - /** - * optional .google.protobuf.Struct json_payload = 6; - * - *
-     * The log entry payload, represented as a structure that
-     * is expressed as a JSON object.
-     * 
- */ - public Builder setJsonPayload(com.google.protobuf.Struct value) { - if (jsonPayloadBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - payload_ = value; - onChanged(); - } else { - jsonPayloadBuilder_.setMessage(value); - } - payloadCase_ = 6; - return this; - } - /** - * optional .google.protobuf.Struct json_payload = 6; - * - *
-     * The log entry payload, represented as a structure that
-     * is expressed as a JSON object.
-     * 
- */ - public Builder setJsonPayload( - com.google.protobuf.Struct.Builder builderForValue) { - if (jsonPayloadBuilder_ == null) { - payload_ = builderForValue.build(); - onChanged(); - } else { - jsonPayloadBuilder_.setMessage(builderForValue.build()); - } - payloadCase_ = 6; - return this; - } - /** - * optional .google.protobuf.Struct json_payload = 6; - * - *
-     * The log entry payload, represented as a structure that
-     * is expressed as a JSON object.
-     * 
- */ - public Builder mergeJsonPayload(com.google.protobuf.Struct value) { - if (jsonPayloadBuilder_ == null) { - if (payloadCase_ == 6 && - payload_ != com.google.protobuf.Struct.getDefaultInstance()) { - payload_ = com.google.protobuf.Struct.newBuilder((com.google.protobuf.Struct) payload_) - .mergeFrom(value).buildPartial(); - } else { - payload_ = value; - } - onChanged(); - } else { - if (payloadCase_ == 6) { - jsonPayloadBuilder_.mergeFrom(value); - } - jsonPayloadBuilder_.setMessage(value); - } - payloadCase_ = 6; - return this; - } - /** - * optional .google.protobuf.Struct json_payload = 6; - * - *
-     * The log entry payload, represented as a structure that
-     * is expressed as a JSON object.
-     * 
- */ - public Builder clearJsonPayload() { - if (jsonPayloadBuilder_ == null) { - if (payloadCase_ == 6) { - payloadCase_ = 0; - payload_ = null; - onChanged(); - } - } else { - if (payloadCase_ == 6) { - payloadCase_ = 0; - payload_ = null; - } - jsonPayloadBuilder_.clear(); - } - return this; - } - /** - * optional .google.protobuf.Struct json_payload = 6; - * - *
-     * The log entry payload, represented as a structure that
-     * is expressed as a JSON object.
-     * 
- */ - public com.google.protobuf.Struct.Builder getJsonPayloadBuilder() { - return getJsonPayloadFieldBuilder().getBuilder(); - } - /** - * optional .google.protobuf.Struct json_payload = 6; - * - *
-     * The log entry payload, represented as a structure that
-     * is expressed as a JSON object.
-     * 
- */ - public com.google.protobuf.StructOrBuilder getJsonPayloadOrBuilder() { - if ((payloadCase_ == 6) && (jsonPayloadBuilder_ != null)) { - return jsonPayloadBuilder_.getMessageOrBuilder(); - } else { - if (payloadCase_ == 6) { - return (com.google.protobuf.Struct) payload_; - } - return com.google.protobuf.Struct.getDefaultInstance(); - } - } - /** - * optional .google.protobuf.Struct json_payload = 6; - * - *
-     * The log entry payload, represented as a structure that
-     * is expressed as a JSON object.
-     * 
- */ - private com.google.protobuf.SingleFieldBuilder< - com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> - getJsonPayloadFieldBuilder() { - if (jsonPayloadBuilder_ == null) { - if (!(payloadCase_ == 6)) { - payload_ = com.google.protobuf.Struct.getDefaultInstance(); - } - jsonPayloadBuilder_ = new com.google.protobuf.SingleFieldBuilder< - com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder>( - (com.google.protobuf.Struct) payload_, - getParentForChildren(), - isClean()); - payload_ = null; - } - payloadCase_ = 6; - onChanged();; - return jsonPayloadBuilder_; - } - - private com.google.protobuf.Timestamp timestamp_ = null; - private com.google.protobuf.SingleFieldBuilder< - com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> timestampBuilder_; - /** - * optional .google.protobuf.Timestamp timestamp = 9; - * - *
-     * Optional. The time the event described by the log entry occurred.  If
-     * omitted, Cloud Logging will use the time the log entry is written.
-     * 
- */ - public boolean hasTimestamp() { - return timestampBuilder_ != null || timestamp_ != null; - } - /** - * optional .google.protobuf.Timestamp timestamp = 9; - * - *
-     * Optional. The time the event described by the log entry occurred.  If
-     * omitted, Cloud Logging will use the time the log entry is written.
-     * 
- */ - public com.google.protobuf.Timestamp getTimestamp() { - if (timestampBuilder_ == null) { - return timestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : timestamp_; - } else { - return timestampBuilder_.getMessage(); - } - } - /** - * optional .google.protobuf.Timestamp timestamp = 9; - * - *
-     * Optional. The time the event described by the log entry occurred.  If
-     * omitted, Cloud Logging will use the time the log entry is written.
-     * 
- */ - public Builder setTimestamp(com.google.protobuf.Timestamp value) { - if (timestampBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - timestamp_ = value; - onChanged(); - } else { - timestampBuilder_.setMessage(value); - } - - return this; - } - /** - * optional .google.protobuf.Timestamp timestamp = 9; - * - *
-     * Optional. The time the event described by the log entry occurred.  If
-     * omitted, Cloud Logging will use the time the log entry is written.
-     * 
- */ - public Builder setTimestamp( - com.google.protobuf.Timestamp.Builder builderForValue) { - if (timestampBuilder_ == null) { - timestamp_ = builderForValue.build(); - onChanged(); - } else { - timestampBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * optional .google.protobuf.Timestamp timestamp = 9; - * - *
-     * Optional. The time the event described by the log entry occurred.  If
-     * omitted, Cloud Logging will use the time the log entry is written.
-     * 
- */ - public Builder mergeTimestamp(com.google.protobuf.Timestamp value) { - if (timestampBuilder_ == null) { - if (timestamp_ != null) { - timestamp_ = - com.google.protobuf.Timestamp.newBuilder(timestamp_).mergeFrom(value).buildPartial(); - } else { - timestamp_ = value; - } - onChanged(); - } else { - timestampBuilder_.mergeFrom(value); - } - - return this; - } - /** - * optional .google.protobuf.Timestamp timestamp = 9; - * - *
-     * Optional. The time the event described by the log entry occurred.  If
-     * omitted, Cloud Logging will use the time the log entry is written.
-     * 
- */ - public Builder clearTimestamp() { - if (timestampBuilder_ == null) { - timestamp_ = null; - onChanged(); - } else { - timestamp_ = null; - timestampBuilder_ = null; - } - - return this; - } - /** - * optional .google.protobuf.Timestamp timestamp = 9; - * - *
-     * Optional. The time the event described by the log entry occurred.  If
-     * omitted, Cloud Logging will use the time the log entry is written.
-     * 
- */ - public com.google.protobuf.Timestamp.Builder getTimestampBuilder() { - - onChanged(); - return getTimestampFieldBuilder().getBuilder(); - } - /** - * optional .google.protobuf.Timestamp timestamp = 9; - * - *
-     * Optional. The time the event described by the log entry occurred.  If
-     * omitted, Cloud Logging will use the time the log entry is written.
-     * 
- */ - public com.google.protobuf.TimestampOrBuilder getTimestampOrBuilder() { - if (timestampBuilder_ != null) { - return timestampBuilder_.getMessageOrBuilder(); - } else { - return timestamp_ == null ? - com.google.protobuf.Timestamp.getDefaultInstance() : timestamp_; - } - } - /** - * optional .google.protobuf.Timestamp timestamp = 9; - * - *
-     * Optional. The time the event described by the log entry occurred.  If
-     * omitted, Cloud Logging will use the time the log entry is written.
-     * 
- */ - private com.google.protobuf.SingleFieldBuilder< - com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> - getTimestampFieldBuilder() { - if (timestampBuilder_ == null) { - timestampBuilder_ = new com.google.protobuf.SingleFieldBuilder< - com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( - getTimestamp(), - getParentForChildren(), - isClean()); - timestamp_ = null; - } - return timestampBuilder_; - } - - private int severity_ = 0; - /** - * optional .google.logging.type.LogSeverity severity = 10; - * - *
-     * Optional. The severity of the log entry. The default value is
-     * `LogSeverity.DEFAULT`.
-     * 
- */ - public int getSeverityValue() { - return severity_; - } - /** - * optional .google.logging.type.LogSeverity severity = 10; - * - *
-     * Optional. The severity of the log entry. The default value is
-     * `LogSeverity.DEFAULT`.
-     * 
- */ - public Builder setSeverityValue(int value) { - severity_ = value; - onChanged(); - return this; - } - /** - * optional .google.logging.type.LogSeverity severity = 10; - * - *
-     * Optional. The severity of the log entry. The default value is
-     * `LogSeverity.DEFAULT`.
-     * 
- */ - public com.google.logging.type.LogSeverity getSeverity() { - com.google.logging.type.LogSeverity result = com.google.logging.type.LogSeverity.valueOf(severity_); - return result == null ? com.google.logging.type.LogSeverity.UNRECOGNIZED : result; - } - /** - * optional .google.logging.type.LogSeverity severity = 10; - * - *
-     * Optional. The severity of the log entry. The default value is
-     * `LogSeverity.DEFAULT`.
-     * 
- */ - public Builder setSeverity(com.google.logging.type.LogSeverity value) { - if (value == null) { - throw new NullPointerException(); - } - - severity_ = value.getNumber(); - onChanged(); - return this; - } - /** - * optional .google.logging.type.LogSeverity severity = 10; - * - *
-     * Optional. The severity of the log entry. The default value is
-     * `LogSeverity.DEFAULT`.
-     * 
- */ - public Builder clearSeverity() { - - severity_ = 0; - onChanged(); - return this; - } - - private java.lang.Object insertId_ = ""; - /** - * optional string insert_id = 4; - * - *
-     * Optional. A unique ID for the log entry. If you provide this field, the
-     * logging service considers other log entries in the same log with the same
-     * ID as duplicates which can be removed.
-     * If omitted, Cloud Logging will generate a unique ID for this log entry.
-     * 
- */ - public java.lang.String getInsertId() { - java.lang.Object ref = insertId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - insertId_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string insert_id = 4; - * - *
-     * Optional. A unique ID for the log entry. If you provide this field, the
-     * logging service considers other log entries in the same log with the same
-     * ID as duplicates which can be removed.
-     * If omitted, Cloud Logging will generate a unique ID for this log entry.
-     * 
- */ - public com.google.protobuf.ByteString - getInsertIdBytes() { - java.lang.Object ref = insertId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - insertId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string insert_id = 4; - * - *
-     * Optional. A unique ID for the log entry. If you provide this field, the
-     * logging service considers other log entries in the same log with the same
-     * ID as duplicates which can be removed.
-     * If omitted, Cloud Logging will generate a unique ID for this log entry.
-     * 
- */ - public Builder setInsertId( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - insertId_ = value; - onChanged(); - return this; - } - /** - * optional string insert_id = 4; - * - *
-     * Optional. A unique ID for the log entry. If you provide this field, the
-     * logging service considers other log entries in the same log with the same
-     * ID as duplicates which can be removed.
-     * If omitted, Cloud Logging will generate a unique ID for this log entry.
-     * 
- */ - public Builder clearInsertId() { - - insertId_ = getDefaultInstance().getInsertId(); - onChanged(); - return this; - } - /** - * optional string insert_id = 4; - * - *
-     * Optional. A unique ID for the log entry. If you provide this field, the
-     * logging service considers other log entries in the same log with the same
-     * ID as duplicates which can be removed.
-     * If omitted, Cloud Logging will generate a unique ID for this log entry.
-     * 
- */ - public Builder setInsertIdBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - insertId_ = value; - onChanged(); - return this; - } - - private com.google.logging.type.HttpRequest httpRequest_ = null; - private com.google.protobuf.SingleFieldBuilder< - com.google.logging.type.HttpRequest, com.google.logging.type.HttpRequest.Builder, com.google.logging.type.HttpRequestOrBuilder> httpRequestBuilder_; - /** - * optional .google.logging.type.HttpRequest http_request = 7; - * - *
-     * Optional. Information about the HTTP request associated with this log entry,
-     * if applicable.
-     * 
- */ - public boolean hasHttpRequest() { - return httpRequestBuilder_ != null || httpRequest_ != null; - } - /** - * optional .google.logging.type.HttpRequest http_request = 7; - * - *
-     * Optional. Information about the HTTP request associated with this log entry,
-     * if applicable.
-     * 
- */ - public com.google.logging.type.HttpRequest getHttpRequest() { - if (httpRequestBuilder_ == null) { - return httpRequest_ == null ? com.google.logging.type.HttpRequest.getDefaultInstance() : httpRequest_; - } else { - return httpRequestBuilder_.getMessage(); - } - } - /** - * optional .google.logging.type.HttpRequest http_request = 7; - * - *
-     * Optional. Information about the HTTP request associated with this log entry,
-     * if applicable.
-     * 
- */ - public Builder setHttpRequest(com.google.logging.type.HttpRequest value) { - if (httpRequestBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - httpRequest_ = value; - onChanged(); - } else { - httpRequestBuilder_.setMessage(value); - } - - return this; - } - /** - * optional .google.logging.type.HttpRequest http_request = 7; - * - *
-     * Optional. Information about the HTTP request associated with this log entry,
-     * if applicable.
-     * 
- */ - public Builder setHttpRequest( - com.google.logging.type.HttpRequest.Builder builderForValue) { - if (httpRequestBuilder_ == null) { - httpRequest_ = builderForValue.build(); - onChanged(); - } else { - httpRequestBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * optional .google.logging.type.HttpRequest http_request = 7; - * - *
-     * Optional. Information about the HTTP request associated with this log entry,
-     * if applicable.
-     * 
- */ - public Builder mergeHttpRequest(com.google.logging.type.HttpRequest value) { - if (httpRequestBuilder_ == null) { - if (httpRequest_ != null) { - httpRequest_ = - com.google.logging.type.HttpRequest.newBuilder(httpRequest_).mergeFrom(value).buildPartial(); - } else { - httpRequest_ = value; - } - onChanged(); - } else { - httpRequestBuilder_.mergeFrom(value); - } - - return this; - } - /** - * optional .google.logging.type.HttpRequest http_request = 7; - * - *
-     * Optional. Information about the HTTP request associated with this log entry,
-     * if applicable.
-     * 
- */ - public Builder clearHttpRequest() { - if (httpRequestBuilder_ == null) { - httpRequest_ = null; - onChanged(); - } else { - httpRequest_ = null; - httpRequestBuilder_ = null; - } - - return this; - } - /** - * optional .google.logging.type.HttpRequest http_request = 7; - * - *
-     * Optional. Information about the HTTP request associated with this log entry,
-     * if applicable.
-     * 
- */ - public com.google.logging.type.HttpRequest.Builder getHttpRequestBuilder() { - - onChanged(); - return getHttpRequestFieldBuilder().getBuilder(); - } - /** - * optional .google.logging.type.HttpRequest http_request = 7; - * - *
-     * Optional. Information about the HTTP request associated with this log entry,
-     * if applicable.
-     * 
- */ - public com.google.logging.type.HttpRequestOrBuilder getHttpRequestOrBuilder() { - if (httpRequestBuilder_ != null) { - return httpRequestBuilder_.getMessageOrBuilder(); - } else { - return httpRequest_ == null ? - com.google.logging.type.HttpRequest.getDefaultInstance() : httpRequest_; - } - } - /** - * optional .google.logging.type.HttpRequest http_request = 7; - * - *
-     * Optional. Information about the HTTP request associated with this log entry,
-     * if applicable.
-     * 
- */ - private com.google.protobuf.SingleFieldBuilder< - com.google.logging.type.HttpRequest, com.google.logging.type.HttpRequest.Builder, com.google.logging.type.HttpRequestOrBuilder> - getHttpRequestFieldBuilder() { - if (httpRequestBuilder_ == null) { - httpRequestBuilder_ = new com.google.protobuf.SingleFieldBuilder< - com.google.logging.type.HttpRequest, com.google.logging.type.HttpRequest.Builder, com.google.logging.type.HttpRequestOrBuilder>( - getHttpRequest(), - getParentForChildren(), - isClean()); - httpRequest_ = null; - } - return httpRequestBuilder_; - } - - private com.google.protobuf.MapField< - java.lang.String, java.lang.String> labels_; - private com.google.protobuf.MapField - internalGetLabels() { - if (labels_ == null) { - return com.google.protobuf.MapField.emptyMapField( - LabelsDefaultEntryHolder.defaultEntry); - } - return labels_; - } - private com.google.protobuf.MapField - internalGetMutableLabels() { - onChanged();; - if (labels_ == null) { - labels_ = com.google.protobuf.MapField.newMapField( - LabelsDefaultEntryHolder.defaultEntry); - } - if (!labels_.isMutable()) { - labels_ = labels_.copy(); - } - return labels_; - } - /** - * map<string, string> labels = 11; - * - *
-     * Optional. A set of user-defined (key, value) data that provides additional
-     * information about the log entry.
-     * 
- */ - public java.util.Map getLabels() { - return internalGetLabels().getMap(); - } - /** - * map<string, string> labels = 11; - * - *
-     * Optional. A set of user-defined (key, value) data that provides additional
-     * information about the log entry.
-     * 
- */ - public java.util.Map - getMutableLabels() { - return internalGetMutableLabels().getMutableMap(); - } - /** - * map<string, string> labels = 11; - * - *
-     * Optional. A set of user-defined (key, value) data that provides additional
-     * information about the log entry.
-     * 
- */ - public Builder putAllLabels( - java.util.Map values) { - getMutableLabels().putAll(values); - return this; - } - - private com.google.logging.v2.LogEntryOperation operation_ = null; - private com.google.protobuf.SingleFieldBuilder< - com.google.logging.v2.LogEntryOperation, com.google.logging.v2.LogEntryOperation.Builder, com.google.logging.v2.LogEntryOperationOrBuilder> operationBuilder_; - /** - * optional .google.logging.v2.LogEntryOperation operation = 15; - * - *
-     * Optional. Information about an operation associated with the log entry, if
-     * applicable.
-     * 
- */ - public boolean hasOperation() { - return operationBuilder_ != null || operation_ != null; - } - /** - * optional .google.logging.v2.LogEntryOperation operation = 15; - * - *
-     * Optional. Information about an operation associated with the log entry, if
-     * applicable.
-     * 
- */ - public com.google.logging.v2.LogEntryOperation getOperation() { - if (operationBuilder_ == null) { - return operation_ == null ? com.google.logging.v2.LogEntryOperation.getDefaultInstance() : operation_; - } else { - return operationBuilder_.getMessage(); - } - } - /** - * optional .google.logging.v2.LogEntryOperation operation = 15; - * - *
-     * Optional. Information about an operation associated with the log entry, if
-     * applicable.
-     * 
- */ - public Builder setOperation(com.google.logging.v2.LogEntryOperation value) { - if (operationBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - operation_ = value; - onChanged(); - } else { - operationBuilder_.setMessage(value); - } - - return this; - } - /** - * optional .google.logging.v2.LogEntryOperation operation = 15; - * - *
-     * Optional. Information about an operation associated with the log entry, if
-     * applicable.
-     * 
- */ - public Builder setOperation( - com.google.logging.v2.LogEntryOperation.Builder builderForValue) { - if (operationBuilder_ == null) { - operation_ = builderForValue.build(); - onChanged(); - } else { - operationBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * optional .google.logging.v2.LogEntryOperation operation = 15; - * - *
-     * Optional. Information about an operation associated with the log entry, if
-     * applicable.
-     * 
- */ - public Builder mergeOperation(com.google.logging.v2.LogEntryOperation value) { - if (operationBuilder_ == null) { - if (operation_ != null) { - operation_ = - com.google.logging.v2.LogEntryOperation.newBuilder(operation_).mergeFrom(value).buildPartial(); - } else { - operation_ = value; - } - onChanged(); - } else { - operationBuilder_.mergeFrom(value); - } - - return this; - } - /** - * optional .google.logging.v2.LogEntryOperation operation = 15; - * - *
-     * Optional. Information about an operation associated with the log entry, if
-     * applicable.
-     * 
- */ - public Builder clearOperation() { - if (operationBuilder_ == null) { - operation_ = null; - onChanged(); - } else { - operation_ = null; - operationBuilder_ = null; - } - - return this; - } - /** - * optional .google.logging.v2.LogEntryOperation operation = 15; - * - *
-     * Optional. Information about an operation associated with the log entry, if
-     * applicable.
-     * 
- */ - public com.google.logging.v2.LogEntryOperation.Builder getOperationBuilder() { - - onChanged(); - return getOperationFieldBuilder().getBuilder(); - } - /** - * optional .google.logging.v2.LogEntryOperation operation = 15; - * - *
-     * Optional. Information about an operation associated with the log entry, if
-     * applicable.
-     * 
- */ - public com.google.logging.v2.LogEntryOperationOrBuilder getOperationOrBuilder() { - if (operationBuilder_ != null) { - return operationBuilder_.getMessageOrBuilder(); - } else { - return operation_ == null ? - com.google.logging.v2.LogEntryOperation.getDefaultInstance() : operation_; - } - } - /** - * optional .google.logging.v2.LogEntryOperation operation = 15; - * - *
-     * Optional. Information about an operation associated with the log entry, if
-     * applicable.
-     * 
- */ - private com.google.protobuf.SingleFieldBuilder< - com.google.logging.v2.LogEntryOperation, com.google.logging.v2.LogEntryOperation.Builder, com.google.logging.v2.LogEntryOperationOrBuilder> - getOperationFieldBuilder() { - if (operationBuilder_ == null) { - operationBuilder_ = new com.google.protobuf.SingleFieldBuilder< - com.google.logging.v2.LogEntryOperation, com.google.logging.v2.LogEntryOperation.Builder, com.google.logging.v2.LogEntryOperationOrBuilder>( - getOperation(), - getParentForChildren(), - isClean()); - operation_ = null; - } - return operationBuilder_; - } - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - - // @@protoc_insertion_point(builder_scope:google.logging.v2.LogEntry) - } - - // @@protoc_insertion_point(class_scope:google.logging.v2.LogEntry) - private static final com.google.logging.v2.LogEntry DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.logging.v2.LogEntry(); - } - - public static com.google.logging.v2.LogEntry getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - public LogEntry parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - try { - return new LogEntry(input, extensionRegistry); - } catch (RuntimeException e) { - if (e.getCause() instanceof - com.google.protobuf.InvalidProtocolBufferException) { - throw (com.google.protobuf.InvalidProtocolBufferException) - e.getCause(); - } - throw e; - } - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public com.google.logging.v2.LogEntry getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/LogEntryOperation.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/LogEntryOperation.java deleted file mode 100644 index abbb0fd5619f..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/LogEntryOperation.java +++ /dev/null @@ -1,790 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/logging/v2/log_entry.proto - -package com.google.logging.v2; - -/** - * Protobuf type {@code google.logging.v2.LogEntryOperation} - * - *
- * Additional information about a potentially long-running operation with which
- * a log entry is associated.
- * 
- */ -public final class LogEntryOperation extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:google.logging.v2.LogEntryOperation) - LogEntryOperationOrBuilder { - // Use LogEntryOperation.newBuilder() to construct. - private LogEntryOperation(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - private LogEntryOperation() { - id_ = ""; - producer_ = ""; - first_ = false; - last_ = false; - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); - } - private LogEntryOperation( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) { - this(); - int mutable_bitField0_ = 0; - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!input.skipField(tag)) { - done = true; - } - break; - } - case 10: { - String s = input.readStringRequireUtf8(); - - id_ = s; - break; - } - case 18: { - String s = input.readStringRequireUtf8(); - - producer_ = s; - break; - } - case 24: { - - first_ = input.readBool(); - break; - } - case 32: { - - last_ = input.readBool(); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw new RuntimeException(e.setUnfinishedMessage(this)); - } catch (java.io.IOException e) { - throw new RuntimeException( - new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this)); - } finally { - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.logging.v2.LogEntryProto.internal_static_google_logging_v2_LogEntryOperation_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.logging.v2.LogEntryProto.internal_static_google_logging_v2_LogEntryOperation_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.logging.v2.LogEntryOperation.class, com.google.logging.v2.LogEntryOperation.Builder.class); - } - - public static final int ID_FIELD_NUMBER = 1; - private volatile java.lang.Object id_; - /** - * optional string id = 1; - * - *
-   * Required. An arbitrary operation identifier. Log entries with the
-   * same identifier are assumed to be part of the same operation.
-   * 
- */ - public java.lang.String getId() { - java.lang.Object ref = id_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - id_ = s; - return s; - } - } - /** - * optional string id = 1; - * - *
-   * Required. An arbitrary operation identifier. Log entries with the
-   * same identifier are assumed to be part of the same operation.
-   * 
- */ - public com.google.protobuf.ByteString - getIdBytes() { - java.lang.Object ref = id_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - id_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PRODUCER_FIELD_NUMBER = 2; - private volatile java.lang.Object producer_; - /** - * optional string producer = 2; - * - *
-   * Required. A arbitrary producer identifier. The combination of
-   * `id` and `producer` must be globally unique.  Examples for `producer`:
-   * `"MyDivision.MyBigCompany.com"`, "github.com/MyProject/MyApplication"`.
-   * 
- */ - public java.lang.String getProducer() { - java.lang.Object ref = producer_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - producer_ = s; - return s; - } - } - /** - * optional string producer = 2; - * - *
-   * Required. A arbitrary producer identifier. The combination of
-   * `id` and `producer` must be globally unique.  Examples for `producer`:
-   * `"MyDivision.MyBigCompany.com"`, "github.com/MyProject/MyApplication"`.
-   * 
- */ - public com.google.protobuf.ByteString - getProducerBytes() { - java.lang.Object ref = producer_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - producer_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int FIRST_FIELD_NUMBER = 3; - private boolean first_; - /** - * optional bool first = 3; - * - *
-   * Optional. Set this to True if this is the first log entry in the operation.
-   * 
- */ - public boolean getFirst() { - return first_; - } - - public static final int LAST_FIELD_NUMBER = 4; - private boolean last_; - /** - * optional bool last = 4; - * - *
-   * Optional. Set this to True if this is the last log entry in the operation.
-   * 
- */ - public boolean getLast() { - return last_; - } - - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getIdBytes().isEmpty()) { - com.google.protobuf.GeneratedMessage.writeString(output, 1, id_); - } - if (!getProducerBytes().isEmpty()) { - com.google.protobuf.GeneratedMessage.writeString(output, 2, producer_); - } - if (first_ != false) { - output.writeBool(3, first_); - } - if (last_ != false) { - output.writeBool(4, last_); - } - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getIdBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessage.computeStringSize(1, id_); - } - if (!getProducerBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessage.computeStringSize(2, producer_); - } - if (first_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(3, first_); - } - if (last_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(4, last_); - } - memoizedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - public static com.google.logging.v2.LogEntryOperation parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.logging.v2.LogEntryOperation parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.logging.v2.LogEntryOperation parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.logging.v2.LogEntryOperation parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.logging.v2.LogEntryOperation parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.google.logging.v2.LogEntryOperation parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static com.google.logging.v2.LogEntryOperation parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static com.google.logging.v2.LogEntryOperation parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static com.google.logging.v2.LogEntryOperation parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.google.logging.v2.LogEntryOperation parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.logging.v2.LogEntryOperation prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code google.logging.v2.LogEntryOperation} - * - *
-   * Additional information about a potentially long-running operation with which
-   * a log entry is associated.
-   * 
- */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:google.logging.v2.LogEntryOperation) - com.google.logging.v2.LogEntryOperationOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.logging.v2.LogEntryProto.internal_static_google_logging_v2_LogEntryOperation_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.logging.v2.LogEntryProto.internal_static_google_logging_v2_LogEntryOperation_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.logging.v2.LogEntryOperation.class, com.google.logging.v2.LogEntryOperation.Builder.class); - } - - // Construct using com.google.logging.v2.LogEntryOperation.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - public Builder clear() { - super.clear(); - id_ = ""; - - producer_ = ""; - - first_ = false; - - last_ = false; - - return this; - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.logging.v2.LogEntryProto.internal_static_google_logging_v2_LogEntryOperation_descriptor; - } - - public com.google.logging.v2.LogEntryOperation getDefaultInstanceForType() { - return com.google.logging.v2.LogEntryOperation.getDefaultInstance(); - } - - public com.google.logging.v2.LogEntryOperation build() { - com.google.logging.v2.LogEntryOperation result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.google.logging.v2.LogEntryOperation buildPartial() { - com.google.logging.v2.LogEntryOperation result = new com.google.logging.v2.LogEntryOperation(this); - result.id_ = id_; - result.producer_ = producer_; - result.first_ = first_; - result.last_ = last_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.logging.v2.LogEntryOperation) { - return mergeFrom((com.google.logging.v2.LogEntryOperation)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.logging.v2.LogEntryOperation other) { - if (other == com.google.logging.v2.LogEntryOperation.getDefaultInstance()) return this; - if (!other.getId().isEmpty()) { - id_ = other.id_; - onChanged(); - } - if (!other.getProducer().isEmpty()) { - producer_ = other.producer_; - onChanged(); - } - if (other.getFirst() != false) { - setFirst(other.getFirst()); - } - if (other.getLast() != false) { - setLast(other.getLast()); - } - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.logging.v2.LogEntryOperation parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.logging.v2.LogEntryOperation) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object id_ = ""; - /** - * optional string id = 1; - * - *
-     * Required. An arbitrary operation identifier. Log entries with the
-     * same identifier are assumed to be part of the same operation.
-     * 
- */ - public java.lang.String getId() { - java.lang.Object ref = id_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - id_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string id = 1; - * - *
-     * Required. An arbitrary operation identifier. Log entries with the
-     * same identifier are assumed to be part of the same operation.
-     * 
- */ - public com.google.protobuf.ByteString - getIdBytes() { - java.lang.Object ref = id_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - id_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string id = 1; - * - *
-     * Required. An arbitrary operation identifier. Log entries with the
-     * same identifier are assumed to be part of the same operation.
-     * 
- */ - public Builder setId( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - id_ = value; - onChanged(); - return this; - } - /** - * optional string id = 1; - * - *
-     * Required. An arbitrary operation identifier. Log entries with the
-     * same identifier are assumed to be part of the same operation.
-     * 
- */ - public Builder clearId() { - - id_ = getDefaultInstance().getId(); - onChanged(); - return this; - } - /** - * optional string id = 1; - * - *
-     * Required. An arbitrary operation identifier. Log entries with the
-     * same identifier are assumed to be part of the same operation.
-     * 
- */ - public Builder setIdBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - id_ = value; - onChanged(); - return this; - } - - private java.lang.Object producer_ = ""; - /** - * optional string producer = 2; - * - *
-     * Required. A arbitrary producer identifier. The combination of
-     * `id` and `producer` must be globally unique.  Examples for `producer`:
-     * `"MyDivision.MyBigCompany.com"`, "github.com/MyProject/MyApplication"`.
-     * 
- */ - public java.lang.String getProducer() { - java.lang.Object ref = producer_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - producer_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string producer = 2; - * - *
-     * Required. A arbitrary producer identifier. The combination of
-     * `id` and `producer` must be globally unique.  Examples for `producer`:
-     * `"MyDivision.MyBigCompany.com"`, "github.com/MyProject/MyApplication"`.
-     * 
- */ - public com.google.protobuf.ByteString - getProducerBytes() { - java.lang.Object ref = producer_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - producer_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string producer = 2; - * - *
-     * Required. A arbitrary producer identifier. The combination of
-     * `id` and `producer` must be globally unique.  Examples for `producer`:
-     * `"MyDivision.MyBigCompany.com"`, "github.com/MyProject/MyApplication"`.
-     * 
- */ - public Builder setProducer( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - producer_ = value; - onChanged(); - return this; - } - /** - * optional string producer = 2; - * - *
-     * Required. A arbitrary producer identifier. The combination of
-     * `id` and `producer` must be globally unique.  Examples for `producer`:
-     * `"MyDivision.MyBigCompany.com"`, "github.com/MyProject/MyApplication"`.
-     * 
- */ - public Builder clearProducer() { - - producer_ = getDefaultInstance().getProducer(); - onChanged(); - return this; - } - /** - * optional string producer = 2; - * - *
-     * Required. A arbitrary producer identifier. The combination of
-     * `id` and `producer` must be globally unique.  Examples for `producer`:
-     * `"MyDivision.MyBigCompany.com"`, "github.com/MyProject/MyApplication"`.
-     * 
- */ - public Builder setProducerBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - producer_ = value; - onChanged(); - return this; - } - - private boolean first_ ; - /** - * optional bool first = 3; - * - *
-     * Optional. Set this to True if this is the first log entry in the operation.
-     * 
- */ - public boolean getFirst() { - return first_; - } - /** - * optional bool first = 3; - * - *
-     * Optional. Set this to True if this is the first log entry in the operation.
-     * 
- */ - public Builder setFirst(boolean value) { - - first_ = value; - onChanged(); - return this; - } - /** - * optional bool first = 3; - * - *
-     * Optional. Set this to True if this is the first log entry in the operation.
-     * 
- */ - public Builder clearFirst() { - - first_ = false; - onChanged(); - return this; - } - - private boolean last_ ; - /** - * optional bool last = 4; - * - *
-     * Optional. Set this to True if this is the last log entry in the operation.
-     * 
- */ - public boolean getLast() { - return last_; - } - /** - * optional bool last = 4; - * - *
-     * Optional. Set this to True if this is the last log entry in the operation.
-     * 
- */ - public Builder setLast(boolean value) { - - last_ = value; - onChanged(); - return this; - } - /** - * optional bool last = 4; - * - *
-     * Optional. Set this to True if this is the last log entry in the operation.
-     * 
- */ - public Builder clearLast() { - - last_ = false; - onChanged(); - return this; - } - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - - // @@protoc_insertion_point(builder_scope:google.logging.v2.LogEntryOperation) - } - - // @@protoc_insertion_point(class_scope:google.logging.v2.LogEntryOperation) - private static final com.google.logging.v2.LogEntryOperation DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.logging.v2.LogEntryOperation(); - } - - public static com.google.logging.v2.LogEntryOperation getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - public LogEntryOperation parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - try { - return new LogEntryOperation(input, extensionRegistry); - } catch (RuntimeException e) { - if (e.getCause() instanceof - com.google.protobuf.InvalidProtocolBufferException) { - throw (com.google.protobuf.InvalidProtocolBufferException) - e.getCause(); - } - throw e; - } - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public com.google.logging.v2.LogEntryOperation getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/LogEntryOperationOrBuilder.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/LogEntryOperationOrBuilder.java deleted file mode 100644 index d3a2c769313e..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/LogEntryOperationOrBuilder.java +++ /dev/null @@ -1,69 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/logging/v2/log_entry.proto - -package com.google.logging.v2; - -public interface LogEntryOperationOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.logging.v2.LogEntryOperation) - com.google.protobuf.MessageOrBuilder { - - /** - * optional string id = 1; - * - *
-   * Required. An arbitrary operation identifier. Log entries with the
-   * same identifier are assumed to be part of the same operation.
-   * 
- */ - java.lang.String getId(); - /** - * optional string id = 1; - * - *
-   * Required. An arbitrary operation identifier. Log entries with the
-   * same identifier are assumed to be part of the same operation.
-   * 
- */ - com.google.protobuf.ByteString - getIdBytes(); - - /** - * optional string producer = 2; - * - *
-   * Required. A arbitrary producer identifier. The combination of
-   * `id` and `producer` must be globally unique.  Examples for `producer`:
-   * `"MyDivision.MyBigCompany.com"`, "github.com/MyProject/MyApplication"`.
-   * 
- */ - java.lang.String getProducer(); - /** - * optional string producer = 2; - * - *
-   * Required. A arbitrary producer identifier. The combination of
-   * `id` and `producer` must be globally unique.  Examples for `producer`:
-   * `"MyDivision.MyBigCompany.com"`, "github.com/MyProject/MyApplication"`.
-   * 
- */ - com.google.protobuf.ByteString - getProducerBytes(); - - /** - * optional bool first = 3; - * - *
-   * Optional. Set this to True if this is the first log entry in the operation.
-   * 
- */ - boolean getFirst(); - - /** - * optional bool last = 4; - * - *
-   * Optional. Set this to True if this is the last log entry in the operation.
-   * 
- */ - boolean getLast(); -} diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/LogEntryOrBuilder.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/LogEntryOrBuilder.java deleted file mode 100644 index 7ad92e438faa..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/LogEntryOrBuilder.java +++ /dev/null @@ -1,277 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/logging/v2/log_entry.proto - -package com.google.logging.v2; - -public interface LogEntryOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.logging.v2.LogEntry) - com.google.protobuf.MessageOrBuilder { - - /** - * optional string log_name = 12; - * - *
-   * Required. The resource name of the log to which this log entry
-   * belongs. The format of the name is
-   * `projects/&lt;project-id&gt;/logs/&lt;log-id%gt;`.  Examples:
-   * `"projects/my-projectid/logs/syslog"`,
-   * `"projects/1234567890/logs/library.googleapis.com%2Fbook_log"`.
-   * The log ID part of resource name must be less than 512 characters
-   * long and can only include the following characters: upper and
-   * lower case alphanumeric characters: [A-Za-z0-9]; and punctuation
-   * characters: forward-slash, underscore, hyphen, and period.
-   * Forward-slash (`/`) characters in the log ID must be URL-encoded.
-   * 
- */ - java.lang.String getLogName(); - /** - * optional string log_name = 12; - * - *
-   * Required. The resource name of the log to which this log entry
-   * belongs. The format of the name is
-   * `projects/&lt;project-id&gt;/logs/&lt;log-id%gt;`.  Examples:
-   * `"projects/my-projectid/logs/syslog"`,
-   * `"projects/1234567890/logs/library.googleapis.com%2Fbook_log"`.
-   * The log ID part of resource name must be less than 512 characters
-   * long and can only include the following characters: upper and
-   * lower case alphanumeric characters: [A-Za-z0-9]; and punctuation
-   * characters: forward-slash, underscore, hyphen, and period.
-   * Forward-slash (`/`) characters in the log ID must be URL-encoded.
-   * 
- */ - com.google.protobuf.ByteString - getLogNameBytes(); - - /** - * optional .google.api.MonitoredResource resource = 8; - * - *
-   * Required. The monitored resource associated with this log entry.
-   * Example: a log entry that reports a database error would be
-   * associated with the monitored resource designating the particular
-   * database that reported the error.
-   * 
- */ - boolean hasResource(); - /** - * optional .google.api.MonitoredResource resource = 8; - * - *
-   * Required. The monitored resource associated with this log entry.
-   * Example: a log entry that reports a database error would be
-   * associated with the monitored resource designating the particular
-   * database that reported the error.
-   * 
- */ - com.google.api.MonitoredResource getResource(); - /** - * optional .google.api.MonitoredResource resource = 8; - * - *
-   * Required. The monitored resource associated with this log entry.
-   * Example: a log entry that reports a database error would be
-   * associated with the monitored resource designating the particular
-   * database that reported the error.
-   * 
- */ - com.google.api.MonitoredResourceOrBuilder getResourceOrBuilder(); - - /** - * optional .google.protobuf.Any proto_payload = 2; - * - *
-   * The log entry payload, represented as a protocol buffer.
-   * You can only use `protoPayload` values that belong to a set of approved
-   * types.
-   * 
- */ - com.google.protobuf.Any getProtoPayload(); - /** - * optional .google.protobuf.Any proto_payload = 2; - * - *
-   * The log entry payload, represented as a protocol buffer.
-   * You can only use `protoPayload` values that belong to a set of approved
-   * types.
-   * 
- */ - com.google.protobuf.AnyOrBuilder getProtoPayloadOrBuilder(); - - /** - * optional string text_payload = 3; - * - *
-   * The log entry payload, represented as a Unicode string (UTF-8).
-   * 
- */ - java.lang.String getTextPayload(); - /** - * optional string text_payload = 3; - * - *
-   * The log entry payload, represented as a Unicode string (UTF-8).
-   * 
- */ - com.google.protobuf.ByteString - getTextPayloadBytes(); - - /** - * optional .google.protobuf.Struct json_payload = 6; - * - *
-   * The log entry payload, represented as a structure that
-   * is expressed as a JSON object.
-   * 
- */ - com.google.protobuf.Struct getJsonPayload(); - /** - * optional .google.protobuf.Struct json_payload = 6; - * - *
-   * The log entry payload, represented as a structure that
-   * is expressed as a JSON object.
-   * 
- */ - com.google.protobuf.StructOrBuilder getJsonPayloadOrBuilder(); - - /** - * optional .google.protobuf.Timestamp timestamp = 9; - * - *
-   * Optional. The time the event described by the log entry occurred.  If
-   * omitted, Cloud Logging will use the time the log entry is written.
-   * 
- */ - boolean hasTimestamp(); - /** - * optional .google.protobuf.Timestamp timestamp = 9; - * - *
-   * Optional. The time the event described by the log entry occurred.  If
-   * omitted, Cloud Logging will use the time the log entry is written.
-   * 
- */ - com.google.protobuf.Timestamp getTimestamp(); - /** - * optional .google.protobuf.Timestamp timestamp = 9; - * - *
-   * Optional. The time the event described by the log entry occurred.  If
-   * omitted, Cloud Logging will use the time the log entry is written.
-   * 
- */ - com.google.protobuf.TimestampOrBuilder getTimestampOrBuilder(); - - /** - * optional .google.logging.type.LogSeverity severity = 10; - * - *
-   * Optional. The severity of the log entry. The default value is
-   * `LogSeverity.DEFAULT`.
-   * 
- */ - int getSeverityValue(); - /** - * optional .google.logging.type.LogSeverity severity = 10; - * - *
-   * Optional. The severity of the log entry. The default value is
-   * `LogSeverity.DEFAULT`.
-   * 
- */ - com.google.logging.type.LogSeverity getSeverity(); - - /** - * optional string insert_id = 4; - * - *
-   * Optional. A unique ID for the log entry. If you provide this field, the
-   * logging service considers other log entries in the same log with the same
-   * ID as duplicates which can be removed.
-   * If omitted, Cloud Logging will generate a unique ID for this log entry.
-   * 
- */ - java.lang.String getInsertId(); - /** - * optional string insert_id = 4; - * - *
-   * Optional. A unique ID for the log entry. If you provide this field, the
-   * logging service considers other log entries in the same log with the same
-   * ID as duplicates which can be removed.
-   * If omitted, Cloud Logging will generate a unique ID for this log entry.
-   * 
- */ - com.google.protobuf.ByteString - getInsertIdBytes(); - - /** - * optional .google.logging.type.HttpRequest http_request = 7; - * - *
-   * Optional. Information about the HTTP request associated with this log entry,
-   * if applicable.
-   * 
- */ - boolean hasHttpRequest(); - /** - * optional .google.logging.type.HttpRequest http_request = 7; - * - *
-   * Optional. Information about the HTTP request associated with this log entry,
-   * if applicable.
-   * 
- */ - com.google.logging.type.HttpRequest getHttpRequest(); - /** - * optional .google.logging.type.HttpRequest http_request = 7; - * - *
-   * Optional. Information about the HTTP request associated with this log entry,
-   * if applicable.
-   * 
- */ - com.google.logging.type.HttpRequestOrBuilder getHttpRequestOrBuilder(); - - /** - * map<string, string> labels = 11; - * - *
-   * Optional. A set of user-defined (key, value) data that provides additional
-   * information about the log entry.
-   * 
- */ - java.util.Map - getLabels(); - - /** - * optional .google.logging.v2.LogEntryOperation operation = 15; - * - *
-   * Optional. Information about an operation associated with the log entry, if
-   * applicable.
-   * 
- */ - boolean hasOperation(); - /** - * optional .google.logging.v2.LogEntryOperation operation = 15; - * - *
-   * Optional. Information about an operation associated with the log entry, if
-   * applicable.
-   * 
- */ - com.google.logging.v2.LogEntryOperation getOperation(); - /** - * optional .google.logging.v2.LogEntryOperation operation = 15; - * - *
-   * Optional. Information about an operation associated with the log entry, if
-   * applicable.
-   * 
- */ - com.google.logging.v2.LogEntryOperationOrBuilder getOperationOrBuilder(); - - public com.google.logging.v2.LogEntry.PayloadCase getPayloadCase(); -} diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/LogEntryProto.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/LogEntryProto.java deleted file mode 100644 index 3be0a91f6922..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/LogEntryProto.java +++ /dev/null @@ -1,108 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/logging/v2/log_entry.proto - -package com.google.logging.v2; - -public final class LogEntryProto { - private LogEntryProto() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - } - static com.google.protobuf.Descriptors.Descriptor - internal_static_google_logging_v2_LogEntry_descriptor; - static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_google_logging_v2_LogEntry_fieldAccessorTable; - static com.google.protobuf.Descriptors.Descriptor - internal_static_google_logging_v2_LogEntry_LabelsEntry_descriptor; - static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_google_logging_v2_LogEntry_LabelsEntry_fieldAccessorTable; - static com.google.protobuf.Descriptors.Descriptor - internal_static_google_logging_v2_LogEntryOperation_descriptor; - static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_google_logging_v2_LogEntryOperation_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n!google/logging/v2/log_entry.proto\022\021goo" + - "gle.logging.v2\032\034google/api/annotations.p" + - "roto\032#google/api/monitored_resource.prot" + - "o\032&google/logging/type/http_request.prot" + - "o\032&google/logging/type/log_severity.prot" + - "o\032\031google/protobuf/any.proto\032\034google/pro" + - "tobuf/struct.proto\032\037google/protobuf/time" + - "stamp.proto\"\237\004\n\010LogEntry\022\020\n\010log_name\030\014 \001" + - "(\t\022/\n\010resource\030\010 \001(\0132\035.google.api.Monito" + - "redResource\022-\n\rproto_payload\030\002 \001(\0132\024.goo", - "gle.protobuf.AnyH\000\022\026\n\014text_payload\030\003 \001(\t" + - "H\000\022/\n\014json_payload\030\006 \001(\0132\027.google.protob" + - "uf.StructH\000\022-\n\ttimestamp\030\t \001(\0132\032.google." + - "protobuf.Timestamp\0222\n\010severity\030\n \001(\0162 .g" + - "oogle.logging.type.LogSeverity\022\021\n\tinsert" + - "_id\030\004 \001(\t\0226\n\014http_request\030\007 \001(\0132 .google" + - ".logging.type.HttpRequest\0227\n\006labels\030\013 \003(" + - "\0132\'.google.logging.v2.LogEntry.LabelsEnt" + - "ry\0227\n\toperation\030\017 \001(\0132$.google.logging.v" + - "2.LogEntryOperation\032-\n\013LabelsEntry\022\013\n\003ke", - "y\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001B\t\n\007payload\"N\n" + - "\021LogEntryOperation\022\n\n\002id\030\001 \001(\t\022\020\n\010produc" + - "er\030\002 \001(\t\022\r\n\005first\030\003 \001(\010\022\014\n\004last\030\004 \001(\010B(\n" + - "\025com.google.logging.v2B\rLogEntryProtoP\001b" + - "\006proto3" - }; - com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = - new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { - public com.google.protobuf.ExtensionRegistry assignDescriptors( - com.google.protobuf.Descriptors.FileDescriptor root) { - descriptor = root; - return null; - } - }; - com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - com.google.api.AnnotationsProto.getDescriptor(), - com.google.api.MonitoredResourceProto.getDescriptor(), - com.google.logging.type.HttpRequestProto.getDescriptor(), - com.google.logging.type.LogSeverityProto.getDescriptor(), - com.google.protobuf.AnyProto.getDescriptor(), - com.google.protobuf.StructProto.getDescriptor(), - com.google.protobuf.TimestampProto.getDescriptor(), - }, assigner); - internal_static_google_logging_v2_LogEntry_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_google_logging_v2_LogEntry_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_google_logging_v2_LogEntry_descriptor, - new java.lang.String[] { "LogName", "Resource", "ProtoPayload", "TextPayload", "JsonPayload", "Timestamp", "Severity", "InsertId", "HttpRequest", "Labels", "Operation", "Payload", }); - internal_static_google_logging_v2_LogEntry_LabelsEntry_descriptor = - internal_static_google_logging_v2_LogEntry_descriptor.getNestedTypes().get(0); - internal_static_google_logging_v2_LogEntry_LabelsEntry_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_google_logging_v2_LogEntry_LabelsEntry_descriptor, - new java.lang.String[] { "Key", "Value", }); - internal_static_google_logging_v2_LogEntryOperation_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_google_logging_v2_LogEntryOperation_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_google_logging_v2_LogEntryOperation_descriptor, - new java.lang.String[] { "Id", "Producer", "First", "Last", }); - com.google.api.AnnotationsProto.getDescriptor(); - com.google.api.MonitoredResourceProto.getDescriptor(); - com.google.logging.type.HttpRequestProto.getDescriptor(); - com.google.logging.type.LogSeverityProto.getDescriptor(); - com.google.protobuf.AnyProto.getDescriptor(); - com.google.protobuf.StructProto.getDescriptor(); - com.google.protobuf.TimestampProto.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/LogMetric.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/LogMetric.java deleted file mode 100644 index 7b5439627e7b..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/LogMetric.java +++ /dev/null @@ -1,934 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/logging/v2/logging_metrics.proto - -package com.google.logging.v2; - -/** - * Protobuf type {@code google.logging.v2.LogMetric} - * - *
- * Describes a logs-based metric.  The value of the metric is the
- * number of log entries that match a logs filter.
- * 
- */ -public final class LogMetric extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:google.logging.v2.LogMetric) - LogMetricOrBuilder { - // Use LogMetric.newBuilder() to construct. - private LogMetric(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - private LogMetric() { - name_ = ""; - description_ = ""; - filter_ = ""; - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); - } - private LogMetric( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) { - this(); - int mutable_bitField0_ = 0; - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!input.skipField(tag)) { - done = true; - } - break; - } - case 10: { - String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 18: { - String s = input.readStringRequireUtf8(); - - description_ = s; - break; - } - case 26: { - String s = input.readStringRequireUtf8(); - - filter_ = s; - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw new RuntimeException(e.setUnfinishedMessage(this)); - } catch (java.io.IOException e) { - throw new RuntimeException( - new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this)); - } finally { - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.logging.v2.LoggingMetrics.internal_static_google_logging_v2_LogMetric_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.logging.v2.LoggingMetrics.internal_static_google_logging_v2_LogMetric_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.logging.v2.LogMetric.class, com.google.logging.v2.LogMetric.Builder.class); - } - - /** - * Protobuf enum {@code google.logging.v2.LogMetric.ApiVersion} - * - *
-   * Cloud Logging API version.
-   * 
- */ - public enum ApiVersion - implements com.google.protobuf.ProtocolMessageEnum { - /** - * V2 = 0; - * - *
-     * Cloud Logging API V2.
-     * 
- */ - V2(0, 0), - /** - * V1 = 1; - * - *
-     * Cloud Logging API V1.
-     * 
- */ - V1(1, 1), - UNRECOGNIZED(-1, -1), - ; - - /** - * V2 = 0; - * - *
-     * Cloud Logging API V2.
-     * 
- */ - public static final int V2_VALUE = 0; - /** - * V1 = 1; - * - *
-     * Cloud Logging API V1.
-     * 
- */ - public static final int V1_VALUE = 1; - - - public final int getNumber() { - if (index == -1) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - public static ApiVersion valueOf(int value) { - switch (value) { - case 0: return V2; - case 1: return V1; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - ApiVersion> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public ApiVersion findValueByNumber(int number) { - return ApiVersion.valueOf(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor - getValueDescriptor() { - return getDescriptor().getValues().get(index); - } - public final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptorForType() { - return getDescriptor(); - } - public static final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptor() { - return com.google.logging.v2.LogMetric.getDescriptor().getEnumTypes().get(0); - } - - private static final ApiVersion[] VALUES = values(); - - public static ApiVersion valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "EnumValueDescriptor is not for this type."); - } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } - return VALUES[desc.getIndex()]; - } - - private final int index; - private final int value; - - private ApiVersion(int index, int value) { - this.index = index; - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:google.logging.v2.LogMetric.ApiVersion) - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - * optional string name = 1; - * - *
-   * Required. The client-assigned metric identifier. Example:
-   * `"severe_errors"`.  Metric identifiers are limited to 1000
-   * characters and can include only the following characters: `A-Z`,
-   * `a-z`, `0-9`, and the special characters `_-.,+!*',()%/\`.  The
-   * forward-slash character (`/`) denotes a hierarchy of name pieces,
-   * and it cannot be the first character of the name.
-   * 
- */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - /** - * optional string name = 1; - * - *
-   * Required. The client-assigned metric identifier. Example:
-   * `"severe_errors"`.  Metric identifiers are limited to 1000
-   * characters and can include only the following characters: `A-Z`,
-   * `a-z`, `0-9`, and the special characters `_-.,+!*',()%/\`.  The
-   * forward-slash character (`/`) denotes a hierarchy of name pieces,
-   * and it cannot be the first character of the name.
-   * 
- */ - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int DESCRIPTION_FIELD_NUMBER = 2; - private volatile java.lang.Object description_; - /** - * optional string description = 2; - * - *
-   * A description of this metric, which is used in documentation.
-   * 
- */ - public java.lang.String getDescription() { - java.lang.Object ref = description_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - description_ = s; - return s; - } - } - /** - * optional string description = 2; - * - *
-   * A description of this metric, which is used in documentation.
-   * 
- */ - public com.google.protobuf.ByteString - getDescriptionBytes() { - java.lang.Object ref = description_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - description_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int FILTER_FIELD_NUMBER = 3; - private volatile java.lang.Object filter_; - /** - * optional string filter = 3; - * - *
-   * An [advanced logs filter](/logging/docs/view/advanced_filters).
-   * Example: `"logName:syslog AND severity>=ERROR"`.
-   * 
- */ - public java.lang.String getFilter() { - java.lang.Object ref = filter_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - filter_ = s; - return s; - } - } - /** - * optional string filter = 3; - * - *
-   * An [advanced logs filter](/logging/docs/view/advanced_filters).
-   * Example: `"logName:syslog AND severity>=ERROR"`.
-   * 
- */ - public com.google.protobuf.ByteString - getFilterBytes() { - java.lang.Object ref = filter_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - filter_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); - } - if (!getDescriptionBytes().isEmpty()) { - com.google.protobuf.GeneratedMessage.writeString(output, 2, description_); - } - if (!getFilterBytes().isEmpty()) { - com.google.protobuf.GeneratedMessage.writeString(output, 3, filter_); - } - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); - } - if (!getDescriptionBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessage.computeStringSize(2, description_); - } - if (!getFilterBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessage.computeStringSize(3, filter_); - } - memoizedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - public static com.google.logging.v2.LogMetric parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.logging.v2.LogMetric parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.logging.v2.LogMetric parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.logging.v2.LogMetric parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.logging.v2.LogMetric parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.google.logging.v2.LogMetric parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static com.google.logging.v2.LogMetric parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static com.google.logging.v2.LogMetric parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static com.google.logging.v2.LogMetric parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.google.logging.v2.LogMetric parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.logging.v2.LogMetric prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code google.logging.v2.LogMetric} - * - *
-   * Describes a logs-based metric.  The value of the metric is the
-   * number of log entries that match a logs filter.
-   * 
- */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:google.logging.v2.LogMetric) - com.google.logging.v2.LogMetricOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.logging.v2.LoggingMetrics.internal_static_google_logging_v2_LogMetric_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.logging.v2.LoggingMetrics.internal_static_google_logging_v2_LogMetric_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.logging.v2.LogMetric.class, com.google.logging.v2.LogMetric.Builder.class); - } - - // Construct using com.google.logging.v2.LogMetric.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - public Builder clear() { - super.clear(); - name_ = ""; - - description_ = ""; - - filter_ = ""; - - return this; - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.logging.v2.LoggingMetrics.internal_static_google_logging_v2_LogMetric_descriptor; - } - - public com.google.logging.v2.LogMetric getDefaultInstanceForType() { - return com.google.logging.v2.LogMetric.getDefaultInstance(); - } - - public com.google.logging.v2.LogMetric build() { - com.google.logging.v2.LogMetric result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.google.logging.v2.LogMetric buildPartial() { - com.google.logging.v2.LogMetric result = new com.google.logging.v2.LogMetric(this); - result.name_ = name_; - result.description_ = description_; - result.filter_ = filter_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.logging.v2.LogMetric) { - return mergeFrom((com.google.logging.v2.LogMetric)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.logging.v2.LogMetric other) { - if (other == com.google.logging.v2.LogMetric.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (!other.getDescription().isEmpty()) { - description_ = other.description_; - onChanged(); - } - if (!other.getFilter().isEmpty()) { - filter_ = other.filter_; - onChanged(); - } - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.logging.v2.LogMetric parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.logging.v2.LogMetric) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object name_ = ""; - /** - * optional string name = 1; - * - *
-     * Required. The client-assigned metric identifier. Example:
-     * `"severe_errors"`.  Metric identifiers are limited to 1000
-     * characters and can include only the following characters: `A-Z`,
-     * `a-z`, `0-9`, and the special characters `_-.,+!*',()%/\`.  The
-     * forward-slash character (`/`) denotes a hierarchy of name pieces,
-     * and it cannot be the first character of the name.
-     * 
- */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string name = 1; - * - *
-     * Required. The client-assigned metric identifier. Example:
-     * `"severe_errors"`.  Metric identifiers are limited to 1000
-     * characters and can include only the following characters: `A-Z`,
-     * `a-z`, `0-9`, and the special characters `_-.,+!*',()%/\`.  The
-     * forward-slash character (`/`) denotes a hierarchy of name pieces,
-     * and it cannot be the first character of the name.
-     * 
- */ - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string name = 1; - * - *
-     * Required. The client-assigned metric identifier. Example:
-     * `"severe_errors"`.  Metric identifiers are limited to 1000
-     * characters and can include only the following characters: `A-Z`,
-     * `a-z`, `0-9`, and the special characters `_-.,+!*',()%/\`.  The
-     * forward-slash character (`/`) denotes a hierarchy of name pieces,
-     * and it cannot be the first character of the name.
-     * 
- */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - * optional string name = 1; - * - *
-     * Required. The client-assigned metric identifier. Example:
-     * `"severe_errors"`.  Metric identifiers are limited to 1000
-     * characters and can include only the following characters: `A-Z`,
-     * `a-z`, `0-9`, and the special characters `_-.,+!*',()%/\`.  The
-     * forward-slash character (`/`) denotes a hierarchy of name pieces,
-     * and it cannot be the first character of the name.
-     * 
- */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * optional string name = 1; - * - *
-     * Required. The client-assigned metric identifier. Example:
-     * `"severe_errors"`.  Metric identifiers are limited to 1000
-     * characters and can include only the following characters: `A-Z`,
-     * `a-z`, `0-9`, and the special characters `_-.,+!*',()%/\`.  The
-     * forward-slash character (`/`) denotes a hierarchy of name pieces,
-     * and it cannot be the first character of the name.
-     * 
- */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - private java.lang.Object description_ = ""; - /** - * optional string description = 2; - * - *
-     * A description of this metric, which is used in documentation.
-     * 
- */ - public java.lang.String getDescription() { - java.lang.Object ref = description_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - description_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string description = 2; - * - *
-     * A description of this metric, which is used in documentation.
-     * 
- */ - public com.google.protobuf.ByteString - getDescriptionBytes() { - java.lang.Object ref = description_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - description_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string description = 2; - * - *
-     * A description of this metric, which is used in documentation.
-     * 
- */ - public Builder setDescription( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - description_ = value; - onChanged(); - return this; - } - /** - * optional string description = 2; - * - *
-     * A description of this metric, which is used in documentation.
-     * 
- */ - public Builder clearDescription() { - - description_ = getDefaultInstance().getDescription(); - onChanged(); - return this; - } - /** - * optional string description = 2; - * - *
-     * A description of this metric, which is used in documentation.
-     * 
- */ - public Builder setDescriptionBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - description_ = value; - onChanged(); - return this; - } - - private java.lang.Object filter_ = ""; - /** - * optional string filter = 3; - * - *
-     * An [advanced logs filter](/logging/docs/view/advanced_filters).
-     * Example: `"logName:syslog AND severity>=ERROR"`.
-     * 
- */ - public java.lang.String getFilter() { - java.lang.Object ref = filter_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - filter_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string filter = 3; - * - *
-     * An [advanced logs filter](/logging/docs/view/advanced_filters).
-     * Example: `"logName:syslog AND severity>=ERROR"`.
-     * 
- */ - public com.google.protobuf.ByteString - getFilterBytes() { - java.lang.Object ref = filter_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - filter_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string filter = 3; - * - *
-     * An [advanced logs filter](/logging/docs/view/advanced_filters).
-     * Example: `"logName:syslog AND severity>=ERROR"`.
-     * 
- */ - public Builder setFilter( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - filter_ = value; - onChanged(); - return this; - } - /** - * optional string filter = 3; - * - *
-     * An [advanced logs filter](/logging/docs/view/advanced_filters).
-     * Example: `"logName:syslog AND severity>=ERROR"`.
-     * 
- */ - public Builder clearFilter() { - - filter_ = getDefaultInstance().getFilter(); - onChanged(); - return this; - } - /** - * optional string filter = 3; - * - *
-     * An [advanced logs filter](/logging/docs/view/advanced_filters).
-     * Example: `"logName:syslog AND severity>=ERROR"`.
-     * 
- */ - public Builder setFilterBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - filter_ = value; - onChanged(); - return this; - } - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - - // @@protoc_insertion_point(builder_scope:google.logging.v2.LogMetric) - } - - // @@protoc_insertion_point(class_scope:google.logging.v2.LogMetric) - private static final com.google.logging.v2.LogMetric DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.logging.v2.LogMetric(); - } - - public static com.google.logging.v2.LogMetric getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - public LogMetric parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - try { - return new LogMetric(input, extensionRegistry); - } catch (RuntimeException e) { - if (e.getCause() instanceof - com.google.protobuf.InvalidProtocolBufferException) { - throw (com.google.protobuf.InvalidProtocolBufferException) - e.getCause(); - } - throw e; - } - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public com.google.logging.v2.LogMetric getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/LogMetricOrBuilder.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/LogMetricOrBuilder.java deleted file mode 100644 index 19b324038e38..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/LogMetricOrBuilder.java +++ /dev/null @@ -1,75 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/logging/v2/logging_metrics.proto - -package com.google.logging.v2; - -public interface LogMetricOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.logging.v2.LogMetric) - com.google.protobuf.MessageOrBuilder { - - /** - * optional string name = 1; - * - *
-   * Required. The client-assigned metric identifier. Example:
-   * `"severe_errors"`.  Metric identifiers are limited to 1000
-   * characters and can include only the following characters: `A-Z`,
-   * `a-z`, `0-9`, and the special characters `_-.,+!*',()%/\`.  The
-   * forward-slash character (`/`) denotes a hierarchy of name pieces,
-   * and it cannot be the first character of the name.
-   * 
- */ - java.lang.String getName(); - /** - * optional string name = 1; - * - *
-   * Required. The client-assigned metric identifier. Example:
-   * `"severe_errors"`.  Metric identifiers are limited to 1000
-   * characters and can include only the following characters: `A-Z`,
-   * `a-z`, `0-9`, and the special characters `_-.,+!*',()%/\`.  The
-   * forward-slash character (`/`) denotes a hierarchy of name pieces,
-   * and it cannot be the first character of the name.
-   * 
- */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - * optional string description = 2; - * - *
-   * A description of this metric, which is used in documentation.
-   * 
- */ - java.lang.String getDescription(); - /** - * optional string description = 2; - * - *
-   * A description of this metric, which is used in documentation.
-   * 
- */ - com.google.protobuf.ByteString - getDescriptionBytes(); - - /** - * optional string filter = 3; - * - *
-   * An [advanced logs filter](/logging/docs/view/advanced_filters).
-   * Example: `"logName:syslog AND severity>=ERROR"`.
-   * 
- */ - java.lang.String getFilter(); - /** - * optional string filter = 3; - * - *
-   * An [advanced logs filter](/logging/docs/view/advanced_filters).
-   * Example: `"logName:syslog AND severity>=ERROR"`.
-   * 
- */ - com.google.protobuf.ByteString - getFilterBytes(); -} diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/LogSink.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/LogSink.java deleted file mode 100644 index 0edaa4c3a704..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/LogSink.java +++ /dev/null @@ -1,1115 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/logging/v2/logging_config.proto - -package com.google.logging.v2; - -/** - * Protobuf type {@code google.logging.v2.LogSink} - * - *
- * Describes a sink used to export log entries outside Cloud Logging.
- * 
- */ -public final class LogSink extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:google.logging.v2.LogSink) - LogSinkOrBuilder { - // Use LogSink.newBuilder() to construct. - private LogSink(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - private LogSink() { - name_ = ""; - destination_ = ""; - filter_ = ""; - outputVersionFormat_ = 0; - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); - } - private LogSink( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) { - this(); - int mutable_bitField0_ = 0; - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!input.skipField(tag)) { - done = true; - } - break; - } - case 10: { - String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 26: { - String s = input.readStringRequireUtf8(); - - destination_ = s; - break; - } - case 42: { - String s = input.readStringRequireUtf8(); - - filter_ = s; - break; - } - case 48: { - int rawValue = input.readEnum(); - - outputVersionFormat_ = rawValue; - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw new RuntimeException(e.setUnfinishedMessage(this)); - } catch (java.io.IOException e) { - throw new RuntimeException( - new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this)); - } finally { - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.logging.v2.LoggingConfig.internal_static_google_logging_v2_LogSink_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.logging.v2.LoggingConfig.internal_static_google_logging_v2_LogSink_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.logging.v2.LogSink.class, com.google.logging.v2.LogSink.Builder.class); - } - - /** - * Protobuf enum {@code google.logging.v2.LogSink.VersionFormat} - * - *
-   * Available log entry formats. Log entries can be written to Cloud
-   * Logging in either format and can be exported in either format.
-   * Version 2 is the preferred format.
-   * 
- */ - public enum VersionFormat - implements com.google.protobuf.ProtocolMessageEnum { - /** - * VERSION_FORMAT_UNSPECIFIED = 0; - * - *
-     * An unspecified version format will default to V2.
-     * 
- */ - VERSION_FORMAT_UNSPECIFIED(0, 0), - /** - * V2 = 1; - * - *
-     * `LogEntry` version 2 format.
-     * 
- */ - V2(1, 1), - /** - * V1 = 2; - * - *
-     * `LogEntry` version 1 format.
-     * 
- */ - V1(2, 2), - UNRECOGNIZED(-1, -1), - ; - - /** - * VERSION_FORMAT_UNSPECIFIED = 0; - * - *
-     * An unspecified version format will default to V2.
-     * 
- */ - public static final int VERSION_FORMAT_UNSPECIFIED_VALUE = 0; - /** - * V2 = 1; - * - *
-     * `LogEntry` version 2 format.
-     * 
- */ - public static final int V2_VALUE = 1; - /** - * V1 = 2; - * - *
-     * `LogEntry` version 1 format.
-     * 
- */ - public static final int V1_VALUE = 2; - - - public final int getNumber() { - if (index == -1) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - public static VersionFormat valueOf(int value) { - switch (value) { - case 0: return VERSION_FORMAT_UNSPECIFIED; - case 1: return V2; - case 2: return V1; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - VersionFormat> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public VersionFormat findValueByNumber(int number) { - return VersionFormat.valueOf(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor - getValueDescriptor() { - return getDescriptor().getValues().get(index); - } - public final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptorForType() { - return getDescriptor(); - } - public static final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptor() { - return com.google.logging.v2.LogSink.getDescriptor().getEnumTypes().get(0); - } - - private static final VersionFormat[] VALUES = values(); - - public static VersionFormat valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "EnumValueDescriptor is not for this type."); - } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } - return VALUES[desc.getIndex()]; - } - - private final int index; - private final int value; - - private VersionFormat(int index, int value) { - this.index = index; - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:google.logging.v2.LogSink.VersionFormat) - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - * optional string name = 1; - * - *
-   * Required. The client-assigned sink identifier. Example:
-   * `"my-severe-errors-to-pubsub"`.
-   * Sink identifiers are limited to 1000 characters
-   * and can include only the following characters: `A-Z`, `a-z`,
-   * `0-9`, and the special characters `_-.`.
-   * 
- */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - /** - * optional string name = 1; - * - *
-   * Required. The client-assigned sink identifier. Example:
-   * `"my-severe-errors-to-pubsub"`.
-   * Sink identifiers are limited to 1000 characters
-   * and can include only the following characters: `A-Z`, `a-z`,
-   * `0-9`, and the special characters `_-.`.
-   * 
- */ - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int DESTINATION_FIELD_NUMBER = 3; - private volatile java.lang.Object destination_; - /** - * optional string destination = 3; - * - *
-   * The export destination. See
-   * [Exporting Logs With Sinks](/logging/docs/api/tasks/exporting-logs).
-   * Examples: `"storage.googleapis.com/a-bucket"`,
-   * `"bigquery.googleapis.com/projects/a-project-id/datasets/a-dataset"`.
-   * 
- */ - public java.lang.String getDestination() { - java.lang.Object ref = destination_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - destination_ = s; - return s; - } - } - /** - * optional string destination = 3; - * - *
-   * The export destination. See
-   * [Exporting Logs With Sinks](/logging/docs/api/tasks/exporting-logs).
-   * Examples: `"storage.googleapis.com/a-bucket"`,
-   * `"bigquery.googleapis.com/projects/a-project-id/datasets/a-dataset"`.
-   * 
- */ - public com.google.protobuf.ByteString - getDestinationBytes() { - java.lang.Object ref = destination_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - destination_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int FILTER_FIELD_NUMBER = 5; - private volatile java.lang.Object filter_; - /** - * optional string filter = 5; - * - *
-   * An [advanced logs filter](/logging/docs/view/advanced_filters)
-   * that defines the log entries to be exported.  The filter must be
-   * consistent with the log entry format designed by the
-   * `outputVersionFormat` parameter, regardless of the format of the
-   * log entry that was originally written to Cloud Logging.
-   * Example: `"logName:syslog AND severity>=ERROR"`.
-   * 
- */ - public java.lang.String getFilter() { - java.lang.Object ref = filter_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - filter_ = s; - return s; - } - } - /** - * optional string filter = 5; - * - *
-   * An [advanced logs filter](/logging/docs/view/advanced_filters)
-   * that defines the log entries to be exported.  The filter must be
-   * consistent with the log entry format designed by the
-   * `outputVersionFormat` parameter, regardless of the format of the
-   * log entry that was originally written to Cloud Logging.
-   * Example: `"logName:syslog AND severity>=ERROR"`.
-   * 
- */ - public com.google.protobuf.ByteString - getFilterBytes() { - java.lang.Object ref = filter_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - filter_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int OUTPUT_VERSION_FORMAT_FIELD_NUMBER = 6; - private int outputVersionFormat_; - /** - * optional .google.logging.v2.LogSink.VersionFormat output_version_format = 6; - * - *
-   * The log entry version used when exporting log entries from this
-   * sink.  This version does not have to correspond to the version of
-   * the log entry when it was written to Cloud Logging.
-   * 
- */ - public int getOutputVersionFormatValue() { - return outputVersionFormat_; - } - /** - * optional .google.logging.v2.LogSink.VersionFormat output_version_format = 6; - * - *
-   * The log entry version used when exporting log entries from this
-   * sink.  This version does not have to correspond to the version of
-   * the log entry when it was written to Cloud Logging.
-   * 
- */ - public com.google.logging.v2.LogSink.VersionFormat getOutputVersionFormat() { - com.google.logging.v2.LogSink.VersionFormat result = com.google.logging.v2.LogSink.VersionFormat.valueOf(outputVersionFormat_); - return result == null ? com.google.logging.v2.LogSink.VersionFormat.UNRECOGNIZED : result; - } - - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); - } - if (!getDestinationBytes().isEmpty()) { - com.google.protobuf.GeneratedMessage.writeString(output, 3, destination_); - } - if (!getFilterBytes().isEmpty()) { - com.google.protobuf.GeneratedMessage.writeString(output, 5, filter_); - } - if (outputVersionFormat_ != com.google.logging.v2.LogSink.VersionFormat.VERSION_FORMAT_UNSPECIFIED.getNumber()) { - output.writeEnum(6, outputVersionFormat_); - } - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); - } - if (!getDestinationBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessage.computeStringSize(3, destination_); - } - if (!getFilterBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessage.computeStringSize(5, filter_); - } - if (outputVersionFormat_ != com.google.logging.v2.LogSink.VersionFormat.VERSION_FORMAT_UNSPECIFIED.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(6, outputVersionFormat_); - } - memoizedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - public static com.google.logging.v2.LogSink parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.logging.v2.LogSink parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.logging.v2.LogSink parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.logging.v2.LogSink parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.logging.v2.LogSink parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.google.logging.v2.LogSink parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static com.google.logging.v2.LogSink parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static com.google.logging.v2.LogSink parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static com.google.logging.v2.LogSink parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.google.logging.v2.LogSink parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.logging.v2.LogSink prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code google.logging.v2.LogSink} - * - *
-   * Describes a sink used to export log entries outside Cloud Logging.
-   * 
- */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:google.logging.v2.LogSink) - com.google.logging.v2.LogSinkOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.logging.v2.LoggingConfig.internal_static_google_logging_v2_LogSink_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.logging.v2.LoggingConfig.internal_static_google_logging_v2_LogSink_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.logging.v2.LogSink.class, com.google.logging.v2.LogSink.Builder.class); - } - - // Construct using com.google.logging.v2.LogSink.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - public Builder clear() { - super.clear(); - name_ = ""; - - destination_ = ""; - - filter_ = ""; - - outputVersionFormat_ = 0; - - return this; - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.logging.v2.LoggingConfig.internal_static_google_logging_v2_LogSink_descriptor; - } - - public com.google.logging.v2.LogSink getDefaultInstanceForType() { - return com.google.logging.v2.LogSink.getDefaultInstance(); - } - - public com.google.logging.v2.LogSink build() { - com.google.logging.v2.LogSink result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.google.logging.v2.LogSink buildPartial() { - com.google.logging.v2.LogSink result = new com.google.logging.v2.LogSink(this); - result.name_ = name_; - result.destination_ = destination_; - result.filter_ = filter_; - result.outputVersionFormat_ = outputVersionFormat_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.logging.v2.LogSink) { - return mergeFrom((com.google.logging.v2.LogSink)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.logging.v2.LogSink other) { - if (other == com.google.logging.v2.LogSink.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (!other.getDestination().isEmpty()) { - destination_ = other.destination_; - onChanged(); - } - if (!other.getFilter().isEmpty()) { - filter_ = other.filter_; - onChanged(); - } - if (other.outputVersionFormat_ != 0) { - setOutputVersionFormatValue(other.getOutputVersionFormatValue()); - } - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.logging.v2.LogSink parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.logging.v2.LogSink) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object name_ = ""; - /** - * optional string name = 1; - * - *
-     * Required. The client-assigned sink identifier. Example:
-     * `"my-severe-errors-to-pubsub"`.
-     * Sink identifiers are limited to 1000 characters
-     * and can include only the following characters: `A-Z`, `a-z`,
-     * `0-9`, and the special characters `_-.`.
-     * 
- */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string name = 1; - * - *
-     * Required. The client-assigned sink identifier. Example:
-     * `"my-severe-errors-to-pubsub"`.
-     * Sink identifiers are limited to 1000 characters
-     * and can include only the following characters: `A-Z`, `a-z`,
-     * `0-9`, and the special characters `_-.`.
-     * 
- */ - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string name = 1; - * - *
-     * Required. The client-assigned sink identifier. Example:
-     * `"my-severe-errors-to-pubsub"`.
-     * Sink identifiers are limited to 1000 characters
-     * and can include only the following characters: `A-Z`, `a-z`,
-     * `0-9`, and the special characters `_-.`.
-     * 
- */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - * optional string name = 1; - * - *
-     * Required. The client-assigned sink identifier. Example:
-     * `"my-severe-errors-to-pubsub"`.
-     * Sink identifiers are limited to 1000 characters
-     * and can include only the following characters: `A-Z`, `a-z`,
-     * `0-9`, and the special characters `_-.`.
-     * 
- */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * optional string name = 1; - * - *
-     * Required. The client-assigned sink identifier. Example:
-     * `"my-severe-errors-to-pubsub"`.
-     * Sink identifiers are limited to 1000 characters
-     * and can include only the following characters: `A-Z`, `a-z`,
-     * `0-9`, and the special characters `_-.`.
-     * 
- */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - private java.lang.Object destination_ = ""; - /** - * optional string destination = 3; - * - *
-     * The export destination. See
-     * [Exporting Logs With Sinks](/logging/docs/api/tasks/exporting-logs).
-     * Examples: `"storage.googleapis.com/a-bucket"`,
-     * `"bigquery.googleapis.com/projects/a-project-id/datasets/a-dataset"`.
-     * 
- */ - public java.lang.String getDestination() { - java.lang.Object ref = destination_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - destination_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string destination = 3; - * - *
-     * The export destination. See
-     * [Exporting Logs With Sinks](/logging/docs/api/tasks/exporting-logs).
-     * Examples: `"storage.googleapis.com/a-bucket"`,
-     * `"bigquery.googleapis.com/projects/a-project-id/datasets/a-dataset"`.
-     * 
- */ - public com.google.protobuf.ByteString - getDestinationBytes() { - java.lang.Object ref = destination_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - destination_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string destination = 3; - * - *
-     * The export destination. See
-     * [Exporting Logs With Sinks](/logging/docs/api/tasks/exporting-logs).
-     * Examples: `"storage.googleapis.com/a-bucket"`,
-     * `"bigquery.googleapis.com/projects/a-project-id/datasets/a-dataset"`.
-     * 
- */ - public Builder setDestination( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - destination_ = value; - onChanged(); - return this; - } - /** - * optional string destination = 3; - * - *
-     * The export destination. See
-     * [Exporting Logs With Sinks](/logging/docs/api/tasks/exporting-logs).
-     * Examples: `"storage.googleapis.com/a-bucket"`,
-     * `"bigquery.googleapis.com/projects/a-project-id/datasets/a-dataset"`.
-     * 
- */ - public Builder clearDestination() { - - destination_ = getDefaultInstance().getDestination(); - onChanged(); - return this; - } - /** - * optional string destination = 3; - * - *
-     * The export destination. See
-     * [Exporting Logs With Sinks](/logging/docs/api/tasks/exporting-logs).
-     * Examples: `"storage.googleapis.com/a-bucket"`,
-     * `"bigquery.googleapis.com/projects/a-project-id/datasets/a-dataset"`.
-     * 
- */ - public Builder setDestinationBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - destination_ = value; - onChanged(); - return this; - } - - private java.lang.Object filter_ = ""; - /** - * optional string filter = 5; - * - *
-     * An [advanced logs filter](/logging/docs/view/advanced_filters)
-     * that defines the log entries to be exported.  The filter must be
-     * consistent with the log entry format designed by the
-     * `outputVersionFormat` parameter, regardless of the format of the
-     * log entry that was originally written to Cloud Logging.
-     * Example: `"logName:syslog AND severity>=ERROR"`.
-     * 
- */ - public java.lang.String getFilter() { - java.lang.Object ref = filter_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - filter_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string filter = 5; - * - *
-     * An [advanced logs filter](/logging/docs/view/advanced_filters)
-     * that defines the log entries to be exported.  The filter must be
-     * consistent with the log entry format designed by the
-     * `outputVersionFormat` parameter, regardless of the format of the
-     * log entry that was originally written to Cloud Logging.
-     * Example: `"logName:syslog AND severity>=ERROR"`.
-     * 
- */ - public com.google.protobuf.ByteString - getFilterBytes() { - java.lang.Object ref = filter_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - filter_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string filter = 5; - * - *
-     * An [advanced logs filter](/logging/docs/view/advanced_filters)
-     * that defines the log entries to be exported.  The filter must be
-     * consistent with the log entry format designed by the
-     * `outputVersionFormat` parameter, regardless of the format of the
-     * log entry that was originally written to Cloud Logging.
-     * Example: `"logName:syslog AND severity>=ERROR"`.
-     * 
- */ - public Builder setFilter( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - filter_ = value; - onChanged(); - return this; - } - /** - * optional string filter = 5; - * - *
-     * An [advanced logs filter](/logging/docs/view/advanced_filters)
-     * that defines the log entries to be exported.  The filter must be
-     * consistent with the log entry format designed by the
-     * `outputVersionFormat` parameter, regardless of the format of the
-     * log entry that was originally written to Cloud Logging.
-     * Example: `"logName:syslog AND severity>=ERROR"`.
-     * 
- */ - public Builder clearFilter() { - - filter_ = getDefaultInstance().getFilter(); - onChanged(); - return this; - } - /** - * optional string filter = 5; - * - *
-     * An [advanced logs filter](/logging/docs/view/advanced_filters)
-     * that defines the log entries to be exported.  The filter must be
-     * consistent with the log entry format designed by the
-     * `outputVersionFormat` parameter, regardless of the format of the
-     * log entry that was originally written to Cloud Logging.
-     * Example: `"logName:syslog AND severity>=ERROR"`.
-     * 
- */ - public Builder setFilterBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - filter_ = value; - onChanged(); - return this; - } - - private int outputVersionFormat_ = 0; - /** - * optional .google.logging.v2.LogSink.VersionFormat output_version_format = 6; - * - *
-     * The log entry version used when exporting log entries from this
-     * sink.  This version does not have to correspond to the version of
-     * the log entry when it was written to Cloud Logging.
-     * 
- */ - public int getOutputVersionFormatValue() { - return outputVersionFormat_; - } - /** - * optional .google.logging.v2.LogSink.VersionFormat output_version_format = 6; - * - *
-     * The log entry version used when exporting log entries from this
-     * sink.  This version does not have to correspond to the version of
-     * the log entry when it was written to Cloud Logging.
-     * 
- */ - public Builder setOutputVersionFormatValue(int value) { - outputVersionFormat_ = value; - onChanged(); - return this; - } - /** - * optional .google.logging.v2.LogSink.VersionFormat output_version_format = 6; - * - *
-     * The log entry version used when exporting log entries from this
-     * sink.  This version does not have to correspond to the version of
-     * the log entry when it was written to Cloud Logging.
-     * 
- */ - public com.google.logging.v2.LogSink.VersionFormat getOutputVersionFormat() { - com.google.logging.v2.LogSink.VersionFormat result = com.google.logging.v2.LogSink.VersionFormat.valueOf(outputVersionFormat_); - return result == null ? com.google.logging.v2.LogSink.VersionFormat.UNRECOGNIZED : result; - } - /** - * optional .google.logging.v2.LogSink.VersionFormat output_version_format = 6; - * - *
-     * The log entry version used when exporting log entries from this
-     * sink.  This version does not have to correspond to the version of
-     * the log entry when it was written to Cloud Logging.
-     * 
- */ - public Builder setOutputVersionFormat(com.google.logging.v2.LogSink.VersionFormat value) { - if (value == null) { - throw new NullPointerException(); - } - - outputVersionFormat_ = value.getNumber(); - onChanged(); - return this; - } - /** - * optional .google.logging.v2.LogSink.VersionFormat output_version_format = 6; - * - *
-     * The log entry version used when exporting log entries from this
-     * sink.  This version does not have to correspond to the version of
-     * the log entry when it was written to Cloud Logging.
-     * 
- */ - public Builder clearOutputVersionFormat() { - - outputVersionFormat_ = 0; - onChanged(); - return this; - } - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - - // @@protoc_insertion_point(builder_scope:google.logging.v2.LogSink) - } - - // @@protoc_insertion_point(class_scope:google.logging.v2.LogSink) - private static final com.google.logging.v2.LogSink DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.logging.v2.LogSink(); - } - - public static com.google.logging.v2.LogSink getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - public LogSink parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - try { - return new LogSink(input, extensionRegistry); - } catch (RuntimeException e) { - if (e.getCause() instanceof - com.google.protobuf.InvalidProtocolBufferException) { - throw (com.google.protobuf.InvalidProtocolBufferException) - e.getCause(); - } - throw e; - } - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public com.google.logging.v2.LogSink getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/LogSinkOrBuilder.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/LogSinkOrBuilder.java deleted file mode 100644 index 4d3a9c6ed0ec..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/LogSinkOrBuilder.java +++ /dev/null @@ -1,108 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/logging/v2/logging_config.proto - -package com.google.logging.v2; - -public interface LogSinkOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.logging.v2.LogSink) - com.google.protobuf.MessageOrBuilder { - - /** - * optional string name = 1; - * - *
-   * Required. The client-assigned sink identifier. Example:
-   * `"my-severe-errors-to-pubsub"`.
-   * Sink identifiers are limited to 1000 characters
-   * and can include only the following characters: `A-Z`, `a-z`,
-   * `0-9`, and the special characters `_-.`.
-   * 
- */ - java.lang.String getName(); - /** - * optional string name = 1; - * - *
-   * Required. The client-assigned sink identifier. Example:
-   * `"my-severe-errors-to-pubsub"`.
-   * Sink identifiers are limited to 1000 characters
-   * and can include only the following characters: `A-Z`, `a-z`,
-   * `0-9`, and the special characters `_-.`.
-   * 
- */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - * optional string destination = 3; - * - *
-   * The export destination. See
-   * [Exporting Logs With Sinks](/logging/docs/api/tasks/exporting-logs).
-   * Examples: `"storage.googleapis.com/a-bucket"`,
-   * `"bigquery.googleapis.com/projects/a-project-id/datasets/a-dataset"`.
-   * 
- */ - java.lang.String getDestination(); - /** - * optional string destination = 3; - * - *
-   * The export destination. See
-   * [Exporting Logs With Sinks](/logging/docs/api/tasks/exporting-logs).
-   * Examples: `"storage.googleapis.com/a-bucket"`,
-   * `"bigquery.googleapis.com/projects/a-project-id/datasets/a-dataset"`.
-   * 
- */ - com.google.protobuf.ByteString - getDestinationBytes(); - - /** - * optional string filter = 5; - * - *
-   * An [advanced logs filter](/logging/docs/view/advanced_filters)
-   * that defines the log entries to be exported.  The filter must be
-   * consistent with the log entry format designed by the
-   * `outputVersionFormat` parameter, regardless of the format of the
-   * log entry that was originally written to Cloud Logging.
-   * Example: `"logName:syslog AND severity>=ERROR"`.
-   * 
- */ - java.lang.String getFilter(); - /** - * optional string filter = 5; - * - *
-   * An [advanced logs filter](/logging/docs/view/advanced_filters)
-   * that defines the log entries to be exported.  The filter must be
-   * consistent with the log entry format designed by the
-   * `outputVersionFormat` parameter, regardless of the format of the
-   * log entry that was originally written to Cloud Logging.
-   * Example: `"logName:syslog AND severity>=ERROR"`.
-   * 
- */ - com.google.protobuf.ByteString - getFilterBytes(); - - /** - * optional .google.logging.v2.LogSink.VersionFormat output_version_format = 6; - * - *
-   * The log entry version used when exporting log entries from this
-   * sink.  This version does not have to correspond to the version of
-   * the log entry when it was written to Cloud Logging.
-   * 
- */ - int getOutputVersionFormatValue(); - /** - * optional .google.logging.v2.LogSink.VersionFormat output_version_format = 6; - * - *
-   * The log entry version used when exporting log entries from this
-   * sink.  This version does not have to correspond to the version of
-   * the log entry when it was written to Cloud Logging.
-   * 
- */ - com.google.logging.v2.LogSink.VersionFormat getOutputVersionFormat(); -} diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/LoggingConfig.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/LoggingConfig.java deleted file mode 100644 index 853e6313d2e1..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/LoggingConfig.java +++ /dev/null @@ -1,162 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/logging/v2/logging_config.proto - -package com.google.logging.v2; - -public final class LoggingConfig { - private LoggingConfig() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - } - static com.google.protobuf.Descriptors.Descriptor - internal_static_google_logging_v2_LogSink_descriptor; - static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_google_logging_v2_LogSink_fieldAccessorTable; - static com.google.protobuf.Descriptors.Descriptor - internal_static_google_logging_v2_ListSinksRequest_descriptor; - static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_google_logging_v2_ListSinksRequest_fieldAccessorTable; - static com.google.protobuf.Descriptors.Descriptor - internal_static_google_logging_v2_ListSinksResponse_descriptor; - static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_google_logging_v2_ListSinksResponse_fieldAccessorTable; - static com.google.protobuf.Descriptors.Descriptor - internal_static_google_logging_v2_GetSinkRequest_descriptor; - static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_google_logging_v2_GetSinkRequest_fieldAccessorTable; - static com.google.protobuf.Descriptors.Descriptor - internal_static_google_logging_v2_CreateSinkRequest_descriptor; - static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_google_logging_v2_CreateSinkRequest_fieldAccessorTable; - static com.google.protobuf.Descriptors.Descriptor - internal_static_google_logging_v2_UpdateSinkRequest_descriptor; - static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_google_logging_v2_UpdateSinkRequest_fieldAccessorTable; - static com.google.protobuf.Descriptors.Descriptor - internal_static_google_logging_v2_DeleteSinkRequest_descriptor; - static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_google_logging_v2_DeleteSinkRequest_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n&google/logging/v2/logging_config.proto" + - "\022\021google.logging.v2\032\034google/api/annotati" + - "ons.proto\032\033google/protobuf/empty.proto\032\037" + - "google/protobuf/timestamp.proto\"\306\001\n\007LogS" + - "ink\022\014\n\004name\030\001 \001(\t\022\023\n\013destination\030\003 \001(\t\022\016" + - "\n\006filter\030\005 \001(\t\022G\n\025output_version_format\030" + - "\006 \001(\0162(.google.logging.v2.LogSink.Versio" + - "nFormat\"?\n\rVersionFormat\022\036\n\032VERSION_FORM" + - "AT_UNSPECIFIED\020\000\022\006\n\002V2\020\001\022\006\n\002V1\020\002\"O\n\020List" + - "SinksRequest\022\024\n\014project_name\030\001 \001(\t\022\022\n\npa", - "ge_token\030\002 \001(\t\022\021\n\tpage_size\030\003 \001(\005\"W\n\021Lis" + - "tSinksResponse\022)\n\005sinks\030\001 \003(\0132\032.google.l" + - "ogging.v2.LogSink\022\027\n\017next_page_token\030\002 \001" + - "(\t\"#\n\016GetSinkRequest\022\021\n\tsink_name\030\001 \001(\t\"" + - "S\n\021CreateSinkRequest\022\024\n\014project_name\030\001 \001" + - "(\t\022(\n\004sink\030\002 \001(\0132\032.google.logging.v2.Log" + - "Sink\"P\n\021UpdateSinkRequest\022\021\n\tsink_name\030\001" + - " \001(\t\022(\n\004sink\030\002 \001(\0132\032.google.logging.v2.L" + - "ogSink\"&\n\021DeleteSinkRequest\022\021\n\tsink_name" + - "\030\001 \001(\t2\245\005\n\017ConfigServiceV2\022\210\001\n\tListSinks", - "\022#.google.logging.v2.ListSinksRequest\032$." + - "google.logging.v2.ListSinksResponse\"0\202\323\344" + - "\223\002*\022(/v2beta1/{project_name=projects/*}/" + - "sinks\022y\n\007GetSink\022!.google.logging.v2.Get" + - "SinkRequest\032\032.google.logging.v2.LogSink\"" + - "/\202\323\344\223\002)\022\'/v2beta1/{sink_name=projects/*/" + - "sinks/*}\022\206\001\n\nCreateSink\022$.google.logging" + - ".v2.CreateSinkRequest\032\032.google.logging.v" + - "2.LogSink\"6\202\323\344\223\0020\"(/v2beta1/{project_nam" + - "e=projects/*}/sinks:\004sink\022\205\001\n\nUpdateSink", - "\022$.google.logging.v2.UpdateSinkRequest\032\032" + - ".google.logging.v2.LogSink\"5\202\323\344\223\002/\032\'/v2b" + - "eta1/{sink_name=projects/*/sinks/*}:\004sin" + - "k\022{\n\nDeleteSink\022$.google.logging.v2.Dele" + - "teSinkRequest\032\026.google.protobuf.Empty\"/\202" + - "\323\344\223\002)*\'/v2beta1/{sink_name=projects/*/si" + - "nks/*}B(\n\025com.google.logging.v2B\rLogging" + - "ConfigP\001b\006proto3" - }; - com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = - new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { - public com.google.protobuf.ExtensionRegistry assignDescriptors( - com.google.protobuf.Descriptors.FileDescriptor root) { - descriptor = root; - return null; - } - }; - com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - com.google.api.AnnotationsProto.getDescriptor(), - com.google.protobuf.EmptyProto.getDescriptor(), - com.google.protobuf.TimestampProto.getDescriptor(), - }, assigner); - internal_static_google_logging_v2_LogSink_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_google_logging_v2_LogSink_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_google_logging_v2_LogSink_descriptor, - new java.lang.String[] { "Name", "Destination", "Filter", "OutputVersionFormat", }); - internal_static_google_logging_v2_ListSinksRequest_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_google_logging_v2_ListSinksRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_google_logging_v2_ListSinksRequest_descriptor, - new java.lang.String[] { "ProjectName", "PageToken", "PageSize", }); - internal_static_google_logging_v2_ListSinksResponse_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_google_logging_v2_ListSinksResponse_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_google_logging_v2_ListSinksResponse_descriptor, - new java.lang.String[] { "Sinks", "NextPageToken", }); - internal_static_google_logging_v2_GetSinkRequest_descriptor = - getDescriptor().getMessageTypes().get(3); - internal_static_google_logging_v2_GetSinkRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_google_logging_v2_GetSinkRequest_descriptor, - new java.lang.String[] { "SinkName", }); - internal_static_google_logging_v2_CreateSinkRequest_descriptor = - getDescriptor().getMessageTypes().get(4); - internal_static_google_logging_v2_CreateSinkRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_google_logging_v2_CreateSinkRequest_descriptor, - new java.lang.String[] { "ProjectName", "Sink", }); - internal_static_google_logging_v2_UpdateSinkRequest_descriptor = - getDescriptor().getMessageTypes().get(5); - internal_static_google_logging_v2_UpdateSinkRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_google_logging_v2_UpdateSinkRequest_descriptor, - new java.lang.String[] { "SinkName", "Sink", }); - internal_static_google_logging_v2_DeleteSinkRequest_descriptor = - getDescriptor().getMessageTypes().get(6); - internal_static_google_logging_v2_DeleteSinkRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_google_logging_v2_DeleteSinkRequest_descriptor, - new java.lang.String[] { "SinkName", }); - com.google.protobuf.ExtensionRegistry registry = - com.google.protobuf.ExtensionRegistry.newInstance(); - registry.add(com.google.api.AnnotationsProto.http); - com.google.protobuf.Descriptors.FileDescriptor - .internalUpdateFileDescriptor(descriptor, registry); - com.google.api.AnnotationsProto.getDescriptor(); - com.google.protobuf.EmptyProto.getDescriptor(); - com.google.protobuf.TimestampProto.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/LoggingMetrics.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/LoggingMetrics.java deleted file mode 100644 index b4c55f0e8ecc..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/LoggingMetrics.java +++ /dev/null @@ -1,159 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/logging/v2/logging_metrics.proto - -package com.google.logging.v2; - -public final class LoggingMetrics { - private LoggingMetrics() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - } - static com.google.protobuf.Descriptors.Descriptor - internal_static_google_logging_v2_LogMetric_descriptor; - static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_google_logging_v2_LogMetric_fieldAccessorTable; - static com.google.protobuf.Descriptors.Descriptor - internal_static_google_logging_v2_ListLogMetricsRequest_descriptor; - static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_google_logging_v2_ListLogMetricsRequest_fieldAccessorTable; - static com.google.protobuf.Descriptors.Descriptor - internal_static_google_logging_v2_ListLogMetricsResponse_descriptor; - static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_google_logging_v2_ListLogMetricsResponse_fieldAccessorTable; - static com.google.protobuf.Descriptors.Descriptor - internal_static_google_logging_v2_GetLogMetricRequest_descriptor; - static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_google_logging_v2_GetLogMetricRequest_fieldAccessorTable; - static com.google.protobuf.Descriptors.Descriptor - internal_static_google_logging_v2_CreateLogMetricRequest_descriptor; - static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_google_logging_v2_CreateLogMetricRequest_fieldAccessorTable; - static com.google.protobuf.Descriptors.Descriptor - internal_static_google_logging_v2_UpdateLogMetricRequest_descriptor; - static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_google_logging_v2_UpdateLogMetricRequest_fieldAccessorTable; - static com.google.protobuf.Descriptors.Descriptor - internal_static_google_logging_v2_DeleteLogMetricRequest_descriptor; - static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_google_logging_v2_DeleteLogMetricRequest_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n\'google/logging/v2/logging_metrics.prot" + - "o\022\021google.logging.v2\032\034google/api/annotat" + - "ions.proto\032\033google/protobuf/empty.proto\"" + - "\\\n\tLogMetric\022\014\n\004name\030\001 \001(\t\022\023\n\013descriptio" + - "n\030\002 \001(\t\022\016\n\006filter\030\003 \001(\t\"\034\n\nApiVersion\022\006\n" + - "\002V2\020\000\022\006\n\002V1\020\001\"T\n\025ListLogMetricsRequest\022\024" + - "\n\014project_name\030\001 \001(\t\022\022\n\npage_token\030\002 \001(\t" + - "\022\021\n\tpage_size\030\003 \001(\005\"`\n\026ListLogMetricsRes" + - "ponse\022-\n\007metrics\030\001 \003(\0132\034.google.logging." + - "v2.LogMetric\022\027\n\017next_page_token\030\002 \001(\t\"*\n", - "\023GetLogMetricRequest\022\023\n\013metric_name\030\001 \001(" + - "\t\"\\\n\026CreateLogMetricRequest\022\024\n\014project_n" + - "ame\030\001 \001(\t\022,\n\006metric\030\002 \001(\0132\034.google.loggi" + - "ng.v2.LogMetric\"[\n\026UpdateLogMetricReques" + - "t\022\023\n\013metric_name\030\001 \001(\t\022,\n\006metric\030\002 \001(\0132\034" + - ".google.logging.v2.LogMetric\"-\n\026DeleteLo" + - "gMetricRequest\022\023\n\013metric_name\030\001 \001(\t2\371\005\n\020" + - "MetricsServiceV2\022\231\001\n\016ListLogMetrics\022(.go" + - "ogle.logging.v2.ListLogMetricsRequest\032)." + - "google.logging.v2.ListLogMetricsResponse", - "\"2\202\323\344\223\002,\022*/v2beta1/{project_name=project" + - "s/*}/metrics\022\211\001\n\014GetLogMetric\022&.google.l" + - "ogging.v2.GetLogMetricRequest\032\034.google.l" + - "ogging.v2.LogMetric\"3\202\323\344\223\002-\022+/v2beta1/{m" + - "etric_name=projects/*/metrics/*}\022\226\001\n\017Cre" + - "ateLogMetric\022).google.logging.v2.CreateL" + - "ogMetricRequest\032\034.google.logging.v2.LogM" + - "etric\":\202\323\344\223\0024\"*/v2beta1/{project_name=pr" + - "ojects/*}/metrics:\006metric\022\227\001\n\017UpdateLogM" + - "etric\022).google.logging.v2.UpdateLogMetri", - "cRequest\032\034.google.logging.v2.LogMetric\";" + - "\202\323\344\223\0025\032+/v2beta1/{metric_name=projects/*" + - "/metrics/*}:\006metric\022\211\001\n\017DeleteLogMetric\022" + - ").google.logging.v2.DeleteLogMetricReque" + - "st\032\026.google.protobuf.Empty\"3\202\323\344\223\002-*+/v2b" + - "eta1/{metric_name=projects/*/metrics/*}B" + - "\031\n\025com.google.logging.v2P\001b\006proto3" - }; - com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = - new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { - public com.google.protobuf.ExtensionRegistry assignDescriptors( - com.google.protobuf.Descriptors.FileDescriptor root) { - descriptor = root; - return null; - } - }; - com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - com.google.api.AnnotationsProto.getDescriptor(), - com.google.protobuf.EmptyProto.getDescriptor(), - }, assigner); - internal_static_google_logging_v2_LogMetric_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_google_logging_v2_LogMetric_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_google_logging_v2_LogMetric_descriptor, - new java.lang.String[] { "Name", "Description", "Filter", }); - internal_static_google_logging_v2_ListLogMetricsRequest_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_google_logging_v2_ListLogMetricsRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_google_logging_v2_ListLogMetricsRequest_descriptor, - new java.lang.String[] { "ProjectName", "PageToken", "PageSize", }); - internal_static_google_logging_v2_ListLogMetricsResponse_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_google_logging_v2_ListLogMetricsResponse_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_google_logging_v2_ListLogMetricsResponse_descriptor, - new java.lang.String[] { "Metrics", "NextPageToken", }); - internal_static_google_logging_v2_GetLogMetricRequest_descriptor = - getDescriptor().getMessageTypes().get(3); - internal_static_google_logging_v2_GetLogMetricRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_google_logging_v2_GetLogMetricRequest_descriptor, - new java.lang.String[] { "MetricName", }); - internal_static_google_logging_v2_CreateLogMetricRequest_descriptor = - getDescriptor().getMessageTypes().get(4); - internal_static_google_logging_v2_CreateLogMetricRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_google_logging_v2_CreateLogMetricRequest_descriptor, - new java.lang.String[] { "ProjectName", "Metric", }); - internal_static_google_logging_v2_UpdateLogMetricRequest_descriptor = - getDescriptor().getMessageTypes().get(5); - internal_static_google_logging_v2_UpdateLogMetricRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_google_logging_v2_UpdateLogMetricRequest_descriptor, - new java.lang.String[] { "MetricName", "Metric", }); - internal_static_google_logging_v2_DeleteLogMetricRequest_descriptor = - getDescriptor().getMessageTypes().get(6); - internal_static_google_logging_v2_DeleteLogMetricRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_google_logging_v2_DeleteLogMetricRequest_descriptor, - new java.lang.String[] { "MetricName", }); - com.google.protobuf.ExtensionRegistry registry = - com.google.protobuf.ExtensionRegistry.newInstance(); - registry.add(com.google.api.AnnotationsProto.http); - com.google.protobuf.Descriptors.FileDescriptor - .internalUpdateFileDescriptor(descriptor, registry); - com.google.api.AnnotationsProto.getDescriptor(); - com.google.protobuf.EmptyProto.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/LoggingProto.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/LoggingProto.java deleted file mode 100644 index d112735796ce..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/LoggingProto.java +++ /dev/null @@ -1,208 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/logging/v2/logging.proto - -package com.google.logging.v2; - -public final class LoggingProto { - private LoggingProto() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - } - static com.google.protobuf.Descriptors.Descriptor - internal_static_google_logging_v2_DeleteLogRequest_descriptor; - static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_google_logging_v2_DeleteLogRequest_fieldAccessorTable; - static com.google.protobuf.Descriptors.Descriptor - internal_static_google_logging_v2_WriteLogEntriesRequest_descriptor; - static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_google_logging_v2_WriteLogEntriesRequest_fieldAccessorTable; - static com.google.protobuf.Descriptors.Descriptor - internal_static_google_logging_v2_WriteLogEntriesRequest_LabelsEntry_descriptor; - static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_google_logging_v2_WriteLogEntriesRequest_LabelsEntry_fieldAccessorTable; - static com.google.protobuf.Descriptors.Descriptor - internal_static_google_logging_v2_WriteLogEntriesResponse_descriptor; - static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_google_logging_v2_WriteLogEntriesResponse_fieldAccessorTable; - static com.google.protobuf.Descriptors.Descriptor - internal_static_google_logging_v2_ListLogEntriesRequest_descriptor; - static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_google_logging_v2_ListLogEntriesRequest_fieldAccessorTable; - static com.google.protobuf.Descriptors.Descriptor - internal_static_google_logging_v2_ListLogEntriesResponse_descriptor; - static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_google_logging_v2_ListLogEntriesResponse_fieldAccessorTable; - static com.google.protobuf.Descriptors.Descriptor - internal_static_google_logging_v2_ReadLogEntriesRequest_descriptor; - static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_google_logging_v2_ReadLogEntriesRequest_fieldAccessorTable; - static com.google.protobuf.Descriptors.Descriptor - internal_static_google_logging_v2_ReadLogEntriesResponse_descriptor; - static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_google_logging_v2_ReadLogEntriesResponse_fieldAccessorTable; - static com.google.protobuf.Descriptors.Descriptor - internal_static_google_logging_v2_ListMonitoredResourceDescriptorsRequest_descriptor; - static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_google_logging_v2_ListMonitoredResourceDescriptorsRequest_fieldAccessorTable; - static com.google.protobuf.Descriptors.Descriptor - internal_static_google_logging_v2_ListMonitoredResourceDescriptorsResponse_descriptor; - static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_google_logging_v2_ListMonitoredResourceDescriptorsResponse_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n\037google/logging/v2/logging.proto\022\021googl" + - "e.logging.v2\032\034google/api/annotations.pro" + - "to\032#google/api/monitored_resource.proto\032" + - "!google/logging/v2/log_entry.proto\032\033goog" + - "le/protobuf/empty.proto\"$\n\020DeleteLogRequ" + - "est\022\020\n\010log_name\030\001 \001(\t\"\377\001\n\026WriteLogEntrie" + - "sRequest\022\020\n\010log_name\030\001 \001(\t\022/\n\010resource\030\002" + - " \001(\0132\035.google.api.MonitoredResource\022E\n\006l" + - "abels\030\003 \003(\01325.google.logging.v2.WriteLog" + - "EntriesRequest.LabelsEntry\022,\n\007entries\030\004 ", - "\003(\0132\033.google.logging.v2.LogEntry\032-\n\013Labe" + - "lsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"" + - "\031\n\027WriteLogEntriesResponse\"u\n\025ListLogEnt" + - "riesRequest\022\023\n\013project_ids\030\001 \003(\t\022\016\n\006filt" + - "er\030\002 \001(\t\022\020\n\010order_by\030\003 \001(\t\022\021\n\tpage_size\030" + - "\004 \001(\005\022\022\n\npage_token\030\005 \001(\t\"_\n\026ListLogEntr" + - "iesResponse\022,\n\007entries\030\001 \003(\0132\033.google.lo" + - "gging.v2.LogEntry\022\027\n\017next_page_token\030\002 \001" + - "(\t\"d\n\025ReadLogEntriesRequest\022\023\n\013project_i" + - "ds\030\001 \003(\t\022\016\n\006filter\030\002 \001(\t\022\020\n\010order_by\030\003 \001", - "(\t\022\024\n\014resume_token\030\004 \001(\t\"\\\n\026ReadLogEntri" + - "esResponse\022,\n\007entries\030\001 \003(\0132\033.google.log" + - "ging.v2.LogEntry\022\024\n\014resume_token\030\002 \001(\t\"P" + - "\n\'ListMonitoredResourceDescriptorsReques" + - "t\022\021\n\tpage_size\030\001 \001(\005\022\022\n\npage_token\030\002 \001(\t" + - "\"\212\001\n(ListMonitoredResourceDescriptorsRes" + - "ponse\022E\n\024resource_descriptors\030\001 \003(\0132\'.go" + - "ogle.api.MonitoredResourceDescriptor\022\027\n\017" + - "next_page_token\030\002 \001(\t2\374\005\n\020LoggingService" + - "V2\022w\n\tDeleteLog\022#.google.logging.v2.Dele", - "teLogRequest\032\026.google.protobuf.Empty\"-\202\323" + - "\344\223\002\'*%/v2beta1/{log_name=projects/*/logs" + - "/*}\022\213\001\n\017WriteLogEntries\022).google.logging" + - ".v2.WriteLogEntriesRequest\032*.google.logg" + - "ing.v2.WriteLogEntriesResponse\"!\202\323\344\223\002\033\"\026" + - "/v2beta1/entries:write:\001*\022\207\001\n\016ListLogEnt" + - "ries\022(.google.logging.v2.ListLogEntriesR" + - "equest\032).google.logging.v2.ListLogEntrie" + - "sResponse\" \202\323\344\223\002\032\"\025/v2beta1/entries:list" + - ":\001*\022\211\001\n\016ReadLogEntries\022(.google.logging.", - "v2.ReadLogEntriesRequest\032).google.loggin" + - "g.v2.ReadLogEntriesResponse\" \202\323\344\223\002\032\"\025/v2" + - "beta1/entries:read:\001*0\001\022\312\001\n ListMonitore" + - "dResourceDescriptors\022:.google.logging.v2" + - ".ListMonitoredResourceDescriptorsRequest" + - "\032;.google.logging.v2.ListMonitoredResour" + - "ceDescriptorsResponse\"-\202\323\344\223\002\'\022%/v2beta1/" + - "monitoredResourceDescriptorsB*\n\025com.goog" + - "le.logging.v2B\014LoggingProtoP\001\370\001\001b\006proto3" - }; - com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = - new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { - public com.google.protobuf.ExtensionRegistry assignDescriptors( - com.google.protobuf.Descriptors.FileDescriptor root) { - descriptor = root; - return null; - } - }; - com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - com.google.api.AnnotationsProto.getDescriptor(), - com.google.api.MonitoredResourceProto.getDescriptor(), - com.google.logging.v2.LogEntryProto.getDescriptor(), - com.google.protobuf.EmptyProto.getDescriptor(), - }, assigner); - internal_static_google_logging_v2_DeleteLogRequest_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_google_logging_v2_DeleteLogRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_google_logging_v2_DeleteLogRequest_descriptor, - new java.lang.String[] { "LogName", }); - internal_static_google_logging_v2_WriteLogEntriesRequest_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_google_logging_v2_WriteLogEntriesRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_google_logging_v2_WriteLogEntriesRequest_descriptor, - new java.lang.String[] { "LogName", "Resource", "Labels", "Entries", }); - internal_static_google_logging_v2_WriteLogEntriesRequest_LabelsEntry_descriptor = - internal_static_google_logging_v2_WriteLogEntriesRequest_descriptor.getNestedTypes().get(0); - internal_static_google_logging_v2_WriteLogEntriesRequest_LabelsEntry_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_google_logging_v2_WriteLogEntriesRequest_LabelsEntry_descriptor, - new java.lang.String[] { "Key", "Value", }); - internal_static_google_logging_v2_WriteLogEntriesResponse_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_google_logging_v2_WriteLogEntriesResponse_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_google_logging_v2_WriteLogEntriesResponse_descriptor, - new java.lang.String[] { }); - internal_static_google_logging_v2_ListLogEntriesRequest_descriptor = - getDescriptor().getMessageTypes().get(3); - internal_static_google_logging_v2_ListLogEntriesRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_google_logging_v2_ListLogEntriesRequest_descriptor, - new java.lang.String[] { "ProjectIds", "Filter", "OrderBy", "PageSize", "PageToken", }); - internal_static_google_logging_v2_ListLogEntriesResponse_descriptor = - getDescriptor().getMessageTypes().get(4); - internal_static_google_logging_v2_ListLogEntriesResponse_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_google_logging_v2_ListLogEntriesResponse_descriptor, - new java.lang.String[] { "Entries", "NextPageToken", }); - internal_static_google_logging_v2_ReadLogEntriesRequest_descriptor = - getDescriptor().getMessageTypes().get(5); - internal_static_google_logging_v2_ReadLogEntriesRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_google_logging_v2_ReadLogEntriesRequest_descriptor, - new java.lang.String[] { "ProjectIds", "Filter", "OrderBy", "ResumeToken", }); - internal_static_google_logging_v2_ReadLogEntriesResponse_descriptor = - getDescriptor().getMessageTypes().get(6); - internal_static_google_logging_v2_ReadLogEntriesResponse_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_google_logging_v2_ReadLogEntriesResponse_descriptor, - new java.lang.String[] { "Entries", "ResumeToken", }); - internal_static_google_logging_v2_ListMonitoredResourceDescriptorsRequest_descriptor = - getDescriptor().getMessageTypes().get(7); - internal_static_google_logging_v2_ListMonitoredResourceDescriptorsRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_google_logging_v2_ListMonitoredResourceDescriptorsRequest_descriptor, - new java.lang.String[] { "PageSize", "PageToken", }); - internal_static_google_logging_v2_ListMonitoredResourceDescriptorsResponse_descriptor = - getDescriptor().getMessageTypes().get(8); - internal_static_google_logging_v2_ListMonitoredResourceDescriptorsResponse_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_google_logging_v2_ListMonitoredResourceDescriptorsResponse_descriptor, - new java.lang.String[] { "ResourceDescriptors", "NextPageToken", }); - com.google.protobuf.ExtensionRegistry registry = - com.google.protobuf.ExtensionRegistry.newInstance(); - registry.add(com.google.api.AnnotationsProto.http); - com.google.protobuf.Descriptors.FileDescriptor - .internalUpdateFileDescriptor(descriptor, registry); - com.google.api.AnnotationsProto.getDescriptor(); - com.google.api.MonitoredResourceProto.getDescriptor(); - com.google.logging.v2.LogEntryProto.getDescriptor(); - com.google.protobuf.EmptyProto.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/LoggingServiceV2Grpc.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/LoggingServiceV2Grpc.java deleted file mode 100644 index 41c301059a75..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/LoggingServiceV2Grpc.java +++ /dev/null @@ -1,348 +0,0 @@ -package com.google.logging.v2; - -import static io.grpc.stub.ClientCalls.asyncUnaryCall; -import static io.grpc.stub.ClientCalls.asyncServerStreamingCall; -import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; -import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall; -import static io.grpc.stub.ClientCalls.blockingUnaryCall; -import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; -import static io.grpc.stub.ClientCalls.futureUnaryCall; -import static io.grpc.MethodDescriptor.generateFullMethodName; -import static io.grpc.stub.ServerCalls.asyncUnaryCall; -import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; -import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; -import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; - -@javax.annotation.Generated("by gRPC proto compiler") -public class LoggingServiceV2Grpc { - - private LoggingServiceV2Grpc() {} - - public static final String SERVICE_NAME = "google.logging.v2.LoggingServiceV2"; - - // Static method descriptors that strictly reflect the proto. - @io.grpc.ExperimentalApi - public static final io.grpc.MethodDescriptor METHOD_DELETE_LOG = - io.grpc.MethodDescriptor.create( - io.grpc.MethodDescriptor.MethodType.UNARY, - generateFullMethodName( - "google.logging.v2.LoggingServiceV2", "DeleteLog"), - io.grpc.protobuf.ProtoUtils.marshaller(com.google.logging.v2.DeleteLogRequest.getDefaultInstance()), - io.grpc.protobuf.ProtoUtils.marshaller(com.google.protobuf.Empty.getDefaultInstance())); - @io.grpc.ExperimentalApi - public static final io.grpc.MethodDescriptor METHOD_WRITE_LOG_ENTRIES = - io.grpc.MethodDescriptor.create( - io.grpc.MethodDescriptor.MethodType.UNARY, - generateFullMethodName( - "google.logging.v2.LoggingServiceV2", "WriteLogEntries"), - io.grpc.protobuf.ProtoUtils.marshaller(com.google.logging.v2.WriteLogEntriesRequest.getDefaultInstance()), - io.grpc.protobuf.ProtoUtils.marshaller(com.google.logging.v2.WriteLogEntriesResponse.getDefaultInstance())); - @io.grpc.ExperimentalApi - public static final io.grpc.MethodDescriptor METHOD_LIST_LOG_ENTRIES = - io.grpc.MethodDescriptor.create( - io.grpc.MethodDescriptor.MethodType.UNARY, - generateFullMethodName( - "google.logging.v2.LoggingServiceV2", "ListLogEntries"), - io.grpc.protobuf.ProtoUtils.marshaller(com.google.logging.v2.ListLogEntriesRequest.getDefaultInstance()), - io.grpc.protobuf.ProtoUtils.marshaller(com.google.logging.v2.ListLogEntriesResponse.getDefaultInstance())); - @io.grpc.ExperimentalApi - public static final io.grpc.MethodDescriptor METHOD_READ_LOG_ENTRIES = - io.grpc.MethodDescriptor.create( - io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING, - generateFullMethodName( - "google.logging.v2.LoggingServiceV2", "ReadLogEntries"), - io.grpc.protobuf.ProtoUtils.marshaller(com.google.logging.v2.ReadLogEntriesRequest.getDefaultInstance()), - io.grpc.protobuf.ProtoUtils.marshaller(com.google.logging.v2.ReadLogEntriesResponse.getDefaultInstance())); - @io.grpc.ExperimentalApi - public static final io.grpc.MethodDescriptor METHOD_LIST_MONITORED_RESOURCE_DESCRIPTORS = - io.grpc.MethodDescriptor.create( - io.grpc.MethodDescriptor.MethodType.UNARY, - generateFullMethodName( - "google.logging.v2.LoggingServiceV2", "ListMonitoredResourceDescriptors"), - io.grpc.protobuf.ProtoUtils.marshaller(com.google.logging.v2.ListMonitoredResourceDescriptorsRequest.getDefaultInstance()), - io.grpc.protobuf.ProtoUtils.marshaller(com.google.logging.v2.ListMonitoredResourceDescriptorsResponse.getDefaultInstance())); - - public static LoggingServiceV2Stub newStub(io.grpc.Channel channel) { - return new LoggingServiceV2Stub(channel); - } - - public static LoggingServiceV2BlockingStub newBlockingStub( - io.grpc.Channel channel) { - return new LoggingServiceV2BlockingStub(channel); - } - - public static LoggingServiceV2FutureStub newFutureStub( - io.grpc.Channel channel) { - return new LoggingServiceV2FutureStub(channel); - } - - public static interface LoggingServiceV2 { - - public void deleteLog(com.google.logging.v2.DeleteLogRequest request, - io.grpc.stub.StreamObserver responseObserver); - - public void writeLogEntries(com.google.logging.v2.WriteLogEntriesRequest request, - io.grpc.stub.StreamObserver responseObserver); - - public void listLogEntries(com.google.logging.v2.ListLogEntriesRequest request, - io.grpc.stub.StreamObserver responseObserver); - - public void readLogEntries(com.google.logging.v2.ReadLogEntriesRequest request, - io.grpc.stub.StreamObserver responseObserver); - - public void listMonitoredResourceDescriptors(com.google.logging.v2.ListMonitoredResourceDescriptorsRequest request, - io.grpc.stub.StreamObserver responseObserver); - } - - public static interface LoggingServiceV2BlockingClient { - - public com.google.protobuf.Empty deleteLog(com.google.logging.v2.DeleteLogRequest request); - - public com.google.logging.v2.WriteLogEntriesResponse writeLogEntries(com.google.logging.v2.WriteLogEntriesRequest request); - - public com.google.logging.v2.ListLogEntriesResponse listLogEntries(com.google.logging.v2.ListLogEntriesRequest request); - - public java.util.Iterator readLogEntries( - com.google.logging.v2.ReadLogEntriesRequest request); - - public com.google.logging.v2.ListMonitoredResourceDescriptorsResponse listMonitoredResourceDescriptors(com.google.logging.v2.ListMonitoredResourceDescriptorsRequest request); - } - - public static interface LoggingServiceV2FutureClient { - - public com.google.common.util.concurrent.ListenableFuture deleteLog( - com.google.logging.v2.DeleteLogRequest request); - - public com.google.common.util.concurrent.ListenableFuture writeLogEntries( - com.google.logging.v2.WriteLogEntriesRequest request); - - public com.google.common.util.concurrent.ListenableFuture listLogEntries( - com.google.logging.v2.ListLogEntriesRequest request); - - public com.google.common.util.concurrent.ListenableFuture listMonitoredResourceDescriptors( - com.google.logging.v2.ListMonitoredResourceDescriptorsRequest request); - } - - public static class LoggingServiceV2Stub extends io.grpc.stub.AbstractStub - implements LoggingServiceV2 { - private LoggingServiceV2Stub(io.grpc.Channel channel) { - super(channel); - } - - private LoggingServiceV2Stub(io.grpc.Channel channel, - io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected LoggingServiceV2Stub build(io.grpc.Channel channel, - io.grpc.CallOptions callOptions) { - return new LoggingServiceV2Stub(channel, callOptions); - } - - @java.lang.Override - public void deleteLog(com.google.logging.v2.DeleteLogRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( - getChannel().newCall(METHOD_DELETE_LOG, getCallOptions()), request, responseObserver); - } - - @java.lang.Override - public void writeLogEntries(com.google.logging.v2.WriteLogEntriesRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( - getChannel().newCall(METHOD_WRITE_LOG_ENTRIES, getCallOptions()), request, responseObserver); - } - - @java.lang.Override - public void listLogEntries(com.google.logging.v2.ListLogEntriesRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( - getChannel().newCall(METHOD_LIST_LOG_ENTRIES, getCallOptions()), request, responseObserver); - } - - @java.lang.Override - public void readLogEntries(com.google.logging.v2.ReadLogEntriesRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncServerStreamingCall( - getChannel().newCall(METHOD_READ_LOG_ENTRIES, getCallOptions()), request, responseObserver); - } - - @java.lang.Override - public void listMonitoredResourceDescriptors(com.google.logging.v2.ListMonitoredResourceDescriptorsRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( - getChannel().newCall(METHOD_LIST_MONITORED_RESOURCE_DESCRIPTORS, getCallOptions()), request, responseObserver); - } - } - - public static class LoggingServiceV2BlockingStub extends io.grpc.stub.AbstractStub - implements LoggingServiceV2BlockingClient { - private LoggingServiceV2BlockingStub(io.grpc.Channel channel) { - super(channel); - } - - private LoggingServiceV2BlockingStub(io.grpc.Channel channel, - io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected LoggingServiceV2BlockingStub build(io.grpc.Channel channel, - io.grpc.CallOptions callOptions) { - return new LoggingServiceV2BlockingStub(channel, callOptions); - } - - @java.lang.Override - public com.google.protobuf.Empty deleteLog(com.google.logging.v2.DeleteLogRequest request) { - return blockingUnaryCall( - getChannel().newCall(METHOD_DELETE_LOG, getCallOptions()), request); - } - - @java.lang.Override - public com.google.logging.v2.WriteLogEntriesResponse writeLogEntries(com.google.logging.v2.WriteLogEntriesRequest request) { - return blockingUnaryCall( - getChannel().newCall(METHOD_WRITE_LOG_ENTRIES, getCallOptions()), request); - } - - @java.lang.Override - public com.google.logging.v2.ListLogEntriesResponse listLogEntries(com.google.logging.v2.ListLogEntriesRequest request) { - return blockingUnaryCall( - getChannel().newCall(METHOD_LIST_LOG_ENTRIES, getCallOptions()), request); - } - - @java.lang.Override - public java.util.Iterator readLogEntries( - com.google.logging.v2.ReadLogEntriesRequest request) { - return blockingServerStreamingCall( - getChannel().newCall(METHOD_READ_LOG_ENTRIES, getCallOptions()), request); - } - - @java.lang.Override - public com.google.logging.v2.ListMonitoredResourceDescriptorsResponse listMonitoredResourceDescriptors(com.google.logging.v2.ListMonitoredResourceDescriptorsRequest request) { - return blockingUnaryCall( - getChannel().newCall(METHOD_LIST_MONITORED_RESOURCE_DESCRIPTORS, getCallOptions()), request); - } - } - - public static class LoggingServiceV2FutureStub extends io.grpc.stub.AbstractStub - implements LoggingServiceV2FutureClient { - private LoggingServiceV2FutureStub(io.grpc.Channel channel) { - super(channel); - } - - private LoggingServiceV2FutureStub(io.grpc.Channel channel, - io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected LoggingServiceV2FutureStub build(io.grpc.Channel channel, - io.grpc.CallOptions callOptions) { - return new LoggingServiceV2FutureStub(channel, callOptions); - } - - @java.lang.Override - public com.google.common.util.concurrent.ListenableFuture deleteLog( - com.google.logging.v2.DeleteLogRequest request) { - return futureUnaryCall( - getChannel().newCall(METHOD_DELETE_LOG, getCallOptions()), request); - } - - @java.lang.Override - public com.google.common.util.concurrent.ListenableFuture writeLogEntries( - com.google.logging.v2.WriteLogEntriesRequest request) { - return futureUnaryCall( - getChannel().newCall(METHOD_WRITE_LOG_ENTRIES, getCallOptions()), request); - } - - @java.lang.Override - public com.google.common.util.concurrent.ListenableFuture listLogEntries( - com.google.logging.v2.ListLogEntriesRequest request) { - return futureUnaryCall( - getChannel().newCall(METHOD_LIST_LOG_ENTRIES, getCallOptions()), request); - } - - @java.lang.Override - public com.google.common.util.concurrent.ListenableFuture listMonitoredResourceDescriptors( - com.google.logging.v2.ListMonitoredResourceDescriptorsRequest request) { - return futureUnaryCall( - getChannel().newCall(METHOD_LIST_MONITORED_RESOURCE_DESCRIPTORS, getCallOptions()), request); - } - } - - public static io.grpc.ServerServiceDefinition bindService( - final LoggingServiceV2 serviceImpl) { - return io.grpc.ServerServiceDefinition.builder(SERVICE_NAME) - .addMethod( - METHOD_DELETE_LOG, - asyncUnaryCall( - new io.grpc.stub.ServerCalls.UnaryMethod< - com.google.logging.v2.DeleteLogRequest, - com.google.protobuf.Empty>() { - @java.lang.Override - public void invoke( - com.google.logging.v2.DeleteLogRequest request, - io.grpc.stub.StreamObserver responseObserver) { - serviceImpl.deleteLog(request, responseObserver); - } - })) - .addMethod( - METHOD_WRITE_LOG_ENTRIES, - asyncUnaryCall( - new io.grpc.stub.ServerCalls.UnaryMethod< - com.google.logging.v2.WriteLogEntriesRequest, - com.google.logging.v2.WriteLogEntriesResponse>() { - @java.lang.Override - public void invoke( - com.google.logging.v2.WriteLogEntriesRequest request, - io.grpc.stub.StreamObserver responseObserver) { - serviceImpl.writeLogEntries(request, responseObserver); - } - })) - .addMethod( - METHOD_LIST_LOG_ENTRIES, - asyncUnaryCall( - new io.grpc.stub.ServerCalls.UnaryMethod< - com.google.logging.v2.ListLogEntriesRequest, - com.google.logging.v2.ListLogEntriesResponse>() { - @java.lang.Override - public void invoke( - com.google.logging.v2.ListLogEntriesRequest request, - io.grpc.stub.StreamObserver responseObserver) { - serviceImpl.listLogEntries(request, responseObserver); - } - })) - .addMethod( - METHOD_READ_LOG_ENTRIES, - asyncServerStreamingCall( - new io.grpc.stub.ServerCalls.ServerStreamingMethod< - com.google.logging.v2.ReadLogEntriesRequest, - com.google.logging.v2.ReadLogEntriesResponse>() { - @java.lang.Override - public void invoke( - com.google.logging.v2.ReadLogEntriesRequest request, - io.grpc.stub.StreamObserver responseObserver) { - serviceImpl.readLogEntries(request, responseObserver); - } - })) - .addMethod( - METHOD_LIST_MONITORED_RESOURCE_DESCRIPTORS, - asyncUnaryCall( - new io.grpc.stub.ServerCalls.UnaryMethod< - com.google.logging.v2.ListMonitoredResourceDescriptorsRequest, - com.google.logging.v2.ListMonitoredResourceDescriptorsResponse>() { - @java.lang.Override - public void invoke( - com.google.logging.v2.ListMonitoredResourceDescriptorsRequest request, - io.grpc.stub.StreamObserver responseObserver) { - serviceImpl.listMonitoredResourceDescriptors(request, responseObserver); - } - })).build(); - } -} diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/MetricsServiceV2Grpc.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/MetricsServiceV2Grpc.java deleted file mode 100644 index ae6687409bc8..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/MetricsServiceV2Grpc.java +++ /dev/null @@ -1,356 +0,0 @@ -package com.google.logging.v2; - -import static io.grpc.stub.ClientCalls.asyncUnaryCall; -import static io.grpc.stub.ClientCalls.asyncServerStreamingCall; -import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; -import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall; -import static io.grpc.stub.ClientCalls.blockingUnaryCall; -import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; -import static io.grpc.stub.ClientCalls.futureUnaryCall; -import static io.grpc.MethodDescriptor.generateFullMethodName; -import static io.grpc.stub.ServerCalls.asyncUnaryCall; -import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; -import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; -import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; - -@javax.annotation.Generated("by gRPC proto compiler") -public class MetricsServiceV2Grpc { - - private MetricsServiceV2Grpc() {} - - public static final String SERVICE_NAME = "google.logging.v2.MetricsServiceV2"; - - // Static method descriptors that strictly reflect the proto. - @io.grpc.ExperimentalApi - public static final io.grpc.MethodDescriptor METHOD_LIST_LOG_METRICS = - io.grpc.MethodDescriptor.create( - io.grpc.MethodDescriptor.MethodType.UNARY, - generateFullMethodName( - "google.logging.v2.MetricsServiceV2", "ListLogMetrics"), - io.grpc.protobuf.ProtoUtils.marshaller(com.google.logging.v2.ListLogMetricsRequest.getDefaultInstance()), - io.grpc.protobuf.ProtoUtils.marshaller(com.google.logging.v2.ListLogMetricsResponse.getDefaultInstance())); - @io.grpc.ExperimentalApi - public static final io.grpc.MethodDescriptor METHOD_GET_LOG_METRIC = - io.grpc.MethodDescriptor.create( - io.grpc.MethodDescriptor.MethodType.UNARY, - generateFullMethodName( - "google.logging.v2.MetricsServiceV2", "GetLogMetric"), - io.grpc.protobuf.ProtoUtils.marshaller(com.google.logging.v2.GetLogMetricRequest.getDefaultInstance()), - io.grpc.protobuf.ProtoUtils.marshaller(com.google.logging.v2.LogMetric.getDefaultInstance())); - @io.grpc.ExperimentalApi - public static final io.grpc.MethodDescriptor METHOD_CREATE_LOG_METRIC = - io.grpc.MethodDescriptor.create( - io.grpc.MethodDescriptor.MethodType.UNARY, - generateFullMethodName( - "google.logging.v2.MetricsServiceV2", "CreateLogMetric"), - io.grpc.protobuf.ProtoUtils.marshaller(com.google.logging.v2.CreateLogMetricRequest.getDefaultInstance()), - io.grpc.protobuf.ProtoUtils.marshaller(com.google.logging.v2.LogMetric.getDefaultInstance())); - @io.grpc.ExperimentalApi - public static final io.grpc.MethodDescriptor METHOD_UPDATE_LOG_METRIC = - io.grpc.MethodDescriptor.create( - io.grpc.MethodDescriptor.MethodType.UNARY, - generateFullMethodName( - "google.logging.v2.MetricsServiceV2", "UpdateLogMetric"), - io.grpc.protobuf.ProtoUtils.marshaller(com.google.logging.v2.UpdateLogMetricRequest.getDefaultInstance()), - io.grpc.protobuf.ProtoUtils.marshaller(com.google.logging.v2.LogMetric.getDefaultInstance())); - @io.grpc.ExperimentalApi - public static final io.grpc.MethodDescriptor METHOD_DELETE_LOG_METRIC = - io.grpc.MethodDescriptor.create( - io.grpc.MethodDescriptor.MethodType.UNARY, - generateFullMethodName( - "google.logging.v2.MetricsServiceV2", "DeleteLogMetric"), - io.grpc.protobuf.ProtoUtils.marshaller(com.google.logging.v2.DeleteLogMetricRequest.getDefaultInstance()), - io.grpc.protobuf.ProtoUtils.marshaller(com.google.protobuf.Empty.getDefaultInstance())); - - public static MetricsServiceV2Stub newStub(io.grpc.Channel channel) { - return new MetricsServiceV2Stub(channel); - } - - public static MetricsServiceV2BlockingStub newBlockingStub( - io.grpc.Channel channel) { - return new MetricsServiceV2BlockingStub(channel); - } - - public static MetricsServiceV2FutureStub newFutureStub( - io.grpc.Channel channel) { - return new MetricsServiceV2FutureStub(channel); - } - - public static interface MetricsServiceV2 { - - public void listLogMetrics(com.google.logging.v2.ListLogMetricsRequest request, - io.grpc.stub.StreamObserver responseObserver); - - public void getLogMetric(com.google.logging.v2.GetLogMetricRequest request, - io.grpc.stub.StreamObserver responseObserver); - - public void createLogMetric(com.google.logging.v2.CreateLogMetricRequest request, - io.grpc.stub.StreamObserver responseObserver); - - public void updateLogMetric(com.google.logging.v2.UpdateLogMetricRequest request, - io.grpc.stub.StreamObserver responseObserver); - - public void deleteLogMetric(com.google.logging.v2.DeleteLogMetricRequest request, - io.grpc.stub.StreamObserver responseObserver); - } - - public static interface MetricsServiceV2BlockingClient { - - public com.google.logging.v2.ListLogMetricsResponse listLogMetrics(com.google.logging.v2.ListLogMetricsRequest request); - - public com.google.logging.v2.LogMetric getLogMetric(com.google.logging.v2.GetLogMetricRequest request); - - public com.google.logging.v2.LogMetric createLogMetric(com.google.logging.v2.CreateLogMetricRequest request); - - public com.google.logging.v2.LogMetric updateLogMetric(com.google.logging.v2.UpdateLogMetricRequest request); - - public com.google.protobuf.Empty deleteLogMetric(com.google.logging.v2.DeleteLogMetricRequest request); - } - - public static interface MetricsServiceV2FutureClient { - - public com.google.common.util.concurrent.ListenableFuture listLogMetrics( - com.google.logging.v2.ListLogMetricsRequest request); - - public com.google.common.util.concurrent.ListenableFuture getLogMetric( - com.google.logging.v2.GetLogMetricRequest request); - - public com.google.common.util.concurrent.ListenableFuture createLogMetric( - com.google.logging.v2.CreateLogMetricRequest request); - - public com.google.common.util.concurrent.ListenableFuture updateLogMetric( - com.google.logging.v2.UpdateLogMetricRequest request); - - public com.google.common.util.concurrent.ListenableFuture deleteLogMetric( - com.google.logging.v2.DeleteLogMetricRequest request); - } - - public static class MetricsServiceV2Stub extends io.grpc.stub.AbstractStub - implements MetricsServiceV2 { - private MetricsServiceV2Stub(io.grpc.Channel channel) { - super(channel); - } - - private MetricsServiceV2Stub(io.grpc.Channel channel, - io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected MetricsServiceV2Stub build(io.grpc.Channel channel, - io.grpc.CallOptions callOptions) { - return new MetricsServiceV2Stub(channel, callOptions); - } - - @java.lang.Override - public void listLogMetrics(com.google.logging.v2.ListLogMetricsRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( - getChannel().newCall(METHOD_LIST_LOG_METRICS, getCallOptions()), request, responseObserver); - } - - @java.lang.Override - public void getLogMetric(com.google.logging.v2.GetLogMetricRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( - getChannel().newCall(METHOD_GET_LOG_METRIC, getCallOptions()), request, responseObserver); - } - - @java.lang.Override - public void createLogMetric(com.google.logging.v2.CreateLogMetricRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( - getChannel().newCall(METHOD_CREATE_LOG_METRIC, getCallOptions()), request, responseObserver); - } - - @java.lang.Override - public void updateLogMetric(com.google.logging.v2.UpdateLogMetricRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( - getChannel().newCall(METHOD_UPDATE_LOG_METRIC, getCallOptions()), request, responseObserver); - } - - @java.lang.Override - public void deleteLogMetric(com.google.logging.v2.DeleteLogMetricRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( - getChannel().newCall(METHOD_DELETE_LOG_METRIC, getCallOptions()), request, responseObserver); - } - } - - public static class MetricsServiceV2BlockingStub extends io.grpc.stub.AbstractStub - implements MetricsServiceV2BlockingClient { - private MetricsServiceV2BlockingStub(io.grpc.Channel channel) { - super(channel); - } - - private MetricsServiceV2BlockingStub(io.grpc.Channel channel, - io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected MetricsServiceV2BlockingStub build(io.grpc.Channel channel, - io.grpc.CallOptions callOptions) { - return new MetricsServiceV2BlockingStub(channel, callOptions); - } - - @java.lang.Override - public com.google.logging.v2.ListLogMetricsResponse listLogMetrics(com.google.logging.v2.ListLogMetricsRequest request) { - return blockingUnaryCall( - getChannel().newCall(METHOD_LIST_LOG_METRICS, getCallOptions()), request); - } - - @java.lang.Override - public com.google.logging.v2.LogMetric getLogMetric(com.google.logging.v2.GetLogMetricRequest request) { - return blockingUnaryCall( - getChannel().newCall(METHOD_GET_LOG_METRIC, getCallOptions()), request); - } - - @java.lang.Override - public com.google.logging.v2.LogMetric createLogMetric(com.google.logging.v2.CreateLogMetricRequest request) { - return blockingUnaryCall( - getChannel().newCall(METHOD_CREATE_LOG_METRIC, getCallOptions()), request); - } - - @java.lang.Override - public com.google.logging.v2.LogMetric updateLogMetric(com.google.logging.v2.UpdateLogMetricRequest request) { - return blockingUnaryCall( - getChannel().newCall(METHOD_UPDATE_LOG_METRIC, getCallOptions()), request); - } - - @java.lang.Override - public com.google.protobuf.Empty deleteLogMetric(com.google.logging.v2.DeleteLogMetricRequest request) { - return blockingUnaryCall( - getChannel().newCall(METHOD_DELETE_LOG_METRIC, getCallOptions()), request); - } - } - - public static class MetricsServiceV2FutureStub extends io.grpc.stub.AbstractStub - implements MetricsServiceV2FutureClient { - private MetricsServiceV2FutureStub(io.grpc.Channel channel) { - super(channel); - } - - private MetricsServiceV2FutureStub(io.grpc.Channel channel, - io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected MetricsServiceV2FutureStub build(io.grpc.Channel channel, - io.grpc.CallOptions callOptions) { - return new MetricsServiceV2FutureStub(channel, callOptions); - } - - @java.lang.Override - public com.google.common.util.concurrent.ListenableFuture listLogMetrics( - com.google.logging.v2.ListLogMetricsRequest request) { - return futureUnaryCall( - getChannel().newCall(METHOD_LIST_LOG_METRICS, getCallOptions()), request); - } - - @java.lang.Override - public com.google.common.util.concurrent.ListenableFuture getLogMetric( - com.google.logging.v2.GetLogMetricRequest request) { - return futureUnaryCall( - getChannel().newCall(METHOD_GET_LOG_METRIC, getCallOptions()), request); - } - - @java.lang.Override - public com.google.common.util.concurrent.ListenableFuture createLogMetric( - com.google.logging.v2.CreateLogMetricRequest request) { - return futureUnaryCall( - getChannel().newCall(METHOD_CREATE_LOG_METRIC, getCallOptions()), request); - } - - @java.lang.Override - public com.google.common.util.concurrent.ListenableFuture updateLogMetric( - com.google.logging.v2.UpdateLogMetricRequest request) { - return futureUnaryCall( - getChannel().newCall(METHOD_UPDATE_LOG_METRIC, getCallOptions()), request); - } - - @java.lang.Override - public com.google.common.util.concurrent.ListenableFuture deleteLogMetric( - com.google.logging.v2.DeleteLogMetricRequest request) { - return futureUnaryCall( - getChannel().newCall(METHOD_DELETE_LOG_METRIC, getCallOptions()), request); - } - } - - public static io.grpc.ServerServiceDefinition bindService( - final MetricsServiceV2 serviceImpl) { - return io.grpc.ServerServiceDefinition.builder(SERVICE_NAME) - .addMethod( - METHOD_LIST_LOG_METRICS, - asyncUnaryCall( - new io.grpc.stub.ServerCalls.UnaryMethod< - com.google.logging.v2.ListLogMetricsRequest, - com.google.logging.v2.ListLogMetricsResponse>() { - @java.lang.Override - public void invoke( - com.google.logging.v2.ListLogMetricsRequest request, - io.grpc.stub.StreamObserver responseObserver) { - serviceImpl.listLogMetrics(request, responseObserver); - } - })) - .addMethod( - METHOD_GET_LOG_METRIC, - asyncUnaryCall( - new io.grpc.stub.ServerCalls.UnaryMethod< - com.google.logging.v2.GetLogMetricRequest, - com.google.logging.v2.LogMetric>() { - @java.lang.Override - public void invoke( - com.google.logging.v2.GetLogMetricRequest request, - io.grpc.stub.StreamObserver responseObserver) { - serviceImpl.getLogMetric(request, responseObserver); - } - })) - .addMethod( - METHOD_CREATE_LOG_METRIC, - asyncUnaryCall( - new io.grpc.stub.ServerCalls.UnaryMethod< - com.google.logging.v2.CreateLogMetricRequest, - com.google.logging.v2.LogMetric>() { - @java.lang.Override - public void invoke( - com.google.logging.v2.CreateLogMetricRequest request, - io.grpc.stub.StreamObserver responseObserver) { - serviceImpl.createLogMetric(request, responseObserver); - } - })) - .addMethod( - METHOD_UPDATE_LOG_METRIC, - asyncUnaryCall( - new io.grpc.stub.ServerCalls.UnaryMethod< - com.google.logging.v2.UpdateLogMetricRequest, - com.google.logging.v2.LogMetric>() { - @java.lang.Override - public void invoke( - com.google.logging.v2.UpdateLogMetricRequest request, - io.grpc.stub.StreamObserver responseObserver) { - serviceImpl.updateLogMetric(request, responseObserver); - } - })) - .addMethod( - METHOD_DELETE_LOG_METRIC, - asyncUnaryCall( - new io.grpc.stub.ServerCalls.UnaryMethod< - com.google.logging.v2.DeleteLogMetricRequest, - com.google.protobuf.Empty>() { - @java.lang.Override - public void invoke( - com.google.logging.v2.DeleteLogMetricRequest request, - io.grpc.stub.StreamObserver responseObserver) { - serviceImpl.deleteLogMetric(request, responseObserver); - } - })).build(); - } -} diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ReadLogEntriesRequest.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ReadLogEntriesRequest.java deleted file mode 100644 index b021f77a06e9..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ReadLogEntriesRequest.java +++ /dev/null @@ -1,1094 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/logging/v2/logging.proto - -package com.google.logging.v2; - -/** - * Protobuf type {@code google.logging.v2.ReadLogEntriesRequest} - * - *
- * The parameters to `ReadLogEntries`.
- * There are two different use cases for streaming:
- * 1.  To return a very large result set. The request eventually
- *     completes when all entries have been returned.
- * 2.  To "tail" a log stream, returning new entries as they arrive.
- *     In this case, the request never completes.
- * Only the first use case is supported.
- * 
- */ -public final class ReadLogEntriesRequest extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:google.logging.v2.ReadLogEntriesRequest) - ReadLogEntriesRequestOrBuilder { - // Use ReadLogEntriesRequest.newBuilder() to construct. - private ReadLogEntriesRequest(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - private ReadLogEntriesRequest() { - projectIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; - filter_ = ""; - orderBy_ = ""; - resumeToken_ = ""; - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); - } - private ReadLogEntriesRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) { - this(); - int mutable_bitField0_ = 0; - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!input.skipField(tag)) { - done = true; - } - break; - } - case 10: { - String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - projectIds_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - projectIds_.add(s); - break; - } - case 18: { - String s = input.readStringRequireUtf8(); - - filter_ = s; - break; - } - case 26: { - String s = input.readStringRequireUtf8(); - - orderBy_ = s; - break; - } - case 34: { - String s = input.readStringRequireUtf8(); - - resumeToken_ = s; - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw new RuntimeException(e.setUnfinishedMessage(this)); - } catch (java.io.IOException e) { - throw new RuntimeException( - new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this)); - } finally { - if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - projectIds_ = projectIds_.getUnmodifiableView(); - } - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_ReadLogEntriesRequest_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_ReadLogEntriesRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.logging.v2.ReadLogEntriesRequest.class, com.google.logging.v2.ReadLogEntriesRequest.Builder.class); - } - - private int bitField0_; - public static final int PROJECT_IDS_FIELD_NUMBER = 1; - private com.google.protobuf.LazyStringList projectIds_; - /** - * repeated string project_ids = 1; - * - *
-   * Required. A list of project ids from which to retrieve log entries.
-   * Example: `"my-project-id"`.
-   * 
- */ - public com.google.protobuf.ProtocolStringList - getProjectIdsList() { - return projectIds_; - } - /** - * repeated string project_ids = 1; - * - *
-   * Required. A list of project ids from which to retrieve log entries.
-   * Example: `"my-project-id"`.
-   * 
- */ - public int getProjectIdsCount() { - return projectIds_.size(); - } - /** - * repeated string project_ids = 1; - * - *
-   * Required. A list of project ids from which to retrieve log entries.
-   * Example: `"my-project-id"`.
-   * 
- */ - public java.lang.String getProjectIds(int index) { - return projectIds_.get(index); - } - /** - * repeated string project_ids = 1; - * - *
-   * Required. A list of project ids from which to retrieve log entries.
-   * Example: `"my-project-id"`.
-   * 
- */ - public com.google.protobuf.ByteString - getProjectIdsBytes(int index) { - return projectIds_.getByteString(index); - } - - public static final int FILTER_FIELD_NUMBER = 2; - private volatile java.lang.Object filter_; - /** - * optional string filter = 2; - * - *
-   * Optional. An [advanced logs filter](/logging/docs/view/advanced_filters).
-   * The response includes only entries that match the filter.
-   * If `filter` is empty, then all entries in all logs are retrieved.
-   * 
- */ - public java.lang.String getFilter() { - java.lang.Object ref = filter_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - filter_ = s; - return s; - } - } - /** - * optional string filter = 2; - * - *
-   * Optional. An [advanced logs filter](/logging/docs/view/advanced_filters).
-   * The response includes only entries that match the filter.
-   * If `filter` is empty, then all entries in all logs are retrieved.
-   * 
- */ - public com.google.protobuf.ByteString - getFilterBytes() { - java.lang.Object ref = filter_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - filter_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ORDER_BY_FIELD_NUMBER = 3; - private volatile java.lang.Object orderBy_; - /** - * optional string order_by = 3; - * - *
-   * Optional. How the results should be sorted.  Presently, the only permitted
-   * values are `"timestamp"` (default) and `"timestamp desc"`.  The first
-   * option returns entries in order of increasing values of
-   * `LogEntry.timestamp` (oldest first), and the second option returns entries
-   * in order of decreasing timestamps (newest first).  Entries with equal
-   * timestamps will be returned in order of `LogEntry.insertId`.
-   * 
- */ - public java.lang.String getOrderBy() { - java.lang.Object ref = orderBy_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - orderBy_ = s; - return s; - } - } - /** - * optional string order_by = 3; - * - *
-   * Optional. How the results should be sorted.  Presently, the only permitted
-   * values are `"timestamp"` (default) and `"timestamp desc"`.  The first
-   * option returns entries in order of increasing values of
-   * `LogEntry.timestamp` (oldest first), and the second option returns entries
-   * in order of decreasing timestamps (newest first).  Entries with equal
-   * timestamps will be returned in order of `LogEntry.insertId`.
-   * 
- */ - public com.google.protobuf.ByteString - getOrderByBytes() { - java.lang.Object ref = orderBy_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - orderBy_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int RESUME_TOKEN_FIELD_NUMBER = 4; - private volatile java.lang.Object resumeToken_; - /** - * optional string resume_token = 4; - * - *
-   * Optional. If the `resumeToken` request parameter is supplied, then the next
-   * page of results in the set are retrieved.  The `resumeToken` request
-   * parameter must be set with the value of the `resumeToken` result parameter
-   * from the previous request.
-   * 
- */ - public java.lang.String getResumeToken() { - java.lang.Object ref = resumeToken_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - resumeToken_ = s; - return s; - } - } - /** - * optional string resume_token = 4; - * - *
-   * Optional. If the `resumeToken` request parameter is supplied, then the next
-   * page of results in the set are retrieved.  The `resumeToken` request
-   * parameter must be set with the value of the `resumeToken` result parameter
-   * from the previous request.
-   * 
- */ - public com.google.protobuf.ByteString - getResumeTokenBytes() { - java.lang.Object ref = resumeToken_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - resumeToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < projectIds_.size(); i++) { - com.google.protobuf.GeneratedMessage.writeString(output, 1, projectIds_.getRaw(i)); - } - if (!getFilterBytes().isEmpty()) { - com.google.protobuf.GeneratedMessage.writeString(output, 2, filter_); - } - if (!getOrderByBytes().isEmpty()) { - com.google.protobuf.GeneratedMessage.writeString(output, 3, orderBy_); - } - if (!getResumeTokenBytes().isEmpty()) { - com.google.protobuf.GeneratedMessage.writeString(output, 4, resumeToken_); - } - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - for (int i = 0; i < projectIds_.size(); i++) { - dataSize += computeStringSizeNoTag(projectIds_.getRaw(i)); - } - size += dataSize; - size += 1 * getProjectIdsList().size(); - } - if (!getFilterBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessage.computeStringSize(2, filter_); - } - if (!getOrderByBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessage.computeStringSize(3, orderBy_); - } - if (!getResumeTokenBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessage.computeStringSize(4, resumeToken_); - } - memoizedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - public static com.google.logging.v2.ReadLogEntriesRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.logging.v2.ReadLogEntriesRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.logging.v2.ReadLogEntriesRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.logging.v2.ReadLogEntriesRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.logging.v2.ReadLogEntriesRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.google.logging.v2.ReadLogEntriesRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static com.google.logging.v2.ReadLogEntriesRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static com.google.logging.v2.ReadLogEntriesRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static com.google.logging.v2.ReadLogEntriesRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.google.logging.v2.ReadLogEntriesRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.logging.v2.ReadLogEntriesRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code google.logging.v2.ReadLogEntriesRequest} - * - *
-   * The parameters to `ReadLogEntries`.
-   * There are two different use cases for streaming:
-   * 1.  To return a very large result set. The request eventually
-   *     completes when all entries have been returned.
-   * 2.  To "tail" a log stream, returning new entries as they arrive.
-   *     In this case, the request never completes.
-   * Only the first use case is supported.
-   * 
- */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:google.logging.v2.ReadLogEntriesRequest) - com.google.logging.v2.ReadLogEntriesRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_ReadLogEntriesRequest_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_ReadLogEntriesRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.logging.v2.ReadLogEntriesRequest.class, com.google.logging.v2.ReadLogEntriesRequest.Builder.class); - } - - // Construct using com.google.logging.v2.ReadLogEntriesRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - public Builder clear() { - super.clear(); - projectIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - filter_ = ""; - - orderBy_ = ""; - - resumeToken_ = ""; - - return this; - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_ReadLogEntriesRequest_descriptor; - } - - public com.google.logging.v2.ReadLogEntriesRequest getDefaultInstanceForType() { - return com.google.logging.v2.ReadLogEntriesRequest.getDefaultInstance(); - } - - public com.google.logging.v2.ReadLogEntriesRequest build() { - com.google.logging.v2.ReadLogEntriesRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.google.logging.v2.ReadLogEntriesRequest buildPartial() { - com.google.logging.v2.ReadLogEntriesRequest result = new com.google.logging.v2.ReadLogEntriesRequest(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - projectIds_ = projectIds_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.projectIds_ = projectIds_; - result.filter_ = filter_; - result.orderBy_ = orderBy_; - result.resumeToken_ = resumeToken_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.logging.v2.ReadLogEntriesRequest) { - return mergeFrom((com.google.logging.v2.ReadLogEntriesRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.logging.v2.ReadLogEntriesRequest other) { - if (other == com.google.logging.v2.ReadLogEntriesRequest.getDefaultInstance()) return this; - if (!other.projectIds_.isEmpty()) { - if (projectIds_.isEmpty()) { - projectIds_ = other.projectIds_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureProjectIdsIsMutable(); - projectIds_.addAll(other.projectIds_); - } - onChanged(); - } - if (!other.getFilter().isEmpty()) { - filter_ = other.filter_; - onChanged(); - } - if (!other.getOrderBy().isEmpty()) { - orderBy_ = other.orderBy_; - onChanged(); - } - if (!other.getResumeToken().isEmpty()) { - resumeToken_ = other.resumeToken_; - onChanged(); - } - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.logging.v2.ReadLogEntriesRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.logging.v2.ReadLogEntriesRequest) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private com.google.protobuf.LazyStringList projectIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureProjectIdsIsMutable() { - if (!((bitField0_ & 0x00000001) == 0x00000001)) { - projectIds_ = new com.google.protobuf.LazyStringArrayList(projectIds_); - bitField0_ |= 0x00000001; - } - } - /** - * repeated string project_ids = 1; - * - *
-     * Required. A list of project ids from which to retrieve log entries.
-     * Example: `"my-project-id"`.
-     * 
- */ - public com.google.protobuf.ProtocolStringList - getProjectIdsList() { - return projectIds_.getUnmodifiableView(); - } - /** - * repeated string project_ids = 1; - * - *
-     * Required. A list of project ids from which to retrieve log entries.
-     * Example: `"my-project-id"`.
-     * 
- */ - public int getProjectIdsCount() { - return projectIds_.size(); - } - /** - * repeated string project_ids = 1; - * - *
-     * Required. A list of project ids from which to retrieve log entries.
-     * Example: `"my-project-id"`.
-     * 
- */ - public java.lang.String getProjectIds(int index) { - return projectIds_.get(index); - } - /** - * repeated string project_ids = 1; - * - *
-     * Required. A list of project ids from which to retrieve log entries.
-     * Example: `"my-project-id"`.
-     * 
- */ - public com.google.protobuf.ByteString - getProjectIdsBytes(int index) { - return projectIds_.getByteString(index); - } - /** - * repeated string project_ids = 1; - * - *
-     * Required. A list of project ids from which to retrieve log entries.
-     * Example: `"my-project-id"`.
-     * 
- */ - public Builder setProjectIds( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureProjectIdsIsMutable(); - projectIds_.set(index, value); - onChanged(); - return this; - } - /** - * repeated string project_ids = 1; - * - *
-     * Required. A list of project ids from which to retrieve log entries.
-     * Example: `"my-project-id"`.
-     * 
- */ - public Builder addProjectIds( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureProjectIdsIsMutable(); - projectIds_.add(value); - onChanged(); - return this; - } - /** - * repeated string project_ids = 1; - * - *
-     * Required. A list of project ids from which to retrieve log entries.
-     * Example: `"my-project-id"`.
-     * 
- */ - public Builder addAllProjectIds( - java.lang.Iterable values) { - ensureProjectIdsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, projectIds_); - onChanged(); - return this; - } - /** - * repeated string project_ids = 1; - * - *
-     * Required. A list of project ids from which to retrieve log entries.
-     * Example: `"my-project-id"`.
-     * 
- */ - public Builder clearProjectIds() { - projectIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * repeated string project_ids = 1; - * - *
-     * Required. A list of project ids from which to retrieve log entries.
-     * Example: `"my-project-id"`.
-     * 
- */ - public Builder addProjectIdsBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureProjectIdsIsMutable(); - projectIds_.add(value); - onChanged(); - return this; - } - - private java.lang.Object filter_ = ""; - /** - * optional string filter = 2; - * - *
-     * Optional. An [advanced logs filter](/logging/docs/view/advanced_filters).
-     * The response includes only entries that match the filter.
-     * If `filter` is empty, then all entries in all logs are retrieved.
-     * 
- */ - public java.lang.String getFilter() { - java.lang.Object ref = filter_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - filter_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string filter = 2; - * - *
-     * Optional. An [advanced logs filter](/logging/docs/view/advanced_filters).
-     * The response includes only entries that match the filter.
-     * If `filter` is empty, then all entries in all logs are retrieved.
-     * 
- */ - public com.google.protobuf.ByteString - getFilterBytes() { - java.lang.Object ref = filter_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - filter_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string filter = 2; - * - *
-     * Optional. An [advanced logs filter](/logging/docs/view/advanced_filters).
-     * The response includes only entries that match the filter.
-     * If `filter` is empty, then all entries in all logs are retrieved.
-     * 
- */ - public Builder setFilter( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - filter_ = value; - onChanged(); - return this; - } - /** - * optional string filter = 2; - * - *
-     * Optional. An [advanced logs filter](/logging/docs/view/advanced_filters).
-     * The response includes only entries that match the filter.
-     * If `filter` is empty, then all entries in all logs are retrieved.
-     * 
- */ - public Builder clearFilter() { - - filter_ = getDefaultInstance().getFilter(); - onChanged(); - return this; - } - /** - * optional string filter = 2; - * - *
-     * Optional. An [advanced logs filter](/logging/docs/view/advanced_filters).
-     * The response includes only entries that match the filter.
-     * If `filter` is empty, then all entries in all logs are retrieved.
-     * 
- */ - public Builder setFilterBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - filter_ = value; - onChanged(); - return this; - } - - private java.lang.Object orderBy_ = ""; - /** - * optional string order_by = 3; - * - *
-     * Optional. How the results should be sorted.  Presently, the only permitted
-     * values are `"timestamp"` (default) and `"timestamp desc"`.  The first
-     * option returns entries in order of increasing values of
-     * `LogEntry.timestamp` (oldest first), and the second option returns entries
-     * in order of decreasing timestamps (newest first).  Entries with equal
-     * timestamps will be returned in order of `LogEntry.insertId`.
-     * 
- */ - public java.lang.String getOrderBy() { - java.lang.Object ref = orderBy_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - orderBy_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string order_by = 3; - * - *
-     * Optional. How the results should be sorted.  Presently, the only permitted
-     * values are `"timestamp"` (default) and `"timestamp desc"`.  The first
-     * option returns entries in order of increasing values of
-     * `LogEntry.timestamp` (oldest first), and the second option returns entries
-     * in order of decreasing timestamps (newest first).  Entries with equal
-     * timestamps will be returned in order of `LogEntry.insertId`.
-     * 
- */ - public com.google.protobuf.ByteString - getOrderByBytes() { - java.lang.Object ref = orderBy_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - orderBy_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string order_by = 3; - * - *
-     * Optional. How the results should be sorted.  Presently, the only permitted
-     * values are `"timestamp"` (default) and `"timestamp desc"`.  The first
-     * option returns entries in order of increasing values of
-     * `LogEntry.timestamp` (oldest first), and the second option returns entries
-     * in order of decreasing timestamps (newest first).  Entries with equal
-     * timestamps will be returned in order of `LogEntry.insertId`.
-     * 
- */ - public Builder setOrderBy( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - orderBy_ = value; - onChanged(); - return this; - } - /** - * optional string order_by = 3; - * - *
-     * Optional. How the results should be sorted.  Presently, the only permitted
-     * values are `"timestamp"` (default) and `"timestamp desc"`.  The first
-     * option returns entries in order of increasing values of
-     * `LogEntry.timestamp` (oldest first), and the second option returns entries
-     * in order of decreasing timestamps (newest first).  Entries with equal
-     * timestamps will be returned in order of `LogEntry.insertId`.
-     * 
- */ - public Builder clearOrderBy() { - - orderBy_ = getDefaultInstance().getOrderBy(); - onChanged(); - return this; - } - /** - * optional string order_by = 3; - * - *
-     * Optional. How the results should be sorted.  Presently, the only permitted
-     * values are `"timestamp"` (default) and `"timestamp desc"`.  The first
-     * option returns entries in order of increasing values of
-     * `LogEntry.timestamp` (oldest first), and the second option returns entries
-     * in order of decreasing timestamps (newest first).  Entries with equal
-     * timestamps will be returned in order of `LogEntry.insertId`.
-     * 
- */ - public Builder setOrderByBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - orderBy_ = value; - onChanged(); - return this; - } - - private java.lang.Object resumeToken_ = ""; - /** - * optional string resume_token = 4; - * - *
-     * Optional. If the `resumeToken` request parameter is supplied, then the next
-     * page of results in the set are retrieved.  The `resumeToken` request
-     * parameter must be set with the value of the `resumeToken` result parameter
-     * from the previous request.
-     * 
- */ - public java.lang.String getResumeToken() { - java.lang.Object ref = resumeToken_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - resumeToken_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string resume_token = 4; - * - *
-     * Optional. If the `resumeToken` request parameter is supplied, then the next
-     * page of results in the set are retrieved.  The `resumeToken` request
-     * parameter must be set with the value of the `resumeToken` result parameter
-     * from the previous request.
-     * 
- */ - public com.google.protobuf.ByteString - getResumeTokenBytes() { - java.lang.Object ref = resumeToken_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - resumeToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string resume_token = 4; - * - *
-     * Optional. If the `resumeToken` request parameter is supplied, then the next
-     * page of results in the set are retrieved.  The `resumeToken` request
-     * parameter must be set with the value of the `resumeToken` result parameter
-     * from the previous request.
-     * 
- */ - public Builder setResumeToken( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - resumeToken_ = value; - onChanged(); - return this; - } - /** - * optional string resume_token = 4; - * - *
-     * Optional. If the `resumeToken` request parameter is supplied, then the next
-     * page of results in the set are retrieved.  The `resumeToken` request
-     * parameter must be set with the value of the `resumeToken` result parameter
-     * from the previous request.
-     * 
- */ - public Builder clearResumeToken() { - - resumeToken_ = getDefaultInstance().getResumeToken(); - onChanged(); - return this; - } - /** - * optional string resume_token = 4; - * - *
-     * Optional. If the `resumeToken` request parameter is supplied, then the next
-     * page of results in the set are retrieved.  The `resumeToken` request
-     * parameter must be set with the value of the `resumeToken` result parameter
-     * from the previous request.
-     * 
- */ - public Builder setResumeTokenBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - resumeToken_ = value; - onChanged(); - return this; - } - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - - // @@protoc_insertion_point(builder_scope:google.logging.v2.ReadLogEntriesRequest) - } - - // @@protoc_insertion_point(class_scope:google.logging.v2.ReadLogEntriesRequest) - private static final com.google.logging.v2.ReadLogEntriesRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.logging.v2.ReadLogEntriesRequest(); - } - - public static com.google.logging.v2.ReadLogEntriesRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - public ReadLogEntriesRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - try { - return new ReadLogEntriesRequest(input, extensionRegistry); - } catch (RuntimeException e) { - if (e.getCause() instanceof - com.google.protobuf.InvalidProtocolBufferException) { - throw (com.google.protobuf.InvalidProtocolBufferException) - e.getCause(); - } - throw e; - } - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public com.google.logging.v2.ReadLogEntriesRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ReadLogEntriesRequestOrBuilder.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ReadLogEntriesRequestOrBuilder.java deleted file mode 100644 index ef241cdf596b..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ReadLogEntriesRequestOrBuilder.java +++ /dev/null @@ -1,122 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/logging/v2/logging.proto - -package com.google.logging.v2; - -public interface ReadLogEntriesRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.logging.v2.ReadLogEntriesRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated string project_ids = 1; - * - *
-   * Required. A list of project ids from which to retrieve log entries.
-   * Example: `"my-project-id"`.
-   * 
- */ - com.google.protobuf.ProtocolStringList - getProjectIdsList(); - /** - * repeated string project_ids = 1; - * - *
-   * Required. A list of project ids from which to retrieve log entries.
-   * Example: `"my-project-id"`.
-   * 
- */ - int getProjectIdsCount(); - /** - * repeated string project_ids = 1; - * - *
-   * Required. A list of project ids from which to retrieve log entries.
-   * Example: `"my-project-id"`.
-   * 
- */ - java.lang.String getProjectIds(int index); - /** - * repeated string project_ids = 1; - * - *
-   * Required. A list of project ids from which to retrieve log entries.
-   * Example: `"my-project-id"`.
-   * 
- */ - com.google.protobuf.ByteString - getProjectIdsBytes(int index); - - /** - * optional string filter = 2; - * - *
-   * Optional. An [advanced logs filter](/logging/docs/view/advanced_filters).
-   * The response includes only entries that match the filter.
-   * If `filter` is empty, then all entries in all logs are retrieved.
-   * 
- */ - java.lang.String getFilter(); - /** - * optional string filter = 2; - * - *
-   * Optional. An [advanced logs filter](/logging/docs/view/advanced_filters).
-   * The response includes only entries that match the filter.
-   * If `filter` is empty, then all entries in all logs are retrieved.
-   * 
- */ - com.google.protobuf.ByteString - getFilterBytes(); - - /** - * optional string order_by = 3; - * - *
-   * Optional. How the results should be sorted.  Presently, the only permitted
-   * values are `"timestamp"` (default) and `"timestamp desc"`.  The first
-   * option returns entries in order of increasing values of
-   * `LogEntry.timestamp` (oldest first), and the second option returns entries
-   * in order of decreasing timestamps (newest first).  Entries with equal
-   * timestamps will be returned in order of `LogEntry.insertId`.
-   * 
- */ - java.lang.String getOrderBy(); - /** - * optional string order_by = 3; - * - *
-   * Optional. How the results should be sorted.  Presently, the only permitted
-   * values are `"timestamp"` (default) and `"timestamp desc"`.  The first
-   * option returns entries in order of increasing values of
-   * `LogEntry.timestamp` (oldest first), and the second option returns entries
-   * in order of decreasing timestamps (newest first).  Entries with equal
-   * timestamps will be returned in order of `LogEntry.insertId`.
-   * 
- */ - com.google.protobuf.ByteString - getOrderByBytes(); - - /** - * optional string resume_token = 4; - * - *
-   * Optional. If the `resumeToken` request parameter is supplied, then the next
-   * page of results in the set are retrieved.  The `resumeToken` request
-   * parameter must be set with the value of the `resumeToken` result parameter
-   * from the previous request.
-   * 
- */ - java.lang.String getResumeToken(); - /** - * optional string resume_token = 4; - * - *
-   * Optional. If the `resumeToken` request parameter is supplied, then the next
-   * page of results in the set are retrieved.  The `resumeToken` request
-   * parameter must be set with the value of the `resumeToken` result parameter
-   * from the previous request.
-   * 
- */ - com.google.protobuf.ByteString - getResumeTokenBytes(); -} diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ReadLogEntriesResponse.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ReadLogEntriesResponse.java deleted file mode 100644 index fefa35362db2..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ReadLogEntriesResponse.java +++ /dev/null @@ -1,946 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/logging/v2/logging.proto - -package com.google.logging.v2; - -/** - * Protobuf type {@code google.logging.v2.ReadLogEntriesResponse} - * - *
- * Result returned from `ReadLogEntries`.
- * 
- */ -public final class ReadLogEntriesResponse extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:google.logging.v2.ReadLogEntriesResponse) - ReadLogEntriesResponseOrBuilder { - // Use ReadLogEntriesResponse.newBuilder() to construct. - private ReadLogEntriesResponse(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - private ReadLogEntriesResponse() { - entries_ = java.util.Collections.emptyList(); - resumeToken_ = ""; - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); - } - private ReadLogEntriesResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) { - this(); - int mutable_bitField0_ = 0; - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!input.skipField(tag)) { - done = true; - } - break; - } - case 10: { - if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - entries_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - entries_.add(input.readMessage(com.google.logging.v2.LogEntry.parser(), extensionRegistry)); - break; - } - case 18: { - String s = input.readStringRequireUtf8(); - - resumeToken_ = s; - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw new RuntimeException(e.setUnfinishedMessage(this)); - } catch (java.io.IOException e) { - throw new RuntimeException( - new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this)); - } finally { - if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - entries_ = java.util.Collections.unmodifiableList(entries_); - } - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_ReadLogEntriesResponse_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_ReadLogEntriesResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.logging.v2.ReadLogEntriesResponse.class, com.google.logging.v2.ReadLogEntriesResponse.Builder.class); - } - - private int bitField0_; - public static final int ENTRIES_FIELD_NUMBER = 1; - private java.util.List entries_; - /** - * repeated .google.logging.v2.LogEntry entries = 1; - * - *
-   * A list of log entries. If the list is empty, there are no more entries in
-   * the stream.
-   * 
- */ - public java.util.List getEntriesList() { - return entries_; - } - /** - * repeated .google.logging.v2.LogEntry entries = 1; - * - *
-   * A list of log entries. If the list is empty, there are no more entries in
-   * the stream.
-   * 
- */ - public java.util.List - getEntriesOrBuilderList() { - return entries_; - } - /** - * repeated .google.logging.v2.LogEntry entries = 1; - * - *
-   * A list of log entries. If the list is empty, there are no more entries in
-   * the stream.
-   * 
- */ - public int getEntriesCount() { - return entries_.size(); - } - /** - * repeated .google.logging.v2.LogEntry entries = 1; - * - *
-   * A list of log entries. If the list is empty, there are no more entries in
-   * the stream.
-   * 
- */ - public com.google.logging.v2.LogEntry getEntries(int index) { - return entries_.get(index); - } - /** - * repeated .google.logging.v2.LogEntry entries = 1; - * - *
-   * A list of log entries. If the list is empty, there are no more entries in
-   * the stream.
-   * 
- */ - public com.google.logging.v2.LogEntryOrBuilder getEntriesOrBuilder( - int index) { - return entries_.get(index); - } - - public static final int RESUME_TOKEN_FIELD_NUMBER = 2; - private volatile java.lang.Object resumeToken_; - /** - * optional string resume_token = 2; - * - *
-   * A token to use to resume from this position of the stream.
-   * Note that even if there are no entries, it might still be possible
-   * to continue from this point at some later time.
-   * 
- */ - public java.lang.String getResumeToken() { - java.lang.Object ref = resumeToken_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - resumeToken_ = s; - return s; - } - } - /** - * optional string resume_token = 2; - * - *
-   * A token to use to resume from this position of the stream.
-   * Note that even if there are no entries, it might still be possible
-   * to continue from this point at some later time.
-   * 
- */ - public com.google.protobuf.ByteString - getResumeTokenBytes() { - java.lang.Object ref = resumeToken_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - resumeToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < entries_.size(); i++) { - output.writeMessage(1, entries_.get(i)); - } - if (!getResumeTokenBytes().isEmpty()) { - com.google.protobuf.GeneratedMessage.writeString(output, 2, resumeToken_); - } - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < entries_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, entries_.get(i)); - } - if (!getResumeTokenBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessage.computeStringSize(2, resumeToken_); - } - memoizedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - public static com.google.logging.v2.ReadLogEntriesResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.logging.v2.ReadLogEntriesResponse parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.logging.v2.ReadLogEntriesResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.logging.v2.ReadLogEntriesResponse parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.logging.v2.ReadLogEntriesResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.google.logging.v2.ReadLogEntriesResponse parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static com.google.logging.v2.ReadLogEntriesResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static com.google.logging.v2.ReadLogEntriesResponse parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static com.google.logging.v2.ReadLogEntriesResponse parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.google.logging.v2.ReadLogEntriesResponse parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.logging.v2.ReadLogEntriesResponse prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code google.logging.v2.ReadLogEntriesResponse} - * - *
-   * Result returned from `ReadLogEntries`.
-   * 
- */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:google.logging.v2.ReadLogEntriesResponse) - com.google.logging.v2.ReadLogEntriesResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_ReadLogEntriesResponse_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_ReadLogEntriesResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.logging.v2.ReadLogEntriesResponse.class, com.google.logging.v2.ReadLogEntriesResponse.Builder.class); - } - - // Construct using com.google.logging.v2.ReadLogEntriesResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - getEntriesFieldBuilder(); - } - } - public Builder clear() { - super.clear(); - if (entriesBuilder_ == null) { - entries_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - entriesBuilder_.clear(); - } - resumeToken_ = ""; - - return this; - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_ReadLogEntriesResponse_descriptor; - } - - public com.google.logging.v2.ReadLogEntriesResponse getDefaultInstanceForType() { - return com.google.logging.v2.ReadLogEntriesResponse.getDefaultInstance(); - } - - public com.google.logging.v2.ReadLogEntriesResponse build() { - com.google.logging.v2.ReadLogEntriesResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.google.logging.v2.ReadLogEntriesResponse buildPartial() { - com.google.logging.v2.ReadLogEntriesResponse result = new com.google.logging.v2.ReadLogEntriesResponse(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (entriesBuilder_ == null) { - if (((bitField0_ & 0x00000001) == 0x00000001)) { - entries_ = java.util.Collections.unmodifiableList(entries_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.entries_ = entries_; - } else { - result.entries_ = entriesBuilder_.build(); - } - result.resumeToken_ = resumeToken_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.logging.v2.ReadLogEntriesResponse) { - return mergeFrom((com.google.logging.v2.ReadLogEntriesResponse)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.logging.v2.ReadLogEntriesResponse other) { - if (other == com.google.logging.v2.ReadLogEntriesResponse.getDefaultInstance()) return this; - if (entriesBuilder_ == null) { - if (!other.entries_.isEmpty()) { - if (entries_.isEmpty()) { - entries_ = other.entries_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureEntriesIsMutable(); - entries_.addAll(other.entries_); - } - onChanged(); - } - } else { - if (!other.entries_.isEmpty()) { - if (entriesBuilder_.isEmpty()) { - entriesBuilder_.dispose(); - entriesBuilder_ = null; - entries_ = other.entries_; - bitField0_ = (bitField0_ & ~0x00000001); - entriesBuilder_ = - com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? - getEntriesFieldBuilder() : null; - } else { - entriesBuilder_.addAllMessages(other.entries_); - } - } - } - if (!other.getResumeToken().isEmpty()) { - resumeToken_ = other.resumeToken_; - onChanged(); - } - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.logging.v2.ReadLogEntriesResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.logging.v2.ReadLogEntriesResponse) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List entries_ = - java.util.Collections.emptyList(); - private void ensureEntriesIsMutable() { - if (!((bitField0_ & 0x00000001) == 0x00000001)) { - entries_ = new java.util.ArrayList(entries_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilder< - com.google.logging.v2.LogEntry, com.google.logging.v2.LogEntry.Builder, com.google.logging.v2.LogEntryOrBuilder> entriesBuilder_; - - /** - * repeated .google.logging.v2.LogEntry entries = 1; - * - *
-     * A list of log entries. If the list is empty, there are no more entries in
-     * the stream.
-     * 
- */ - public java.util.List getEntriesList() { - if (entriesBuilder_ == null) { - return java.util.Collections.unmodifiableList(entries_); - } else { - return entriesBuilder_.getMessageList(); - } - } - /** - * repeated .google.logging.v2.LogEntry entries = 1; - * - *
-     * A list of log entries. If the list is empty, there are no more entries in
-     * the stream.
-     * 
- */ - public int getEntriesCount() { - if (entriesBuilder_ == null) { - return entries_.size(); - } else { - return entriesBuilder_.getCount(); - } - } - /** - * repeated .google.logging.v2.LogEntry entries = 1; - * - *
-     * A list of log entries. If the list is empty, there are no more entries in
-     * the stream.
-     * 
- */ - public com.google.logging.v2.LogEntry getEntries(int index) { - if (entriesBuilder_ == null) { - return entries_.get(index); - } else { - return entriesBuilder_.getMessage(index); - } - } - /** - * repeated .google.logging.v2.LogEntry entries = 1; - * - *
-     * A list of log entries. If the list is empty, there are no more entries in
-     * the stream.
-     * 
- */ - public Builder setEntries( - int index, com.google.logging.v2.LogEntry value) { - if (entriesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEntriesIsMutable(); - entries_.set(index, value); - onChanged(); - } else { - entriesBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .google.logging.v2.LogEntry entries = 1; - * - *
-     * A list of log entries. If the list is empty, there are no more entries in
-     * the stream.
-     * 
- */ - public Builder setEntries( - int index, com.google.logging.v2.LogEntry.Builder builderForValue) { - if (entriesBuilder_ == null) { - ensureEntriesIsMutable(); - entries_.set(index, builderForValue.build()); - onChanged(); - } else { - entriesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .google.logging.v2.LogEntry entries = 1; - * - *
-     * A list of log entries. If the list is empty, there are no more entries in
-     * the stream.
-     * 
- */ - public Builder addEntries(com.google.logging.v2.LogEntry value) { - if (entriesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEntriesIsMutable(); - entries_.add(value); - onChanged(); - } else { - entriesBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .google.logging.v2.LogEntry entries = 1; - * - *
-     * A list of log entries. If the list is empty, there are no more entries in
-     * the stream.
-     * 
- */ - public Builder addEntries( - int index, com.google.logging.v2.LogEntry value) { - if (entriesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEntriesIsMutable(); - entries_.add(index, value); - onChanged(); - } else { - entriesBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .google.logging.v2.LogEntry entries = 1; - * - *
-     * A list of log entries. If the list is empty, there are no more entries in
-     * the stream.
-     * 
- */ - public Builder addEntries( - com.google.logging.v2.LogEntry.Builder builderForValue) { - if (entriesBuilder_ == null) { - ensureEntriesIsMutable(); - entries_.add(builderForValue.build()); - onChanged(); - } else { - entriesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .google.logging.v2.LogEntry entries = 1; - * - *
-     * A list of log entries. If the list is empty, there are no more entries in
-     * the stream.
-     * 
- */ - public Builder addEntries( - int index, com.google.logging.v2.LogEntry.Builder builderForValue) { - if (entriesBuilder_ == null) { - ensureEntriesIsMutable(); - entries_.add(index, builderForValue.build()); - onChanged(); - } else { - entriesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .google.logging.v2.LogEntry entries = 1; - * - *
-     * A list of log entries. If the list is empty, there are no more entries in
-     * the stream.
-     * 
- */ - public Builder addAllEntries( - java.lang.Iterable values) { - if (entriesBuilder_ == null) { - ensureEntriesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, entries_); - onChanged(); - } else { - entriesBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .google.logging.v2.LogEntry entries = 1; - * - *
-     * A list of log entries. If the list is empty, there are no more entries in
-     * the stream.
-     * 
- */ - public Builder clearEntries() { - if (entriesBuilder_ == null) { - entries_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - entriesBuilder_.clear(); - } - return this; - } - /** - * repeated .google.logging.v2.LogEntry entries = 1; - * - *
-     * A list of log entries. If the list is empty, there are no more entries in
-     * the stream.
-     * 
- */ - public Builder removeEntries(int index) { - if (entriesBuilder_ == null) { - ensureEntriesIsMutable(); - entries_.remove(index); - onChanged(); - } else { - entriesBuilder_.remove(index); - } - return this; - } - /** - * repeated .google.logging.v2.LogEntry entries = 1; - * - *
-     * A list of log entries. If the list is empty, there are no more entries in
-     * the stream.
-     * 
- */ - public com.google.logging.v2.LogEntry.Builder getEntriesBuilder( - int index) { - return getEntriesFieldBuilder().getBuilder(index); - } - /** - * repeated .google.logging.v2.LogEntry entries = 1; - * - *
-     * A list of log entries. If the list is empty, there are no more entries in
-     * the stream.
-     * 
- */ - public com.google.logging.v2.LogEntryOrBuilder getEntriesOrBuilder( - int index) { - if (entriesBuilder_ == null) { - return entries_.get(index); } else { - return entriesBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .google.logging.v2.LogEntry entries = 1; - * - *
-     * A list of log entries. If the list is empty, there are no more entries in
-     * the stream.
-     * 
- */ - public java.util.List - getEntriesOrBuilderList() { - if (entriesBuilder_ != null) { - return entriesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(entries_); - } - } - /** - * repeated .google.logging.v2.LogEntry entries = 1; - * - *
-     * A list of log entries. If the list is empty, there are no more entries in
-     * the stream.
-     * 
- */ - public com.google.logging.v2.LogEntry.Builder addEntriesBuilder() { - return getEntriesFieldBuilder().addBuilder( - com.google.logging.v2.LogEntry.getDefaultInstance()); - } - /** - * repeated .google.logging.v2.LogEntry entries = 1; - * - *
-     * A list of log entries. If the list is empty, there are no more entries in
-     * the stream.
-     * 
- */ - public com.google.logging.v2.LogEntry.Builder addEntriesBuilder( - int index) { - return getEntriesFieldBuilder().addBuilder( - index, com.google.logging.v2.LogEntry.getDefaultInstance()); - } - /** - * repeated .google.logging.v2.LogEntry entries = 1; - * - *
-     * A list of log entries. If the list is empty, there are no more entries in
-     * the stream.
-     * 
- */ - public java.util.List - getEntriesBuilderList() { - return getEntriesFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilder< - com.google.logging.v2.LogEntry, com.google.logging.v2.LogEntry.Builder, com.google.logging.v2.LogEntryOrBuilder> - getEntriesFieldBuilder() { - if (entriesBuilder_ == null) { - entriesBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< - com.google.logging.v2.LogEntry, com.google.logging.v2.LogEntry.Builder, com.google.logging.v2.LogEntryOrBuilder>( - entries_, - ((bitField0_ & 0x00000001) == 0x00000001), - getParentForChildren(), - isClean()); - entries_ = null; - } - return entriesBuilder_; - } - - private java.lang.Object resumeToken_ = ""; - /** - * optional string resume_token = 2; - * - *
-     * A token to use to resume from this position of the stream.
-     * Note that even if there are no entries, it might still be possible
-     * to continue from this point at some later time.
-     * 
- */ - public java.lang.String getResumeToken() { - java.lang.Object ref = resumeToken_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - resumeToken_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string resume_token = 2; - * - *
-     * A token to use to resume from this position of the stream.
-     * Note that even if there are no entries, it might still be possible
-     * to continue from this point at some later time.
-     * 
- */ - public com.google.protobuf.ByteString - getResumeTokenBytes() { - java.lang.Object ref = resumeToken_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - resumeToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string resume_token = 2; - * - *
-     * A token to use to resume from this position of the stream.
-     * Note that even if there are no entries, it might still be possible
-     * to continue from this point at some later time.
-     * 
- */ - public Builder setResumeToken( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - resumeToken_ = value; - onChanged(); - return this; - } - /** - * optional string resume_token = 2; - * - *
-     * A token to use to resume from this position of the stream.
-     * Note that even if there are no entries, it might still be possible
-     * to continue from this point at some later time.
-     * 
- */ - public Builder clearResumeToken() { - - resumeToken_ = getDefaultInstance().getResumeToken(); - onChanged(); - return this; - } - /** - * optional string resume_token = 2; - * - *
-     * A token to use to resume from this position of the stream.
-     * Note that even if there are no entries, it might still be possible
-     * to continue from this point at some later time.
-     * 
- */ - public Builder setResumeTokenBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - resumeToken_ = value; - onChanged(); - return this; - } - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - - // @@protoc_insertion_point(builder_scope:google.logging.v2.ReadLogEntriesResponse) - } - - // @@protoc_insertion_point(class_scope:google.logging.v2.ReadLogEntriesResponse) - private static final com.google.logging.v2.ReadLogEntriesResponse DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.logging.v2.ReadLogEntriesResponse(); - } - - public static com.google.logging.v2.ReadLogEntriesResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - public ReadLogEntriesResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - try { - return new ReadLogEntriesResponse(input, extensionRegistry); - } catch (RuntimeException e) { - if (e.getCause() instanceof - com.google.protobuf.InvalidProtocolBufferException) { - throw (com.google.protobuf.InvalidProtocolBufferException) - e.getCause(); - } - throw e; - } - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public com.google.logging.v2.ReadLogEntriesResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ReadLogEntriesResponseOrBuilder.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ReadLogEntriesResponseOrBuilder.java deleted file mode 100644 index 970a9e6cfa57..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/ReadLogEntriesResponseOrBuilder.java +++ /dev/null @@ -1,80 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/logging/v2/logging.proto - -package com.google.logging.v2; - -public interface ReadLogEntriesResponseOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.logging.v2.ReadLogEntriesResponse) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .google.logging.v2.LogEntry entries = 1; - * - *
-   * A list of log entries. If the list is empty, there are no more entries in
-   * the stream.
-   * 
- */ - java.util.List - getEntriesList(); - /** - * repeated .google.logging.v2.LogEntry entries = 1; - * - *
-   * A list of log entries. If the list is empty, there are no more entries in
-   * the stream.
-   * 
- */ - com.google.logging.v2.LogEntry getEntries(int index); - /** - * repeated .google.logging.v2.LogEntry entries = 1; - * - *
-   * A list of log entries. If the list is empty, there are no more entries in
-   * the stream.
-   * 
- */ - int getEntriesCount(); - /** - * repeated .google.logging.v2.LogEntry entries = 1; - * - *
-   * A list of log entries. If the list is empty, there are no more entries in
-   * the stream.
-   * 
- */ - java.util.List - getEntriesOrBuilderList(); - /** - * repeated .google.logging.v2.LogEntry entries = 1; - * - *
-   * A list of log entries. If the list is empty, there are no more entries in
-   * the stream.
-   * 
- */ - com.google.logging.v2.LogEntryOrBuilder getEntriesOrBuilder( - int index); - - /** - * optional string resume_token = 2; - * - *
-   * A token to use to resume from this position of the stream.
-   * Note that even if there are no entries, it might still be possible
-   * to continue from this point at some later time.
-   * 
- */ - java.lang.String getResumeToken(); - /** - * optional string resume_token = 2; - * - *
-   * A token to use to resume from this position of the stream.
-   * Note that even if there are no entries, it might still be possible
-   * to continue from this point at some later time.
-   * 
- */ - com.google.protobuf.ByteString - getResumeTokenBytes(); -} diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/UpdateLogMetricRequest.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/UpdateLogMetricRequest.java deleted file mode 100644 index da942f15c143..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/UpdateLogMetricRequest.java +++ /dev/null @@ -1,748 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/logging/v2/logging_metrics.proto - -package com.google.logging.v2; - -/** - * Protobuf type {@code google.logging.v2.UpdateLogMetricRequest} - * - *
- * The parameters to UpdateLogMetric.
- * 
- */ -public final class UpdateLogMetricRequest extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:google.logging.v2.UpdateLogMetricRequest) - UpdateLogMetricRequestOrBuilder { - // Use UpdateLogMetricRequest.newBuilder() to construct. - private UpdateLogMetricRequest(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - private UpdateLogMetricRequest() { - metricName_ = ""; - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); - } - private UpdateLogMetricRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) { - this(); - int mutable_bitField0_ = 0; - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!input.skipField(tag)) { - done = true; - } - break; - } - case 10: { - String s = input.readStringRequireUtf8(); - - metricName_ = s; - break; - } - case 18: { - com.google.logging.v2.LogMetric.Builder subBuilder = null; - if (metric_ != null) { - subBuilder = metric_.toBuilder(); - } - metric_ = input.readMessage(com.google.logging.v2.LogMetric.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(metric_); - metric_ = subBuilder.buildPartial(); - } - - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw new RuntimeException(e.setUnfinishedMessage(this)); - } catch (java.io.IOException e) { - throw new RuntimeException( - new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this)); - } finally { - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.logging.v2.LoggingMetrics.internal_static_google_logging_v2_UpdateLogMetricRequest_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.logging.v2.LoggingMetrics.internal_static_google_logging_v2_UpdateLogMetricRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.logging.v2.UpdateLogMetricRequest.class, com.google.logging.v2.UpdateLogMetricRequest.Builder.class); - } - - public static final int METRIC_NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object metricName_; - /** - * optional string metric_name = 1; - * - *
-   * 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() { - java.lang.Object ref = metricName_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - metricName_ = s; - return s; - } - } - /** - * optional string metric_name = 1; - * - *
-   * 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 com.google.protobuf.ByteString - getMetricNameBytes() { - java.lang.Object ref = metricName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - metricName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int METRIC_FIELD_NUMBER = 2; - private com.google.logging.v2.LogMetric metric_; - /** - * optional .google.logging.v2.LogMetric metric = 2; - * - *
-   * The updated metric, whose name must be the same as the
-   * metric identifier in `metricName`. If `metricName` does not
-   * exist, then a new metric is created.
-   * 
- */ - public boolean hasMetric() { - return metric_ != null; - } - /** - * optional .google.logging.v2.LogMetric metric = 2; - * - *
-   * The updated metric, whose name must be the same as the
-   * metric identifier in `metricName`. If `metricName` does not
-   * exist, then a new metric is created.
-   * 
- */ - public com.google.logging.v2.LogMetric getMetric() { - return metric_ == null ? com.google.logging.v2.LogMetric.getDefaultInstance() : metric_; - } - /** - * optional .google.logging.v2.LogMetric metric = 2; - * - *
-   * The updated metric, whose name must be the same as the
-   * metric identifier in `metricName`. If `metricName` does not
-   * exist, then a new metric is created.
-   * 
- */ - public com.google.logging.v2.LogMetricOrBuilder getMetricOrBuilder() { - return getMetric(); - } - - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getMetricNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessage.writeString(output, 1, metricName_); - } - if (metric_ != null) { - output.writeMessage(2, getMetric()); - } - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getMetricNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessage.computeStringSize(1, metricName_); - } - if (metric_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getMetric()); - } - memoizedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - public static com.google.logging.v2.UpdateLogMetricRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.logging.v2.UpdateLogMetricRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.logging.v2.UpdateLogMetricRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.logging.v2.UpdateLogMetricRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.logging.v2.UpdateLogMetricRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.google.logging.v2.UpdateLogMetricRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static com.google.logging.v2.UpdateLogMetricRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static com.google.logging.v2.UpdateLogMetricRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static com.google.logging.v2.UpdateLogMetricRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.google.logging.v2.UpdateLogMetricRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.logging.v2.UpdateLogMetricRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code google.logging.v2.UpdateLogMetricRequest} - * - *
-   * The parameters to UpdateLogMetric.
-   * 
- */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:google.logging.v2.UpdateLogMetricRequest) - com.google.logging.v2.UpdateLogMetricRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.logging.v2.LoggingMetrics.internal_static_google_logging_v2_UpdateLogMetricRequest_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.logging.v2.LoggingMetrics.internal_static_google_logging_v2_UpdateLogMetricRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.logging.v2.UpdateLogMetricRequest.class, com.google.logging.v2.UpdateLogMetricRequest.Builder.class); - } - - // Construct using com.google.logging.v2.UpdateLogMetricRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - public Builder clear() { - super.clear(); - metricName_ = ""; - - if (metricBuilder_ == null) { - metric_ = null; - } else { - metric_ = null; - metricBuilder_ = null; - } - return this; - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.logging.v2.LoggingMetrics.internal_static_google_logging_v2_UpdateLogMetricRequest_descriptor; - } - - public com.google.logging.v2.UpdateLogMetricRequest getDefaultInstanceForType() { - return com.google.logging.v2.UpdateLogMetricRequest.getDefaultInstance(); - } - - public com.google.logging.v2.UpdateLogMetricRequest build() { - com.google.logging.v2.UpdateLogMetricRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.google.logging.v2.UpdateLogMetricRequest buildPartial() { - com.google.logging.v2.UpdateLogMetricRequest result = new com.google.logging.v2.UpdateLogMetricRequest(this); - result.metricName_ = metricName_; - if (metricBuilder_ == null) { - result.metric_ = metric_; - } else { - result.metric_ = metricBuilder_.build(); - } - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.logging.v2.UpdateLogMetricRequest) { - return mergeFrom((com.google.logging.v2.UpdateLogMetricRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.logging.v2.UpdateLogMetricRequest other) { - if (other == com.google.logging.v2.UpdateLogMetricRequest.getDefaultInstance()) return this; - if (!other.getMetricName().isEmpty()) { - metricName_ = other.metricName_; - onChanged(); - } - if (other.hasMetric()) { - mergeMetric(other.getMetric()); - } - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.logging.v2.UpdateLogMetricRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.logging.v2.UpdateLogMetricRequest) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object metricName_ = ""; - /** - * optional string metric_name = 1; - * - *
-     * 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() { - java.lang.Object ref = metricName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - metricName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string metric_name = 1; - * - *
-     * 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 com.google.protobuf.ByteString - getMetricNameBytes() { - java.lang.Object ref = metricName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - metricName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string metric_name = 1; - * - *
-     * 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 Builder setMetricName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - metricName_ = value; - onChanged(); - return this; - } - /** - * optional string metric_name = 1; - * - *
-     * 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 Builder clearMetricName() { - - metricName_ = getDefaultInstance().getMetricName(); - onChanged(); - return this; - } - /** - * optional string metric_name = 1; - * - *
-     * 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 Builder setMetricNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - metricName_ = value; - onChanged(); - return this; - } - - private com.google.logging.v2.LogMetric metric_ = null; - private com.google.protobuf.SingleFieldBuilder< - com.google.logging.v2.LogMetric, com.google.logging.v2.LogMetric.Builder, com.google.logging.v2.LogMetricOrBuilder> metricBuilder_; - /** - * optional .google.logging.v2.LogMetric metric = 2; - * - *
-     * The updated metric, whose name must be the same as the
-     * metric identifier in `metricName`. If `metricName` does not
-     * exist, then a new metric is created.
-     * 
- */ - public boolean hasMetric() { - return metricBuilder_ != null || metric_ != null; - } - /** - * optional .google.logging.v2.LogMetric metric = 2; - * - *
-     * The updated metric, whose name must be the same as the
-     * metric identifier in `metricName`. If `metricName` does not
-     * exist, then a new metric is created.
-     * 
- */ - public com.google.logging.v2.LogMetric getMetric() { - if (metricBuilder_ == null) { - return metric_ == null ? com.google.logging.v2.LogMetric.getDefaultInstance() : metric_; - } else { - return metricBuilder_.getMessage(); - } - } - /** - * optional .google.logging.v2.LogMetric metric = 2; - * - *
-     * The updated metric, whose name must be the same as the
-     * metric identifier in `metricName`. If `metricName` does not
-     * exist, then a new metric is created.
-     * 
- */ - public Builder setMetric(com.google.logging.v2.LogMetric value) { - if (metricBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - metric_ = value; - onChanged(); - } else { - metricBuilder_.setMessage(value); - } - - return this; - } - /** - * optional .google.logging.v2.LogMetric metric = 2; - * - *
-     * The updated metric, whose name must be the same as the
-     * metric identifier in `metricName`. If `metricName` does not
-     * exist, then a new metric is created.
-     * 
- */ - public Builder setMetric( - com.google.logging.v2.LogMetric.Builder builderForValue) { - if (metricBuilder_ == null) { - metric_ = builderForValue.build(); - onChanged(); - } else { - metricBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * optional .google.logging.v2.LogMetric metric = 2; - * - *
-     * The updated metric, whose name must be the same as the
-     * metric identifier in `metricName`. If `metricName` does not
-     * exist, then a new metric is created.
-     * 
- */ - public Builder mergeMetric(com.google.logging.v2.LogMetric value) { - if (metricBuilder_ == null) { - if (metric_ != null) { - metric_ = - com.google.logging.v2.LogMetric.newBuilder(metric_).mergeFrom(value).buildPartial(); - } else { - metric_ = value; - } - onChanged(); - } else { - metricBuilder_.mergeFrom(value); - } - - return this; - } - /** - * optional .google.logging.v2.LogMetric metric = 2; - * - *
-     * The updated metric, whose name must be the same as the
-     * metric identifier in `metricName`. If `metricName` does not
-     * exist, then a new metric is created.
-     * 
- */ - public Builder clearMetric() { - if (metricBuilder_ == null) { - metric_ = null; - onChanged(); - } else { - metric_ = null; - metricBuilder_ = null; - } - - return this; - } - /** - * optional .google.logging.v2.LogMetric metric = 2; - * - *
-     * The updated metric, whose name must be the same as the
-     * metric identifier in `metricName`. If `metricName` does not
-     * exist, then a new metric is created.
-     * 
- */ - public com.google.logging.v2.LogMetric.Builder getMetricBuilder() { - - onChanged(); - return getMetricFieldBuilder().getBuilder(); - } - /** - * optional .google.logging.v2.LogMetric metric = 2; - * - *
-     * The updated metric, whose name must be the same as the
-     * metric identifier in `metricName`. If `metricName` does not
-     * exist, then a new metric is created.
-     * 
- */ - public com.google.logging.v2.LogMetricOrBuilder getMetricOrBuilder() { - if (metricBuilder_ != null) { - return metricBuilder_.getMessageOrBuilder(); - } else { - return metric_ == null ? - com.google.logging.v2.LogMetric.getDefaultInstance() : metric_; - } - } - /** - * optional .google.logging.v2.LogMetric metric = 2; - * - *
-     * The updated metric, whose name must be the same as the
-     * metric identifier in `metricName`. If `metricName` does not
-     * exist, then a new metric is created.
-     * 
- */ - private com.google.protobuf.SingleFieldBuilder< - com.google.logging.v2.LogMetric, com.google.logging.v2.LogMetric.Builder, com.google.logging.v2.LogMetricOrBuilder> - getMetricFieldBuilder() { - if (metricBuilder_ == null) { - metricBuilder_ = new com.google.protobuf.SingleFieldBuilder< - com.google.logging.v2.LogMetric, com.google.logging.v2.LogMetric.Builder, com.google.logging.v2.LogMetricOrBuilder>( - getMetric(), - getParentForChildren(), - isClean()); - metric_ = null; - } - return metricBuilder_; - } - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - - // @@protoc_insertion_point(builder_scope:google.logging.v2.UpdateLogMetricRequest) - } - - // @@protoc_insertion_point(class_scope:google.logging.v2.UpdateLogMetricRequest) - private static final com.google.logging.v2.UpdateLogMetricRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.logging.v2.UpdateLogMetricRequest(); - } - - public static com.google.logging.v2.UpdateLogMetricRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - public UpdateLogMetricRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - try { - return new UpdateLogMetricRequest(input, extensionRegistry); - } catch (RuntimeException e) { - if (e.getCause() instanceof - com.google.protobuf.InvalidProtocolBufferException) { - throw (com.google.protobuf.InvalidProtocolBufferException) - e.getCause(); - } - throw e; - } - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public com.google.logging.v2.UpdateLogMetricRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/UpdateLogMetricRequestOrBuilder.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/UpdateLogMetricRequestOrBuilder.java deleted file mode 100644 index 4c203e0f314e..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/UpdateLogMetricRequestOrBuilder.java +++ /dev/null @@ -1,66 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/logging/v2/logging_metrics.proto - -package com.google.logging.v2; - -public interface UpdateLogMetricRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.logging.v2.UpdateLogMetricRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * optional string metric_name = 1; - * - *
-   * 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.
-   * 
- */ - java.lang.String getMetricName(); - /** - * optional string metric_name = 1; - * - *
-   * 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.protobuf.ByteString - getMetricNameBytes(); - - /** - * optional .google.logging.v2.LogMetric metric = 2; - * - *
-   * The updated metric, whose name must be the same as the
-   * metric identifier in `metricName`. If `metricName` does not
-   * exist, then a new metric is created.
-   * 
- */ - boolean hasMetric(); - /** - * optional .google.logging.v2.LogMetric metric = 2; - * - *
-   * The updated metric, whose name must be the same as the
-   * metric identifier in `metricName`. If `metricName` does not
-   * exist, then a new metric is created.
-   * 
- */ - com.google.logging.v2.LogMetric getMetric(); - /** - * optional .google.logging.v2.LogMetric metric = 2; - * - *
-   * The updated metric, whose name must be the same as the
-   * metric identifier in `metricName`. If `metricName` does not
-   * exist, then a new metric is created.
-   * 
- */ - com.google.logging.v2.LogMetricOrBuilder getMetricOrBuilder(); -} diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/UpdateSinkRequest.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/UpdateSinkRequest.java deleted file mode 100644 index 422b598fb9e6..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/UpdateSinkRequest.java +++ /dev/null @@ -1,748 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/logging/v2/logging_config.proto - -package com.google.logging.v2; - -/** - * Protobuf type {@code google.logging.v2.UpdateSinkRequest} - * - *
- * The parameters to `UpdateSink`.
- * 
- */ -public final class UpdateSinkRequest extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:google.logging.v2.UpdateSinkRequest) - UpdateSinkRequestOrBuilder { - // Use UpdateSinkRequest.newBuilder() to construct. - private UpdateSinkRequest(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - private UpdateSinkRequest() { - sinkName_ = ""; - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); - } - private UpdateSinkRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) { - this(); - int mutable_bitField0_ = 0; - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!input.skipField(tag)) { - done = true; - } - break; - } - case 10: { - String s = input.readStringRequireUtf8(); - - sinkName_ = s; - break; - } - case 18: { - com.google.logging.v2.LogSink.Builder subBuilder = null; - if (sink_ != null) { - subBuilder = sink_.toBuilder(); - } - sink_ = input.readMessage(com.google.logging.v2.LogSink.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(sink_); - sink_ = subBuilder.buildPartial(); - } - - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw new RuntimeException(e.setUnfinishedMessage(this)); - } catch (java.io.IOException e) { - throw new RuntimeException( - new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this)); - } finally { - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.logging.v2.LoggingConfig.internal_static_google_logging_v2_UpdateSinkRequest_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.logging.v2.LoggingConfig.internal_static_google_logging_v2_UpdateSinkRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.logging.v2.UpdateSinkRequest.class, com.google.logging.v2.UpdateSinkRequest.Builder.class); - } - - public static final int SINK_NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object sinkName_; - /** - * optional string sink_name = 1; - * - *
-   * The resource name of the sink to update.
-   * Example: `"projects/my-project-id/sinks/my-sink-id"`.
-   * The updated sink must be provided in the request and have the
-   * same name that is specified in `sinkName`.  If the sink does not
-   * exist, it is created.
-   * 
- */ - public java.lang.String getSinkName() { - java.lang.Object ref = sinkName_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - sinkName_ = s; - return s; - } - } - /** - * optional string sink_name = 1; - * - *
-   * The resource name of the sink to update.
-   * Example: `"projects/my-project-id/sinks/my-sink-id"`.
-   * The updated sink must be provided in the request and have the
-   * same name that is specified in `sinkName`.  If the sink does not
-   * exist, it is created.
-   * 
- */ - public com.google.protobuf.ByteString - getSinkNameBytes() { - java.lang.Object ref = sinkName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - sinkName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int SINK_FIELD_NUMBER = 2; - private com.google.logging.v2.LogSink sink_; - /** - * optional .google.logging.v2.LogSink sink = 2; - * - *
-   * The updated sink, whose name must be the same as the sink
-   * identifier in `sinkName`.  If `sinkName` does not exist, then
-   * this method creates a new sink.
-   * 
- */ - public boolean hasSink() { - return sink_ != null; - } - /** - * optional .google.logging.v2.LogSink sink = 2; - * - *
-   * The updated sink, whose name must be the same as the sink
-   * identifier in `sinkName`.  If `sinkName` does not exist, then
-   * this method creates a new sink.
-   * 
- */ - public com.google.logging.v2.LogSink getSink() { - return sink_ == null ? com.google.logging.v2.LogSink.getDefaultInstance() : sink_; - } - /** - * optional .google.logging.v2.LogSink sink = 2; - * - *
-   * The updated sink, whose name must be the same as the sink
-   * identifier in `sinkName`.  If `sinkName` does not exist, then
-   * this method creates a new sink.
-   * 
- */ - public com.google.logging.v2.LogSinkOrBuilder getSinkOrBuilder() { - return getSink(); - } - - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getSinkNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessage.writeString(output, 1, sinkName_); - } - if (sink_ != null) { - output.writeMessage(2, getSink()); - } - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getSinkNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessage.computeStringSize(1, sinkName_); - } - if (sink_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getSink()); - } - memoizedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - public static com.google.logging.v2.UpdateSinkRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.logging.v2.UpdateSinkRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.logging.v2.UpdateSinkRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.logging.v2.UpdateSinkRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.logging.v2.UpdateSinkRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.google.logging.v2.UpdateSinkRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static com.google.logging.v2.UpdateSinkRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static com.google.logging.v2.UpdateSinkRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static com.google.logging.v2.UpdateSinkRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.google.logging.v2.UpdateSinkRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.logging.v2.UpdateSinkRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code google.logging.v2.UpdateSinkRequest} - * - *
-   * The parameters to `UpdateSink`.
-   * 
- */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:google.logging.v2.UpdateSinkRequest) - com.google.logging.v2.UpdateSinkRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.logging.v2.LoggingConfig.internal_static_google_logging_v2_UpdateSinkRequest_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.logging.v2.LoggingConfig.internal_static_google_logging_v2_UpdateSinkRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.logging.v2.UpdateSinkRequest.class, com.google.logging.v2.UpdateSinkRequest.Builder.class); - } - - // Construct using com.google.logging.v2.UpdateSinkRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - public Builder clear() { - super.clear(); - sinkName_ = ""; - - if (sinkBuilder_ == null) { - sink_ = null; - } else { - sink_ = null; - sinkBuilder_ = null; - } - return this; - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.logging.v2.LoggingConfig.internal_static_google_logging_v2_UpdateSinkRequest_descriptor; - } - - public com.google.logging.v2.UpdateSinkRequest getDefaultInstanceForType() { - return com.google.logging.v2.UpdateSinkRequest.getDefaultInstance(); - } - - public com.google.logging.v2.UpdateSinkRequest build() { - com.google.logging.v2.UpdateSinkRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.google.logging.v2.UpdateSinkRequest buildPartial() { - com.google.logging.v2.UpdateSinkRequest result = new com.google.logging.v2.UpdateSinkRequest(this); - result.sinkName_ = sinkName_; - if (sinkBuilder_ == null) { - result.sink_ = sink_; - } else { - result.sink_ = sinkBuilder_.build(); - } - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.logging.v2.UpdateSinkRequest) { - return mergeFrom((com.google.logging.v2.UpdateSinkRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.logging.v2.UpdateSinkRequest other) { - if (other == com.google.logging.v2.UpdateSinkRequest.getDefaultInstance()) return this; - if (!other.getSinkName().isEmpty()) { - sinkName_ = other.sinkName_; - onChanged(); - } - if (other.hasSink()) { - mergeSink(other.getSink()); - } - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.logging.v2.UpdateSinkRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.logging.v2.UpdateSinkRequest) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object sinkName_ = ""; - /** - * optional string sink_name = 1; - * - *
-     * The resource name of the sink to update.
-     * Example: `"projects/my-project-id/sinks/my-sink-id"`.
-     * The updated sink must be provided in the request and have the
-     * same name that is specified in `sinkName`.  If the sink does not
-     * exist, it is created.
-     * 
- */ - public java.lang.String getSinkName() { - java.lang.Object ref = sinkName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - sinkName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string sink_name = 1; - * - *
-     * The resource name of the sink to update.
-     * Example: `"projects/my-project-id/sinks/my-sink-id"`.
-     * The updated sink must be provided in the request and have the
-     * same name that is specified in `sinkName`.  If the sink does not
-     * exist, it is created.
-     * 
- */ - public com.google.protobuf.ByteString - getSinkNameBytes() { - java.lang.Object ref = sinkName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - sinkName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string sink_name = 1; - * - *
-     * The resource name of the sink to update.
-     * Example: `"projects/my-project-id/sinks/my-sink-id"`.
-     * The updated sink must be provided in the request and have the
-     * same name that is specified in `sinkName`.  If the sink does not
-     * exist, it is created.
-     * 
- */ - public Builder setSinkName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - sinkName_ = value; - onChanged(); - return this; - } - /** - * optional string sink_name = 1; - * - *
-     * The resource name of the sink to update.
-     * Example: `"projects/my-project-id/sinks/my-sink-id"`.
-     * The updated sink must be provided in the request and have the
-     * same name that is specified in `sinkName`.  If the sink does not
-     * exist, it is created.
-     * 
- */ - public Builder clearSinkName() { - - sinkName_ = getDefaultInstance().getSinkName(); - onChanged(); - return this; - } - /** - * optional string sink_name = 1; - * - *
-     * The resource name of the sink to update.
-     * Example: `"projects/my-project-id/sinks/my-sink-id"`.
-     * The updated sink must be provided in the request and have the
-     * same name that is specified in `sinkName`.  If the sink does not
-     * exist, it is created.
-     * 
- */ - public Builder setSinkNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - sinkName_ = value; - onChanged(); - return this; - } - - private com.google.logging.v2.LogSink sink_ = null; - private com.google.protobuf.SingleFieldBuilder< - com.google.logging.v2.LogSink, com.google.logging.v2.LogSink.Builder, com.google.logging.v2.LogSinkOrBuilder> sinkBuilder_; - /** - * optional .google.logging.v2.LogSink sink = 2; - * - *
-     * The updated sink, whose name must be the same as the sink
-     * identifier in `sinkName`.  If `sinkName` does not exist, then
-     * this method creates a new sink.
-     * 
- */ - public boolean hasSink() { - return sinkBuilder_ != null || sink_ != null; - } - /** - * optional .google.logging.v2.LogSink sink = 2; - * - *
-     * The updated sink, whose name must be the same as the sink
-     * identifier in `sinkName`.  If `sinkName` does not exist, then
-     * this method creates a new sink.
-     * 
- */ - public com.google.logging.v2.LogSink getSink() { - if (sinkBuilder_ == null) { - return sink_ == null ? com.google.logging.v2.LogSink.getDefaultInstance() : sink_; - } else { - return sinkBuilder_.getMessage(); - } - } - /** - * optional .google.logging.v2.LogSink sink = 2; - * - *
-     * The updated sink, whose name must be the same as the sink
-     * identifier in `sinkName`.  If `sinkName` does not exist, then
-     * this method creates a new sink.
-     * 
- */ - public Builder setSink(com.google.logging.v2.LogSink value) { - if (sinkBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - sink_ = value; - onChanged(); - } else { - sinkBuilder_.setMessage(value); - } - - return this; - } - /** - * optional .google.logging.v2.LogSink sink = 2; - * - *
-     * The updated sink, whose name must be the same as the sink
-     * identifier in `sinkName`.  If `sinkName` does not exist, then
-     * this method creates a new sink.
-     * 
- */ - public Builder setSink( - com.google.logging.v2.LogSink.Builder builderForValue) { - if (sinkBuilder_ == null) { - sink_ = builderForValue.build(); - onChanged(); - } else { - sinkBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * optional .google.logging.v2.LogSink sink = 2; - * - *
-     * The updated sink, whose name must be the same as the sink
-     * identifier in `sinkName`.  If `sinkName` does not exist, then
-     * this method creates a new sink.
-     * 
- */ - public Builder mergeSink(com.google.logging.v2.LogSink value) { - if (sinkBuilder_ == null) { - if (sink_ != null) { - sink_ = - com.google.logging.v2.LogSink.newBuilder(sink_).mergeFrom(value).buildPartial(); - } else { - sink_ = value; - } - onChanged(); - } else { - sinkBuilder_.mergeFrom(value); - } - - return this; - } - /** - * optional .google.logging.v2.LogSink sink = 2; - * - *
-     * The updated sink, whose name must be the same as the sink
-     * identifier in `sinkName`.  If `sinkName` does not exist, then
-     * this method creates a new sink.
-     * 
- */ - public Builder clearSink() { - if (sinkBuilder_ == null) { - sink_ = null; - onChanged(); - } else { - sink_ = null; - sinkBuilder_ = null; - } - - return this; - } - /** - * optional .google.logging.v2.LogSink sink = 2; - * - *
-     * The updated sink, whose name must be the same as the sink
-     * identifier in `sinkName`.  If `sinkName` does not exist, then
-     * this method creates a new sink.
-     * 
- */ - public com.google.logging.v2.LogSink.Builder getSinkBuilder() { - - onChanged(); - return getSinkFieldBuilder().getBuilder(); - } - /** - * optional .google.logging.v2.LogSink sink = 2; - * - *
-     * The updated sink, whose name must be the same as the sink
-     * identifier in `sinkName`.  If `sinkName` does not exist, then
-     * this method creates a new sink.
-     * 
- */ - public com.google.logging.v2.LogSinkOrBuilder getSinkOrBuilder() { - if (sinkBuilder_ != null) { - return sinkBuilder_.getMessageOrBuilder(); - } else { - return sink_ == null ? - com.google.logging.v2.LogSink.getDefaultInstance() : sink_; - } - } - /** - * optional .google.logging.v2.LogSink sink = 2; - * - *
-     * The updated sink, whose name must be the same as the sink
-     * identifier in `sinkName`.  If `sinkName` does not exist, then
-     * this method creates a new sink.
-     * 
- */ - private com.google.protobuf.SingleFieldBuilder< - com.google.logging.v2.LogSink, com.google.logging.v2.LogSink.Builder, com.google.logging.v2.LogSinkOrBuilder> - getSinkFieldBuilder() { - if (sinkBuilder_ == null) { - sinkBuilder_ = new com.google.protobuf.SingleFieldBuilder< - com.google.logging.v2.LogSink, com.google.logging.v2.LogSink.Builder, com.google.logging.v2.LogSinkOrBuilder>( - getSink(), - getParentForChildren(), - isClean()); - sink_ = null; - } - return sinkBuilder_; - } - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - - // @@protoc_insertion_point(builder_scope:google.logging.v2.UpdateSinkRequest) - } - - // @@protoc_insertion_point(class_scope:google.logging.v2.UpdateSinkRequest) - private static final com.google.logging.v2.UpdateSinkRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.logging.v2.UpdateSinkRequest(); - } - - public static com.google.logging.v2.UpdateSinkRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - public UpdateSinkRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - try { - return new UpdateSinkRequest(input, extensionRegistry); - } catch (RuntimeException e) { - if (e.getCause() instanceof - com.google.protobuf.InvalidProtocolBufferException) { - throw (com.google.protobuf.InvalidProtocolBufferException) - e.getCause(); - } - throw e; - } - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public com.google.logging.v2.UpdateSinkRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/UpdateSinkRequestOrBuilder.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/UpdateSinkRequestOrBuilder.java deleted file mode 100644 index 665ec44341f9..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/UpdateSinkRequestOrBuilder.java +++ /dev/null @@ -1,66 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/logging/v2/logging_config.proto - -package com.google.logging.v2; - -public interface UpdateSinkRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.logging.v2.UpdateSinkRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * optional string sink_name = 1; - * - *
-   * The resource name of the sink to update.
-   * Example: `"projects/my-project-id/sinks/my-sink-id"`.
-   * The updated sink must be provided in the request and have the
-   * same name that is specified in `sinkName`.  If the sink does not
-   * exist, it is created.
-   * 
- */ - java.lang.String getSinkName(); - /** - * optional string sink_name = 1; - * - *
-   * The resource name of the sink to update.
-   * Example: `"projects/my-project-id/sinks/my-sink-id"`.
-   * The updated sink must be provided in the request and have the
-   * same name that is specified in `sinkName`.  If the sink does not
-   * exist, it is created.
-   * 
- */ - com.google.protobuf.ByteString - getSinkNameBytes(); - - /** - * optional .google.logging.v2.LogSink sink = 2; - * - *
-   * The updated sink, whose name must be the same as the sink
-   * identifier in `sinkName`.  If `sinkName` does not exist, then
-   * this method creates a new sink.
-   * 
- */ - boolean hasSink(); - /** - * optional .google.logging.v2.LogSink sink = 2; - * - *
-   * The updated sink, whose name must be the same as the sink
-   * identifier in `sinkName`.  If `sinkName` does not exist, then
-   * this method creates a new sink.
-   * 
- */ - com.google.logging.v2.LogSink getSink(); - /** - * optional .google.logging.v2.LogSink sink = 2; - * - *
-   * The updated sink, whose name must be the same as the sink
-   * identifier in `sinkName`.  If `sinkName` does not exist, then
-   * this method creates a new sink.
-   * 
- */ - com.google.logging.v2.LogSinkOrBuilder getSinkOrBuilder(); -} diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/WriteLogEntriesRequest.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/WriteLogEntriesRequest.java deleted file mode 100644 index 15abf64119ce..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/WriteLogEntriesRequest.java +++ /dev/null @@ -1,1356 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/logging/v2/logging.proto - -package com.google.logging.v2; - -/** - * Protobuf type {@code google.logging.v2.WriteLogEntriesRequest} - * - *
- * The parameters to WriteLogEntries.
- * 
- */ -public final class WriteLogEntriesRequest extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:google.logging.v2.WriteLogEntriesRequest) - WriteLogEntriesRequestOrBuilder { - // Use WriteLogEntriesRequest.newBuilder() to construct. - private WriteLogEntriesRequest(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - private WriteLogEntriesRequest() { - logName_ = ""; - entries_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); - } - private WriteLogEntriesRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) { - this(); - int mutable_bitField0_ = 0; - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!input.skipField(tag)) { - done = true; - } - break; - } - case 10: { - String s = input.readStringRequireUtf8(); - - logName_ = s; - break; - } - case 18: { - com.google.api.MonitoredResource.Builder subBuilder = null; - if (resource_ != null) { - subBuilder = resource_.toBuilder(); - } - resource_ = input.readMessage(com.google.api.MonitoredResource.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(resource_); - resource_ = subBuilder.buildPartial(); - } - - break; - } - case 26: { - if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { - labels_ = com.google.protobuf.MapField.newMapField( - LabelsDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000004; - } - com.google.protobuf.MapEntry - labels = input.readMessage( - LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - labels_.getMutableMap().put(labels.getKey(), labels.getValue()); - break; - } - case 34: { - if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) { - entries_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000008; - } - entries_.add(input.readMessage(com.google.logging.v2.LogEntry.parser(), extensionRegistry)); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw new RuntimeException(e.setUnfinishedMessage(this)); - } catch (java.io.IOException e) { - throw new RuntimeException( - new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this)); - } finally { - if (((mutable_bitField0_ & 0x00000008) == 0x00000008)) { - entries_ = java.util.Collections.unmodifiableList(entries_); - } - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_WriteLogEntriesRequest_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 3: - return internalGetLabels(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_WriteLogEntriesRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.logging.v2.WriteLogEntriesRequest.class, com.google.logging.v2.WriteLogEntriesRequest.Builder.class); - } - - private int bitField0_; - public static final int LOG_NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object logName_; - /** - * optional string log_name = 1; - * - *
-   * Optional. A default log resource name for those log entries in `entries`
-   * that do not specify their own `logName`.  Example:
-   * `"projects/my-project/logs/syslog"`.  See
-   * [LogEntry][google.logging.v2.LogEntry].
-   * 
- */ - public java.lang.String getLogName() { - java.lang.Object ref = logName_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - logName_ = s; - return s; - } - } - /** - * optional string log_name = 1; - * - *
-   * Optional. A default log resource name for those log entries in `entries`
-   * that do not specify their own `logName`.  Example:
-   * `"projects/my-project/logs/syslog"`.  See
-   * [LogEntry][google.logging.v2.LogEntry].
-   * 
- */ - public com.google.protobuf.ByteString - getLogNameBytes() { - java.lang.Object ref = logName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - logName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int RESOURCE_FIELD_NUMBER = 2; - private com.google.api.MonitoredResource resource_; - /** - * optional .google.api.MonitoredResource resource = 2; - * - *
-   * Optional. A default monitored resource for those log entries in `entries`
-   * that do not specify their own `resource`.
-   * 
- */ - public boolean hasResource() { - return resource_ != null; - } - /** - * optional .google.api.MonitoredResource resource = 2; - * - *
-   * Optional. A default monitored resource for those log entries in `entries`
-   * that do not specify their own `resource`.
-   * 
- */ - public com.google.api.MonitoredResource getResource() { - return resource_ == null ? com.google.api.MonitoredResource.getDefaultInstance() : resource_; - } - /** - * optional .google.api.MonitoredResource resource = 2; - * - *
-   * Optional. A default monitored resource for those log entries in `entries`
-   * that do not specify their own `resource`.
-   * 
- */ - public com.google.api.MonitoredResourceOrBuilder getResourceOrBuilder() { - return getResource(); - } - - public static final int LABELS_FIELD_NUMBER = 3; - private static final class LabelsDefaultEntryHolder { - static final com.google.protobuf.MapEntry< - java.lang.String, java.lang.String> defaultEntry = - com.google.protobuf.MapEntry - .newDefaultInstance( - com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_WriteLogEntriesRequest_LabelsEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.STRING, - ""); - } - private com.google.protobuf.MapField< - java.lang.String, java.lang.String> labels_; - private com.google.protobuf.MapField - internalGetLabels() { - if (labels_ == null) { - return com.google.protobuf.MapField.emptyMapField( - LabelsDefaultEntryHolder.defaultEntry); - } - return labels_; - } - /** - * map<string, string> labels = 3; - * - *
-   * Optional. User-defined `key:value` items that are added to
-   * the `labels` field of each log entry in `entries`, except when a log
-   * entry specifies its own 'key:value' item with the same key.
-   * Example: `{ "size": "large", "color":"red" }`
-   * 
- */ - - public java.util.Map getLabels() { - return internalGetLabels().getMap(); - } - - public static final int ENTRIES_FIELD_NUMBER = 4; - private java.util.List entries_; - /** - * repeated .google.logging.v2.LogEntry entries = 4; - * - *
-   * Required. The log entries to write. The log entries must have values for
-   * all required fields.
-   * 
- */ - public java.util.List getEntriesList() { - return entries_; - } - /** - * repeated .google.logging.v2.LogEntry entries = 4; - * - *
-   * Required. The log entries to write. The log entries must have values for
-   * all required fields.
-   * 
- */ - public java.util.List - getEntriesOrBuilderList() { - return entries_; - } - /** - * repeated .google.logging.v2.LogEntry entries = 4; - * - *
-   * Required. The log entries to write. The log entries must have values for
-   * all required fields.
-   * 
- */ - public int getEntriesCount() { - return entries_.size(); - } - /** - * repeated .google.logging.v2.LogEntry entries = 4; - * - *
-   * Required. The log entries to write. The log entries must have values for
-   * all required fields.
-   * 
- */ - public com.google.logging.v2.LogEntry getEntries(int index) { - return entries_.get(index); - } - /** - * repeated .google.logging.v2.LogEntry entries = 4; - * - *
-   * Required. The log entries to write. The log entries must have values for
-   * all required fields.
-   * 
- */ - public com.google.logging.v2.LogEntryOrBuilder getEntriesOrBuilder( - int index) { - return entries_.get(index); - } - - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getLogNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessage.writeString(output, 1, logName_); - } - if (resource_ != null) { - output.writeMessage(2, getResource()); - } - for (java.util.Map.Entry entry - : internalGetLabels().getMap().entrySet()) { - com.google.protobuf.MapEntry - labels = LabelsDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - output.writeMessage(3, labels); - } - for (int i = 0; i < entries_.size(); i++) { - output.writeMessage(4, entries_.get(i)); - } - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getLogNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessage.computeStringSize(1, logName_); - } - if (resource_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getResource()); - } - for (java.util.Map.Entry entry - : internalGetLabels().getMap().entrySet()) { - com.google.protobuf.MapEntry - labels = LabelsDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, labels); - } - for (int i = 0; i < entries_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, entries_.get(i)); - } - memoizedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - public static com.google.logging.v2.WriteLogEntriesRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.logging.v2.WriteLogEntriesRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.logging.v2.WriteLogEntriesRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.logging.v2.WriteLogEntriesRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.logging.v2.WriteLogEntriesRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.google.logging.v2.WriteLogEntriesRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static com.google.logging.v2.WriteLogEntriesRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static com.google.logging.v2.WriteLogEntriesRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static com.google.logging.v2.WriteLogEntriesRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.google.logging.v2.WriteLogEntriesRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.logging.v2.WriteLogEntriesRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code google.logging.v2.WriteLogEntriesRequest} - * - *
-   * The parameters to WriteLogEntries.
-   * 
- */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:google.logging.v2.WriteLogEntriesRequest) - com.google.logging.v2.WriteLogEntriesRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_WriteLogEntriesRequest_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 3: - return internalGetLabels(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField( - int number) { - switch (number) { - case 3: - return internalGetMutableLabels(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_WriteLogEntriesRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.logging.v2.WriteLogEntriesRequest.class, com.google.logging.v2.WriteLogEntriesRequest.Builder.class); - } - - // Construct using com.google.logging.v2.WriteLogEntriesRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - getEntriesFieldBuilder(); - } - } - public Builder clear() { - super.clear(); - logName_ = ""; - - if (resourceBuilder_ == null) { - resource_ = null; - } else { - resource_ = null; - resourceBuilder_ = null; - } - internalGetMutableLabels().clear(); - if (entriesBuilder_ == null) { - entries_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); - } else { - entriesBuilder_.clear(); - } - return this; - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_WriteLogEntriesRequest_descriptor; - } - - public com.google.logging.v2.WriteLogEntriesRequest getDefaultInstanceForType() { - return com.google.logging.v2.WriteLogEntriesRequest.getDefaultInstance(); - } - - public com.google.logging.v2.WriteLogEntriesRequest build() { - com.google.logging.v2.WriteLogEntriesRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.google.logging.v2.WriteLogEntriesRequest buildPartial() { - com.google.logging.v2.WriteLogEntriesRequest result = new com.google.logging.v2.WriteLogEntriesRequest(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - result.logName_ = logName_; - if (resourceBuilder_ == null) { - result.resource_ = resource_; - } else { - result.resource_ = resourceBuilder_.build(); - } - result.labels_ = internalGetLabels(); - result.labels_.makeImmutable(); - if (entriesBuilder_ == null) { - if (((bitField0_ & 0x00000008) == 0x00000008)) { - entries_ = java.util.Collections.unmodifiableList(entries_); - bitField0_ = (bitField0_ & ~0x00000008); - } - result.entries_ = entries_; - } else { - result.entries_ = entriesBuilder_.build(); - } - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.logging.v2.WriteLogEntriesRequest) { - return mergeFrom((com.google.logging.v2.WriteLogEntriesRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.logging.v2.WriteLogEntriesRequest other) { - if (other == com.google.logging.v2.WriteLogEntriesRequest.getDefaultInstance()) return this; - if (!other.getLogName().isEmpty()) { - logName_ = other.logName_; - onChanged(); - } - if (other.hasResource()) { - mergeResource(other.getResource()); - } - internalGetMutableLabels().mergeFrom( - other.internalGetLabels()); - if (entriesBuilder_ == null) { - if (!other.entries_.isEmpty()) { - if (entries_.isEmpty()) { - entries_ = other.entries_; - bitField0_ = (bitField0_ & ~0x00000008); - } else { - ensureEntriesIsMutable(); - entries_.addAll(other.entries_); - } - onChanged(); - } - } else { - if (!other.entries_.isEmpty()) { - if (entriesBuilder_.isEmpty()) { - entriesBuilder_.dispose(); - entriesBuilder_ = null; - entries_ = other.entries_; - bitField0_ = (bitField0_ & ~0x00000008); - entriesBuilder_ = - com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? - getEntriesFieldBuilder() : null; - } else { - entriesBuilder_.addAllMessages(other.entries_); - } - } - } - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.logging.v2.WriteLogEntriesRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.logging.v2.WriteLogEntriesRequest) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object logName_ = ""; - /** - * optional string log_name = 1; - * - *
-     * Optional. A default log resource name for those log entries in `entries`
-     * that do not specify their own `logName`.  Example:
-     * `"projects/my-project/logs/syslog"`.  See
-     * [LogEntry][google.logging.v2.LogEntry].
-     * 
- */ - public java.lang.String getLogName() { - java.lang.Object ref = logName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - logName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string log_name = 1; - * - *
-     * Optional. A default log resource name for those log entries in `entries`
-     * that do not specify their own `logName`.  Example:
-     * `"projects/my-project/logs/syslog"`.  See
-     * [LogEntry][google.logging.v2.LogEntry].
-     * 
- */ - public com.google.protobuf.ByteString - getLogNameBytes() { - java.lang.Object ref = logName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - logName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string log_name = 1; - * - *
-     * Optional. A default log resource name for those log entries in `entries`
-     * that do not specify their own `logName`.  Example:
-     * `"projects/my-project/logs/syslog"`.  See
-     * [LogEntry][google.logging.v2.LogEntry].
-     * 
- */ - public Builder setLogName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - logName_ = value; - onChanged(); - return this; - } - /** - * optional string log_name = 1; - * - *
-     * Optional. A default log resource name for those log entries in `entries`
-     * that do not specify their own `logName`.  Example:
-     * `"projects/my-project/logs/syslog"`.  See
-     * [LogEntry][google.logging.v2.LogEntry].
-     * 
- */ - public Builder clearLogName() { - - logName_ = getDefaultInstance().getLogName(); - onChanged(); - return this; - } - /** - * optional string log_name = 1; - * - *
-     * Optional. A default log resource name for those log entries in `entries`
-     * that do not specify their own `logName`.  Example:
-     * `"projects/my-project/logs/syslog"`.  See
-     * [LogEntry][google.logging.v2.LogEntry].
-     * 
- */ - public Builder setLogNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - logName_ = value; - onChanged(); - return this; - } - - private com.google.api.MonitoredResource resource_ = null; - private com.google.protobuf.SingleFieldBuilder< - com.google.api.MonitoredResource, com.google.api.MonitoredResource.Builder, com.google.api.MonitoredResourceOrBuilder> resourceBuilder_; - /** - * optional .google.api.MonitoredResource resource = 2; - * - *
-     * Optional. A default monitored resource for those log entries in `entries`
-     * that do not specify their own `resource`.
-     * 
- */ - public boolean hasResource() { - return resourceBuilder_ != null || resource_ != null; - } - /** - * optional .google.api.MonitoredResource resource = 2; - * - *
-     * Optional. A default monitored resource for those log entries in `entries`
-     * that do not specify their own `resource`.
-     * 
- */ - public com.google.api.MonitoredResource getResource() { - if (resourceBuilder_ == null) { - return resource_ == null ? com.google.api.MonitoredResource.getDefaultInstance() : resource_; - } else { - return resourceBuilder_.getMessage(); - } - } - /** - * optional .google.api.MonitoredResource resource = 2; - * - *
-     * Optional. A default monitored resource for those log entries in `entries`
-     * that do not specify their own `resource`.
-     * 
- */ - public Builder setResource(com.google.api.MonitoredResource value) { - if (resourceBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - resource_ = value; - onChanged(); - } else { - resourceBuilder_.setMessage(value); - } - - return this; - } - /** - * optional .google.api.MonitoredResource resource = 2; - * - *
-     * Optional. A default monitored resource for those log entries in `entries`
-     * that do not specify their own `resource`.
-     * 
- */ - public Builder setResource( - com.google.api.MonitoredResource.Builder builderForValue) { - if (resourceBuilder_ == null) { - resource_ = builderForValue.build(); - onChanged(); - } else { - resourceBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * optional .google.api.MonitoredResource resource = 2; - * - *
-     * Optional. A default monitored resource for those log entries in `entries`
-     * that do not specify their own `resource`.
-     * 
- */ - public Builder mergeResource(com.google.api.MonitoredResource value) { - if (resourceBuilder_ == null) { - if (resource_ != null) { - resource_ = - com.google.api.MonitoredResource.newBuilder(resource_).mergeFrom(value).buildPartial(); - } else { - resource_ = value; - } - onChanged(); - } else { - resourceBuilder_.mergeFrom(value); - } - - return this; - } - /** - * optional .google.api.MonitoredResource resource = 2; - * - *
-     * Optional. A default monitored resource for those log entries in `entries`
-     * that do not specify their own `resource`.
-     * 
- */ - public Builder clearResource() { - if (resourceBuilder_ == null) { - resource_ = null; - onChanged(); - } else { - resource_ = null; - resourceBuilder_ = null; - } - - return this; - } - /** - * optional .google.api.MonitoredResource resource = 2; - * - *
-     * Optional. A default monitored resource for those log entries in `entries`
-     * that do not specify their own `resource`.
-     * 
- */ - public com.google.api.MonitoredResource.Builder getResourceBuilder() { - - onChanged(); - return getResourceFieldBuilder().getBuilder(); - } - /** - * optional .google.api.MonitoredResource resource = 2; - * - *
-     * Optional. A default monitored resource for those log entries in `entries`
-     * that do not specify their own `resource`.
-     * 
- */ - public com.google.api.MonitoredResourceOrBuilder getResourceOrBuilder() { - if (resourceBuilder_ != null) { - return resourceBuilder_.getMessageOrBuilder(); - } else { - return resource_ == null ? - com.google.api.MonitoredResource.getDefaultInstance() : resource_; - } - } - /** - * optional .google.api.MonitoredResource resource = 2; - * - *
-     * Optional. A default monitored resource for those log entries in `entries`
-     * that do not specify their own `resource`.
-     * 
- */ - private com.google.protobuf.SingleFieldBuilder< - com.google.api.MonitoredResource, com.google.api.MonitoredResource.Builder, com.google.api.MonitoredResourceOrBuilder> - getResourceFieldBuilder() { - if (resourceBuilder_ == null) { - resourceBuilder_ = new com.google.protobuf.SingleFieldBuilder< - com.google.api.MonitoredResource, com.google.api.MonitoredResource.Builder, com.google.api.MonitoredResourceOrBuilder>( - getResource(), - getParentForChildren(), - isClean()); - resource_ = null; - } - return resourceBuilder_; - } - - private com.google.protobuf.MapField< - java.lang.String, java.lang.String> labels_; - private com.google.protobuf.MapField - internalGetLabels() { - if (labels_ == null) { - return com.google.protobuf.MapField.emptyMapField( - LabelsDefaultEntryHolder.defaultEntry); - } - return labels_; - } - private com.google.protobuf.MapField - internalGetMutableLabels() { - onChanged();; - if (labels_ == null) { - labels_ = com.google.protobuf.MapField.newMapField( - LabelsDefaultEntryHolder.defaultEntry); - } - if (!labels_.isMutable()) { - labels_ = labels_.copy(); - } - return labels_; - } - /** - * map<string, string> labels = 3; - * - *
-     * Optional. User-defined `key:value` items that are added to
-     * the `labels` field of each log entry in `entries`, except when a log
-     * entry specifies its own 'key:value' item with the same key.
-     * Example: `{ "size": "large", "color":"red" }`
-     * 
- */ - public java.util.Map getLabels() { - return internalGetLabels().getMap(); - } - /** - * map<string, string> labels = 3; - * - *
-     * Optional. User-defined `key:value` items that are added to
-     * the `labels` field of each log entry in `entries`, except when a log
-     * entry specifies its own 'key:value' item with the same key.
-     * Example: `{ "size": "large", "color":"red" }`
-     * 
- */ - public java.util.Map - getMutableLabels() { - return internalGetMutableLabels().getMutableMap(); - } - /** - * map<string, string> labels = 3; - * - *
-     * Optional. User-defined `key:value` items that are added to
-     * the `labels` field of each log entry in `entries`, except when a log
-     * entry specifies its own 'key:value' item with the same key.
-     * Example: `{ "size": "large", "color":"red" }`
-     * 
- */ - public Builder putAllLabels( - java.util.Map values) { - getMutableLabels().putAll(values); - return this; - } - - private java.util.List entries_ = - java.util.Collections.emptyList(); - private void ensureEntriesIsMutable() { - if (!((bitField0_ & 0x00000008) == 0x00000008)) { - entries_ = new java.util.ArrayList(entries_); - bitField0_ |= 0x00000008; - } - } - - private com.google.protobuf.RepeatedFieldBuilder< - com.google.logging.v2.LogEntry, com.google.logging.v2.LogEntry.Builder, com.google.logging.v2.LogEntryOrBuilder> entriesBuilder_; - - /** - * repeated .google.logging.v2.LogEntry entries = 4; - * - *
-     * Required. The log entries to write. The log entries must have values for
-     * all required fields.
-     * 
- */ - public java.util.List getEntriesList() { - if (entriesBuilder_ == null) { - return java.util.Collections.unmodifiableList(entries_); - } else { - return entriesBuilder_.getMessageList(); - } - } - /** - * repeated .google.logging.v2.LogEntry entries = 4; - * - *
-     * Required. The log entries to write. The log entries must have values for
-     * all required fields.
-     * 
- */ - public int getEntriesCount() { - if (entriesBuilder_ == null) { - return entries_.size(); - } else { - return entriesBuilder_.getCount(); - } - } - /** - * repeated .google.logging.v2.LogEntry entries = 4; - * - *
-     * Required. The log entries to write. The log entries must have values for
-     * all required fields.
-     * 
- */ - public com.google.logging.v2.LogEntry getEntries(int index) { - if (entriesBuilder_ == null) { - return entries_.get(index); - } else { - return entriesBuilder_.getMessage(index); - } - } - /** - * repeated .google.logging.v2.LogEntry entries = 4; - * - *
-     * Required. The log entries to write. The log entries must have values for
-     * all required fields.
-     * 
- */ - public Builder setEntries( - int index, com.google.logging.v2.LogEntry value) { - if (entriesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEntriesIsMutable(); - entries_.set(index, value); - onChanged(); - } else { - entriesBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .google.logging.v2.LogEntry entries = 4; - * - *
-     * Required. The log entries to write. The log entries must have values for
-     * all required fields.
-     * 
- */ - public Builder setEntries( - int index, com.google.logging.v2.LogEntry.Builder builderForValue) { - if (entriesBuilder_ == null) { - ensureEntriesIsMutable(); - entries_.set(index, builderForValue.build()); - onChanged(); - } else { - entriesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .google.logging.v2.LogEntry entries = 4; - * - *
-     * Required. The log entries to write. The log entries must have values for
-     * all required fields.
-     * 
- */ - public Builder addEntries(com.google.logging.v2.LogEntry value) { - if (entriesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEntriesIsMutable(); - entries_.add(value); - onChanged(); - } else { - entriesBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .google.logging.v2.LogEntry entries = 4; - * - *
-     * Required. The log entries to write. The log entries must have values for
-     * all required fields.
-     * 
- */ - public Builder addEntries( - int index, com.google.logging.v2.LogEntry value) { - if (entriesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEntriesIsMutable(); - entries_.add(index, value); - onChanged(); - } else { - entriesBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .google.logging.v2.LogEntry entries = 4; - * - *
-     * Required. The log entries to write. The log entries must have values for
-     * all required fields.
-     * 
- */ - public Builder addEntries( - com.google.logging.v2.LogEntry.Builder builderForValue) { - if (entriesBuilder_ == null) { - ensureEntriesIsMutable(); - entries_.add(builderForValue.build()); - onChanged(); - } else { - entriesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .google.logging.v2.LogEntry entries = 4; - * - *
-     * Required. The log entries to write. The log entries must have values for
-     * all required fields.
-     * 
- */ - public Builder addEntries( - int index, com.google.logging.v2.LogEntry.Builder builderForValue) { - if (entriesBuilder_ == null) { - ensureEntriesIsMutable(); - entries_.add(index, builderForValue.build()); - onChanged(); - } else { - entriesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .google.logging.v2.LogEntry entries = 4; - * - *
-     * Required. The log entries to write. The log entries must have values for
-     * all required fields.
-     * 
- */ - public Builder addAllEntries( - java.lang.Iterable values) { - if (entriesBuilder_ == null) { - ensureEntriesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, entries_); - onChanged(); - } else { - entriesBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .google.logging.v2.LogEntry entries = 4; - * - *
-     * Required. The log entries to write. The log entries must have values for
-     * all required fields.
-     * 
- */ - public Builder clearEntries() { - if (entriesBuilder_ == null) { - entries_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); - onChanged(); - } else { - entriesBuilder_.clear(); - } - return this; - } - /** - * repeated .google.logging.v2.LogEntry entries = 4; - * - *
-     * Required. The log entries to write. The log entries must have values for
-     * all required fields.
-     * 
- */ - public Builder removeEntries(int index) { - if (entriesBuilder_ == null) { - ensureEntriesIsMutable(); - entries_.remove(index); - onChanged(); - } else { - entriesBuilder_.remove(index); - } - return this; - } - /** - * repeated .google.logging.v2.LogEntry entries = 4; - * - *
-     * Required. The log entries to write. The log entries must have values for
-     * all required fields.
-     * 
- */ - public com.google.logging.v2.LogEntry.Builder getEntriesBuilder( - int index) { - return getEntriesFieldBuilder().getBuilder(index); - } - /** - * repeated .google.logging.v2.LogEntry entries = 4; - * - *
-     * Required. The log entries to write. The log entries must have values for
-     * all required fields.
-     * 
- */ - public com.google.logging.v2.LogEntryOrBuilder getEntriesOrBuilder( - int index) { - if (entriesBuilder_ == null) { - return entries_.get(index); } else { - return entriesBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .google.logging.v2.LogEntry entries = 4; - * - *
-     * Required. The log entries to write. The log entries must have values for
-     * all required fields.
-     * 
- */ - public java.util.List - getEntriesOrBuilderList() { - if (entriesBuilder_ != null) { - return entriesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(entries_); - } - } - /** - * repeated .google.logging.v2.LogEntry entries = 4; - * - *
-     * Required. The log entries to write. The log entries must have values for
-     * all required fields.
-     * 
- */ - public com.google.logging.v2.LogEntry.Builder addEntriesBuilder() { - return getEntriesFieldBuilder().addBuilder( - com.google.logging.v2.LogEntry.getDefaultInstance()); - } - /** - * repeated .google.logging.v2.LogEntry entries = 4; - * - *
-     * Required. The log entries to write. The log entries must have values for
-     * all required fields.
-     * 
- */ - public com.google.logging.v2.LogEntry.Builder addEntriesBuilder( - int index) { - return getEntriesFieldBuilder().addBuilder( - index, com.google.logging.v2.LogEntry.getDefaultInstance()); - } - /** - * repeated .google.logging.v2.LogEntry entries = 4; - * - *
-     * Required. The log entries to write. The log entries must have values for
-     * all required fields.
-     * 
- */ - public java.util.List - getEntriesBuilderList() { - return getEntriesFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilder< - com.google.logging.v2.LogEntry, com.google.logging.v2.LogEntry.Builder, com.google.logging.v2.LogEntryOrBuilder> - getEntriesFieldBuilder() { - if (entriesBuilder_ == null) { - entriesBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< - com.google.logging.v2.LogEntry, com.google.logging.v2.LogEntry.Builder, com.google.logging.v2.LogEntryOrBuilder>( - entries_, - ((bitField0_ & 0x00000008) == 0x00000008), - getParentForChildren(), - isClean()); - entries_ = null; - } - return entriesBuilder_; - } - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - - // @@protoc_insertion_point(builder_scope:google.logging.v2.WriteLogEntriesRequest) - } - - // @@protoc_insertion_point(class_scope:google.logging.v2.WriteLogEntriesRequest) - private static final com.google.logging.v2.WriteLogEntriesRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.logging.v2.WriteLogEntriesRequest(); - } - - public static com.google.logging.v2.WriteLogEntriesRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - public WriteLogEntriesRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - try { - return new WriteLogEntriesRequest(input, extensionRegistry); - } catch (RuntimeException e) { - if (e.getCause() instanceof - com.google.protobuf.InvalidProtocolBufferException) { - throw (com.google.protobuf.InvalidProtocolBufferException) - e.getCause(); - } - throw e; - } - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public com.google.logging.v2.WriteLogEntriesRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/WriteLogEntriesRequestOrBuilder.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/WriteLogEntriesRequestOrBuilder.java deleted file mode 100644 index 015655a8c602..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/WriteLogEntriesRequestOrBuilder.java +++ /dev/null @@ -1,123 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/logging/v2/logging.proto - -package com.google.logging.v2; - -public interface WriteLogEntriesRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.logging.v2.WriteLogEntriesRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * optional string log_name = 1; - * - *
-   * Optional. A default log resource name for those log entries in `entries`
-   * that do not specify their own `logName`.  Example:
-   * `"projects/my-project/logs/syslog"`.  See
-   * [LogEntry][google.logging.v2.LogEntry].
-   * 
- */ - java.lang.String getLogName(); - /** - * optional string log_name = 1; - * - *
-   * Optional. A default log resource name for those log entries in `entries`
-   * that do not specify their own `logName`.  Example:
-   * `"projects/my-project/logs/syslog"`.  See
-   * [LogEntry][google.logging.v2.LogEntry].
-   * 
- */ - com.google.protobuf.ByteString - getLogNameBytes(); - - /** - * optional .google.api.MonitoredResource resource = 2; - * - *
-   * Optional. A default monitored resource for those log entries in `entries`
-   * that do not specify their own `resource`.
-   * 
- */ - boolean hasResource(); - /** - * optional .google.api.MonitoredResource resource = 2; - * - *
-   * Optional. A default monitored resource for those log entries in `entries`
-   * that do not specify their own `resource`.
-   * 
- */ - com.google.api.MonitoredResource getResource(); - /** - * optional .google.api.MonitoredResource resource = 2; - * - *
-   * Optional. A default monitored resource for those log entries in `entries`
-   * that do not specify their own `resource`.
-   * 
- */ - com.google.api.MonitoredResourceOrBuilder getResourceOrBuilder(); - - /** - * map<string, string> labels = 3; - * - *
-   * Optional. User-defined `key:value` items that are added to
-   * the `labels` field of each log entry in `entries`, except when a log
-   * entry specifies its own 'key:value' item with the same key.
-   * Example: `{ "size": "large", "color":"red" }`
-   * 
- */ - java.util.Map - getLabels(); - - /** - * repeated .google.logging.v2.LogEntry entries = 4; - * - *
-   * Required. The log entries to write. The log entries must have values for
-   * all required fields.
-   * 
- */ - java.util.List - getEntriesList(); - /** - * repeated .google.logging.v2.LogEntry entries = 4; - * - *
-   * Required. The log entries to write. The log entries must have values for
-   * all required fields.
-   * 
- */ - com.google.logging.v2.LogEntry getEntries(int index); - /** - * repeated .google.logging.v2.LogEntry entries = 4; - * - *
-   * Required. The log entries to write. The log entries must have values for
-   * all required fields.
-   * 
- */ - int getEntriesCount(); - /** - * repeated .google.logging.v2.LogEntry entries = 4; - * - *
-   * Required. The log entries to write. The log entries must have values for
-   * all required fields.
-   * 
- */ - java.util.List - getEntriesOrBuilderList(); - /** - * repeated .google.logging.v2.LogEntry entries = 4; - * - *
-   * Required. The log entries to write. The log entries must have values for
-   * all required fields.
-   * 
- */ - com.google.logging.v2.LogEntryOrBuilder getEntriesOrBuilder( - int index); -} diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/WriteLogEntriesResponse.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/WriteLogEntriesResponse.java deleted file mode 100644 index 7e587c2f085c..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/WriteLogEntriesResponse.java +++ /dev/null @@ -1,324 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/logging/v2/logging.proto - -package com.google.logging.v2; - -/** - * Protobuf type {@code google.logging.v2.WriteLogEntriesResponse} - * - *
- * Result returned from WriteLogEntries.
- * 
- */ -public final class WriteLogEntriesResponse extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:google.logging.v2.WriteLogEntriesResponse) - WriteLogEntriesResponseOrBuilder { - // Use WriteLogEntriesResponse.newBuilder() to construct. - private WriteLogEntriesResponse(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - private WriteLogEntriesResponse() { - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); - } - private WriteLogEntriesResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) { - this(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!input.skipField(tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw new RuntimeException(e.setUnfinishedMessage(this)); - } catch (java.io.IOException e) { - throw new RuntimeException( - new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this)); - } finally { - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_WriteLogEntriesResponse_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_WriteLogEntriesResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.logging.v2.WriteLogEntriesResponse.class, com.google.logging.v2.WriteLogEntriesResponse.Builder.class); - } - - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - memoizedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - public static com.google.logging.v2.WriteLogEntriesResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.logging.v2.WriteLogEntriesResponse parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.logging.v2.WriteLogEntriesResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.logging.v2.WriteLogEntriesResponse parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.logging.v2.WriteLogEntriesResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.google.logging.v2.WriteLogEntriesResponse parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static com.google.logging.v2.WriteLogEntriesResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static com.google.logging.v2.WriteLogEntriesResponse parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static com.google.logging.v2.WriteLogEntriesResponse parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static com.google.logging.v2.WriteLogEntriesResponse parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.logging.v2.WriteLogEntriesResponse prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code google.logging.v2.WriteLogEntriesResponse} - * - *
-   * Result returned from WriteLogEntries.
-   * 
- */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:google.logging.v2.WriteLogEntriesResponse) - com.google.logging.v2.WriteLogEntriesResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_WriteLogEntriesResponse_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_WriteLogEntriesResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.logging.v2.WriteLogEntriesResponse.class, com.google.logging.v2.WriteLogEntriesResponse.Builder.class); - } - - // Construct using com.google.logging.v2.WriteLogEntriesResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - public Builder clear() { - super.clear(); - return this; - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.logging.v2.LoggingProto.internal_static_google_logging_v2_WriteLogEntriesResponse_descriptor; - } - - public com.google.logging.v2.WriteLogEntriesResponse getDefaultInstanceForType() { - return com.google.logging.v2.WriteLogEntriesResponse.getDefaultInstance(); - } - - public com.google.logging.v2.WriteLogEntriesResponse build() { - com.google.logging.v2.WriteLogEntriesResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public com.google.logging.v2.WriteLogEntriesResponse buildPartial() { - com.google.logging.v2.WriteLogEntriesResponse result = new com.google.logging.v2.WriteLogEntriesResponse(this); - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.logging.v2.WriteLogEntriesResponse) { - return mergeFrom((com.google.logging.v2.WriteLogEntriesResponse)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.logging.v2.WriteLogEntriesResponse other) { - if (other == com.google.logging.v2.WriteLogEntriesResponse.getDefaultInstance()) return this; - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.logging.v2.WriteLogEntriesResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.logging.v2.WriteLogEntriesResponse) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - - // @@protoc_insertion_point(builder_scope:google.logging.v2.WriteLogEntriesResponse) - } - - // @@protoc_insertion_point(class_scope:google.logging.v2.WriteLogEntriesResponse) - private static final com.google.logging.v2.WriteLogEntriesResponse DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.logging.v2.WriteLogEntriesResponse(); - } - - public static com.google.logging.v2.WriteLogEntriesResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - public WriteLogEntriesResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - try { - return new WriteLogEntriesResponse(input, extensionRegistry); - } catch (RuntimeException e) { - if (e.getCause() instanceof - com.google.protobuf.InvalidProtocolBufferException) { - throw (com.google.protobuf.InvalidProtocolBufferException) - e.getCause(); - } - throw e; - } - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public com.google.logging.v2.WriteLogEntriesResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/WriteLogEntriesResponseOrBuilder.java b/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/WriteLogEntriesResponseOrBuilder.java deleted file mode 100644 index f034c806d8a3..000000000000 --- a/gcloud-java-logging/generated/src/main/java/com/google/logging/v2/WriteLogEntriesResponseOrBuilder.java +++ /dev/null @@ -1,9 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/logging/v2/logging.proto - -package com.google.logging.v2; - -public interface WriteLogEntriesResponseOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.logging.v2.WriteLogEntriesResponse) - com.google.protobuf.MessageOrBuilder { -} diff --git a/gcloud-java-logging/pom.xml b/gcloud-java-logging/pom.xml index f8ddd17e8083..745a2a2f394e 100644 --- a/gcloud-java-logging/pom.xml +++ b/gcloud-java-logging/pom.xml @@ -11,16 +11,31 @@ com.google.gcloud gcloud-java-pom - 0.0.11-SNAPSHOT + 0.1.4 gcloud-java-logging - ${project.groupId} - gcloud-java-gax - ${project.version} + com.google.api + gax + 0.0.4 + + + com.google.api.grpc + grpc-core-proto + 0.0.2 + + + com.google.api.grpc + grpc-logging-type + 0.0.1 + + + com.google.api.grpc + grpc-logging-v2 + 0.0.1 io.grpc diff --git a/gcloud-java-logging/src/main/java/com/google/gcloud/logging/spi/v2/ConfigServiceV2Api.java b/gcloud-java-logging/src/main/java/com/google/gcloud/logging/spi/v2/ConfigServiceV2Api.java index 51bbbc34f2a6..509c94ce1d97 100644 --- a/gcloud-java-logging/src/main/java/com/google/gcloud/logging/spi/v2/ConfigServiceV2Api.java +++ b/gcloud-java-logging/src/main/java/com/google/gcloud/logging/spi/v2/ConfigServiceV2Api.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Google Inc. All Rights Reserved. + * Copyright 2016 Google Inc. All Rights Reserved. * * 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 @@ -30,9 +30,11 @@ * * Happy editing! */ + package com.google.gcloud.logging.spi.v2; -import com.google.logging.v2.ConfigServiceV2Grpc; +import com.google.api.gax.grpc.ApiCallable; +import com.google.api.gax.protobuf.PathTemplate; import com.google.logging.v2.CreateSinkRequest; import com.google.logging.v2.DeleteSinkRequest; import com.google.logging.v2.GetSinkRequest; @@ -41,115 +43,126 @@ import com.google.logging.v2.LogSink; import com.google.logging.v2.UpdateSinkRequest; import com.google.protobuf.Empty; -import io.gapi.gax.grpc.ApiCallable; -import io.gapi.gax.grpc.PageDescriptor; -import io.gapi.gax.grpc.ServiceApiSettings; -import io.gapi.gax.internal.ApiUtils; -import io.gapi.gax.protobuf.PathTemplate; + import io.grpc.ManagedChannel; + +import java.io.Closeable; import java.io.IOException; +import java.util.ArrayList; +import java.util.List; // Manually-added imports: add custom (non-generated) imports after this point. - - // AUTO-GENERATED DOCUMENTATION AND SERVICE - see instructions at the top of the file for editing. /** - * See //google/logging/v2/logging.proto for documentation + * Service Description: See src/api/google/logging/v2/logging.proto for documentation * * * */ -@javax.annotation.Generated("by API code generation") +@javax.annotation.Generated("by GAPIC") public class ConfigServiceV2Api implements AutoCloseable { - // ========= - // Constants - // ========= - - /** - * The default address of the service. - * - * - * - */ - public static final String SERVICE_ADDRESS = "logging.googleapis.com"; - - /** - * The default port of the service. - * - * - * - */ - public static final int DEFAULT_SERVICE_PORT = 443; - - - private static final ApiCallable - LIST_SINKS = ApiCallable.create(ConfigServiceV2Grpc.METHOD_LIST_SINKS); - private static final ApiCallable - GET_SINK = ApiCallable.create(ConfigServiceV2Grpc.METHOD_GET_SINK); - private static final ApiCallable - CREATE_SINK = ApiCallable.create(ConfigServiceV2Grpc.METHOD_CREATE_SINK); - private static final ApiCallable - UPDATE_SINK = ApiCallable.create(ConfigServiceV2Grpc.METHOD_UPDATE_SINK); - private static final ApiCallable - DELETE_SINK = ApiCallable.create(ConfigServiceV2Grpc.METHOD_DELETE_SINK); - - private static PageDescriptor LIST_SINKS_PAGE_DESC = - new PageDescriptor() { - @Override - public Object emptyToken() { - return ""; - } - @Override - public ListSinksRequest injectToken( - ListSinksRequest payload, Object token) { - return ListSinksRequest - .newBuilder(payload) - .setPageToken((String) token) - .build(); - } - @Override - public Object extractNextToken(ListSinksResponse payload) { - return payload.getNextPageToken(); - } - @Override - public Iterable extractResources(ListSinksResponse payload) { - return payload.getSinksList(); - } - }; - - private static String ALL_SCOPES[] = { - "https://www.googleapis.com/auth/logging.read", - "https://www.googleapis.com/auth/logging.write", - "https://www.googleapis.com/auth/logging.admin" - }; - - /** - * A PathTemplate representing the fully-qualified path to represent - * a project_name resource. - * - * - * - */ - private static final PathTemplate PROJECT_NAME_PATH_TEMPLATE = - PathTemplate.create("/projects/{project}"); - /** - * A PathTemplate representing the fully-qualified path to represent - * a sink_name resource. - * - * - * - */ - private static final PathTemplate SINK_NAME_PATH_TEMPLATE = - PathTemplate.create("/projects/{project}/sinks/{sink}"); + public static class ResourceNames { + private ResourceNames() {} + + // ======================= + // ResourceNames Constants + // ======================= + + /** + * A PathTemplate representing the fully-qualified path to represent + * a project resource. + * + * + * + */ + private static final PathTemplate PROJECT_PATH_TEMPLATE = + PathTemplate.create("projects/{project}"); + + /** + * A PathTemplate representing the fully-qualified path to represent + * a sink resource. + * + * + * + */ + private static final PathTemplate SINK_PATH_TEMPLATE = + PathTemplate.create("projects/{project}/sinks/{sink}"); + + // ============================== + // Resource Name Helper Functions + // ============================== + + /** + * Formats a string containing the fully-qualified path to represent + * a project resource. + * + * + * + */ + public static final String formatProjectPath(String project) { + return PROJECT_PATH_TEMPLATE.instantiate("project", project); + } + + /** + * Formats a string containing the fully-qualified path to represent + * a sink resource. + * + * + * + */ + public static final String formatSinkPath(String project, String sink) { + return SINK_PATH_TEMPLATE.instantiate("project", project, "sink", sink); + } + + /** + * Parses the project from the given fully-qualified path which + * represents a project resource. + * + * + * + */ + public static final String parseProjectFromProjectPath(String projectPath) { + return PROJECT_PATH_TEMPLATE.parse(projectPath).get("project"); + } + + /** + * Parses the project from the given fully-qualified path which + * represents a sink resource. + * + * + * + */ + public static final String parseProjectFromSinkPath(String sinkPath) { + return SINK_PATH_TEMPLATE.parse(sinkPath).get("project"); + } + + /** + * Parses the sink from the given fully-qualified path which + * represents a sink resource. + * + * + * + */ + public static final String parseSinkFromSinkPath(String sinkPath) { + return SINK_PATH_TEMPLATE.parse(sinkPath).get("sink"); + } + } // ======== // Members // ======== private final ManagedChannel channel; - private final ServiceApiSettings settings; + private final List closeables = new ArrayList<>(); + + private final ApiCallable listSinksCallable; + private final ApiCallable> listSinksIterableCallable; + private final ApiCallable getSinkCallable; + private final ApiCallable createSinkCallable; + private final ApiCallable updateSinkCallable; + private final ApiCallable deleteSinkCallable; // =============== // Factory Methods @@ -162,97 +175,46 @@ public Iterable extractResources(ListSinksResponse payload) { * */ public static ConfigServiceV2Api create() throws IOException { - return create(new ServiceApiSettings()); + return create(ConfigServiceV2Settings.create()); } /** - * Constructs an instance of ConfigServiceV2Api, using the given settings. The channels are created based - * on the settings passed in, or defaults for any settings that are not set. + * Constructs an instance of ConfigServiceV2Api, using the given settings. The channels are + * created based on the settings passed in, or defaults for any settings that are not set. * * * */ - public static ConfigServiceV2Api create(ServiceApiSettings settings) throws IOException { + public static ConfigServiceV2Api create(ConfigServiceV2Settings settings) throws IOException { return new ConfigServiceV2Api(settings); } /** - * Constructs an instance of ConfigServiceV2Api, using the given settings. This is protected so that it - * easy to make a subclass, but otherwise, the static factory methods should be preferred. - * - * - * - */ - protected ConfigServiceV2Api(ServiceApiSettings settings) throws IOException { - ServiceApiSettings internalSettings = ApiUtils.populateSettings(settings, - SERVICE_ADDRESS, DEFAULT_SERVICE_PORT, ALL_SCOPES); - this.settings = internalSettings; - this.channel = internalSettings.getChannel(); - } - - // ============================== - // Resource Name Helper Functions - // ============================== - - /** - * Creates a string containing the fully-qualified path to represent - * a project_name resource. - * - * - * - */ - public static final String createProjectNamePath(String project) { - return PROJECT_NAME_PATH_TEMPLATE.instantiate( - "project", project); - } - - /** - * Creates a string containing the fully-qualified path to represent - * a sink_name resource. - * - * - * - */ - public static final String createSinkNamePath(String project, String sink) { - return SINK_NAME_PATH_TEMPLATE.instantiate( - "project", project,"sink", sink); - } - - - /** - * Extracts the project from the given fully-qualified path which - * represents a projectName resource. - * - * - * - */ - public static final String extractProjectFromProjectNamePath(String projectNamePath) { - return PROJECT_NAME_PATH_TEMPLATE.parse(projectNamePath).get("project"); - } - - /** - * Extracts the project from the given fully-qualified path which - * represents a sinkName resource. - * - * - * - */ - public static final String extractProjectFromSinkNamePath(String sinkNamePath) { - return SINK_NAME_PATH_TEMPLATE.parse(sinkNamePath).get("project"); - } - - /** - * Extracts the sink from the given fully-qualified path which - * represents a sinkName resource. + * Constructs an instance of ConfigServiceV2Api, using the given settings. This is protected so + * that it easy to make a subclass, but otherwise, the static factory methods should be preferred. * * * */ - public static final String extractSinkFromSinkNamePath(String sinkNamePath) { - return SINK_NAME_PATH_TEMPLATE.parse(sinkNamePath).get("sink"); + protected ConfigServiceV2Api(ConfigServiceV2Settings settings) throws IOException { + this.channel = settings.getChannel(); + + this.listSinksCallable = settings.listSinksMethod().build(settings); + this.listSinksIterableCallable = settings.listSinksMethod().buildPageStreaming(settings); + this.getSinkCallable = settings.getSinkMethod().build(settings); + this.createSinkCallable = settings.createSinkMethod().build(settings); + this.updateSinkCallable = settings.updateSinkMethod().build(settings); + this.deleteSinkCallable = settings.deleteSinkMethod().build(settings); + + closeables.add( + new Closeable() { + @Override + public void close() throws IOException { + channel.shutdown(); + } + }); } - // ============= // Service Calls // ============= @@ -267,10 +229,7 @@ public static final String extractSinkFromSinkNamePath(String sinkNamePath) { * */ public Iterable listSinks(String projectName) { - ListSinksRequest request = - ListSinksRequest.newBuilder() - .setProjectName(projectName) - .build(); + ListSinksRequest request = ListSinksRequest.newBuilder().setProjectName(projectName).build(); return listSinks(request); } @@ -284,8 +243,7 @@ public Iterable listSinks(String projectName) { * @param request The request object containing all of the parameters for the API call. */ public Iterable listSinks(ListSinksRequest request) { - return listSinksStreamingCallable() - .iterableResponseStreamCall(request); + return listSinksIterableCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD - see instructions at the top of the file for editing. @@ -295,8 +253,8 @@ public Iterable listSinks(ListSinksRequest request) { * * */ - public ApiCallable listSinksStreamingCallable() { - return listSinksCallable().pageStreaming(LIST_SINKS_PAGE_DESC); + public ApiCallable> listSinksIterableCallable() { + return listSinksIterableCallable; } // AUTO-GENERATED DOCUMENTATION AND METHOD - see instructions at the top of the file for editing. @@ -307,7 +265,7 @@ public ApiCallable listSinksStreamingCallable() { * */ public ApiCallable listSinksCallable() { - return ApiUtils.prepareIdempotentCallable(LIST_SINKS, settings).bind(channel); + return listSinksCallable; } // ----- getSink ----- @@ -323,10 +281,7 @@ public ApiCallable listSinksCallable() { * Example: `"projects/my-project-id/sinks/my-sink-id"`. */ public LogSink getSink(String sinkName) { - GetSinkRequest request = - GetSinkRequest.newBuilder() - .setSinkName(sinkName) - .build(); + GetSinkRequest request = GetSinkRequest.newBuilder().setSinkName(sinkName).build(); return getSink(request); } @@ -340,7 +295,7 @@ public LogSink getSink(String sinkName) { * * @param request The request object containing all of the parameters for the API call. */ - public LogSink getSink(GetSinkRequest request) { + private LogSink getSink(GetSinkRequest request) { return getSinkCallable().call(request); } @@ -352,7 +307,7 @@ public LogSink getSink(GetSinkRequest request) { * */ public ApiCallable getSinkCallable() { - return ApiUtils.prepareIdempotentCallable(GET_SINK, settings).bind(channel); + return getSinkCallable; } // ----- createSink ----- @@ -373,10 +328,7 @@ public ApiCallable getSinkCallable() { */ public LogSink createSink(String projectName, LogSink sink) { CreateSinkRequest request = - CreateSinkRequest.newBuilder() - .setProjectName(projectName) - .setSink(sink) - .build(); + CreateSinkRequest.newBuilder().setProjectName(projectName).setSink(sink).build(); return createSink(request); } @@ -402,7 +354,7 @@ public LogSink createSink(CreateSinkRequest request) { * */ public ApiCallable createSinkCallable() { - return CREATE_SINK.bind(channel); + return createSinkCallable; } // ----- updateSink ----- @@ -426,10 +378,7 @@ public ApiCallable createSinkCallable() { */ public LogSink updateSink(String sinkName, LogSink sink) { UpdateSinkRequest request = - UpdateSinkRequest.newBuilder() - .setSinkName(sinkName) - .setSink(sink) - .build(); + UpdateSinkRequest.newBuilder().setSinkName(sinkName).setSink(sink).build(); return updateSink(request); } @@ -455,7 +404,7 @@ public LogSink updateSink(UpdateSinkRequest request) { * */ public ApiCallable updateSinkCallable() { - return ApiUtils.prepareIdempotentCallable(UPDATE_SINK, settings).bind(channel); + return updateSinkCallable; } // ----- deleteSink ----- @@ -471,10 +420,7 @@ public ApiCallable updateSinkCallable() { * Example: `"projects/my-project-id/sinks/my-sink-id"`. */ public void deleteSink(String sinkName) { - DeleteSinkRequest request = - DeleteSinkRequest.newBuilder() - .setSinkName(sinkName) - .build(); + DeleteSinkRequest request = DeleteSinkRequest.newBuilder().setSinkName(sinkName).build(); deleteSink(request); } @@ -488,7 +434,7 @@ public void deleteSink(String sinkName) { * * @param request The request object containing all of the parameters for the API call. */ - public void deleteSink(DeleteSinkRequest request) { + private void deleteSink(DeleteSinkRequest request) { deleteSinkCallable().call(request); } @@ -500,10 +446,9 @@ public void deleteSink(DeleteSinkRequest request) { * */ public ApiCallable deleteSinkCallable() { - return ApiUtils.prepareIdempotentCallable(DELETE_SINK, settings).bind(channel); + return deleteSinkCallable; } - // ======== // Cleanup // ======== @@ -516,16 +461,12 @@ public ApiCallable deleteSinkCallable() { * */ @Override - public void close() { - // Manually-added shutdown code - - // Auto-generated shutdown code - channel.shutdown(); - - // Manually-added shutdown code + public void close() throws Exception { + for (AutoCloseable closeable : closeables) { + closeable.close(); + } } - // ======== // Manually-added methods: add custom (non-generated) methods after this point. // ======== diff --git a/gcloud-java-logging/src/main/java/com/google/gcloud/logging/spi/v2/ConfigServiceV2Settings.java b/gcloud-java-logging/src/main/java/com/google/gcloud/logging/spi/v2/ConfigServiceV2Settings.java new file mode 100644 index 000000000000..a8abc907f31e --- /dev/null +++ b/gcloud-java-logging/src/main/java/com/google/gcloud/logging/spi/v2/ConfigServiceV2Settings.java @@ -0,0 +1,290 @@ +/* + * Copyright 2016 Google Inc. All Rights Reserved. + * + * 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. + */ + +/* + * EDITING INSTRUCTIONS + * This file was generated from the file + * https://github.com/google/googleapis/blob/master/google/logging/v2/logging_config.proto + * and updates to that file get reflected here through a refresh process. + * For the short term, the refresh process will only be runnable by Google engineers. + * Manual additions are allowed because the refresh process performs + * a 3-way merge in order to preserve those manual additions. In order to not + * break the refresh process, only certain types of modifications are + * allowed. + * + * Allowed modifications - currently these are the only types allowed: + * 1. New methods (these should be added to the end of the class) + * 2. New imports + * 3. Additional documentation between "manual edit" demarcations + * + * Happy editing! + */ + +package com.google.gcloud.logging.spi.v2; + +import com.google.api.gax.core.BackoffParams; +import com.google.api.gax.core.ConnectionSettings; +import com.google.api.gax.core.RetryParams; +import com.google.api.gax.grpc.ApiCallSettings; +import com.google.api.gax.grpc.ApiCallable.ApiCallableBuilder; +import com.google.api.gax.grpc.ApiCallable.PageStreamingApiCallableBuilder; +import com.google.api.gax.grpc.PageDescriptor; +import com.google.api.gax.grpc.ServiceApiSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import com.google.logging.v2.ConfigServiceV2Grpc; +import com.google.logging.v2.CreateSinkRequest; +import com.google.logging.v2.DeleteSinkRequest; +import com.google.logging.v2.GetSinkRequest; +import com.google.logging.v2.ListSinksRequest; +import com.google.logging.v2.ListSinksResponse; +import com.google.logging.v2.LogSink; +import com.google.logging.v2.UpdateSinkRequest; +import com.google.protobuf.Empty; + +import io.grpc.Status; + +// Manually-added imports: add custom (non-generated) imports after this point. + +// AUTO-GENERATED DOCUMENTATION AND CLASS - see instructions at the top of the file for editing. +@javax.annotation.Generated("by GAPIC") +public class ConfigServiceV2Settings extends ServiceApiSettings { + + // ========= + // Constants + // ========= + + /** + * The default address of the service. + * + * + * + */ + public static final String DEFAULT_SERVICE_ADDRESS = "logging.googleapis.com"; + + /** + * The default port of the service. + * + * + * + */ + public static final int DEFAULT_SERVICE_PORT = 443; + + /** + * The default scopes of the service. + */ + public static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder() + .add("https://www.googleapis.com/auth/logging.write") + .add("https://www.googleapis.com/auth/logging.admin") + .add("https://www.googleapis.com/auth/logging.read") + .add("https://www.googleapis.com/auth/cloud-platform.read-only") + .add("https://www.googleapis.com/auth/cloud-platform") + .build(); + + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + Sets.immutableEnumSet( + Lists.newArrayList( + Status.Code.DEADLINE_EXCEEDED, Status.Code.UNAVAILABLE))); + definitions.put("non_idempotent", Sets.immutableEnumSet(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetryParams params = null; + params = + RetryParams.newBuilder() + .setRetryBackoff( + BackoffParams.newBuilder() + .setInitialDelayMillis(100L) + .setDelayMultiplier(1.2) + .setMaxDelayMillis(1000L) + .build()) + .setTimeoutBackoff( + BackoffParams.newBuilder() + .setInitialDelayMillis(300L) + .setDelayMultiplier(1.3) + .setMaxDelayMillis(3000L) + .build()) + .setTotalTimeout(30000L) + .build(); + definitions.put("default", params); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + private static class MethodBuilders { + private final PageStreamingApiCallableBuilder + listSinksMethod; + private final ApiCallableBuilder getSinkMethod; + private final ApiCallableBuilder createSinkMethod; + private final ApiCallableBuilder updateSinkMethod; + private final ApiCallableBuilder deleteSinkMethod; + private final ImmutableList allMethods; + + public MethodBuilders() { + listSinksMethod = + new PageStreamingApiCallableBuilder<>( + ConfigServiceV2Grpc.METHOD_LIST_SINKS, LIST_SINKS_PAGE_STR_DESC); + listSinksMethod.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")); + listSinksMethod.setRetryParams(RETRY_PARAM_DEFINITIONS.get("default")); + + getSinkMethod = new ApiCallableBuilder<>(ConfigServiceV2Grpc.METHOD_GET_SINK); + getSinkMethod.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")); + getSinkMethod.setRetryParams(RETRY_PARAM_DEFINITIONS.get("default")); + + createSinkMethod = new ApiCallableBuilder<>(ConfigServiceV2Grpc.METHOD_CREATE_SINK); + createSinkMethod.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")); + createSinkMethod.setRetryParams(RETRY_PARAM_DEFINITIONS.get("default")); + + updateSinkMethod = new ApiCallableBuilder<>(ConfigServiceV2Grpc.METHOD_UPDATE_SINK); + updateSinkMethod.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")); + updateSinkMethod.setRetryParams(RETRY_PARAM_DEFINITIONS.get("default")); + + deleteSinkMethod = new ApiCallableBuilder<>(ConfigServiceV2Grpc.METHOD_DELETE_SINK); + deleteSinkMethod.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")); + deleteSinkMethod.setRetryParams(RETRY_PARAM_DEFINITIONS.get("default")); + + allMethods = + ImmutableList.builder() + .add( + listSinksMethod, + getSinkMethod, + createSinkMethod, + updateSinkMethod, + deleteSinkMethod) + .build(); + } + } + + private final MethodBuilders methods; + + // =============== + // Factory Methods + // =============== + + /** + * Constructs an instance of ConfigServiceV2Settings with default settings. + * + * + * + */ + public static ConfigServiceV2Settings create() { + ConfigServiceV2Settings settings = new ConfigServiceV2Settings(new MethodBuilders()); + settings.provideChannelWith( + ConnectionSettings.builder() + .setServiceAddress(DEFAULT_SERVICE_ADDRESS) + .setPort(DEFAULT_SERVICE_PORT) + .provideCredentialsWith(DEFAULT_SERVICE_SCOPES) + .build()); + return settings; + } + + /** + * Constructs an instance of ConfigServiceV2Settings with default settings. This is protected so + * that it easy to make a subclass, but otherwise, the static factory methods should be preferred. + * + * + * + */ + protected ConfigServiceV2Settings(MethodBuilders methods) { + super(methods.allMethods); + this.methods = methods; + } + + /** + * Returns the PageStreamingApiCallableBuilder for the API method listSinks. + * + * + * + */ + public PageStreamingApiCallableBuilder + listSinksMethod() { + return methods.listSinksMethod; + } + + /** + * Returns the ApiCallableBuilder for the API method getSink. + * + * + * + */ + public ApiCallableBuilder getSinkMethod() { + return methods.getSinkMethod; + } + + /** + * Returns the ApiCallableBuilder for the API method createSink. + * + * + * + */ + public ApiCallableBuilder createSinkMethod() { + return methods.createSinkMethod; + } + + /** + * Returns the ApiCallableBuilder for the API method updateSink. + * + * + * + */ + public ApiCallableBuilder updateSinkMethod() { + return methods.updateSinkMethod; + } + + /** + * Returns the ApiCallableBuilder for the API method deleteSink. + * + * + * + */ + public ApiCallableBuilder deleteSinkMethod() { + return methods.deleteSinkMethod; + } + + private static PageDescriptor + LIST_SINKS_PAGE_STR_DESC = + new PageDescriptor() { + @Override + public Object emptyToken() { + return ""; + } + + @Override + public ListSinksRequest injectToken(ListSinksRequest payload, Object token) { + return ListSinksRequest.newBuilder(payload).setPageToken((String) token).build(); + } + + @Override + public Object extractNextToken(ListSinksResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListSinksResponse payload) { + return payload.getSinksList(); + } + }; +} diff --git a/gcloud-java-logging/src/main/java/com/google/gcloud/logging/spi/v2/LoggingServiceV2Api.java b/gcloud-java-logging/src/main/java/com/google/gcloud/logging/spi/v2/LoggingServiceV2Api.java index 86285b90bfdc..84fbfa124f95 100644 --- a/gcloud-java-logging/src/main/java/com/google/gcloud/logging/spi/v2/LoggingServiceV2Api.java +++ b/gcloud-java-logging/src/main/java/com/google/gcloud/logging/spi/v2/LoggingServiceV2Api.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Google Inc. All Rights Reserved. + * Copyright 2016 Google Inc. All Rights Reserved. * * 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 @@ -30,172 +30,122 @@ * * Happy editing! */ + package com.google.gcloud.logging.spi.v2; import com.google.api.MonitoredResource; import com.google.api.MonitoredResourceDescriptor; +import com.google.api.gax.grpc.ApiCallable; +import com.google.api.gax.protobuf.PathTemplate; import com.google.logging.v2.DeleteLogRequest; import com.google.logging.v2.ListLogEntriesRequest; import com.google.logging.v2.ListLogEntriesResponse; import com.google.logging.v2.ListMonitoredResourceDescriptorsRequest; import com.google.logging.v2.ListMonitoredResourceDescriptorsResponse; import com.google.logging.v2.LogEntry; -import com.google.logging.v2.LoggingServiceV2Grpc; import com.google.logging.v2.ReadLogEntriesRequest; import com.google.logging.v2.ReadLogEntriesResponse; import com.google.logging.v2.WriteLogEntriesRequest; import com.google.logging.v2.WriteLogEntriesResponse; import com.google.protobuf.Empty; -import io.gapi.gax.grpc.ApiCallable; -import io.gapi.gax.grpc.PageDescriptor; -import io.gapi.gax.grpc.ServiceApiSettings; -import io.gapi.gax.internal.ApiUtils; -import io.gapi.gax.protobuf.PathTemplate; + import io.grpc.ManagedChannel; + +import java.io.Closeable; import java.io.IOException; +import java.util.ArrayList; import java.util.List; import java.util.Map; // Manually-added imports: add custom (non-generated) imports after this point. - - // AUTO-GENERATED DOCUMENTATION AND SERVICE - see instructions at the top of the file for editing. /** - * Service for ingesting and querying logs. + * Service Description: Service for ingesting and querying logs. * * * */ -@javax.annotation.Generated("by API code generation") +@javax.annotation.Generated("by GAPIC") public class LoggingServiceV2Api implements AutoCloseable { - // ========= - // Constants - // ========= - - /** - * The default address of the service. - * - * - * - */ - public static final String SERVICE_ADDRESS = "logging.googleapis.com"; - - /** - * The default port of the service. - * - * - * - */ - public static final int DEFAULT_SERVICE_PORT = 443; - - - private static final ApiCallable - DELETE_LOG = ApiCallable.create(LoggingServiceV2Grpc.METHOD_DELETE_LOG); - private static final ApiCallable - WRITE_LOG_ENTRIES = ApiCallable.create(LoggingServiceV2Grpc.METHOD_WRITE_LOG_ENTRIES); - private static final ApiCallable - LIST_LOG_ENTRIES = ApiCallable.create(LoggingServiceV2Grpc.METHOD_LIST_LOG_ENTRIES); - private static final ApiCallable - READ_LOG_ENTRIES = ApiCallable.create(LoggingServiceV2Grpc.METHOD_READ_LOG_ENTRIES); - private static final ApiCallable - LIST_MONITORED_RESOURCE_DESCRIPTORS = ApiCallable.create(LoggingServiceV2Grpc.METHOD_LIST_MONITORED_RESOURCE_DESCRIPTORS); - - private static PageDescriptor LIST_LOG_ENTRIES_PAGE_DESC = - new PageDescriptor() { - @Override - public Object emptyToken() { - return ""; - } - @Override - public ListLogEntriesRequest injectToken( - ListLogEntriesRequest payload, Object token) { - return ListLogEntriesRequest - .newBuilder(payload) - .setPageToken((String) token) - .build(); - } - @Override - public Object extractNextToken(ListLogEntriesResponse payload) { - return payload.getNextPageToken(); - } - @Override - public Iterable extractResources(ListLogEntriesResponse payload) { - return payload.getEntriesList(); - } - }; - - private static PageDescriptor READ_LOG_ENTRIES_PAGE_DESC = - new PageDescriptor() { - @Override - public Object emptyToken() { - return ""; - } - @Override - public ReadLogEntriesRequest injectToken( - ReadLogEntriesRequest payload, Object token) { - return ReadLogEntriesRequest - .newBuilder(payload) - .setResumeToken((String) token) - .build(); - } - @Override - public Object extractNextToken(ReadLogEntriesResponse payload) { - return payload.getResumeToken(); - } - @Override - public Iterable extractResources(ReadLogEntriesResponse payload) { - return payload.getEntriesList(); - } - }; - - private static PageDescriptor LIST_MONITORED_RESOURCE_DESCRIPTORS_PAGE_DESC = - new PageDescriptor() { - @Override - public Object emptyToken() { - return ""; - } - @Override - public ListMonitoredResourceDescriptorsRequest injectToken( - ListMonitoredResourceDescriptorsRequest payload, Object token) { - return ListMonitoredResourceDescriptorsRequest - .newBuilder(payload) - .setPageToken((String) token) - .build(); - } - @Override - public Object extractNextToken(ListMonitoredResourceDescriptorsResponse payload) { - return payload.getNextPageToken(); - } - @Override - public Iterable extractResources(ListMonitoredResourceDescriptorsResponse payload) { - return payload.getResourceDescriptorsList(); - } - }; - - private static String ALL_SCOPES[] = { - "https://www.googleapis.com/auth/logging.read", - "https://www.googleapis.com/auth/logging.write", - "https://www.googleapis.com/auth/logging.admin" - }; - - /** - * A PathTemplate representing the fully-qualified path to represent - * a log_name resource. - * - * - * - */ - private static final PathTemplate LOG_NAME_PATH_TEMPLATE = - PathTemplate.create("/projects/{project}/logs/{log}"); + public static class ResourceNames { + private ResourceNames() {} + + // ======================= + // ResourceNames Constants + // ======================= + + /** + * A PathTemplate representing the fully-qualified path to represent + * a log resource. + * + * + * + */ + private static final PathTemplate LOG_PATH_TEMPLATE = + PathTemplate.create("projects/{project}/logs/{log}"); + + // ============================== + // Resource Name Helper Functions + // ============================== + + /** + * Formats a string containing the fully-qualified path to represent + * a log resource. + * + * + * + */ + public static final String formatLogPath(String project, String log) { + return LOG_PATH_TEMPLATE.instantiate("project", project, "log", log); + } + + /** + * Parses the project from the given fully-qualified path which + * represents a log resource. + * + * + * + */ + public static final String parseProjectFromLogPath(String logPath) { + return LOG_PATH_TEMPLATE.parse(logPath).get("project"); + } + + /** + * Parses the log from the given fully-qualified path which + * represents a log resource. + * + * + * + */ + public static final String parseLogFromLogPath(String logPath) { + return LOG_PATH_TEMPLATE.parse(logPath).get("log"); + } + } // ======== // Members // ======== private final ManagedChannel channel; - private final ServiceApiSettings settings; + private final List closeables = new ArrayList<>(); + + private final ApiCallable deleteLogCallable; + private final ApiCallable + writeLogEntriesCallable; + private final ApiCallable listLogEntriesCallable; + private final ApiCallable> + listLogEntriesIterableCallable; + private final ApiCallable readLogEntriesCallable; + private final ApiCallable> + readLogEntriesIterableCallable; + private final ApiCallable< + ListMonitoredResourceDescriptorsRequest, ListMonitoredResourceDescriptorsResponse> + listMonitoredResourceDescriptorsCallable; + private final ApiCallable< + ListMonitoredResourceDescriptorsRequest, Iterable> + listMonitoredResourceDescriptorsIterableCallable; // =============== // Factory Methods @@ -208,74 +158,52 @@ public Iterable extractResources(ListMonitoredResou * */ public static LoggingServiceV2Api create() throws IOException { - return create(new ServiceApiSettings()); + return create(LoggingServiceV2Settings.create()); } /** - * Constructs an instance of LoggingServiceV2Api, using the given settings. The channels are created based - * on the settings passed in, or defaults for any settings that are not set. + * Constructs an instance of LoggingServiceV2Api, using the given settings. The channels are + * created based on the settings passed in, or defaults for any settings that are not set. * * * */ - public static LoggingServiceV2Api create(ServiceApiSettings settings) throws IOException { + public static LoggingServiceV2Api create(LoggingServiceV2Settings settings) throws IOException { return new LoggingServiceV2Api(settings); } /** - * Constructs an instance of LoggingServiceV2Api, using the given settings. This is protected so that it - * easy to make a subclass, but otherwise, the static factory methods should be preferred. - * - * - * - */ - protected LoggingServiceV2Api(ServiceApiSettings settings) throws IOException { - ServiceApiSettings internalSettings = ApiUtils.populateSettings(settings, - SERVICE_ADDRESS, DEFAULT_SERVICE_PORT, ALL_SCOPES); - this.settings = internalSettings; - this.channel = internalSettings.getChannel(); - } - - // ============================== - // Resource Name Helper Functions - // ============================== - - /** - * Creates a string containing the fully-qualified path to represent - * a log_name resource. + * Constructs an instance of LoggingServiceV2Api, using the given settings. This is protected so + * that it easy to make a subclass, but otherwise, the static factory methods should be preferred. * * * */ - public static final String createLogNamePath(String project, String log) { - return LOG_NAME_PATH_TEMPLATE.instantiate( - "project", project,"log", log); + protected LoggingServiceV2Api(LoggingServiceV2Settings settings) throws IOException { + this.channel = settings.getChannel(); + + this.deleteLogCallable = settings.deleteLogMethod().build(settings); + this.writeLogEntriesCallable = settings.writeLogEntriesMethod().build(settings); + this.listLogEntriesCallable = settings.listLogEntriesMethod().build(settings); + this.listLogEntriesIterableCallable = + settings.listLogEntriesMethod().buildPageStreaming(settings); + this.readLogEntriesCallable = settings.readLogEntriesMethod().build(settings); + this.readLogEntriesIterableCallable = + settings.readLogEntriesMethod().buildPageStreaming(settings); + this.listMonitoredResourceDescriptorsCallable = + settings.listMonitoredResourceDescriptorsMethod().build(settings); + this.listMonitoredResourceDescriptorsIterableCallable = + settings.listMonitoredResourceDescriptorsMethod().buildPageStreaming(settings); + + closeables.add( + new Closeable() { + @Override + public void close() throws IOException { + channel.shutdown(); + } + }); } - - /** - * Extracts the project from the given fully-qualified path which - * represents a logName resource. - * - * - * - */ - public static final String extractProjectFromLogNamePath(String logNamePath) { - return LOG_NAME_PATH_TEMPLATE.parse(logNamePath).get("project"); - } - - /** - * Extracts the log from the given fully-qualified path which - * represents a logName resource. - * - * - * - */ - public static final String extractLogFromLogNamePath(String logNamePath) { - return LOG_NAME_PATH_TEMPLATE.parse(logNamePath).get("log"); - } - - // ============= // Service Calls // ============= @@ -294,10 +222,7 @@ public static final String extractLogFromLogNamePath(String logNamePath) { * `"projects/my-project/logs/syslog"`. */ public void deleteLog(String logName) { - DeleteLogRequest request = - DeleteLogRequest.newBuilder() - .setLogName(logName) - .build(); + DeleteLogRequest request = DeleteLogRequest.newBuilder().setLogName(logName).build(); deleteLog(request); } @@ -312,7 +237,7 @@ public void deleteLog(String logName) { * * @param request The request object containing all of the parameters for the API call. */ - public void deleteLog(DeleteLogRequest request) { + private void deleteLog(DeleteLogRequest request) { deleteLogCallable().call(request); } @@ -325,7 +250,7 @@ public void deleteLog(DeleteLogRequest request) { * */ public ApiCallable deleteLogCallable() { - return ApiUtils.prepareIdempotentCallable(DELETE_LOG, settings).bind(channel); + return deleteLogCallable; } // ----- writeLogEntries ----- @@ -351,14 +276,18 @@ public ApiCallable deleteLogCallable() { * @param entries Required. The log entries to write. The log entries must have values for * all required fields. */ - public WriteLogEntriesResponse writeLogEntries(String logName, MonitoredResource resource, Map labels, List entries) { + public WriteLogEntriesResponse writeLogEntries( + String logName, + MonitoredResource resource, + Map labels, + List entries) { WriteLogEntriesRequest request = WriteLogEntriesRequest.newBuilder() - .setLogName(logName) - .setResource(resource) - .putAllLabels(labels) - .addAllEntries(entries) - .build(); + .setLogName(logName) + .setResource(resource) + .putAllLabels(labels) + .addAllEntries(entries) + .build(); return writeLogEntries(request); } @@ -386,7 +315,7 @@ public WriteLogEntriesResponse writeLogEntries(WriteLogEntriesRequest request) { * */ public ApiCallable writeLogEntriesCallable() { - return WRITE_LOG_ENTRIES.bind(channel); + return writeLogEntriesCallable; } // ----- listLogEntries ----- @@ -404,10 +333,10 @@ public ApiCallable writeLogEntr public Iterable listLogEntries(List projectIds, String filter, String orderBy) { ListLogEntriesRequest request = ListLogEntriesRequest.newBuilder() - .addAllProjectIds(projectIds) - .setFilter(filter) - .setOrderBy(orderBy) - .build(); + .addAllProjectIds(projectIds) + .setFilter(filter) + .setOrderBy(orderBy) + .build(); return listLogEntries(request); } @@ -424,8 +353,7 @@ public Iterable listLogEntries(List projectIds, String filter, * @param request The request object containing all of the parameters for the API call. */ public Iterable listLogEntries(ListLogEntriesRequest request) { - return listLogEntriesStreamingCallable() - .iterableResponseStreamCall(request); + return listLogEntriesIterableCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD - see instructions at the top of the file for editing. @@ -438,8 +366,8 @@ public Iterable listLogEntries(ListLogEntriesRequest request) { * * */ - public ApiCallable listLogEntriesStreamingCallable() { - return listLogEntriesCallable().pageStreaming(LIST_LOG_ENTRIES_PAGE_DESC); + public ApiCallable> listLogEntriesIterableCallable() { + return listLogEntriesIterableCallable; } // AUTO-GENERATED DOCUMENTATION AND METHOD - see instructions at the top of the file for editing. @@ -453,7 +381,7 @@ public ApiCallable listLogEntriesStreamingCalla * */ public ApiCallable listLogEntriesCallable() { - return LIST_LOG_ENTRIES.bind(channel); + return listLogEntriesCallable; } // ----- readLogEntries ----- @@ -469,10 +397,10 @@ public ApiCallable listLogEntries public Iterable readLogEntries(List projectIds, String filter, String orderBy) { ReadLogEntriesRequest request = ReadLogEntriesRequest.newBuilder() - .addAllProjectIds(projectIds) - .setFilter(filter) - .setOrderBy(orderBy) - .build(); + .addAllProjectIds(projectIds) + .setFilter(filter) + .setOrderBy(orderBy) + .build(); return readLogEntries(request); } @@ -487,8 +415,7 @@ public Iterable readLogEntries(List projectIds, String filter, * @param request The request object containing all of the parameters for the API call. */ public Iterable readLogEntries(ReadLogEntriesRequest request) { - return readLogEntriesStreamingCallable() - .iterableResponseStreamCall(request); + return readLogEntriesIterableCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD - see instructions at the top of the file for editing. @@ -499,8 +426,8 @@ public Iterable readLogEntries(ReadLogEntriesRequest request) { * * */ - public ApiCallable readLogEntriesStreamingCallable() { - return readLogEntriesCallable().pageStreaming(READ_LOG_ENTRIES_PAGE_DESC); + public ApiCallable> readLogEntriesIterableCallable() { + return readLogEntriesIterableCallable; } // AUTO-GENERATED DOCUMENTATION AND METHOD - see instructions at the top of the file for editing. @@ -512,7 +439,7 @@ public ApiCallable readLogEntriesStreamingCalla * */ public ApiCallable readLogEntriesCallable() { - return READ_LOG_ENTRIES.bind(channel); + return readLogEntriesCallable; } // ----- listMonitoredResourceDescriptors ----- @@ -526,9 +453,9 @@ public ApiCallable readLogEntries * * @param request The request object containing all of the parameters for the API call. */ - public Iterable listMonitoredResourceDescriptors(ListMonitoredResourceDescriptorsRequest request) { - return listMonitoredResourceDescriptorsStreamingCallable() - .iterableResponseStreamCall(request); + public Iterable listMonitoredResourceDescriptors( + ListMonitoredResourceDescriptorsRequest request) { + return listMonitoredResourceDescriptorsIterableCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD - see instructions at the top of the file for editing. @@ -538,8 +465,9 @@ public Iterable listMonitoredResourceDescriptors(Li * * */ - public ApiCallable listMonitoredResourceDescriptorsStreamingCallable() { - return listMonitoredResourceDescriptorsCallable().pageStreaming(LIST_MONITORED_RESOURCE_DESCRIPTORS_PAGE_DESC); + public ApiCallable> + listMonitoredResourceDescriptorsIterableCallable() { + return listMonitoredResourceDescriptorsIterableCallable; } // AUTO-GENERATED DOCUMENTATION AND METHOD - see instructions at the top of the file for editing. @@ -549,11 +477,12 @@ public ApiCallable * */ - public ApiCallable listMonitoredResourceDescriptorsCallable() { - return ApiUtils.prepareIdempotentCallable(LIST_MONITORED_RESOURCE_DESCRIPTORS, settings).bind(channel); + public ApiCallable< + ListMonitoredResourceDescriptorsRequest, ListMonitoredResourceDescriptorsResponse> + listMonitoredResourceDescriptorsCallable() { + return listMonitoredResourceDescriptorsCallable; } - // ======== // Cleanup // ======== @@ -566,16 +495,12 @@ public ApiCallable */ @Override - public void close() { - // Manually-added shutdown code - - // Auto-generated shutdown code - channel.shutdown(); - - // Manually-added shutdown code + public void close() throws Exception { + for (AutoCloseable closeable : closeables) { + closeable.close(); + } } - // ======== // Manually-added methods: add custom (non-generated) methods after this point. // ======== diff --git a/gcloud-java-logging/src/main/java/com/google/gcloud/logging/spi/v2/LoggingServiceV2Settings.java b/gcloud-java-logging/src/main/java/com/google/gcloud/logging/spi/v2/LoggingServiceV2Settings.java new file mode 100644 index 000000000000..4ebf708598b8 --- /dev/null +++ b/gcloud-java-logging/src/main/java/com/google/gcloud/logging/spi/v2/LoggingServiceV2Settings.java @@ -0,0 +1,372 @@ +/* + * Copyright 2016 Google Inc. All Rights Reserved. + * + * 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. + */ + +/* + * EDITING INSTRUCTIONS + * This file was generated from the file + * https://github.com/google/googleapis/blob/master/google/logging/v2/logging.proto + * and updates to that file get reflected here through a refresh process. + * For the short term, the refresh process will only be runnable by Google engineers. + * Manual additions are allowed because the refresh process performs + * a 3-way merge in order to preserve those manual additions. In order to not + * break the refresh process, only certain types of modifications are + * allowed. + * + * Allowed modifications - currently these are the only types allowed: + * 1. New methods (these should be added to the end of the class) + * 2. New imports + * 3. Additional documentation between "manual edit" demarcations + * + * Happy editing! + */ + +package com.google.gcloud.logging.spi.v2; + +import com.google.api.MonitoredResourceDescriptor; +import com.google.api.gax.core.BackoffParams; +import com.google.api.gax.core.ConnectionSettings; +import com.google.api.gax.core.RetryParams; +import com.google.api.gax.grpc.ApiCallSettings; +import com.google.api.gax.grpc.ApiCallable.ApiCallableBuilder; +import com.google.api.gax.grpc.ApiCallable.PageStreamingApiCallableBuilder; +import com.google.api.gax.grpc.PageDescriptor; +import com.google.api.gax.grpc.ServiceApiSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import com.google.logging.v2.DeleteLogRequest; +import com.google.logging.v2.ListLogEntriesRequest; +import com.google.logging.v2.ListLogEntriesResponse; +import com.google.logging.v2.ListMonitoredResourceDescriptorsRequest; +import com.google.logging.v2.ListMonitoredResourceDescriptorsResponse; +import com.google.logging.v2.LogEntry; +import com.google.logging.v2.LoggingServiceV2Grpc; +import com.google.logging.v2.ReadLogEntriesRequest; +import com.google.logging.v2.ReadLogEntriesResponse; +import com.google.logging.v2.WriteLogEntriesRequest; +import com.google.logging.v2.WriteLogEntriesResponse; +import com.google.protobuf.Empty; + +import io.grpc.Status; + +// Manually-added imports: add custom (non-generated) imports after this point. + +// AUTO-GENERATED DOCUMENTATION AND CLASS - see instructions at the top of the file for editing. +@javax.annotation.Generated("by GAPIC") +public class LoggingServiceV2Settings extends ServiceApiSettings { + + // ========= + // Constants + // ========= + + /** + * The default address of the service. + * + * + * + */ + public static final String DEFAULT_SERVICE_ADDRESS = "logging.googleapis.com"; + + /** + * The default port of the service. + * + * + * + */ + public static final int DEFAULT_SERVICE_PORT = 443; + + /** + * The default scopes of the service. + */ + public static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder() + .add("https://www.googleapis.com/auth/logging.write") + .add("https://www.googleapis.com/auth/logging.admin") + .add("https://www.googleapis.com/auth/logging.read") + .add("https://www.googleapis.com/auth/cloud-platform.read-only") + .add("https://www.googleapis.com/auth/cloud-platform") + .build(); + + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + Sets.immutableEnumSet( + Lists.newArrayList( + Status.Code.DEADLINE_EXCEEDED, Status.Code.UNAVAILABLE))); + definitions.put("non_idempotent", Sets.immutableEnumSet(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetryParams params = null; + params = + RetryParams.newBuilder() + .setRetryBackoff( + BackoffParams.newBuilder() + .setInitialDelayMillis(100L) + .setDelayMultiplier(1.2) + .setMaxDelayMillis(1000L) + .build()) + .setTimeoutBackoff( + BackoffParams.newBuilder() + .setInitialDelayMillis(300L) + .setDelayMultiplier(1.3) + .setMaxDelayMillis(3000L) + .build()) + .setTotalTimeout(30000L) + .build(); + definitions.put("default", params); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + private static class MethodBuilders { + private final ApiCallableBuilder deleteLogMethod; + private final ApiCallableBuilder + writeLogEntriesMethod; + private final PageStreamingApiCallableBuilder< + ListLogEntriesRequest, ListLogEntriesResponse, LogEntry> + listLogEntriesMethod; + private final PageStreamingApiCallableBuilder< + ReadLogEntriesRequest, ReadLogEntriesResponse, LogEntry> + readLogEntriesMethod; + private final PageStreamingApiCallableBuilder< + ListMonitoredResourceDescriptorsRequest, ListMonitoredResourceDescriptorsResponse, + MonitoredResourceDescriptor> + listMonitoredResourceDescriptorsMethod; + private final ImmutableList allMethods; + + public MethodBuilders() { + deleteLogMethod = new ApiCallableBuilder<>(LoggingServiceV2Grpc.METHOD_DELETE_LOG); + deleteLogMethod.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")); + deleteLogMethod.setRetryParams(RETRY_PARAM_DEFINITIONS.get("default")); + + writeLogEntriesMethod = + new ApiCallableBuilder<>(LoggingServiceV2Grpc.METHOD_WRITE_LOG_ENTRIES); + writeLogEntriesMethod.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")); + writeLogEntriesMethod.setRetryParams(RETRY_PARAM_DEFINITIONS.get("default")); + + listLogEntriesMethod = + new PageStreamingApiCallableBuilder<>( + LoggingServiceV2Grpc.METHOD_LIST_LOG_ENTRIES, LIST_LOG_ENTRIES_PAGE_STR_DESC); + listLogEntriesMethod.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")); + listLogEntriesMethod.setRetryParams(RETRY_PARAM_DEFINITIONS.get("default")); + + readLogEntriesMethod = + new PageStreamingApiCallableBuilder<>( + LoggingServiceV2Grpc.METHOD_READ_LOG_ENTRIES, READ_LOG_ENTRIES_PAGE_STR_DESC); + readLogEntriesMethod.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")); + readLogEntriesMethod.setRetryParams(RETRY_PARAM_DEFINITIONS.get("default")); + + listMonitoredResourceDescriptorsMethod = + new PageStreamingApiCallableBuilder<>( + LoggingServiceV2Grpc.METHOD_LIST_MONITORED_RESOURCE_DESCRIPTORS, + LIST_MONITORED_RESOURCE_DESCRIPTORS_PAGE_STR_DESC); + listMonitoredResourceDescriptorsMethod.setRetryableCodes( + RETRYABLE_CODE_DEFINITIONS.get("idempotent")); + listMonitoredResourceDescriptorsMethod.setRetryParams(RETRY_PARAM_DEFINITIONS.get("default")); + + allMethods = + ImmutableList.builder() + .add( + deleteLogMethod, + writeLogEntriesMethod, + listLogEntriesMethod, + readLogEntriesMethod, + listMonitoredResourceDescriptorsMethod) + .build(); + } + } + + private final MethodBuilders methods; + + // =============== + // Factory Methods + // =============== + + /** + * Constructs an instance of LoggingServiceV2Settings with default settings. + * + * + * + */ + public static LoggingServiceV2Settings create() { + LoggingServiceV2Settings settings = new LoggingServiceV2Settings(new MethodBuilders()); + settings.provideChannelWith( + ConnectionSettings.builder() + .setServiceAddress(DEFAULT_SERVICE_ADDRESS) + .setPort(DEFAULT_SERVICE_PORT) + .provideCredentialsWith(DEFAULT_SERVICE_SCOPES) + .build()); + return settings; + } + + /** + * Constructs an instance of LoggingServiceV2Settings with default settings. This is protected so + * that it easy to make a subclass, but otherwise, the static factory methods should be preferred. + * + * + * + */ + protected LoggingServiceV2Settings(MethodBuilders methods) { + super(methods.allMethods); + this.methods = methods; + } + + /** + * Returns the ApiCallableBuilder for the API method deleteLog. + * + * + * + */ + public ApiCallableBuilder deleteLogMethod() { + return methods.deleteLogMethod; + } + + /** + * Returns the ApiCallableBuilder for the API method writeLogEntries. + * + * + * + */ + public ApiCallableBuilder + writeLogEntriesMethod() { + return methods.writeLogEntriesMethod; + } + + /** + * Returns the PageStreamingApiCallableBuilder for the API method listLogEntries. + * + * + * + */ + public PageStreamingApiCallableBuilder + listLogEntriesMethod() { + return methods.listLogEntriesMethod; + } + + /** + * Returns the PageStreamingApiCallableBuilder for the API method readLogEntries. + * + * + * + */ + public PageStreamingApiCallableBuilder + readLogEntriesMethod() { + return methods.readLogEntriesMethod; + } + + /** + * Returns the PageStreamingApiCallableBuilder for the API method + * listMonitoredResourceDescriptors. + * + * + * + */ + public PageStreamingApiCallableBuilder< + ListMonitoredResourceDescriptorsRequest, ListMonitoredResourceDescriptorsResponse, + MonitoredResourceDescriptor> + listMonitoredResourceDescriptorsMethod() { + return methods.listMonitoredResourceDescriptorsMethod; + } + + private static PageDescriptor + LIST_LOG_ENTRIES_PAGE_STR_DESC = + new PageDescriptor() { + @Override + public Object emptyToken() { + return ""; + } + + @Override + public ListLogEntriesRequest injectToken(ListLogEntriesRequest payload, Object token) { + return ListLogEntriesRequest.newBuilder(payload).setPageToken((String) token).build(); + } + + @Override + public Object extractNextToken(ListLogEntriesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLogEntriesResponse payload) { + return payload.getEntriesList(); + } + }; + + private static PageDescriptor + READ_LOG_ENTRIES_PAGE_STR_DESC = + new PageDescriptor() { + @Override + public Object emptyToken() { + return ""; + } + + @Override + public ReadLogEntriesRequest injectToken(ReadLogEntriesRequest payload, Object token) { + return ReadLogEntriesRequest.newBuilder(payload) + .setResumeToken((String) token) + .build(); + } + + @Override + public Object extractNextToken(ReadLogEntriesResponse payload) { + return payload.getResumeToken(); + } + + @Override + public Iterable extractResources(ReadLogEntriesResponse payload) { + return payload.getEntriesList(); + } + }; + + private static PageDescriptor< + ListMonitoredResourceDescriptorsRequest, ListMonitoredResourceDescriptorsResponse, + MonitoredResourceDescriptor> + LIST_MONITORED_RESOURCE_DESCRIPTORS_PAGE_STR_DESC = + new PageDescriptor< + ListMonitoredResourceDescriptorsRequest, ListMonitoredResourceDescriptorsResponse, + MonitoredResourceDescriptor>() { + @Override + public Object emptyToken() { + return ""; + } + + @Override + public ListMonitoredResourceDescriptorsRequest injectToken( + ListMonitoredResourceDescriptorsRequest payload, Object token) { + return ListMonitoredResourceDescriptorsRequest.newBuilder(payload) + .setPageToken((String) token) + .build(); + } + + @Override + public Object extractNextToken(ListMonitoredResourceDescriptorsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + ListMonitoredResourceDescriptorsResponse payload) { + return payload.getResourceDescriptorsList(); + } + }; +} diff --git a/gcloud-java-logging/src/main/java/com/google/gcloud/logging/spi/v2/MetricsServiceV2Api.java b/gcloud-java-logging/src/main/java/com/google/gcloud/logging/spi/v2/MetricsServiceV2Api.java index 78d408550ffb..3ebddfc51fb6 100644 --- a/gcloud-java-logging/src/main/java/com/google/gcloud/logging/spi/v2/MetricsServiceV2Api.java +++ b/gcloud-java-logging/src/main/java/com/google/gcloud/logging/spi/v2/MetricsServiceV2Api.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Google Inc. All Rights Reserved. + * Copyright 2016 Google Inc. All Rights Reserved. * * 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 @@ -30,126 +30,140 @@ * * Happy editing! */ + package com.google.gcloud.logging.spi.v2; +import com.google.api.gax.grpc.ApiCallable; +import com.google.api.gax.protobuf.PathTemplate; import com.google.logging.v2.CreateLogMetricRequest; import com.google.logging.v2.DeleteLogMetricRequest; import com.google.logging.v2.GetLogMetricRequest; import com.google.logging.v2.ListLogMetricsRequest; import com.google.logging.v2.ListLogMetricsResponse; import com.google.logging.v2.LogMetric; -import com.google.logging.v2.MetricsServiceV2Grpc; import com.google.logging.v2.UpdateLogMetricRequest; import com.google.protobuf.Empty; -import io.gapi.gax.grpc.ApiCallable; -import io.gapi.gax.grpc.PageDescriptor; -import io.gapi.gax.grpc.ServiceApiSettings; -import io.gapi.gax.internal.ApiUtils; -import io.gapi.gax.protobuf.PathTemplate; + import io.grpc.ManagedChannel; + +import java.io.Closeable; import java.io.IOException; +import java.util.ArrayList; +import java.util.List; // Manually-added imports: add custom (non-generated) imports after this point. - - // AUTO-GENERATED DOCUMENTATION AND SERVICE - see instructions at the top of the file for editing. /** - * See //google/logging/v1/logging.proto for documentation + * Service Description: See src/api/google/logging/v1/logging.proto for documentation * * * */ -@javax.annotation.Generated("by API code generation") +@javax.annotation.Generated("by GAPIC") public class MetricsServiceV2Api implements AutoCloseable { - // ========= - // Constants - // ========= - - /** - * The default address of the service. - * - * - * - */ - public static final String SERVICE_ADDRESS = "logging.googleapis.com"; - - /** - * The default port of the service. - * - * - * - */ - public static final int DEFAULT_SERVICE_PORT = 443; - - - private static final ApiCallable - LIST_LOG_METRICS = ApiCallable.create(MetricsServiceV2Grpc.METHOD_LIST_LOG_METRICS); - private static final ApiCallable - GET_LOG_METRIC = ApiCallable.create(MetricsServiceV2Grpc.METHOD_GET_LOG_METRIC); - private static final ApiCallable - CREATE_LOG_METRIC = ApiCallable.create(MetricsServiceV2Grpc.METHOD_CREATE_LOG_METRIC); - private static final ApiCallable - UPDATE_LOG_METRIC = ApiCallable.create(MetricsServiceV2Grpc.METHOD_UPDATE_LOG_METRIC); - private static final ApiCallable - DELETE_LOG_METRIC = ApiCallable.create(MetricsServiceV2Grpc.METHOD_DELETE_LOG_METRIC); - - private static PageDescriptor LIST_LOG_METRICS_PAGE_DESC = - new PageDescriptor() { - @Override - public Object emptyToken() { - return ""; - } - @Override - public ListLogMetricsRequest injectToken( - ListLogMetricsRequest payload, Object token) { - return ListLogMetricsRequest - .newBuilder(payload) - .setPageToken((String) token) - .build(); - } - @Override - public Object extractNextToken(ListLogMetricsResponse payload) { - return payload.getNextPageToken(); - } - @Override - public Iterable extractResources(ListLogMetricsResponse payload) { - return payload.getMetricsList(); - } - }; - - private static String ALL_SCOPES[] = { - "https://www.googleapis.com/auth/logging.read", - "https://www.googleapis.com/auth/logging.write", - "https://www.googleapis.com/auth/logging.admin" - }; - - /** - * A PathTemplate representing the fully-qualified path to represent - * a project_name resource. - * - * - * - */ - private static final PathTemplate PROJECT_NAME_PATH_TEMPLATE = - PathTemplate.create("/projects/{project}"); - /** - * A PathTemplate representing the fully-qualified path to represent - * a metric_name resource. - * - * - * - */ - private static final PathTemplate METRIC_NAME_PATH_TEMPLATE = - PathTemplate.create("/projects/{project}/metrics/{metric}"); + public static class ResourceNames { + private ResourceNames() {} + + // ======================= + // ResourceNames Constants + // ======================= + + /** + * A PathTemplate representing the fully-qualified path to represent + * a project resource. + * + * + * + */ + private static final PathTemplate PROJECT_PATH_TEMPLATE = + PathTemplate.create("projects/{project}"); + + /** + * A PathTemplate representing the fully-qualified path to represent + * a metric resource. + * + * + * + */ + private static final PathTemplate METRIC_PATH_TEMPLATE = + PathTemplate.create("projects/{project}/metrics/{metric}"); + + // ============================== + // Resource Name Helper Functions + // ============================== + + /** + * Formats a string containing the fully-qualified path to represent + * a project resource. + * + * + * + */ + public static final String formatProjectPath(String project) { + return PROJECT_PATH_TEMPLATE.instantiate("project", project); + } + + /** + * Formats a string containing the fully-qualified path to represent + * a metric resource. + * + * + * + */ + public static final String formatMetricPath(String project, String metric) { + return METRIC_PATH_TEMPLATE.instantiate("project", project, "metric", metric); + } + + /** + * Parses the project from the given fully-qualified path which + * represents a project resource. + * + * + * + */ + public static final String parseProjectFromProjectPath(String projectPath) { + return PROJECT_PATH_TEMPLATE.parse(projectPath).get("project"); + } + + /** + * Parses the project from the given fully-qualified path which + * represents a metric resource. + * + * + * + */ + public static final String parseProjectFromMetricPath(String metricPath) { + return METRIC_PATH_TEMPLATE.parse(metricPath).get("project"); + } + + /** + * Parses the metric from the given fully-qualified path which + * represents a metric resource. + * + * + * + */ + public static final String parseMetricFromMetricPath(String metricPath) { + return METRIC_PATH_TEMPLATE.parse(metricPath).get("metric"); + } + } // ======== // Members // ======== private final ManagedChannel channel; - private final ServiceApiSettings settings; + private final List closeables = new ArrayList<>(); + + private final ApiCallable listLogMetricsCallable; + private final ApiCallable> + listLogMetricsIterableCallable; + private final ApiCallable getLogMetricCallable; + private final ApiCallable createLogMetricCallable; + private final ApiCallable updateLogMetricCallable; + private final ApiCallable deleteLogMetricCallable; // =============== // Factory Methods @@ -162,97 +176,47 @@ public Iterable extractResources(ListLogMetricsResponse payload) { * */ public static MetricsServiceV2Api create() throws IOException { - return create(new ServiceApiSettings()); + return create(MetricsServiceV2Settings.create()); } /** - * Constructs an instance of MetricsServiceV2Api, using the given settings. The channels are created based - * on the settings passed in, or defaults for any settings that are not set. + * Constructs an instance of MetricsServiceV2Api, using the given settings. The channels are + * created based on the settings passed in, or defaults for any settings that are not set. * * * */ - public static MetricsServiceV2Api create(ServiceApiSettings settings) throws IOException { + public static MetricsServiceV2Api create(MetricsServiceV2Settings settings) throws IOException { return new MetricsServiceV2Api(settings); } /** - * Constructs an instance of MetricsServiceV2Api, using the given settings. This is protected so that it - * easy to make a subclass, but otherwise, the static factory methods should be preferred. - * - * - * - */ - protected MetricsServiceV2Api(ServiceApiSettings settings) throws IOException { - ServiceApiSettings internalSettings = ApiUtils.populateSettings(settings, - SERVICE_ADDRESS, DEFAULT_SERVICE_PORT, ALL_SCOPES); - this.settings = internalSettings; - this.channel = internalSettings.getChannel(); - } - - // ============================== - // Resource Name Helper Functions - // ============================== - - /** - * Creates a string containing the fully-qualified path to represent - * a project_name resource. - * - * - * - */ - public static final String createProjectNamePath(String project) { - return PROJECT_NAME_PATH_TEMPLATE.instantiate( - "project", project); - } - - /** - * Creates a string containing the fully-qualified path to represent - * a metric_name resource. - * - * - * - */ - public static final String createMetricNamePath(String project, String metric) { - return METRIC_NAME_PATH_TEMPLATE.instantiate( - "project", project,"metric", metric); - } - - - /** - * Extracts the project from the given fully-qualified path which - * represents a projectName resource. - * - * - * - */ - public static final String extractProjectFromProjectNamePath(String projectNamePath) { - return PROJECT_NAME_PATH_TEMPLATE.parse(projectNamePath).get("project"); - } - - /** - * Extracts the project from the given fully-qualified path which - * represents a metricName resource. - * - * - * - */ - public static final String extractProjectFromMetricNamePath(String metricNamePath) { - return METRIC_NAME_PATH_TEMPLATE.parse(metricNamePath).get("project"); - } - - /** - * Extracts the metric from the given fully-qualified path which - * represents a metricName resource. + * Constructs an instance of MetricsServiceV2Api, using the given settings. This is protected so + * that it easy to make a subclass, but otherwise, the static factory methods should be preferred. * * * */ - public static final String extractMetricFromMetricNamePath(String metricNamePath) { - return METRIC_NAME_PATH_TEMPLATE.parse(metricNamePath).get("metric"); + protected MetricsServiceV2Api(MetricsServiceV2Settings settings) throws IOException { + this.channel = settings.getChannel(); + + this.listLogMetricsCallable = settings.listLogMetricsMethod().build(settings); + this.listLogMetricsIterableCallable = + settings.listLogMetricsMethod().buildPageStreaming(settings); + this.getLogMetricCallable = settings.getLogMetricMethod().build(settings); + this.createLogMetricCallable = settings.createLogMetricMethod().build(settings); + this.updateLogMetricCallable = settings.updateLogMetricMethod().build(settings); + this.deleteLogMetricCallable = settings.deleteLogMetricMethod().build(settings); + + closeables.add( + new Closeable() { + @Override + public void close() throws IOException { + channel.shutdown(); + } + }); } - // ============= // Service Calls // ============= @@ -268,9 +232,7 @@ public static final String extractMetricFromMetricNamePath(String metricNamePath */ public Iterable listLogMetrics(String projectName) { ListLogMetricsRequest request = - ListLogMetricsRequest.newBuilder() - .setProjectName(projectName) - .build(); + ListLogMetricsRequest.newBuilder().setProjectName(projectName).build(); return listLogMetrics(request); } @@ -284,8 +246,7 @@ public Iterable listLogMetrics(String projectName) { * @param request The request object containing all of the parameters for the API call. */ public Iterable listLogMetrics(ListLogMetricsRequest request) { - return listLogMetricsStreamingCallable() - .iterableResponseStreamCall(request); + return listLogMetricsIterableCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD - see instructions at the top of the file for editing. @@ -295,8 +256,8 @@ public Iterable listLogMetrics(ListLogMetricsRequest request) { * * */ - public ApiCallable listLogMetricsStreamingCallable() { - return listLogMetricsCallable().pageStreaming(LIST_LOG_METRICS_PAGE_DESC); + public ApiCallable> listLogMetricsIterableCallable() { + return listLogMetricsIterableCallable; } // AUTO-GENERATED DOCUMENTATION AND METHOD - see instructions at the top of the file for editing. @@ -307,7 +268,7 @@ public ApiCallable listLogMetricsStreamingCall * */ public ApiCallable listLogMetricsCallable() { - return ApiUtils.prepareIdempotentCallable(LIST_LOG_METRICS, settings).bind(channel); + return listLogMetricsCallable; } // ----- getLogMetric ----- @@ -324,9 +285,7 @@ public ApiCallable listLogMetrics */ public LogMetric getLogMetric(String metricName) { GetLogMetricRequest request = - GetLogMetricRequest.newBuilder() - .setMetricName(metricName) - .build(); + GetLogMetricRequest.newBuilder().setMetricName(metricName).build(); return getLogMetric(request); } @@ -340,7 +299,7 @@ public LogMetric getLogMetric(String metricName) { * * @param request The request object containing all of the parameters for the API call. */ - public LogMetric getLogMetric(GetLogMetricRequest request) { + private LogMetric getLogMetric(GetLogMetricRequest request) { return getLogMetricCallable().call(request); } @@ -352,7 +311,7 @@ public LogMetric getLogMetric(GetLogMetricRequest request) { * */ public ApiCallable getLogMetricCallable() { - return ApiUtils.prepareIdempotentCallable(GET_LOG_METRIC, settings).bind(channel); + return getLogMetricCallable; } // ----- createLogMetric ----- @@ -373,10 +332,7 @@ public ApiCallable getLogMetricCallable() { */ public LogMetric createLogMetric(String projectName, LogMetric metric) { CreateLogMetricRequest request = - CreateLogMetricRequest.newBuilder() - .setProjectName(projectName) - .setMetric(metric) - .build(); + CreateLogMetricRequest.newBuilder().setProjectName(projectName).setMetric(metric).build(); return createLogMetric(request); } @@ -402,7 +358,7 @@ public LogMetric createLogMetric(CreateLogMetricRequest request) { * */ public ApiCallable createLogMetricCallable() { - return CREATE_LOG_METRIC.bind(channel); + return createLogMetricCallable; } // ----- updateLogMetric ----- @@ -426,10 +382,7 @@ public ApiCallable createLogMetricCallable() */ public LogMetric updateLogMetric(String metricName, LogMetric metric) { UpdateLogMetricRequest request = - UpdateLogMetricRequest.newBuilder() - .setMetricName(metricName) - .setMetric(metric) - .build(); + UpdateLogMetricRequest.newBuilder().setMetricName(metricName).setMetric(metric).build(); return updateLogMetric(request); } @@ -455,7 +408,7 @@ public LogMetric updateLogMetric(UpdateLogMetricRequest request) { * */ public ApiCallable updateLogMetricCallable() { - return ApiUtils.prepareIdempotentCallable(UPDATE_LOG_METRIC, settings).bind(channel); + return updateLogMetricCallable; } // ----- deleteLogMetric ----- @@ -472,9 +425,7 @@ public ApiCallable updateLogMetricCallable() */ public void deleteLogMetric(String metricName) { DeleteLogMetricRequest request = - DeleteLogMetricRequest.newBuilder() - .setMetricName(metricName) - .build(); + DeleteLogMetricRequest.newBuilder().setMetricName(metricName).build(); deleteLogMetric(request); } @@ -488,7 +439,7 @@ public void deleteLogMetric(String metricName) { * * @param request The request object containing all of the parameters for the API call. */ - public void deleteLogMetric(DeleteLogMetricRequest request) { + private void deleteLogMetric(DeleteLogMetricRequest request) { deleteLogMetricCallable().call(request); } @@ -500,10 +451,9 @@ public void deleteLogMetric(DeleteLogMetricRequest request) { * */ public ApiCallable deleteLogMetricCallable() { - return ApiUtils.prepareIdempotentCallable(DELETE_LOG_METRIC, settings).bind(channel); + return deleteLogMetricCallable; } - // ======== // Cleanup // ======== @@ -516,16 +466,12 @@ public ApiCallable deleteLogMetricCallable() { * */ @Override - public void close() { - // Manually-added shutdown code - - // Auto-generated shutdown code - channel.shutdown(); - - // Manually-added shutdown code + public void close() throws Exception { + for (AutoCloseable closeable : closeables) { + closeable.close(); + } } - // ======== // Manually-added methods: add custom (non-generated) methods after this point. // ======== diff --git a/gcloud-java-logging/src/main/java/com/google/gcloud/logging/spi/v2/MetricsServiceV2Settings.java b/gcloud-java-logging/src/main/java/com/google/gcloud/logging/spi/v2/MetricsServiceV2Settings.java new file mode 100644 index 000000000000..804279ddfff0 --- /dev/null +++ b/gcloud-java-logging/src/main/java/com/google/gcloud/logging/spi/v2/MetricsServiceV2Settings.java @@ -0,0 +1,294 @@ +/* + * Copyright 2016 Google Inc. All Rights Reserved. + * + * 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. + */ + +/* + * EDITING INSTRUCTIONS + * This file was generated from the file + * https://github.com/google/googleapis/blob/master/google/logging/v2/logging_metrics.proto + * and updates to that file get reflected here through a refresh process. + * For the short term, the refresh process will only be runnable by Google engineers. + * Manual additions are allowed because the refresh process performs + * a 3-way merge in order to preserve those manual additions. In order to not + * break the refresh process, only certain types of modifications are + * allowed. + * + * Allowed modifications - currently these are the only types allowed: + * 1. New methods (these should be added to the end of the class) + * 2. New imports + * 3. Additional documentation between "manual edit" demarcations + * + * Happy editing! + */ + +package com.google.gcloud.logging.spi.v2; + +import com.google.api.gax.core.BackoffParams; +import com.google.api.gax.core.ConnectionSettings; +import com.google.api.gax.core.RetryParams; +import com.google.api.gax.grpc.ApiCallSettings; +import com.google.api.gax.grpc.ApiCallable.ApiCallableBuilder; +import com.google.api.gax.grpc.ApiCallable.PageStreamingApiCallableBuilder; +import com.google.api.gax.grpc.PageDescriptor; +import com.google.api.gax.grpc.ServiceApiSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import com.google.logging.v2.CreateLogMetricRequest; +import com.google.logging.v2.DeleteLogMetricRequest; +import com.google.logging.v2.GetLogMetricRequest; +import com.google.logging.v2.ListLogMetricsRequest; +import com.google.logging.v2.ListLogMetricsResponse; +import com.google.logging.v2.LogMetric; +import com.google.logging.v2.MetricsServiceV2Grpc; +import com.google.logging.v2.UpdateLogMetricRequest; +import com.google.protobuf.Empty; + +import io.grpc.Status; + +// Manually-added imports: add custom (non-generated) imports after this point. + +// AUTO-GENERATED DOCUMENTATION AND CLASS - see instructions at the top of the file for editing. +@javax.annotation.Generated("by GAPIC") +public class MetricsServiceV2Settings extends ServiceApiSettings { + + // ========= + // Constants + // ========= + + /** + * The default address of the service. + * + * + * + */ + public static final String DEFAULT_SERVICE_ADDRESS = "logging.googleapis.com"; + + /** + * The default port of the service. + * + * + * + */ + public static final int DEFAULT_SERVICE_PORT = 443; + + /** + * The default scopes of the service. + */ + public static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder() + .add("https://www.googleapis.com/auth/logging.write") + .add("https://www.googleapis.com/auth/logging.admin") + .add("https://www.googleapis.com/auth/logging.read") + .add("https://www.googleapis.com/auth/cloud-platform.read-only") + .add("https://www.googleapis.com/auth/cloud-platform") + .build(); + + private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = ImmutableMap.builder(); + definitions.put( + "idempotent", + Sets.immutableEnumSet( + Lists.newArrayList( + Status.Code.DEADLINE_EXCEEDED, Status.Code.UNAVAILABLE))); + definitions.put("non_idempotent", Sets.immutableEnumSet(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetryParams params = null; + params = + RetryParams.newBuilder() + .setRetryBackoff( + BackoffParams.newBuilder() + .setInitialDelayMillis(100L) + .setDelayMultiplier(1.2) + .setMaxDelayMillis(1000L) + .build()) + .setTimeoutBackoff( + BackoffParams.newBuilder() + .setInitialDelayMillis(300L) + .setDelayMultiplier(1.3) + .setMaxDelayMillis(3000L) + .build()) + .setTotalTimeout(30000L) + .build(); + definitions.put("default", params); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + private static class MethodBuilders { + private final PageStreamingApiCallableBuilder< + ListLogMetricsRequest, ListLogMetricsResponse, LogMetric> + listLogMetricsMethod; + private final ApiCallableBuilder getLogMetricMethod; + private final ApiCallableBuilder createLogMetricMethod; + private final ApiCallableBuilder updateLogMetricMethod; + private final ApiCallableBuilder deleteLogMetricMethod; + private final ImmutableList allMethods; + + public MethodBuilders() { + listLogMetricsMethod = + new PageStreamingApiCallableBuilder<>( + MetricsServiceV2Grpc.METHOD_LIST_LOG_METRICS, LIST_LOG_METRICS_PAGE_STR_DESC); + listLogMetricsMethod.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")); + listLogMetricsMethod.setRetryParams(RETRY_PARAM_DEFINITIONS.get("default")); + + getLogMetricMethod = new ApiCallableBuilder<>(MetricsServiceV2Grpc.METHOD_GET_LOG_METRIC); + getLogMetricMethod.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")); + getLogMetricMethod.setRetryParams(RETRY_PARAM_DEFINITIONS.get("default")); + + createLogMetricMethod = + new ApiCallableBuilder<>(MetricsServiceV2Grpc.METHOD_CREATE_LOG_METRIC); + createLogMetricMethod.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")); + createLogMetricMethod.setRetryParams(RETRY_PARAM_DEFINITIONS.get("default")); + + updateLogMetricMethod = + new ApiCallableBuilder<>(MetricsServiceV2Grpc.METHOD_UPDATE_LOG_METRIC); + updateLogMetricMethod.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")); + updateLogMetricMethod.setRetryParams(RETRY_PARAM_DEFINITIONS.get("default")); + + deleteLogMetricMethod = + new ApiCallableBuilder<>(MetricsServiceV2Grpc.METHOD_DELETE_LOG_METRIC); + deleteLogMetricMethod.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")); + deleteLogMetricMethod.setRetryParams(RETRY_PARAM_DEFINITIONS.get("default")); + + allMethods = + ImmutableList.builder() + .add( + listLogMetricsMethod, + getLogMetricMethod, + createLogMetricMethod, + updateLogMetricMethod, + deleteLogMetricMethod) + .build(); + } + } + + private final MethodBuilders methods; + + // =============== + // Factory Methods + // =============== + + /** + * Constructs an instance of MetricsServiceV2Settings with default settings. + * + * + * + */ + public static MetricsServiceV2Settings create() { + MetricsServiceV2Settings settings = new MetricsServiceV2Settings(new MethodBuilders()); + settings.provideChannelWith( + ConnectionSettings.builder() + .setServiceAddress(DEFAULT_SERVICE_ADDRESS) + .setPort(DEFAULT_SERVICE_PORT) + .provideCredentialsWith(DEFAULT_SERVICE_SCOPES) + .build()); + return settings; + } + + /** + * Constructs an instance of MetricsServiceV2Settings with default settings. This is protected so + * that it easy to make a subclass, but otherwise, the static factory methods should be preferred. + * + * + * + */ + protected MetricsServiceV2Settings(MethodBuilders methods) { + super(methods.allMethods); + this.methods = methods; + } + + /** + * Returns the PageStreamingApiCallableBuilder for the API method listLogMetrics. + * + * + * + */ + public PageStreamingApiCallableBuilder + listLogMetricsMethod() { + return methods.listLogMetricsMethod; + } + + /** + * Returns the ApiCallableBuilder for the API method getLogMetric. + * + * + * + */ + public ApiCallableBuilder getLogMetricMethod() { + return methods.getLogMetricMethod; + } + + /** + * Returns the ApiCallableBuilder for the API method createLogMetric. + * + * + * + */ + public ApiCallableBuilder createLogMetricMethod() { + return methods.createLogMetricMethod; + } + + /** + * Returns the ApiCallableBuilder for the API method updateLogMetric. + * + * + * + */ + public ApiCallableBuilder updateLogMetricMethod() { + return methods.updateLogMetricMethod; + } + + /** + * Returns the ApiCallableBuilder for the API method deleteLogMetric. + * + * + * + */ + public ApiCallableBuilder deleteLogMetricMethod() { + return methods.deleteLogMetricMethod; + } + + private static PageDescriptor + LIST_LOG_METRICS_PAGE_STR_DESC = + new PageDescriptor() { + @Override + public Object emptyToken() { + return ""; + } + + @Override + public ListLogMetricsRequest injectToken(ListLogMetricsRequest payload, Object token) { + return ListLogMetricsRequest.newBuilder(payload).setPageToken((String) token).build(); + } + + @Override + public Object extractNextToken(ListLogMetricsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLogMetricsResponse payload) { + return payload.getMetricsList(); + } + }; +} diff --git a/gcloud-java-logging/src/main/java/com/google/gcloud/logging/testing/LocalLoggingHelper.java b/gcloud-java-logging/src/main/java/com/google/gcloud/logging/spi/v2/testing/LocalLoggingHelper.java similarity index 76% rename from gcloud-java-logging/src/main/java/com/google/gcloud/logging/testing/LocalLoggingHelper.java rename to gcloud-java-logging/src/main/java/com/google/gcloud/logging/spi/v2/testing/LocalLoggingHelper.java index 4653112fed52..e7684b6742da 100644 --- a/gcloud-java-logging/src/main/java/com/google/gcloud/logging/testing/LocalLoggingHelper.java +++ b/gcloud-java-logging/src/main/java/com/google/gcloud/logging/spi/v2/testing/LocalLoggingHelper.java @@ -1,6 +1,19 @@ -package com.google.gcloud.logging.testing; +/* + * Copyright 2016 Google Inc. All Rights Reserved. + * + * 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. + */ + +package com.google.gcloud.logging.spi.v2.testing; -import com.google.gcloud.pubsub.spi.v2.testing.LocalLoggingImpl; import com.google.logging.v2.LoggingServiceV2Grpc; import io.grpc.ManagedChannel; diff --git a/gcloud-java-logging/src/main/java/com/google/gcloud/logging/spi/v2/testing/LocalLoggingImpl.java b/gcloud-java-logging/src/main/java/com/google/gcloud/logging/spi/v2/testing/LocalLoggingImpl.java index 3144389a5a09..8c8e18426253 100644 --- a/gcloud-java-logging/src/main/java/com/google/gcloud/logging/spi/v2/testing/LocalLoggingImpl.java +++ b/gcloud-java-logging/src/main/java/com/google/gcloud/logging/spi/v2/testing/LocalLoggingImpl.java @@ -1,4 +1,18 @@ -package com.google.gcloud.pubsub.spi.v2.testing; +/* + * Copyright 2016 Google Inc. All Rights Reserved. + * + * 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. + */ + +package com.google.gcloud.logging.spi.v2.testing; import com.google.logging.v2.DeleteLogRequest; import com.google.logging.v2.ListLogEntriesRequest; diff --git a/gcloud-java-logging/src/test/java/com/google/gcloud/logging/spi/v2/LoggingServiceV2ApiTest.java b/gcloud-java-logging/src/test/java/com/google/gcloud/logging/spi/v2/LoggingServiceV2ApiTest.java index fb55edc053b4..e290fe79dadc 100644 --- a/gcloud-java-logging/src/test/java/com/google/gcloud/logging/spi/v2/LoggingServiceV2ApiTest.java +++ b/gcloud-java-logging/src/test/java/com/google/gcloud/logging/spi/v2/LoggingServiceV2ApiTest.java @@ -16,16 +16,9 @@ import com.google.api.MonitoredResource; import com.google.common.collect.Iterables; -import com.google.gcloud.logging.testing.LocalLoggingHelper; +import com.google.gcloud.logging.spi.v2.testing.LocalLoggingHelper; import com.google.logging.v2.LogEntry; -import io.gapi.gax.grpc.ServiceApiSettings; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -33,6 +26,11 @@ import org.junit.BeforeClass; import org.junit.Test; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + public class LoggingServiceV2ApiTest { private static LocalLoggingHelper loggingHelper; private LoggingServiceV2Api loggingApi; @@ -51,19 +49,19 @@ public static void stopServer() { @Before public void setUp() throws IOException { loggingHelper.reset(); - ServiceApiSettings settings = new ServiceApiSettings(); - settings.setChannel(loggingHelper.createChannel()); + LoggingServiceV2Settings settings = LoggingServiceV2Settings.create(); + settings.provideChannelWith(loggingHelper.createChannel()); loggingApi = LoggingServiceV2Api.create(settings); } @After - public void tearDown() { + public void tearDown() throws Exception { loggingApi.close(); } @Test public void testWriteLog() { - String logName = LoggingServiceV2Api.createLogNamePath("my-project", "my-log"); + String logName = LoggingServiceV2Api.ResourceNames.formatLogPath("my-project", "my-log"); MonitoredResource resource = MonitoredResource.newBuilder().build(); List entries = new ArrayList<>(); entries.add(LogEntry.newBuilder().setLogName(logName).setTextPayload("foobar").build()); @@ -72,7 +70,7 @@ public void testWriteLog() { @Test public void testListLog() { - String logName = LoggingServiceV2Api.createLogNamePath("my-project", "my-log"); + String logName = LoggingServiceV2Api.ResourceNames.formatLogPath("my-project", "my-log"); MonitoredResource resource = MonitoredResource.newBuilder().build(); List entries = new ArrayList<>(); entries.add(LogEntry.newBuilder().setLogName(logName).setTextPayload("foobar").build()); @@ -92,7 +90,7 @@ public void testListNoLog() { @Test public void testDeleteLog() { - String logName = LoggingServiceV2Api.createLogNamePath("my-project", "my-log"); + String logName = LoggingServiceV2Api.ResourceNames.formatLogPath("my-project", "my-log"); MonitoredResource resource = MonitoredResource.newBuilder().build(); List entries = new ArrayList<>(); entries.add(LogEntry.newBuilder().setLogName(logName).setTextPayload("foobar").build());