diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/ConfigServiceV2Client.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/ConfigServiceV2Client.java new file mode 100644 index 000000000..d97f1d822 --- /dev/null +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/ConfigServiceV2Client.java @@ -0,0 +1,2436 @@ +/* + * Copyright 2020 Google LLC + * + * 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 + * + * https://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.cloud.logging.v2; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.logging.v2.stub.ConfigServiceV2Stub; +import com.google.cloud.logging.v2.stub.ConfigServiceV2StubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.logging.v2.BillingAccountName; +import com.google.logging.v2.CmekSettings; +import com.google.logging.v2.CreateExclusionRequest; +import com.google.logging.v2.CreateSinkRequest; +import com.google.logging.v2.DeleteExclusionRequest; +import com.google.logging.v2.DeleteSinkRequest; +import com.google.logging.v2.FolderName; +import com.google.logging.v2.GetBucketRequest; +import com.google.logging.v2.GetCmekSettingsRequest; +import com.google.logging.v2.GetExclusionRequest; +import com.google.logging.v2.GetSinkRequest; +import com.google.logging.v2.ListBucketsRequest; +import com.google.logging.v2.ListBucketsResponse; +import com.google.logging.v2.ListExclusionsRequest; +import com.google.logging.v2.ListExclusionsResponse; +import com.google.logging.v2.ListSinksRequest; +import com.google.logging.v2.ListSinksResponse; +import com.google.logging.v2.LogBucket; +import com.google.logging.v2.LogExclusion; +import com.google.logging.v2.LogExclusionName; +import com.google.logging.v2.LogSink; +import com.google.logging.v2.LogSinkName; +import com.google.logging.v2.OrganizationName; +import com.google.logging.v2.ProjectName; +import com.google.logging.v2.UpdateBucketRequest; +import com.google.logging.v2.UpdateCmekSettingsRequest; +import com.google.logging.v2.UpdateExclusionRequest; +import com.google.logging.v2.UpdateSinkRequest; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Service for configuring sinks used to route log entries. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+ *   LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]");
+ *   LogSink response = configServiceV2Client.getSink(sinkName);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the configServiceV2Client object to clean up resources + * such as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *

This class can be customized by passing in a custom instance of ConfigServiceV2Settings to + * create(). For example: + * + *

To customize credentials: + * + *

+ * 
+ * ConfigServiceV2Settings configServiceV2Settings =
+ *     ConfigServiceV2Settings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * ConfigServiceV2Client configServiceV2Client =
+ *     ConfigServiceV2Client.create(configServiceV2Settings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * ConfigServiceV2Settings configServiceV2Settings =
+ *     ConfigServiceV2Settings.newBuilder().setEndpoint(myEndpoint).build();
+ * ConfigServiceV2Client configServiceV2Client =
+ *     ConfigServiceV2Client.create(configServiceV2Settings);
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class ConfigServiceV2Client implements BackgroundResource { + private final ConfigServiceV2Settings settings; + private final ConfigServiceV2Stub stub; + + /** Constructs an instance of ConfigServiceV2Client with default settings. */ + public static final ConfigServiceV2Client create() throws IOException { + return create(ConfigServiceV2Settings.newBuilder().build()); + } + + /** + * Constructs an instance of ConfigServiceV2Client, 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 final ConfigServiceV2Client create(ConfigServiceV2Settings settings) + throws IOException { + return new ConfigServiceV2Client(settings); + } + + /** + * Constructs an instance of ConfigServiceV2Client, using the given stub for making calls. This is + * for advanced usage - prefer to use ConfigServiceV2Settings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final ConfigServiceV2Client create(ConfigServiceV2Stub stub) { + return new ConfigServiceV2Client(stub); + } + + /** + * Constructs an instance of ConfigServiceV2Client, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected ConfigServiceV2Client(ConfigServiceV2Settings settings) throws IOException { + this.settings = settings; + this.stub = ((ConfigServiceV2StubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected ConfigServiceV2Client(ConfigServiceV2Stub stub) { + this.settings = null; + this.stub = stub; + } + + public final ConfigServiceV2Settings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public ConfigServiceV2Stub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists buckets (Beta). + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   String parent = "";
+   *   for (LogBucket element : configServiceV2Client.listBuckets(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The parent resource whose buckets are to be listed: + *

"projects/[PROJECT_ID]/locations/[LOCATION_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]" + *

Note: The locations portion of the resource must be specified, but supplying the + * character `-` in place of [LOCATION_ID] will return all buckets. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListBucketsPagedResponse listBuckets(String parent) { + ListBucketsRequest request = ListBucketsRequest.newBuilder().setParent(parent).build(); + return listBuckets(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists buckets (Beta). + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   String parent = "";
+   *   ListBucketsRequest request = ListBucketsRequest.newBuilder()
+   *     .setParent(parent)
+   *     .build();
+   *   for (LogBucket element : configServiceV2Client.listBuckets(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListBucketsPagedResponse listBuckets(ListBucketsRequest request) { + return listBucketsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists buckets (Beta). + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   String parent = "";
+   *   ListBucketsRequest request = ListBucketsRequest.newBuilder()
+   *     .setParent(parent)
+   *     .build();
+   *   ApiFuture<ListBucketsPagedResponse> future = configServiceV2Client.listBucketsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (LogBucket element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listBucketsPagedCallable() { + return stub.listBucketsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists buckets (Beta). + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   String parent = "";
+   *   ListBucketsRequest request = ListBucketsRequest.newBuilder()
+   *     .setParent(parent)
+   *     .build();
+   *   while (true) {
+   *     ListBucketsResponse response = configServiceV2Client.listBucketsCallable().call(request);
+   *     for (LogBucket element : response.getBucketsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable listBucketsCallable() { + return stub.listBucketsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a bucket (Beta). + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   LogBucketName name = LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]");
+   *   GetBucketRequest request = GetBucketRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   LogBucket response = configServiceV2Client.getBucket(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogBucket getBucket(GetBucketRequest request) { + return getBucketCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a bucket (Beta). + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   LogBucketName name = LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]");
+   *   GetBucketRequest request = GetBucketRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<LogBucket> future = configServiceV2Client.getBucketCallable().futureCall(request);
+   *   // Do something
+   *   LogBucket response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getBucketCallable() { + return stub.getBucketCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a bucket. This method replaces the following fields in the existing bucket with values + * from the new bucket: `retention_period` + * + *

If the retention period is decreased and the bucket is locked, FAILED_PRECONDITION will be + * returned. + * + *

If the bucket has a LifecycleState of DELETE_REQUESTED, FAILED_PRECONDITION will be + * returned. + * + *

A buckets region may not be modified after it is created. This method is in Beta. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   LogBucketName name = LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]");
+   *   LogBucket bucket = LogBucket.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   UpdateBucketRequest request = UpdateBucketRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setBucket(bucket)
+   *     .setUpdateMask(updateMask)
+   *     .build();
+   *   LogBucket response = configServiceV2Client.updateBucket(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogBucket updateBucket(UpdateBucketRequest request) { + return updateBucketCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a bucket. This method replaces the following fields in the existing bucket with values + * from the new bucket: `retention_period` + * + *

If the retention period is decreased and the bucket is locked, FAILED_PRECONDITION will be + * returned. + * + *

If the bucket has a LifecycleState of DELETE_REQUESTED, FAILED_PRECONDITION will be + * returned. + * + *

A buckets region may not be modified after it is created. This method is in Beta. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   LogBucketName name = LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]");
+   *   LogBucket bucket = LogBucket.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   UpdateBucketRequest request = UpdateBucketRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setBucket(bucket)
+   *     .setUpdateMask(updateMask)
+   *     .build();
+   *   ApiFuture<LogBucket> future = configServiceV2Client.updateBucketCallable().futureCall(request);
+   *   // Do something
+   *   LogBucket response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable updateBucketCallable() { + return stub.updateBucketCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists sinks. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   for (LogSink element : configServiceV2Client.listSinks(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The parent resource whose sinks are to be listed: + *

"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListSinksPagedResponse listSinks(ProjectName parent) { + ListSinksRequest request = + ListSinksRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + return listSinks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists sinks. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+   *   for (LogSink element : configServiceV2Client.listSinks(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The parent resource whose sinks are to be listed: + *

"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListSinksPagedResponse listSinks(OrganizationName parent) { + ListSinksRequest request = + ListSinksRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + return listSinks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists sinks. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   FolderName parent = FolderName.of("[FOLDER]");
+   *   for (LogSink element : configServiceV2Client.listSinks(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The parent resource whose sinks are to be listed: + *

"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListSinksPagedResponse listSinks(FolderName parent) { + ListSinksRequest request = + ListSinksRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + return listSinks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists sinks. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]");
+   *   for (LogSink element : configServiceV2Client.listSinks(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The parent resource whose sinks are to be listed: + *

"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListSinksPagedResponse listSinks(BillingAccountName parent) { + ListSinksRequest request = + ListSinksRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + return listSinks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists sinks. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   for (LogSink element : configServiceV2Client.listSinks(parent.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The parent resource whose sinks are to be listed: + *

"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListSinksPagedResponse listSinks(String parent) { + ListSinksRequest request = ListSinksRequest.newBuilder().setParent(parent).build(); + return listSinks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists sinks. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   ListSinksRequest request = ListSinksRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   for (LogSink element : configServiceV2Client.listSinks(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListSinksPagedResponse listSinks(ListSinksRequest request) { + return listSinksPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists sinks. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   ListSinksRequest request = ListSinksRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   ApiFuture<ListSinksPagedResponse> future = configServiceV2Client.listSinksPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (LogSink element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable listSinksPagedCallable() { + return stub.listSinksPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists sinks. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   ListSinksRequest request = ListSinksRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   while (true) {
+   *     ListSinksResponse response = configServiceV2Client.listSinksCallable().call(request);
+   *     for (LogSink element : response.getSinksList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable listSinksCallable() { + return stub.listSinksCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a sink. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]");
+   *   LogSink response = configServiceV2Client.getSink(sinkName);
+   * }
+   * 
+ * + * @param sinkName Required. The resource name of the sink: + *

"projects/[PROJECT_ID]/sinks/[SINK_ID]" + * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * "folders/[FOLDER_ID]/sinks/[SINK_ID]" + *

Example: `"projects/my-project-id/sinks/my-sink-id"`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogSink getSink(LogSinkName sinkName) { + GetSinkRequest request = + GetSinkRequest.newBuilder() + .setSinkName(sinkName == null ? null : sinkName.toString()) + .build(); + return getSink(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a sink. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]");
+   *   LogSink response = configServiceV2Client.getSink(sinkName.toString());
+   * }
+   * 
+ * + * @param sinkName Required. The resource name of the sink: + *

"projects/[PROJECT_ID]/sinks/[SINK_ID]" + * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * "folders/[FOLDER_ID]/sinks/[SINK_ID]" + *

Example: `"projects/my-project-id/sinks/my-sink-id"`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogSink getSink(String sinkName) { + GetSinkRequest request = GetSinkRequest.newBuilder().setSinkName(sinkName).build(); + return getSink(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a sink. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]");
+   *   GetSinkRequest request = GetSinkRequest.newBuilder()
+   *     .setSinkName(sinkName.toString())
+   *     .build();
+   *   LogSink response = configServiceV2Client.getSink(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogSink getSink(GetSinkRequest request) { + return getSinkCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a sink. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]");
+   *   GetSinkRequest request = GetSinkRequest.newBuilder()
+   *     .setSinkName(sinkName.toString())
+   *     .build();
+   *   ApiFuture<LogSink> future = configServiceV2Client.getSinkCallable().futureCall(request);
+   *   // Do something
+   *   LogSink response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getSinkCallable() { + return stub.getSinkCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a sink that exports specified log entries to a destination. The export of + * newly-ingested log entries begins immediately, unless the sink's `writer_identity` is not + * permitted to write to the destination. A sink can export log entries only from the resource + * owning the sink. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   LogSink sink = LogSink.newBuilder().build();
+   *   LogSink response = configServiceV2Client.createSink(parent, sink);
+   * }
+   * 
+ * + * @param parent Required. The resource in which to create the sink: + *

"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + *

Examples: `"projects/my-logging-project"`, `"organizations/123456789"`. + * @param sink Required. The new sink, whose `name` parameter is a sink identifier that is not + * already in use. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogSink createSink(ProjectName parent, LogSink sink) { + CreateSinkRequest request = + CreateSinkRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setSink(sink) + .build(); + return createSink(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a sink that exports specified log entries to a destination. The export of + * newly-ingested log entries begins immediately, unless the sink's `writer_identity` is not + * permitted to write to the destination. A sink can export log entries only from the resource + * owning the sink. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+   *   LogSink sink = LogSink.newBuilder().build();
+   *   LogSink response = configServiceV2Client.createSink(parent, sink);
+   * }
+   * 
+ * + * @param parent Required. The resource in which to create the sink: + *

"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + *

Examples: `"projects/my-logging-project"`, `"organizations/123456789"`. + * @param sink Required. The new sink, whose `name` parameter is a sink identifier that is not + * already in use. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogSink createSink(OrganizationName parent, LogSink sink) { + CreateSinkRequest request = + CreateSinkRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setSink(sink) + .build(); + return createSink(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a sink that exports specified log entries to a destination. The export of + * newly-ingested log entries begins immediately, unless the sink's `writer_identity` is not + * permitted to write to the destination. A sink can export log entries only from the resource + * owning the sink. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   FolderName parent = FolderName.of("[FOLDER]");
+   *   LogSink sink = LogSink.newBuilder().build();
+   *   LogSink response = configServiceV2Client.createSink(parent, sink);
+   * }
+   * 
+ * + * @param parent Required. The resource in which to create the sink: + *

"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + *

Examples: `"projects/my-logging-project"`, `"organizations/123456789"`. + * @param sink Required. The new sink, whose `name` parameter is a sink identifier that is not + * already in use. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogSink createSink(FolderName parent, LogSink sink) { + CreateSinkRequest request = + CreateSinkRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setSink(sink) + .build(); + return createSink(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a sink that exports specified log entries to a destination. The export of + * newly-ingested log entries begins immediately, unless the sink's `writer_identity` is not + * permitted to write to the destination. A sink can export log entries only from the resource + * owning the sink. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]");
+   *   LogSink sink = LogSink.newBuilder().build();
+   *   LogSink response = configServiceV2Client.createSink(parent, sink);
+   * }
+   * 
+ * + * @param parent Required. The resource in which to create the sink: + *

"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + *

Examples: `"projects/my-logging-project"`, `"organizations/123456789"`. + * @param sink Required. The new sink, whose `name` parameter is a sink identifier that is not + * already in use. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogSink createSink(BillingAccountName parent, LogSink sink) { + CreateSinkRequest request = + CreateSinkRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setSink(sink) + .build(); + return createSink(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a sink that exports specified log entries to a destination. The export of + * newly-ingested log entries begins immediately, unless the sink's `writer_identity` is not + * permitted to write to the destination. A sink can export log entries only from the resource + * owning the sink. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   LogSink sink = LogSink.newBuilder().build();
+   *   LogSink response = configServiceV2Client.createSink(parent.toString(), sink);
+   * }
+   * 
+ * + * @param parent Required. The resource in which to create the sink: + *

"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + *

Examples: `"projects/my-logging-project"`, `"organizations/123456789"`. + * @param sink Required. The new sink, whose `name` parameter is a sink identifier that is not + * already in use. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogSink createSink(String parent, LogSink sink) { + CreateSinkRequest request = + CreateSinkRequest.newBuilder().setParent(parent).setSink(sink).build(); + return createSink(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a sink that exports specified log entries to a destination. The export of + * newly-ingested log entries begins immediately, unless the sink's `writer_identity` is not + * permitted to write to the destination. A sink can export log entries only from the resource + * owning the sink. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   LogSink sink = LogSink.newBuilder().build();
+   *   CreateSinkRequest request = CreateSinkRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setSink(sink)
+   *     .build();
+   *   LogSink response = configServiceV2Client.createSink(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogSink createSink(CreateSinkRequest request) { + return createSinkCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a sink that exports specified log entries to a destination. The export of + * newly-ingested log entries begins immediately, unless the sink's `writer_identity` is not + * permitted to write to the destination. A sink can export log entries only from the resource + * owning the sink. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   LogSink sink = LogSink.newBuilder().build();
+   *   CreateSinkRequest request = CreateSinkRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setSink(sink)
+   *     .build();
+   *   ApiFuture<LogSink> future = configServiceV2Client.createSinkCallable().futureCall(request);
+   *   // Do something
+   *   LogSink response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable createSinkCallable() { + return stub.createSinkCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a sink. This method replaces the following fields in the existing sink with values from + * the new sink: `destination`, and `filter`. + * + *

The updated sink might also have a new `writer_identity`; see the `unique_writer_identity` + * field. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]");
+   *   LogSink sink = LogSink.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   LogSink response = configServiceV2Client.updateSink(sinkName, sink, updateMask);
+   * }
+   * 
+ * + * @param sinkName Required. The full resource name of the sink to update, including the parent + * resource and the sink identifier: + *

"projects/[PROJECT_ID]/sinks/[SINK_ID]" + * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * "folders/[FOLDER_ID]/sinks/[SINK_ID]" + *

Example: `"projects/my-project-id/sinks/my-sink-id"`. + * @param sink Required. The updated sink, whose name is the same identifier that appears as part + * of `sink_name`. + * @param updateMask Optional. Field mask that specifies the fields in `sink` that need an update. + * A sink field will be overwritten if, and only if, it is in the update mask. `name` and + * output only fields cannot be updated. + *

An empty updateMask is temporarily treated as using the following mask for backwards + * compatibility purposes: destination,filter,includeChildren At some point in the future, + * behavior will be removed and specifying an empty updateMask will be an error. + *

For a detailed `FieldMask` definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask + *

Example: `updateMask=filter`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogSink updateSink(LogSinkName sinkName, LogSink sink, FieldMask updateMask) { + UpdateSinkRequest request = + UpdateSinkRequest.newBuilder() + .setSinkName(sinkName == null ? null : sinkName.toString()) + .setSink(sink) + .setUpdateMask(updateMask) + .build(); + return updateSink(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a sink. This method replaces the following fields in the existing sink with values from + * the new sink: `destination`, and `filter`. + * + *

The updated sink might also have a new `writer_identity`; see the `unique_writer_identity` + * field. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]");
+   *   LogSink sink = LogSink.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   LogSink response = configServiceV2Client.updateSink(sinkName.toString(), sink, updateMask);
+   * }
+   * 
+ * + * @param sinkName Required. The full resource name of the sink to update, including the parent + * resource and the sink identifier: + *

"projects/[PROJECT_ID]/sinks/[SINK_ID]" + * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * "folders/[FOLDER_ID]/sinks/[SINK_ID]" + *

Example: `"projects/my-project-id/sinks/my-sink-id"`. + * @param sink Required. The updated sink, whose name is the same identifier that appears as part + * of `sink_name`. + * @param updateMask Optional. Field mask that specifies the fields in `sink` that need an update. + * A sink field will be overwritten if, and only if, it is in the update mask. `name` and + * output only fields cannot be updated. + *

An empty updateMask is temporarily treated as using the following mask for backwards + * compatibility purposes: destination,filter,includeChildren At some point in the future, + * behavior will be removed and specifying an empty updateMask will be an error. + *

For a detailed `FieldMask` definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask + *

Example: `updateMask=filter`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogSink updateSink(String sinkName, LogSink sink, FieldMask updateMask) { + UpdateSinkRequest request = + UpdateSinkRequest.newBuilder() + .setSinkName(sinkName) + .setSink(sink) + .setUpdateMask(updateMask) + .build(); + return updateSink(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a sink. This method replaces the following fields in the existing sink with values from + * the new sink: `destination`, and `filter`. + * + *

The updated sink might also have a new `writer_identity`; see the `unique_writer_identity` + * field. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]");
+   *   LogSink sink = LogSink.newBuilder().build();
+   *   LogSink response = configServiceV2Client.updateSink(sinkName, sink);
+   * }
+   * 
+ * + * @param sinkName Required. The full resource name of the sink to update, including the parent + * resource and the sink identifier: + *

"projects/[PROJECT_ID]/sinks/[SINK_ID]" + * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * "folders/[FOLDER_ID]/sinks/[SINK_ID]" + *

Example: `"projects/my-project-id/sinks/my-sink-id"`. + * @param sink Required. The updated sink, whose name is the same identifier that appears as part + * of `sink_name`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogSink updateSink(LogSinkName sinkName, LogSink sink) { + UpdateSinkRequest request = + UpdateSinkRequest.newBuilder() + .setSinkName(sinkName == null ? null : sinkName.toString()) + .setSink(sink) + .build(); + return updateSink(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a sink. This method replaces the following fields in the existing sink with values from + * the new sink: `destination`, and `filter`. + * + *

The updated sink might also have a new `writer_identity`; see the `unique_writer_identity` + * field. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]");
+   *   LogSink sink = LogSink.newBuilder().build();
+   *   LogSink response = configServiceV2Client.updateSink(sinkName.toString(), sink);
+   * }
+   * 
+ * + * @param sinkName Required. The full resource name of the sink to update, including the parent + * resource and the sink identifier: + *

"projects/[PROJECT_ID]/sinks/[SINK_ID]" + * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * "folders/[FOLDER_ID]/sinks/[SINK_ID]" + *

Example: `"projects/my-project-id/sinks/my-sink-id"`. + * @param sink Required. The updated sink, whose name is the same identifier that appears as part + * of `sink_name`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogSink updateSink(String sinkName, LogSink sink) { + UpdateSinkRequest request = + UpdateSinkRequest.newBuilder().setSinkName(sinkName).setSink(sink).build(); + return updateSink(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a sink. This method replaces the following fields in the existing sink with values from + * the new sink: `destination`, and `filter`. + * + *

The updated sink might also have a new `writer_identity`; see the `unique_writer_identity` + * field. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]");
+   *   LogSink sink = LogSink.newBuilder().build();
+   *   UpdateSinkRequest request = UpdateSinkRequest.newBuilder()
+   *     .setSinkName(sinkName.toString())
+   *     .setSink(sink)
+   *     .build();
+   *   LogSink response = configServiceV2Client.updateSink(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogSink updateSink(UpdateSinkRequest request) { + return updateSinkCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a sink. This method replaces the following fields in the existing sink with values from + * the new sink: `destination`, and `filter`. + * + *

The updated sink might also have a new `writer_identity`; see the `unique_writer_identity` + * field. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]");
+   *   LogSink sink = LogSink.newBuilder().build();
+   *   UpdateSinkRequest request = UpdateSinkRequest.newBuilder()
+   *     .setSinkName(sinkName.toString())
+   *     .setSink(sink)
+   *     .build();
+   *   ApiFuture<LogSink> future = configServiceV2Client.updateSinkCallable().futureCall(request);
+   *   // Do something
+   *   LogSink response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable updateSinkCallable() { + return stub.updateSinkCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a sink. If the sink has a unique `writer_identity`, then that service account is also + * deleted. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]");
+   *   configServiceV2Client.deleteSink(sinkName);
+   * }
+   * 
+ * + * @param sinkName Required. The full resource name of the sink to delete, including the parent + * resource and the sink identifier: + *

"projects/[PROJECT_ID]/sinks/[SINK_ID]" + * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * "folders/[FOLDER_ID]/sinks/[SINK_ID]" + *

Example: `"projects/my-project-id/sinks/my-sink-id"`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteSink(LogSinkName sinkName) { + DeleteSinkRequest request = + DeleteSinkRequest.newBuilder() + .setSinkName(sinkName == null ? null : sinkName.toString()) + .build(); + deleteSink(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a sink. If the sink has a unique `writer_identity`, then that service account is also + * deleted. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]");
+   *   configServiceV2Client.deleteSink(sinkName.toString());
+   * }
+   * 
+ * + * @param sinkName Required. The full resource name of the sink to delete, including the parent + * resource and the sink identifier: + *

"projects/[PROJECT_ID]/sinks/[SINK_ID]" + * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * "folders/[FOLDER_ID]/sinks/[SINK_ID]" + *

Example: `"projects/my-project-id/sinks/my-sink-id"`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteSink(String sinkName) { + DeleteSinkRequest request = DeleteSinkRequest.newBuilder().setSinkName(sinkName).build(); + deleteSink(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a sink. If the sink has a unique `writer_identity`, then that service account is also + * deleted. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]");
+   *   DeleteSinkRequest request = DeleteSinkRequest.newBuilder()
+   *     .setSinkName(sinkName.toString())
+   *     .build();
+   *   configServiceV2Client.deleteSink(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteSink(DeleteSinkRequest request) { + deleteSinkCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a sink. If the sink has a unique `writer_identity`, then that service account is also + * deleted. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]");
+   *   DeleteSinkRequest request = DeleteSinkRequest.newBuilder()
+   *     .setSinkName(sinkName.toString())
+   *     .build();
+   *   ApiFuture<Void> future = configServiceV2Client.deleteSinkCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable deleteSinkCallable() { + return stub.deleteSinkCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists all the exclusions in a parent resource. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   for (LogExclusion element : configServiceV2Client.listExclusions(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The parent resource whose exclusions are to be listed. + *

"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListExclusionsPagedResponse listExclusions(ProjectName parent) { + ListExclusionsRequest request = + ListExclusionsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listExclusions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists all the exclusions in a parent resource. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+   *   for (LogExclusion element : configServiceV2Client.listExclusions(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The parent resource whose exclusions are to be listed. + *

"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListExclusionsPagedResponse listExclusions(OrganizationName parent) { + ListExclusionsRequest request = + ListExclusionsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listExclusions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists all the exclusions in a parent resource. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   FolderName parent = FolderName.of("[FOLDER]");
+   *   for (LogExclusion element : configServiceV2Client.listExclusions(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The parent resource whose exclusions are to be listed. + *

"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListExclusionsPagedResponse listExclusions(FolderName parent) { + ListExclusionsRequest request = + ListExclusionsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listExclusions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists all the exclusions in a parent resource. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]");
+   *   for (LogExclusion element : configServiceV2Client.listExclusions(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The parent resource whose exclusions are to be listed. + *

"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListExclusionsPagedResponse listExclusions(BillingAccountName parent) { + ListExclusionsRequest request = + ListExclusionsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listExclusions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists all the exclusions in a parent resource. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   for (LogExclusion element : configServiceV2Client.listExclusions(parent.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The parent resource whose exclusions are to be listed. + *

"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListExclusionsPagedResponse listExclusions(String parent) { + ListExclusionsRequest request = ListExclusionsRequest.newBuilder().setParent(parent).build(); + return listExclusions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists all the exclusions in a parent resource. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   ListExclusionsRequest request = ListExclusionsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   for (LogExclusion element : configServiceV2Client.listExclusions(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListExclusionsPagedResponse listExclusions(ListExclusionsRequest request) { + return listExclusionsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists all the exclusions in a parent resource. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   ListExclusionsRequest request = ListExclusionsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   ApiFuture<ListExclusionsPagedResponse> future = configServiceV2Client.listExclusionsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (LogExclusion element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listExclusionsPagedCallable() { + return stub.listExclusionsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists all the exclusions in a parent resource. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   ListExclusionsRequest request = ListExclusionsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   while (true) {
+   *     ListExclusionsResponse response = configServiceV2Client.listExclusionsCallable().call(request);
+   *     for (LogExclusion element : response.getExclusionsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listExclusionsCallable() { + return stub.listExclusionsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the description of an exclusion. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   LogExclusionName name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]");
+   *   LogExclusion response = configServiceV2Client.getExclusion(name);
+   * }
+   * 
+ * + * @param name Required. The resource name of an existing exclusion: + *

"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + *

Example: `"projects/my-project-id/exclusions/my-exclusion-id"`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogExclusion getExclusion(LogExclusionName name) { + GetExclusionRequest request = + GetExclusionRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getExclusion(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the description of an exclusion. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   LogExclusionName name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]");
+   *   LogExclusion response = configServiceV2Client.getExclusion(name.toString());
+   * }
+   * 
+ * + * @param name Required. The resource name of an existing exclusion: + *

"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + *

Example: `"projects/my-project-id/exclusions/my-exclusion-id"`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogExclusion getExclusion(String name) { + GetExclusionRequest request = GetExclusionRequest.newBuilder().setName(name).build(); + return getExclusion(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the description of an exclusion. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   LogExclusionName name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]");
+   *   GetExclusionRequest request = GetExclusionRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   LogExclusion response = configServiceV2Client.getExclusion(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogExclusion getExclusion(GetExclusionRequest request) { + return getExclusionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the description of an exclusion. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   LogExclusionName name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]");
+   *   GetExclusionRequest request = GetExclusionRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<LogExclusion> future = configServiceV2Client.getExclusionCallable().futureCall(request);
+   *   // Do something
+   *   LogExclusion response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getExclusionCallable() { + return stub.getExclusionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new exclusion in a specified parent resource. Only log entries belonging to that + * resource can be excluded. You can have up to 10 exclusions in a resource. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   LogExclusion exclusion = LogExclusion.newBuilder().build();
+   *   LogExclusion response = configServiceV2Client.createExclusion(parent, exclusion);
+   * }
+   * 
+ * + * @param parent Required. The parent resource in which to create the exclusion: + *

"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + *

Examples: `"projects/my-logging-project"`, `"organizations/123456789"`. + * @param exclusion Required. The new exclusion, whose `name` parameter is an exclusion name that + * is not already used in the parent resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogExclusion createExclusion(ProjectName parent, LogExclusion exclusion) { + CreateExclusionRequest request = + CreateExclusionRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setExclusion(exclusion) + .build(); + return createExclusion(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new exclusion in a specified parent resource. Only log entries belonging to that + * resource can be excluded. You can have up to 10 exclusions in a resource. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+   *   LogExclusion exclusion = LogExclusion.newBuilder().build();
+   *   LogExclusion response = configServiceV2Client.createExclusion(parent, exclusion);
+   * }
+   * 
+ * + * @param parent Required. The parent resource in which to create the exclusion: + *

"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + *

Examples: `"projects/my-logging-project"`, `"organizations/123456789"`. + * @param exclusion Required. The new exclusion, whose `name` parameter is an exclusion name that + * is not already used in the parent resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogExclusion createExclusion(OrganizationName parent, LogExclusion exclusion) { + CreateExclusionRequest request = + CreateExclusionRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setExclusion(exclusion) + .build(); + return createExclusion(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new exclusion in a specified parent resource. Only log entries belonging to that + * resource can be excluded. You can have up to 10 exclusions in a resource. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   FolderName parent = FolderName.of("[FOLDER]");
+   *   LogExclusion exclusion = LogExclusion.newBuilder().build();
+   *   LogExclusion response = configServiceV2Client.createExclusion(parent, exclusion);
+   * }
+   * 
+ * + * @param parent Required. The parent resource in which to create the exclusion: + *

"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + *

Examples: `"projects/my-logging-project"`, `"organizations/123456789"`. + * @param exclusion Required. The new exclusion, whose `name` parameter is an exclusion name that + * is not already used in the parent resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogExclusion createExclusion(FolderName parent, LogExclusion exclusion) { + CreateExclusionRequest request = + CreateExclusionRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setExclusion(exclusion) + .build(); + return createExclusion(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new exclusion in a specified parent resource. Only log entries belonging to that + * resource can be excluded. You can have up to 10 exclusions in a resource. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]");
+   *   LogExclusion exclusion = LogExclusion.newBuilder().build();
+   *   LogExclusion response = configServiceV2Client.createExclusion(parent, exclusion);
+   * }
+   * 
+ * + * @param parent Required. The parent resource in which to create the exclusion: + *

"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + *

Examples: `"projects/my-logging-project"`, `"organizations/123456789"`. + * @param exclusion Required. The new exclusion, whose `name` parameter is an exclusion name that + * is not already used in the parent resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogExclusion createExclusion(BillingAccountName parent, LogExclusion exclusion) { + CreateExclusionRequest request = + CreateExclusionRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setExclusion(exclusion) + .build(); + return createExclusion(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new exclusion in a specified parent resource. Only log entries belonging to that + * resource can be excluded. You can have up to 10 exclusions in a resource. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   LogExclusion exclusion = LogExclusion.newBuilder().build();
+   *   LogExclusion response = configServiceV2Client.createExclusion(parent.toString(), exclusion);
+   * }
+   * 
+ * + * @param parent Required. The parent resource in which to create the exclusion: + *

"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + *

Examples: `"projects/my-logging-project"`, `"organizations/123456789"`. + * @param exclusion Required. The new exclusion, whose `name` parameter is an exclusion name that + * is not already used in the parent resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogExclusion createExclusion(String parent, LogExclusion exclusion) { + CreateExclusionRequest request = + CreateExclusionRequest.newBuilder().setParent(parent).setExclusion(exclusion).build(); + return createExclusion(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new exclusion in a specified parent resource. Only log entries belonging to that + * resource can be excluded. You can have up to 10 exclusions in a resource. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   LogExclusion exclusion = LogExclusion.newBuilder().build();
+   *   CreateExclusionRequest request = CreateExclusionRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setExclusion(exclusion)
+   *     .build();
+   *   LogExclusion response = configServiceV2Client.createExclusion(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogExclusion createExclusion(CreateExclusionRequest request) { + return createExclusionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new exclusion in a specified parent resource. Only log entries belonging to that + * resource can be excluded. You can have up to 10 exclusions in a resource. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   LogExclusion exclusion = LogExclusion.newBuilder().build();
+   *   CreateExclusionRequest request = CreateExclusionRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setExclusion(exclusion)
+   *     .build();
+   *   ApiFuture<LogExclusion> future = configServiceV2Client.createExclusionCallable().futureCall(request);
+   *   // Do something
+   *   LogExclusion response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable createExclusionCallable() { + return stub.createExclusionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Changes one or more properties of an existing exclusion. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   LogExclusionName name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]");
+   *   LogExclusion exclusion = LogExclusion.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   LogExclusion response = configServiceV2Client.updateExclusion(name, exclusion, updateMask);
+   * }
+   * 
+ * + * @param name Required. The resource name of the exclusion to update: + *

"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + *

Example: `"projects/my-project-id/exclusions/my-exclusion-id"`. + * @param exclusion Required. New values for the existing exclusion. Only the fields specified in + * `update_mask` are relevant. + * @param updateMask Required. A non-empty list of fields to change in the existing exclusion. New + * values for the fields are taken from the corresponding fields in the + * [LogExclusion][google.logging.v2.LogExclusion] included in this request. Fields not + * mentioned in `update_mask` are not changed and are ignored in the request. + *

For example, to change the filter and description of an exclusion, specify an + * `update_mask` of `"filter,description"`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogExclusion updateExclusion( + LogExclusionName name, LogExclusion exclusion, FieldMask updateMask) { + UpdateExclusionRequest request = + UpdateExclusionRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setExclusion(exclusion) + .setUpdateMask(updateMask) + .build(); + return updateExclusion(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Changes one or more properties of an existing exclusion. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   LogExclusionName name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]");
+   *   LogExclusion exclusion = LogExclusion.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   LogExclusion response = configServiceV2Client.updateExclusion(name.toString(), exclusion, updateMask);
+   * }
+   * 
+ * + * @param name Required. The resource name of the exclusion to update: + *

"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + *

Example: `"projects/my-project-id/exclusions/my-exclusion-id"`. + * @param exclusion Required. New values for the existing exclusion. Only the fields specified in + * `update_mask` are relevant. + * @param updateMask Required. A non-empty list of fields to change in the existing exclusion. New + * values for the fields are taken from the corresponding fields in the + * [LogExclusion][google.logging.v2.LogExclusion] included in this request. Fields not + * mentioned in `update_mask` are not changed and are ignored in the request. + *

For example, to change the filter and description of an exclusion, specify an + * `update_mask` of `"filter,description"`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogExclusion updateExclusion( + String name, LogExclusion exclusion, FieldMask updateMask) { + UpdateExclusionRequest request = + UpdateExclusionRequest.newBuilder() + .setName(name) + .setExclusion(exclusion) + .setUpdateMask(updateMask) + .build(); + return updateExclusion(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Changes one or more properties of an existing exclusion. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   LogExclusionName name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]");
+   *   LogExclusion exclusion = LogExclusion.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   UpdateExclusionRequest request = UpdateExclusionRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setExclusion(exclusion)
+   *     .setUpdateMask(updateMask)
+   *     .build();
+   *   LogExclusion response = configServiceV2Client.updateExclusion(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogExclusion updateExclusion(UpdateExclusionRequest request) { + return updateExclusionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Changes one or more properties of an existing exclusion. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   LogExclusionName name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]");
+   *   LogExclusion exclusion = LogExclusion.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   UpdateExclusionRequest request = UpdateExclusionRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setExclusion(exclusion)
+   *     .setUpdateMask(updateMask)
+   *     .build();
+   *   ApiFuture<LogExclusion> future = configServiceV2Client.updateExclusionCallable().futureCall(request);
+   *   // Do something
+   *   LogExclusion response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable updateExclusionCallable() { + return stub.updateExclusionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes an exclusion. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   LogExclusionName name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]");
+   *   configServiceV2Client.deleteExclusion(name);
+   * }
+   * 
+ * + * @param name Required. The resource name of an existing exclusion to delete: + *

"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + *

Example: `"projects/my-project-id/exclusions/my-exclusion-id"`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteExclusion(LogExclusionName name) { + DeleteExclusionRequest request = + DeleteExclusionRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteExclusion(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes an exclusion. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   LogExclusionName name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]");
+   *   configServiceV2Client.deleteExclusion(name.toString());
+   * }
+   * 
+ * + * @param name Required. The resource name of an existing exclusion to delete: + *

"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + *

Example: `"projects/my-project-id/exclusions/my-exclusion-id"`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteExclusion(String name) { + DeleteExclusionRequest request = DeleteExclusionRequest.newBuilder().setName(name).build(); + deleteExclusion(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes an exclusion. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   LogExclusionName name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]");
+   *   DeleteExclusionRequest request = DeleteExclusionRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   configServiceV2Client.deleteExclusion(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteExclusion(DeleteExclusionRequest request) { + deleteExclusionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes an exclusion. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   LogExclusionName name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]");
+   *   DeleteExclusionRequest request = DeleteExclusionRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Void> future = configServiceV2Client.deleteExclusionCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable deleteExclusionCallable() { + return stub.deleteExclusionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the Logs Router CMEK settings for the given resource. + * + *

Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once + * configured, it applies to all projects and folders in the GCP organization. + * + *

See [Enabling CMEK for Logs Router](/logging/docs/routing/managed-encryption) for more + * information. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   CmekSettingsName name = CmekSettingsName.ofProjectName("[PROJECT]");
+   *   GetCmekSettingsRequest request = GetCmekSettingsRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   CmekSettings response = configServiceV2Client.getCmekSettings(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final CmekSettings getCmekSettings(GetCmekSettingsRequest request) { + return getCmekSettingsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the Logs Router CMEK settings for the given resource. + * + *

Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once + * configured, it applies to all projects and folders in the GCP organization. + * + *

See [Enabling CMEK for Logs Router](/logging/docs/routing/managed-encryption) for more + * information. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   CmekSettingsName name = CmekSettingsName.ofProjectName("[PROJECT]");
+   *   GetCmekSettingsRequest request = GetCmekSettingsRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<CmekSettings> future = configServiceV2Client.getCmekSettingsCallable().futureCall(request);
+   *   // Do something
+   *   CmekSettings response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getCmekSettingsCallable() { + return stub.getCmekSettingsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the Logs Router CMEK settings for the given resource. + * + *

Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once + * configured, it applies to all projects and folders in the GCP organization. + * + *

[UpdateCmekSettings][google.logging.v2.ConfigServiceV2.UpdateCmekSettings] will fail if 1) + * `kms_key_name` is invalid, or 2) the associated service account does not have the required + * `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key, or 3) access to the key + * is disabled. + * + *

See [Enabling CMEK for Logs Router](/logging/docs/routing/managed-encryption) for more + * information. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   String name = "";
+   *   CmekSettings cmekSettings = CmekSettings.newBuilder().build();
+   *   UpdateCmekSettingsRequest request = UpdateCmekSettingsRequest.newBuilder()
+   *     .setName(name)
+   *     .setCmekSettings(cmekSettings)
+   *     .build();
+   *   CmekSettings response = configServiceV2Client.updateCmekSettings(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final CmekSettings updateCmekSettings(UpdateCmekSettingsRequest request) { + return updateCmekSettingsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the Logs Router CMEK settings for the given resource. + * + *

Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once + * configured, it applies to all projects and folders in the GCP organization. + * + *

[UpdateCmekSettings][google.logging.v2.ConfigServiceV2.UpdateCmekSettings] will fail if 1) + * `kms_key_name` is invalid, or 2) the associated service account does not have the required + * `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key, or 3) access to the key + * is disabled. + * + *

See [Enabling CMEK for Logs Router](/logging/docs/routing/managed-encryption) for more + * information. + * + *

Sample code: + * + *


+   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   *   String name = "";
+   *   CmekSettings cmekSettings = CmekSettings.newBuilder().build();
+   *   UpdateCmekSettingsRequest request = UpdateCmekSettingsRequest.newBuilder()
+   *     .setName(name)
+   *     .setCmekSettings(cmekSettings)
+   *     .build();
+   *   ApiFuture<CmekSettings> future = configServiceV2Client.updateCmekSettingsCallable().futureCall(request);
+   *   // Do something
+   *   CmekSettings response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable updateCmekSettingsCallable() { + return stub.updateCmekSettingsCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListBucketsPagedResponse + extends AbstractPagedListResponse< + ListBucketsRequest, + ListBucketsResponse, + LogBucket, + ListBucketsPage, + ListBucketsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListBucketsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListBucketsPagedResponse apply(ListBucketsPage input) { + return new ListBucketsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListBucketsPagedResponse(ListBucketsPage page) { + super(page, ListBucketsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListBucketsPage + extends AbstractPage { + + private ListBucketsPage( + PageContext context, + ListBucketsResponse response) { + super(context, response); + } + + private static ListBucketsPage createEmptyPage() { + return new ListBucketsPage(null, null); + } + + @Override + protected ListBucketsPage createPage( + PageContext context, + ListBucketsResponse response) { + return new ListBucketsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListBucketsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListBucketsRequest, + ListBucketsResponse, + LogBucket, + ListBucketsPage, + ListBucketsFixedSizeCollection> { + + private ListBucketsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListBucketsFixedSizeCollection createEmptyCollection() { + return new ListBucketsFixedSizeCollection(null, 0); + } + + @Override + protected ListBucketsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListBucketsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListSinksPagedResponse + extends AbstractPagedListResponse< + ListSinksRequest, + ListSinksResponse, + LogSink, + ListSinksPage, + ListSinksFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListSinksPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListSinksPagedResponse apply(ListSinksPage input) { + return new ListSinksPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListSinksPagedResponse(ListSinksPage page) { + super(page, ListSinksFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListSinksPage + extends AbstractPage { + + private ListSinksPage( + PageContext context, + ListSinksResponse response) { + super(context, response); + } + + private static ListSinksPage createEmptyPage() { + return new ListSinksPage(null, null); + } + + @Override + protected ListSinksPage createPage( + PageContext context, + ListSinksResponse response) { + return new ListSinksPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListSinksFixedSizeCollection + extends AbstractFixedSizeCollection< + ListSinksRequest, + ListSinksResponse, + LogSink, + ListSinksPage, + ListSinksFixedSizeCollection> { + + private ListSinksFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListSinksFixedSizeCollection createEmptyCollection() { + return new ListSinksFixedSizeCollection(null, 0); + } + + @Override + protected ListSinksFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListSinksFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListExclusionsPagedResponse + extends AbstractPagedListResponse< + ListExclusionsRequest, + ListExclusionsResponse, + LogExclusion, + ListExclusionsPage, + ListExclusionsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListExclusionsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListExclusionsPagedResponse apply(ListExclusionsPage input) { + return new ListExclusionsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListExclusionsPagedResponse(ListExclusionsPage page) { + super(page, ListExclusionsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListExclusionsPage + extends AbstractPage< + ListExclusionsRequest, ListExclusionsResponse, LogExclusion, ListExclusionsPage> { + + private ListExclusionsPage( + PageContext context, + ListExclusionsResponse response) { + super(context, response); + } + + private static ListExclusionsPage createEmptyPage() { + return new ListExclusionsPage(null, null); + } + + @Override + protected ListExclusionsPage createPage( + PageContext context, + ListExclusionsResponse response) { + return new ListExclusionsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListExclusionsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListExclusionsRequest, + ListExclusionsResponse, + LogExclusion, + ListExclusionsPage, + ListExclusionsFixedSizeCollection> { + + private ListExclusionsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListExclusionsFixedSizeCollection createEmptyCollection() { + return new ListExclusionsFixedSizeCollection(null, 0); + } + + @Override + protected ListExclusionsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListExclusionsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/ConfigServiceV2Settings.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/ConfigServiceV2Settings.java new file mode 100644 index 000000000..97bbd705d --- /dev/null +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/ConfigServiceV2Settings.java @@ -0,0 +1,360 @@ +/* + * Copyright 2020 Google LLC + * + * 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 + * + * https://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.cloud.logging.v2; + +import static com.google.cloud.logging.v2.ConfigServiceV2Client.ListBucketsPagedResponse; +import static com.google.cloud.logging.v2.ConfigServiceV2Client.ListExclusionsPagedResponse; +import static com.google.cloud.logging.v2.ConfigServiceV2Client.ListSinksPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.logging.v2.stub.ConfigServiceV2StubSettings; +import com.google.logging.v2.CmekSettings; +import com.google.logging.v2.CreateExclusionRequest; +import com.google.logging.v2.CreateSinkRequest; +import com.google.logging.v2.DeleteExclusionRequest; +import com.google.logging.v2.DeleteSinkRequest; +import com.google.logging.v2.GetBucketRequest; +import com.google.logging.v2.GetCmekSettingsRequest; +import com.google.logging.v2.GetExclusionRequest; +import com.google.logging.v2.GetSinkRequest; +import com.google.logging.v2.ListBucketsRequest; +import com.google.logging.v2.ListBucketsResponse; +import com.google.logging.v2.ListExclusionsRequest; +import com.google.logging.v2.ListExclusionsResponse; +import com.google.logging.v2.ListSinksRequest; +import com.google.logging.v2.ListSinksResponse; +import com.google.logging.v2.LogBucket; +import com.google.logging.v2.LogExclusion; +import com.google.logging.v2.LogSink; +import com.google.logging.v2.UpdateBucketRequest; +import com.google.logging.v2.UpdateCmekSettingsRequest; +import com.google.logging.v2.UpdateExclusionRequest; +import com.google.logging.v2.UpdateSinkRequest; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link ConfigServiceV2Client}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (logging.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of getSink to 30 seconds: + * + *

+ * 
+ * ConfigServiceV2Settings.Builder configServiceV2SettingsBuilder =
+ *     ConfigServiceV2Settings.newBuilder();
+ * configServiceV2SettingsBuilder
+ *     .getSinkSettings()
+ *     .setRetrySettings(
+ *         configServiceV2SettingsBuilder.getSinkSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * ConfigServiceV2Settings configServiceV2Settings = configServiceV2SettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class ConfigServiceV2Settings extends ClientSettings { + /** Returns the object with the settings used for calls to listBuckets. */ + public PagedCallSettings + listBucketsSettings() { + return ((ConfigServiceV2StubSettings) getStubSettings()).listBucketsSettings(); + } + + /** Returns the object with the settings used for calls to getBucket. */ + public UnaryCallSettings getBucketSettings() { + return ((ConfigServiceV2StubSettings) getStubSettings()).getBucketSettings(); + } + + /** Returns the object with the settings used for calls to updateBucket. */ + public UnaryCallSettings updateBucketSettings() { + return ((ConfigServiceV2StubSettings) getStubSettings()).updateBucketSettings(); + } + + /** Returns the object with the settings used for calls to listSinks. */ + public PagedCallSettings + listSinksSettings() { + return ((ConfigServiceV2StubSettings) getStubSettings()).listSinksSettings(); + } + + /** Returns the object with the settings used for calls to getSink. */ + public UnaryCallSettings getSinkSettings() { + return ((ConfigServiceV2StubSettings) getStubSettings()).getSinkSettings(); + } + + /** Returns the object with the settings used for calls to createSink. */ + public UnaryCallSettings createSinkSettings() { + return ((ConfigServiceV2StubSettings) getStubSettings()).createSinkSettings(); + } + + /** Returns the object with the settings used for calls to updateSink. */ + public UnaryCallSettings updateSinkSettings() { + return ((ConfigServiceV2StubSettings) getStubSettings()).updateSinkSettings(); + } + + /** Returns the object with the settings used for calls to deleteSink. */ + public UnaryCallSettings deleteSinkSettings() { + return ((ConfigServiceV2StubSettings) getStubSettings()).deleteSinkSettings(); + } + + /** Returns the object with the settings used for calls to listExclusions. */ + public PagedCallSettings< + ListExclusionsRequest, ListExclusionsResponse, ListExclusionsPagedResponse> + listExclusionsSettings() { + return ((ConfigServiceV2StubSettings) getStubSettings()).listExclusionsSettings(); + } + + /** Returns the object with the settings used for calls to getExclusion. */ + public UnaryCallSettings getExclusionSettings() { + return ((ConfigServiceV2StubSettings) getStubSettings()).getExclusionSettings(); + } + + /** Returns the object with the settings used for calls to createExclusion. */ + public UnaryCallSettings createExclusionSettings() { + return ((ConfigServiceV2StubSettings) getStubSettings()).createExclusionSettings(); + } + + /** Returns the object with the settings used for calls to updateExclusion. */ + public UnaryCallSettings updateExclusionSettings() { + return ((ConfigServiceV2StubSettings) getStubSettings()).updateExclusionSettings(); + } + + /** Returns the object with the settings used for calls to deleteExclusion. */ + public UnaryCallSettings deleteExclusionSettings() { + return ((ConfigServiceV2StubSettings) getStubSettings()).deleteExclusionSettings(); + } + + /** Returns the object with the settings used for calls to getCmekSettings. */ + public UnaryCallSettings getCmekSettingsSettings() { + return ((ConfigServiceV2StubSettings) getStubSettings()).getCmekSettingsSettings(); + } + + /** Returns the object with the settings used for calls to updateCmekSettings. */ + public UnaryCallSettings updateCmekSettingsSettings() { + return ((ConfigServiceV2StubSettings) getStubSettings()).updateCmekSettingsSettings(); + } + + public static final ConfigServiceV2Settings create(ConfigServiceV2StubSettings stub) + throws IOException { + return new ConfigServiceV2Settings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return ConfigServiceV2StubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return ConfigServiceV2StubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return ConfigServiceV2StubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return ConfigServiceV2StubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return ConfigServiceV2StubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return ConfigServiceV2StubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ConfigServiceV2StubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected ConfigServiceV2Settings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for ConfigServiceV2Settings. */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(ConfigServiceV2StubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(ConfigServiceV2StubSettings.newBuilder()); + } + + protected Builder(ConfigServiceV2Settings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(ConfigServiceV2StubSettings.Builder stubSettings) { + super(stubSettings); + } + + public ConfigServiceV2StubSettings.Builder getStubSettingsBuilder() { + return ((ConfigServiceV2StubSettings.Builder) getStubSettings()); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to listBuckets. */ + public PagedCallSettings.Builder< + ListBucketsRequest, ListBucketsResponse, ListBucketsPagedResponse> + listBucketsSettings() { + return getStubSettingsBuilder().listBucketsSettings(); + } + + /** Returns the builder for the settings used for calls to getBucket. */ + public UnaryCallSettings.Builder getBucketSettings() { + return getStubSettingsBuilder().getBucketSettings(); + } + + /** Returns the builder for the settings used for calls to updateBucket. */ + public UnaryCallSettings.Builder updateBucketSettings() { + return getStubSettingsBuilder().updateBucketSettings(); + } + + /** Returns the builder for the settings used for calls to listSinks. */ + public PagedCallSettings.Builder + listSinksSettings() { + return getStubSettingsBuilder().listSinksSettings(); + } + + /** Returns the builder for the settings used for calls to getSink. */ + public UnaryCallSettings.Builder getSinkSettings() { + return getStubSettingsBuilder().getSinkSettings(); + } + + /** Returns the builder for the settings used for calls to createSink. */ + public UnaryCallSettings.Builder createSinkSettings() { + return getStubSettingsBuilder().createSinkSettings(); + } + + /** Returns the builder for the settings used for calls to updateSink. */ + public UnaryCallSettings.Builder updateSinkSettings() { + return getStubSettingsBuilder().updateSinkSettings(); + } + + /** Returns the builder for the settings used for calls to deleteSink. */ + public UnaryCallSettings.Builder deleteSinkSettings() { + return getStubSettingsBuilder().deleteSinkSettings(); + } + + /** Returns the builder for the settings used for calls to listExclusions. */ + public PagedCallSettings.Builder< + ListExclusionsRequest, ListExclusionsResponse, ListExclusionsPagedResponse> + listExclusionsSettings() { + return getStubSettingsBuilder().listExclusionsSettings(); + } + + /** Returns the builder for the settings used for calls to getExclusion. */ + public UnaryCallSettings.Builder getExclusionSettings() { + return getStubSettingsBuilder().getExclusionSettings(); + } + + /** Returns the builder for the settings used for calls to createExclusion. */ + public UnaryCallSettings.Builder + createExclusionSettings() { + return getStubSettingsBuilder().createExclusionSettings(); + } + + /** Returns the builder for the settings used for calls to updateExclusion. */ + public UnaryCallSettings.Builder + updateExclusionSettings() { + return getStubSettingsBuilder().updateExclusionSettings(); + } + + /** Returns the builder for the settings used for calls to deleteExclusion. */ + public UnaryCallSettings.Builder deleteExclusionSettings() { + return getStubSettingsBuilder().deleteExclusionSettings(); + } + + /** Returns the builder for the settings used for calls to getCmekSettings. */ + public UnaryCallSettings.Builder + getCmekSettingsSettings() { + return getStubSettingsBuilder().getCmekSettingsSettings(); + } + + /** Returns the builder for the settings used for calls to updateCmekSettings. */ + public UnaryCallSettings.Builder + updateCmekSettingsSettings() { + return getStubSettingsBuilder().updateCmekSettingsSettings(); + } + + @Override + public ConfigServiceV2Settings build() throws IOException { + return new ConfigServiceV2Settings(this); + } + } +} diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/LoggingServiceV2Client.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/LoggingServiceV2Client.java new file mode 100644 index 000000000..dce69237f --- /dev/null +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/LoggingServiceV2Client.java @@ -0,0 +1,1195 @@ +/* + * Copyright 2020 Google LLC + * + * 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 + * + * https://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.cloud.logging.v2; + +import com.google.api.MonitoredResource; +import com.google.api.MonitoredResourceDescriptor; +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.logging.v2.stub.LoggingServiceV2Stub; +import com.google.cloud.logging.v2.stub.LoggingServiceV2StubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.logging.v2.BillingAccountName; +import com.google.logging.v2.DeleteLogRequest; +import com.google.logging.v2.FolderName; +import com.google.logging.v2.ListLogEntriesRequest; +import com.google.logging.v2.ListLogEntriesResponse; +import com.google.logging.v2.ListLogsRequest; +import com.google.logging.v2.ListLogsResponse; +import com.google.logging.v2.ListMonitoredResourceDescriptorsRequest; +import com.google.logging.v2.ListMonitoredResourceDescriptorsResponse; +import com.google.logging.v2.LogEntry; +import com.google.logging.v2.LogName; +import com.google.logging.v2.OrganizationName; +import com.google.logging.v2.ProjectName; +import com.google.logging.v2.WriteLogEntriesRequest; +import com.google.logging.v2.WriteLogEntriesResponse; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Service for ingesting and querying logs. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (LoggingServiceV2Client loggingServiceV2Client = LoggingServiceV2Client.create()) {
+ *   LogName logName = LogName.ofProjectLogName("[PROJECT]", "[LOG]");
+ *   loggingServiceV2Client.deleteLog(logName);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the loggingServiceV2Client object to clean up resources + * such as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *

This class can be customized by passing in a custom instance of LoggingServiceV2Settings to + * create(). For example: + * + *

To customize credentials: + * + *

+ * 
+ * LoggingServiceV2Settings loggingServiceV2Settings =
+ *     LoggingServiceV2Settings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * LoggingServiceV2Client loggingServiceV2Client =
+ *     LoggingServiceV2Client.create(loggingServiceV2Settings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * LoggingServiceV2Settings loggingServiceV2Settings =
+ *     LoggingServiceV2Settings.newBuilder().setEndpoint(myEndpoint).build();
+ * LoggingServiceV2Client loggingServiceV2Client =
+ *     LoggingServiceV2Client.create(loggingServiceV2Settings);
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class LoggingServiceV2Client implements BackgroundResource { + private final LoggingServiceV2Settings settings; + private final LoggingServiceV2Stub stub; + + /** Constructs an instance of LoggingServiceV2Client with default settings. */ + public static final LoggingServiceV2Client create() throws IOException { + return create(LoggingServiceV2Settings.newBuilder().build()); + } + + /** + * Constructs an instance of LoggingServiceV2Client, 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 final LoggingServiceV2Client create(LoggingServiceV2Settings settings) + throws IOException { + return new LoggingServiceV2Client(settings); + } + + /** + * Constructs an instance of LoggingServiceV2Client, using the given stub for making calls. This + * is for advanced usage - prefer to use LoggingServiceV2Settings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final LoggingServiceV2Client create(LoggingServiceV2Stub stub) { + return new LoggingServiceV2Client(stub); + } + + /** + * Constructs an instance of LoggingServiceV2Client, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected LoggingServiceV2Client(LoggingServiceV2Settings settings) throws IOException { + this.settings = settings; + this.stub = ((LoggingServiceV2StubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected LoggingServiceV2Client(LoggingServiceV2Stub stub) { + this.settings = null; + this.stub = stub; + } + + public final LoggingServiceV2Settings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public LoggingServiceV2Stub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries + * written shortly before the delete operation might not be deleted. Entries received after the + * delete operation with a timestamp before the operation will be deleted. + * + *

Sample code: + * + *


+   * try (LoggingServiceV2Client loggingServiceV2Client = LoggingServiceV2Client.create()) {
+   *   LogName logName = LogName.ofProjectLogName("[PROJECT]", "[LOG]");
+   *   loggingServiceV2Client.deleteLog(logName);
+   * }
+   * 
+ * + * @param logName Required. The resource name of the log to delete: + *

"projects/[PROJECT_ID]/logs/[LOG_ID]" "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" "folders/[FOLDER_ID]/logs/[LOG_ID]" + *

`[LOG_ID]` must be URL-encoded. For example, `"projects/my-project-id/logs/syslog"`, + * `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`. For more + * information about log names, see [LogEntry][google.logging.v2.LogEntry]. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteLog(LogName logName) { + DeleteLogRequest request = + DeleteLogRequest.newBuilder() + .setLogName(logName == null ? null : logName.toString()) + .build(); + deleteLog(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries + * written shortly before the delete operation might not be deleted. Entries received after the + * delete operation with a timestamp before the operation will be deleted. + * + *

Sample code: + * + *


+   * try (LoggingServiceV2Client loggingServiceV2Client = LoggingServiceV2Client.create()) {
+   *   LogName logName = LogName.ofProjectLogName("[PROJECT]", "[LOG]");
+   *   loggingServiceV2Client.deleteLog(logName.toString());
+   * }
+   * 
+ * + * @param logName Required. The resource name of the log to delete: + *

"projects/[PROJECT_ID]/logs/[LOG_ID]" "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" "folders/[FOLDER_ID]/logs/[LOG_ID]" + *

`[LOG_ID]` must be URL-encoded. For example, `"projects/my-project-id/logs/syslog"`, + * `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`. For more + * information about log names, see [LogEntry][google.logging.v2.LogEntry]. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteLog(String logName) { + DeleteLogRequest request = DeleteLogRequest.newBuilder().setLogName(logName).build(); + deleteLog(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries + * written shortly before the delete operation might not be deleted. Entries received after the + * delete operation with a timestamp before the operation will be deleted. + * + *

Sample code: + * + *


+   * try (LoggingServiceV2Client loggingServiceV2Client = LoggingServiceV2Client.create()) {
+   *   LogName logName = LogName.ofProjectLogName("[PROJECT]", "[LOG]");
+   *   DeleteLogRequest request = DeleteLogRequest.newBuilder()
+   *     .setLogName(logName.toString())
+   *     .build();
+   *   loggingServiceV2Client.deleteLog(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteLog(DeleteLogRequest request) { + deleteLogCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries + * written shortly before the delete operation might not be deleted. Entries received after the + * delete operation with a timestamp before the operation will be deleted. + * + *

Sample code: + * + *


+   * try (LoggingServiceV2Client loggingServiceV2Client = LoggingServiceV2Client.create()) {
+   *   LogName logName = LogName.ofProjectLogName("[PROJECT]", "[LOG]");
+   *   DeleteLogRequest request = DeleteLogRequest.newBuilder()
+   *     .setLogName(logName.toString())
+   *     .build();
+   *   ApiFuture<Void> future = loggingServiceV2Client.deleteLogCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable deleteLogCallable() { + return stub.deleteLogCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Writes log entries to Logging. This API method is the only way to send log entries to Logging. + * This method is used, directly or indirectly, by the Logging agent (fluentd) and all logging + * libraries configured to use Logging. A single request may contain log entries for a maximum of + * 1000 different resources (projects, organizations, billing accounts or folders) + * + *

Sample code: + * + *


+   * try (LoggingServiceV2Client loggingServiceV2Client = LoggingServiceV2Client.create()) {
+   *   LogName logName = LogName.ofProjectLogName("[PROJECT]", "[LOG]");
+   *   MonitoredResource resource = MonitoredResource.newBuilder().build();
+   *   Map<String, String> labels = new HashMap<>();
+   *   List<LogEntry> entries = new ArrayList<>();
+   *   WriteLogEntriesResponse response = loggingServiceV2Client.writeLogEntries(logName, resource, labels, entries);
+   * }
+   * 
+ * + * @param logName Optional. A default log resource name that is assigned to all log entries in + * `entries` that do not specify a value for `log_name`: + *

"projects/[PROJECT_ID]/logs/[LOG_ID]" "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" "folders/[FOLDER_ID]/logs/[LOG_ID]" + *

`[LOG_ID]` must be URL-encoded. For example: + *

"projects/my-project-id/logs/syslog" + * "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity" + *

The permission `logging.logEntries.create` is needed on each project, organization, + * billing account, or folder that is receiving new log entries, whether the resource is + * specified in `logName` or in an individual log entry. + * @param resource Optional. A default monitored resource object that is assigned to all log + * entries in `entries` that do not specify a value for `resource`. Example: + *

{ "type": "gce_instance", "labels": { "zone": "us-central1-a", "instance_id": + * "00000000000000000000" }} + *

See [LogEntry][google.logging.v2.LogEntry]. + * @param labels Optional. Default labels that are added to the `labels` field of all log entries + * in `entries`. If a log entry already has a label with the same key as a label in this + * parameter, then the log entry's label is not changed. See + * [LogEntry][google.logging.v2.LogEntry]. + * @param entries Required. The log entries to send to Logging. The order of log entries in this + * list does not matter. Values supplied in this method's `log_name`, `resource`, and `labels` + * fields are copied into those log entries in this list that do not include values for their + * corresponding fields. For more information, see the [LogEntry][google.logging.v2.LogEntry] + * type. + *

If the `timestamp` or `insert_id` fields are missing in log entries, then this method + * supplies the current time or a unique identifier, respectively. The supplied values are + * chosen so that, among the log entries that did not supply their own values, the entries + * earlier in the list will sort before the entries later in the list. See the `entries.list` + * method. + *

Log entries with timestamps that are more than the [logs retention + * period](/logging/quota-policy) in the past or more than 24 hours in the future will not be + * available when calling `entries.list`. However, those log entries can still be [exported + * with LogSinks](/logging/docs/api/tasks/exporting-logs). + *

To improve throughput and to avoid exceeding the [quota limit](/logging/quota-policy) + * for calls to `entries.write`, you should try to include several log entries in this list, + * rather than calling this method for each individual log entry. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final WriteLogEntriesResponse writeLogEntries( + LogName logName, + MonitoredResource resource, + Map labels, + List entries) { + WriteLogEntriesRequest request = + WriteLogEntriesRequest.newBuilder() + .setLogName(logName == null ? null : logName.toString()) + .setResource(resource) + .putAllLabels(labels) + .addAllEntries(entries) + .build(); + return writeLogEntries(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Writes log entries to Logging. This API method is the only way to send log entries to Logging. + * This method is used, directly or indirectly, by the Logging agent (fluentd) and all logging + * libraries configured to use Logging. A single request may contain log entries for a maximum of + * 1000 different resources (projects, organizations, billing accounts or folders) + * + *

Sample code: + * + *


+   * try (LoggingServiceV2Client loggingServiceV2Client = LoggingServiceV2Client.create()) {
+   *   LogName logName = LogName.ofProjectLogName("[PROJECT]", "[LOG]");
+   *   MonitoredResource resource = MonitoredResource.newBuilder().build();
+   *   Map<String, String> labels = new HashMap<>();
+   *   List<LogEntry> entries = new ArrayList<>();
+   *   WriteLogEntriesResponse response = loggingServiceV2Client.writeLogEntries(logName.toString(), resource, labels, entries);
+   * }
+   * 
+ * + * @param logName Optional. A default log resource name that is assigned to all log entries in + * `entries` that do not specify a value for `log_name`: + *

"projects/[PROJECT_ID]/logs/[LOG_ID]" "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" "folders/[FOLDER_ID]/logs/[LOG_ID]" + *

`[LOG_ID]` must be URL-encoded. For example: + *

"projects/my-project-id/logs/syslog" + * "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity" + *

The permission `logging.logEntries.create` is needed on each project, organization, + * billing account, or folder that is receiving new log entries, whether the resource is + * specified in `logName` or in an individual log entry. + * @param resource Optional. A default monitored resource object that is assigned to all log + * entries in `entries` that do not specify a value for `resource`. Example: + *

{ "type": "gce_instance", "labels": { "zone": "us-central1-a", "instance_id": + * "00000000000000000000" }} + *

See [LogEntry][google.logging.v2.LogEntry]. + * @param labels Optional. Default labels that are added to the `labels` field of all log entries + * in `entries`. If a log entry already has a label with the same key as a label in this + * parameter, then the log entry's label is not changed. See + * [LogEntry][google.logging.v2.LogEntry]. + * @param entries Required. The log entries to send to Logging. The order of log entries in this + * list does not matter. Values supplied in this method's `log_name`, `resource`, and `labels` + * fields are copied into those log entries in this list that do not include values for their + * corresponding fields. For more information, see the [LogEntry][google.logging.v2.LogEntry] + * type. + *

If the `timestamp` or `insert_id` fields are missing in log entries, then this method + * supplies the current time or a unique identifier, respectively. The supplied values are + * chosen so that, among the log entries that did not supply their own values, the entries + * earlier in the list will sort before the entries later in the list. See the `entries.list` + * method. + *

Log entries with timestamps that are more than the [logs retention + * period](/logging/quota-policy) in the past or more than 24 hours in the future will not be + * available when calling `entries.list`. However, those log entries can still be [exported + * with LogSinks](/logging/docs/api/tasks/exporting-logs). + *

To improve throughput and to avoid exceeding the [quota limit](/logging/quota-policy) + * for calls to `entries.write`, you should try to include several log entries in this list, + * rather than calling this method for each individual log entry. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final 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 + /** + * Writes log entries to Logging. This API method is the only way to send log entries to Logging. + * This method is used, directly or indirectly, by the Logging agent (fluentd) and all logging + * libraries configured to use Logging. A single request may contain log entries for a maximum of + * 1000 different resources (projects, organizations, billing accounts or folders) + * + *

Sample code: + * + *


+   * try (LoggingServiceV2Client loggingServiceV2Client = LoggingServiceV2Client.create()) {
+   *   List<LogEntry> entries = new ArrayList<>();
+   *   WriteLogEntriesRequest request = WriteLogEntriesRequest.newBuilder()
+   *     .addAllEntries(entries)
+   *     .build();
+   *   WriteLogEntriesResponse response = loggingServiceV2Client.writeLogEntries(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final WriteLogEntriesResponse writeLogEntries(WriteLogEntriesRequest request) { + return writeLogEntriesCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Writes log entries to Logging. This API method is the only way to send log entries to Logging. + * This method is used, directly or indirectly, by the Logging agent (fluentd) and all logging + * libraries configured to use Logging. A single request may contain log entries for a maximum of + * 1000 different resources (projects, organizations, billing accounts or folders) + * + *

Sample code: + * + *


+   * try (LoggingServiceV2Client loggingServiceV2Client = LoggingServiceV2Client.create()) {
+   *   List<LogEntry> entries = new ArrayList<>();
+   *   WriteLogEntriesRequest request = WriteLogEntriesRequest.newBuilder()
+   *     .addAllEntries(entries)
+   *     .build();
+   *   ApiFuture<WriteLogEntriesResponse> future = loggingServiceV2Client.writeLogEntriesCallable().futureCall(request);
+   *   // Do something
+   *   WriteLogEntriesResponse response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + writeLogEntriesCallable() { + return stub.writeLogEntriesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists log entries. Use this method to retrieve log entries that originated from a + * project/folder/organization/billing account. For ways to export log entries, see [Exporting + * Logs](/logging/docs/export). + * + *

Sample code: + * + *


+   * try (LoggingServiceV2Client loggingServiceV2Client = LoggingServiceV2Client.create()) {
+   *   List<String> formattedResourceNames = new ArrayList<>();
+   *   String filter = "";
+   *   String orderBy = "";
+   *   for (LogEntry element : loggingServiceV2Client.listLogEntries(formattedResourceNames, filter, orderBy).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param resourceNames Required. Names of one or more parent resources from which to retrieve log + * entries: + *

"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + *

Projects listed in the `project_ids` field are added to this list. + * @param filter Optional. A filter that chooses which log entries to return. See [Advanced Logs + * Queries](/logging/docs/view/advanced-queries). Only log entries that match the filter are + * returned. An empty filter matches all log entries in the resources listed in + * `resource_names`. Referencing a parent resource that is not listed in `resource_names` will + * cause the filter to return no results. The maximum length of the filter is 20000 + * characters. + * @param orderBy Optional. How the results should be sorted. Presently, the only permitted values + * are `"timestamp asc"` (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 their `insert_id` values. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListLogEntriesPagedResponse listLogEntries( + List resourceNames, String filter, String orderBy) { + ListLogEntriesRequest request = + ListLogEntriesRequest.newBuilder() + .addAllResourceNames(resourceNames) + .setFilter(filter) + .setOrderBy(orderBy) + .build(); + return listLogEntries(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists log entries. Use this method to retrieve log entries that originated from a + * project/folder/organization/billing account. For ways to export log entries, see [Exporting + * Logs](/logging/docs/export). + * + *

Sample code: + * + *


+   * try (LoggingServiceV2Client loggingServiceV2Client = LoggingServiceV2Client.create()) {
+   *   List<ProjectName> resourceNames = new ArrayList<>();
+   *   ListLogEntriesRequest request = ListLogEntriesRequest.newBuilder()
+   *     .addAllResourceNames(ProjectName.toStringList(resourceNames))
+   *     .build();
+   *   for (LogEntry element : loggingServiceV2Client.listLogEntries(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListLogEntriesPagedResponse listLogEntries(ListLogEntriesRequest request) { + return listLogEntriesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists log entries. Use this method to retrieve log entries that originated from a + * project/folder/organization/billing account. For ways to export log entries, see [Exporting + * Logs](/logging/docs/export). + * + *

Sample code: + * + *


+   * try (LoggingServiceV2Client loggingServiceV2Client = LoggingServiceV2Client.create()) {
+   *   List<ProjectName> resourceNames = new ArrayList<>();
+   *   ListLogEntriesRequest request = ListLogEntriesRequest.newBuilder()
+   *     .addAllResourceNames(ProjectName.toStringList(resourceNames))
+   *     .build();
+   *   ApiFuture<ListLogEntriesPagedResponse> future = loggingServiceV2Client.listLogEntriesPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (LogEntry element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listLogEntriesPagedCallable() { + return stub.listLogEntriesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists log entries. Use this method to retrieve log entries that originated from a + * project/folder/organization/billing account. For ways to export log entries, see [Exporting + * Logs](/logging/docs/export). + * + *

Sample code: + * + *


+   * try (LoggingServiceV2Client loggingServiceV2Client = LoggingServiceV2Client.create()) {
+   *   List<ProjectName> resourceNames = new ArrayList<>();
+   *   ListLogEntriesRequest request = ListLogEntriesRequest.newBuilder()
+   *     .addAllResourceNames(ProjectName.toStringList(resourceNames))
+   *     .build();
+   *   while (true) {
+   *     ListLogEntriesResponse response = loggingServiceV2Client.listLogEntriesCallable().call(request);
+   *     for (LogEntry element : response.getEntriesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listLogEntriesCallable() { + return stub.listLogEntriesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists the descriptors for monitored resource types used by Logging. + * + *

Sample code: + * + *


+   * try (LoggingServiceV2Client loggingServiceV2Client = LoggingServiceV2Client.create()) {
+   *   ListMonitoredResourceDescriptorsRequest request = ListMonitoredResourceDescriptorsRequest.newBuilder().build();
+   *   for (MonitoredResourceDescriptor element : loggingServiceV2Client.listMonitoredResourceDescriptors(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListMonitoredResourceDescriptorsPagedResponse listMonitoredResourceDescriptors( + ListMonitoredResourceDescriptorsRequest request) { + return listMonitoredResourceDescriptorsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists the descriptors for monitored resource types used by Logging. + * + *

Sample code: + * + *


+   * try (LoggingServiceV2Client loggingServiceV2Client = LoggingServiceV2Client.create()) {
+   *   ListMonitoredResourceDescriptorsRequest request = ListMonitoredResourceDescriptorsRequest.newBuilder().build();
+   *   ApiFuture<ListMonitoredResourceDescriptorsPagedResponse> future = loggingServiceV2Client.listMonitoredResourceDescriptorsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (MonitoredResourceDescriptor element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable< + ListMonitoredResourceDescriptorsRequest, ListMonitoredResourceDescriptorsPagedResponse> + listMonitoredResourceDescriptorsPagedCallable() { + return stub.listMonitoredResourceDescriptorsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists the descriptors for monitored resource types used by Logging. + * + *

Sample code: + * + *


+   * try (LoggingServiceV2Client loggingServiceV2Client = LoggingServiceV2Client.create()) {
+   *   ListMonitoredResourceDescriptorsRequest request = ListMonitoredResourceDescriptorsRequest.newBuilder().build();
+   *   while (true) {
+   *     ListMonitoredResourceDescriptorsResponse response = loggingServiceV2Client.listMonitoredResourceDescriptorsCallable().call(request);
+   *     for (MonitoredResourceDescriptor element : response.getResourceDescriptorsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable< + ListMonitoredResourceDescriptorsRequest, ListMonitoredResourceDescriptorsResponse> + listMonitoredResourceDescriptorsCallable() { + return stub.listMonitoredResourceDescriptorsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have + * entries are listed. + * + *

Sample code: + * + *


+   * try (LoggingServiceV2Client loggingServiceV2Client = LoggingServiceV2Client.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   for (String element : loggingServiceV2Client.listLogs(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The resource name that owns the logs: + *

"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListLogsPagedResponse listLogs(ProjectName parent) { + ListLogsRequest request = + ListLogsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + return listLogs(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have + * entries are listed. + * + *

Sample code: + * + *


+   * try (LoggingServiceV2Client loggingServiceV2Client = LoggingServiceV2Client.create()) {
+   *   OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+   *   for (String element : loggingServiceV2Client.listLogs(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The resource name that owns the logs: + *

"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListLogsPagedResponse listLogs(OrganizationName parent) { + ListLogsRequest request = + ListLogsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + return listLogs(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have + * entries are listed. + * + *

Sample code: + * + *


+   * try (LoggingServiceV2Client loggingServiceV2Client = LoggingServiceV2Client.create()) {
+   *   FolderName parent = FolderName.of("[FOLDER]");
+   *   for (String element : loggingServiceV2Client.listLogs(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The resource name that owns the logs: + *

"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListLogsPagedResponse listLogs(FolderName parent) { + ListLogsRequest request = + ListLogsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + return listLogs(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have + * entries are listed. + * + *

Sample code: + * + *


+   * try (LoggingServiceV2Client loggingServiceV2Client = LoggingServiceV2Client.create()) {
+   *   BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]");
+   *   for (String element : loggingServiceV2Client.listLogs(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The resource name that owns the logs: + *

"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListLogsPagedResponse listLogs(BillingAccountName parent) { + ListLogsRequest request = + ListLogsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + return listLogs(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have + * entries are listed. + * + *

Sample code: + * + *


+   * try (LoggingServiceV2Client loggingServiceV2Client = LoggingServiceV2Client.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   for (String element : loggingServiceV2Client.listLogs(parent.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The resource name that owns the logs: + *

"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListLogsPagedResponse listLogs(String parent) { + ListLogsRequest request = ListLogsRequest.newBuilder().setParent(parent).build(); + return listLogs(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have + * entries are listed. + * + *

Sample code: + * + *


+   * try (LoggingServiceV2Client loggingServiceV2Client = LoggingServiceV2Client.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   ListLogsRequest request = ListLogsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   for (String element : loggingServiceV2Client.listLogs(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListLogsPagedResponse listLogs(ListLogsRequest request) { + return listLogsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have + * entries are listed. + * + *

Sample code: + * + *


+   * try (LoggingServiceV2Client loggingServiceV2Client = LoggingServiceV2Client.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   ListLogsRequest request = ListLogsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   ApiFuture<ListLogsPagedResponse> future = loggingServiceV2Client.listLogsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (String element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable listLogsPagedCallable() { + return stub.listLogsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have + * entries are listed. + * + *

Sample code: + * + *


+   * try (LoggingServiceV2Client loggingServiceV2Client = LoggingServiceV2Client.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   ListLogsRequest request = ListLogsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   while (true) {
+   *     ListLogsResponse response = loggingServiceV2Client.listLogsCallable().call(request);
+   *     for (String element : response.getLogNamesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable listLogsCallable() { + return stub.listLogsCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListLogEntriesPagedResponse + extends AbstractPagedListResponse< + ListLogEntriesRequest, + ListLogEntriesResponse, + LogEntry, + ListLogEntriesPage, + ListLogEntriesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLogEntriesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListLogEntriesPagedResponse apply(ListLogEntriesPage input) { + return new ListLogEntriesPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListLogEntriesPagedResponse(ListLogEntriesPage page) { + super(page, ListLogEntriesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLogEntriesPage + extends AbstractPage< + ListLogEntriesRequest, ListLogEntriesResponse, LogEntry, ListLogEntriesPage> { + + private ListLogEntriesPage( + PageContext context, + ListLogEntriesResponse response) { + super(context, response); + } + + private static ListLogEntriesPage createEmptyPage() { + return new ListLogEntriesPage(null, null); + } + + @Override + protected ListLogEntriesPage createPage( + PageContext context, + ListLogEntriesResponse response) { + return new ListLogEntriesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLogEntriesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLogEntriesRequest, + ListLogEntriesResponse, + LogEntry, + ListLogEntriesPage, + ListLogEntriesFixedSizeCollection> { + + private ListLogEntriesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLogEntriesFixedSizeCollection createEmptyCollection() { + return new ListLogEntriesFixedSizeCollection(null, 0); + } + + @Override + protected ListLogEntriesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLogEntriesFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListMonitoredResourceDescriptorsPagedResponse + extends AbstractPagedListResponse< + ListMonitoredResourceDescriptorsRequest, + ListMonitoredResourceDescriptorsResponse, + MonitoredResourceDescriptor, + ListMonitoredResourceDescriptorsPage, + ListMonitoredResourceDescriptorsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext< + ListMonitoredResourceDescriptorsRequest, + ListMonitoredResourceDescriptorsResponse, + MonitoredResourceDescriptor> + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListMonitoredResourceDescriptorsPage.createEmptyPage() + .createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction< + ListMonitoredResourceDescriptorsPage, + ListMonitoredResourceDescriptorsPagedResponse>() { + @Override + public ListMonitoredResourceDescriptorsPagedResponse apply( + ListMonitoredResourceDescriptorsPage input) { + return new ListMonitoredResourceDescriptorsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListMonitoredResourceDescriptorsPagedResponse( + ListMonitoredResourceDescriptorsPage page) { + super(page, ListMonitoredResourceDescriptorsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListMonitoredResourceDescriptorsPage + extends AbstractPage< + ListMonitoredResourceDescriptorsRequest, + ListMonitoredResourceDescriptorsResponse, + MonitoredResourceDescriptor, + ListMonitoredResourceDescriptorsPage> { + + private ListMonitoredResourceDescriptorsPage( + PageContext< + ListMonitoredResourceDescriptorsRequest, + ListMonitoredResourceDescriptorsResponse, + MonitoredResourceDescriptor> + context, + ListMonitoredResourceDescriptorsResponse response) { + super(context, response); + } + + private static ListMonitoredResourceDescriptorsPage createEmptyPage() { + return new ListMonitoredResourceDescriptorsPage(null, null); + } + + @Override + protected ListMonitoredResourceDescriptorsPage createPage( + PageContext< + ListMonitoredResourceDescriptorsRequest, + ListMonitoredResourceDescriptorsResponse, + MonitoredResourceDescriptor> + context, + ListMonitoredResourceDescriptorsResponse response) { + return new ListMonitoredResourceDescriptorsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext< + ListMonitoredResourceDescriptorsRequest, + ListMonitoredResourceDescriptorsResponse, + MonitoredResourceDescriptor> + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListMonitoredResourceDescriptorsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListMonitoredResourceDescriptorsRequest, + ListMonitoredResourceDescriptorsResponse, + MonitoredResourceDescriptor, + ListMonitoredResourceDescriptorsPage, + ListMonitoredResourceDescriptorsFixedSizeCollection> { + + private ListMonitoredResourceDescriptorsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListMonitoredResourceDescriptorsFixedSizeCollection createEmptyCollection() { + return new ListMonitoredResourceDescriptorsFixedSizeCollection(null, 0); + } + + @Override + protected ListMonitoredResourceDescriptorsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListMonitoredResourceDescriptorsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListLogsPagedResponse + extends AbstractPagedListResponse< + ListLogsRequest, ListLogsResponse, String, ListLogsPage, ListLogsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLogsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListLogsPagedResponse apply(ListLogsPage input) { + return new ListLogsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListLogsPagedResponse(ListLogsPage page) { + super(page, ListLogsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLogsPage + extends AbstractPage { + + private ListLogsPage( + PageContext context, ListLogsResponse response) { + super(context, response); + } + + private static ListLogsPage createEmptyPage() { + return new ListLogsPage(null, null); + } + + @Override + protected ListLogsPage createPage( + PageContext context, ListLogsResponse response) { + return new ListLogsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLogsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLogsRequest, ListLogsResponse, String, ListLogsPage, ListLogsFixedSizeCollection> { + + private ListLogsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLogsFixedSizeCollection createEmptyCollection() { + return new ListLogsFixedSizeCollection(null, 0); + } + + @Override + protected ListLogsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLogsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/LoggingServiceV2Settings.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/LoggingServiceV2Settings.java new file mode 100644 index 000000000..1ef1a9e8e --- /dev/null +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/LoggingServiceV2Settings.java @@ -0,0 +1,251 @@ +/* + * Copyright 2020 Google LLC + * + * 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 + * + * https://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.cloud.logging.v2; + +import static com.google.cloud.logging.v2.LoggingServiceV2Client.ListLogEntriesPagedResponse; +import static com.google.cloud.logging.v2.LoggingServiceV2Client.ListLogsPagedResponse; +import static com.google.cloud.logging.v2.LoggingServiceV2Client.ListMonitoredResourceDescriptorsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.logging.v2.stub.LoggingServiceV2StubSettings; +import com.google.logging.v2.DeleteLogRequest; +import com.google.logging.v2.ListLogEntriesRequest; +import com.google.logging.v2.ListLogEntriesResponse; +import com.google.logging.v2.ListLogsRequest; +import com.google.logging.v2.ListLogsResponse; +import com.google.logging.v2.ListMonitoredResourceDescriptorsRequest; +import com.google.logging.v2.ListMonitoredResourceDescriptorsResponse; +import com.google.logging.v2.WriteLogEntriesRequest; +import com.google.logging.v2.WriteLogEntriesResponse; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link LoggingServiceV2Client}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (logging.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of deleteLog to 30 seconds: + * + *

+ * 
+ * LoggingServiceV2Settings.Builder loggingServiceV2SettingsBuilder =
+ *     LoggingServiceV2Settings.newBuilder();
+ * loggingServiceV2SettingsBuilder
+ *     .deleteLogSettings()
+ *     .setRetrySettings(
+ *         loggingServiceV2SettingsBuilder.deleteLogSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * LoggingServiceV2Settings loggingServiceV2Settings = loggingServiceV2SettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class LoggingServiceV2Settings extends ClientSettings { + /** Returns the object with the settings used for calls to deleteLog. */ + public UnaryCallSettings deleteLogSettings() { + return ((LoggingServiceV2StubSettings) getStubSettings()).deleteLogSettings(); + } + + /** Returns the object with the settings used for calls to writeLogEntries. */ + public UnaryCallSettings + writeLogEntriesSettings() { + return ((LoggingServiceV2StubSettings) getStubSettings()).writeLogEntriesSettings(); + } + + /** Returns the object with the settings used for calls to listLogEntries. */ + public PagedCallSettings< + ListLogEntriesRequest, ListLogEntriesResponse, ListLogEntriesPagedResponse> + listLogEntriesSettings() { + return ((LoggingServiceV2StubSettings) getStubSettings()).listLogEntriesSettings(); + } + + /** Returns the object with the settings used for calls to listMonitoredResourceDescriptors. */ + public PagedCallSettings< + ListMonitoredResourceDescriptorsRequest, + ListMonitoredResourceDescriptorsResponse, + ListMonitoredResourceDescriptorsPagedResponse> + listMonitoredResourceDescriptorsSettings() { + return ((LoggingServiceV2StubSettings) getStubSettings()) + .listMonitoredResourceDescriptorsSettings(); + } + + /** Returns the object with the settings used for calls to listLogs. */ + public PagedCallSettings + listLogsSettings() { + return ((LoggingServiceV2StubSettings) getStubSettings()).listLogsSettings(); + } + + public static final LoggingServiceV2Settings create(LoggingServiceV2StubSettings stub) + throws IOException { + return new LoggingServiceV2Settings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return LoggingServiceV2StubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return LoggingServiceV2StubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return LoggingServiceV2StubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return LoggingServiceV2StubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return LoggingServiceV2StubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return LoggingServiceV2StubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return LoggingServiceV2StubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected LoggingServiceV2Settings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for LoggingServiceV2Settings. */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(LoggingServiceV2StubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(LoggingServiceV2StubSettings.newBuilder()); + } + + protected Builder(LoggingServiceV2Settings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(LoggingServiceV2StubSettings.Builder stubSettings) { + super(stubSettings); + } + + public LoggingServiceV2StubSettings.Builder getStubSettingsBuilder() { + return ((LoggingServiceV2StubSettings.Builder) getStubSettings()); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to deleteLog. */ + public UnaryCallSettings.Builder deleteLogSettings() { + return getStubSettingsBuilder().deleteLogSettings(); + } + + /** Returns the builder for the settings used for calls to writeLogEntries. */ + public UnaryCallSettings.Builder + writeLogEntriesSettings() { + return getStubSettingsBuilder().writeLogEntriesSettings(); + } + + /** Returns the builder for the settings used for calls to listLogEntries. */ + public PagedCallSettings.Builder< + ListLogEntriesRequest, ListLogEntriesResponse, ListLogEntriesPagedResponse> + listLogEntriesSettings() { + return getStubSettingsBuilder().listLogEntriesSettings(); + } + + /** Returns the builder for the settings used for calls to listMonitoredResourceDescriptors. */ + public PagedCallSettings.Builder< + ListMonitoredResourceDescriptorsRequest, + ListMonitoredResourceDescriptorsResponse, + ListMonitoredResourceDescriptorsPagedResponse> + listMonitoredResourceDescriptorsSettings() { + return getStubSettingsBuilder().listMonitoredResourceDescriptorsSettings(); + } + + /** Returns the builder for the settings used for calls to listLogs. */ + public PagedCallSettings.Builder + listLogsSettings() { + return getStubSettingsBuilder().listLogsSettings(); + } + + @Override + public LoggingServiceV2Settings build() throws IOException { + return new LoggingServiceV2Settings(this); + } + } +} diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/MetricsServiceV2Client.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/MetricsServiceV2Client.java new file mode 100644 index 000000000..cb01524a9 --- /dev/null +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/MetricsServiceV2Client.java @@ -0,0 +1,810 @@ +/* + * Copyright 2020 Google LLC + * + * 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 + * + * https://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.cloud.logging.v2; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.logging.v2.stub.MetricsServiceV2Stub; +import com.google.cloud.logging.v2.stub.MetricsServiceV2StubSettings; +import com.google.common.util.concurrent.MoreExecutors; +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.LogMetricName; +import com.google.logging.v2.ProjectName; +import com.google.logging.v2.UpdateLogMetricRequest; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Service for configuring logs-based metrics. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (MetricsServiceV2Client metricsServiceV2Client = MetricsServiceV2Client.create()) {
+ *   LogMetricName metricName = LogMetricName.of("[PROJECT]", "[METRIC]");
+ *   LogMetric response = metricsServiceV2Client.getLogMetric(metricName);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the metricsServiceV2Client object to clean up resources + * such as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *

This class can be customized by passing in a custom instance of MetricsServiceV2Settings to + * create(). For example: + * + *

To customize credentials: + * + *

+ * 
+ * MetricsServiceV2Settings metricsServiceV2Settings =
+ *     MetricsServiceV2Settings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * MetricsServiceV2Client metricsServiceV2Client =
+ *     MetricsServiceV2Client.create(metricsServiceV2Settings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * MetricsServiceV2Settings metricsServiceV2Settings =
+ *     MetricsServiceV2Settings.newBuilder().setEndpoint(myEndpoint).build();
+ * MetricsServiceV2Client metricsServiceV2Client =
+ *     MetricsServiceV2Client.create(metricsServiceV2Settings);
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class MetricsServiceV2Client implements BackgroundResource { + private final MetricsServiceV2Settings settings; + private final MetricsServiceV2Stub stub; + + /** Constructs an instance of MetricsServiceV2Client with default settings. */ + public static final MetricsServiceV2Client create() throws IOException { + return create(MetricsServiceV2Settings.newBuilder().build()); + } + + /** + * Constructs an instance of MetricsServiceV2Client, 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 final MetricsServiceV2Client create(MetricsServiceV2Settings settings) + throws IOException { + return new MetricsServiceV2Client(settings); + } + + /** + * Constructs an instance of MetricsServiceV2Client, using the given stub for making calls. This + * is for advanced usage - prefer to use MetricsServiceV2Settings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final MetricsServiceV2Client create(MetricsServiceV2Stub stub) { + return new MetricsServiceV2Client(stub); + } + + /** + * Constructs an instance of MetricsServiceV2Client, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected MetricsServiceV2Client(MetricsServiceV2Settings settings) throws IOException { + this.settings = settings; + this.stub = ((MetricsServiceV2StubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected MetricsServiceV2Client(MetricsServiceV2Stub stub) { + this.settings = null; + this.stub = stub; + } + + public final MetricsServiceV2Settings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public MetricsServiceV2Stub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists logs-based metrics. + * + *

Sample code: + * + *


+   * try (MetricsServiceV2Client metricsServiceV2Client = MetricsServiceV2Client.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   for (LogMetric element : metricsServiceV2Client.listLogMetrics(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The name of the project containing the metrics: + *

"projects/[PROJECT_ID]" + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListLogMetricsPagedResponse listLogMetrics(ProjectName parent) { + ListLogMetricsRequest request = + ListLogMetricsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listLogMetrics(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists logs-based metrics. + * + *

Sample code: + * + *


+   * try (MetricsServiceV2Client metricsServiceV2Client = MetricsServiceV2Client.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   for (LogMetric element : metricsServiceV2Client.listLogMetrics(parent.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The name of the project containing the metrics: + *

"projects/[PROJECT_ID]" + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListLogMetricsPagedResponse listLogMetrics(String parent) { + ListLogMetricsRequest request = ListLogMetricsRequest.newBuilder().setParent(parent).build(); + return listLogMetrics(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists logs-based metrics. + * + *

Sample code: + * + *


+   * try (MetricsServiceV2Client metricsServiceV2Client = MetricsServiceV2Client.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   ListLogMetricsRequest request = ListLogMetricsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   for (LogMetric element : metricsServiceV2Client.listLogMetrics(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListLogMetricsPagedResponse listLogMetrics(ListLogMetricsRequest request) { + return listLogMetricsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists logs-based metrics. + * + *

Sample code: + * + *


+   * try (MetricsServiceV2Client metricsServiceV2Client = MetricsServiceV2Client.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   ListLogMetricsRequest request = ListLogMetricsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   ApiFuture<ListLogMetricsPagedResponse> future = metricsServiceV2Client.listLogMetricsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (LogMetric element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listLogMetricsPagedCallable() { + return stub.listLogMetricsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists logs-based metrics. + * + *

Sample code: + * + *


+   * try (MetricsServiceV2Client metricsServiceV2Client = MetricsServiceV2Client.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   ListLogMetricsRequest request = ListLogMetricsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   while (true) {
+   *     ListLogMetricsResponse response = metricsServiceV2Client.listLogMetricsCallable().call(request);
+   *     for (LogMetric element : response.getMetricsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listLogMetricsCallable() { + return stub.listLogMetricsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a logs-based metric. + * + *

Sample code: + * + *


+   * try (MetricsServiceV2Client metricsServiceV2Client = MetricsServiceV2Client.create()) {
+   *   LogMetricName metricName = LogMetricName.of("[PROJECT]", "[METRIC]");
+   *   LogMetric response = metricsServiceV2Client.getLogMetric(metricName);
+   * }
+   * 
+ * + * @param metricName Required. The resource name of the desired metric: + *

"projects/[PROJECT_ID]/metrics/[METRIC_ID]" + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogMetric getLogMetric(LogMetricName metricName) { + GetLogMetricRequest request = + GetLogMetricRequest.newBuilder() + .setMetricName(metricName == null ? null : metricName.toString()) + .build(); + return getLogMetric(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a logs-based metric. + * + *

Sample code: + * + *


+   * try (MetricsServiceV2Client metricsServiceV2Client = MetricsServiceV2Client.create()) {
+   *   LogMetricName metricName = LogMetricName.of("[PROJECT]", "[METRIC]");
+   *   LogMetric response = metricsServiceV2Client.getLogMetric(metricName.toString());
+   * }
+   * 
+ * + * @param metricName Required. The resource name of the desired metric: + *

"projects/[PROJECT_ID]/metrics/[METRIC_ID]" + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogMetric getLogMetric(String metricName) { + GetLogMetricRequest request = + GetLogMetricRequest.newBuilder().setMetricName(metricName).build(); + return getLogMetric(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a logs-based metric. + * + *

Sample code: + * + *


+   * try (MetricsServiceV2Client metricsServiceV2Client = MetricsServiceV2Client.create()) {
+   *   LogMetricName metricName = LogMetricName.of("[PROJECT]", "[METRIC]");
+   *   GetLogMetricRequest request = GetLogMetricRequest.newBuilder()
+   *     .setMetricName(metricName.toString())
+   *     .build();
+   *   LogMetric response = metricsServiceV2Client.getLogMetric(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogMetric getLogMetric(GetLogMetricRequest request) { + return getLogMetricCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a logs-based metric. + * + *

Sample code: + * + *


+   * try (MetricsServiceV2Client metricsServiceV2Client = MetricsServiceV2Client.create()) {
+   *   LogMetricName metricName = LogMetricName.of("[PROJECT]", "[METRIC]");
+   *   GetLogMetricRequest request = GetLogMetricRequest.newBuilder()
+   *     .setMetricName(metricName.toString())
+   *     .build();
+   *   ApiFuture<LogMetric> future = metricsServiceV2Client.getLogMetricCallable().futureCall(request);
+   *   // Do something
+   *   LogMetric response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getLogMetricCallable() { + return stub.getLogMetricCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a logs-based metric. + * + *

Sample code: + * + *


+   * try (MetricsServiceV2Client metricsServiceV2Client = MetricsServiceV2Client.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   LogMetric metric = LogMetric.newBuilder().build();
+   *   LogMetric response = metricsServiceV2Client.createLogMetric(parent, metric);
+   * }
+   * 
+ * + * @param parent Required. The resource name of the project in which to create the metric: + *

"projects/[PROJECT_ID]" + *

The new metric must be provided in the request. + * @param metric Required. The new logs-based metric, which must not have an identifier that + * already exists. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogMetric createLogMetric(ProjectName parent, LogMetric metric) { + CreateLogMetricRequest request = + CreateLogMetricRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setMetric(metric) + .build(); + return createLogMetric(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a logs-based metric. + * + *

Sample code: + * + *


+   * try (MetricsServiceV2Client metricsServiceV2Client = MetricsServiceV2Client.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   LogMetric metric = LogMetric.newBuilder().build();
+   *   LogMetric response = metricsServiceV2Client.createLogMetric(parent.toString(), metric);
+   * }
+   * 
+ * + * @param parent Required. The resource name of the project in which to create the metric: + *

"projects/[PROJECT_ID]" + *

The new metric must be provided in the request. + * @param metric Required. The new logs-based metric, which must not have an identifier that + * already exists. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogMetric createLogMetric(String parent, LogMetric metric) { + CreateLogMetricRequest request = + CreateLogMetricRequest.newBuilder().setParent(parent).setMetric(metric).build(); + return createLogMetric(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a logs-based metric. + * + *

Sample code: + * + *


+   * try (MetricsServiceV2Client metricsServiceV2Client = MetricsServiceV2Client.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   LogMetric metric = LogMetric.newBuilder().build();
+   *   CreateLogMetricRequest request = CreateLogMetricRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setMetric(metric)
+   *     .build();
+   *   LogMetric response = metricsServiceV2Client.createLogMetric(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogMetric createLogMetric(CreateLogMetricRequest request) { + return createLogMetricCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a logs-based metric. + * + *

Sample code: + * + *


+   * try (MetricsServiceV2Client metricsServiceV2Client = MetricsServiceV2Client.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   LogMetric metric = LogMetric.newBuilder().build();
+   *   CreateLogMetricRequest request = CreateLogMetricRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setMetric(metric)
+   *     .build();
+   *   ApiFuture<LogMetric> future = metricsServiceV2Client.createLogMetricCallable().futureCall(request);
+   *   // Do something
+   *   LogMetric response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable createLogMetricCallable() { + return stub.createLogMetricCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates or updates a logs-based metric. + * + *

Sample code: + * + *


+   * try (MetricsServiceV2Client metricsServiceV2Client = MetricsServiceV2Client.create()) {
+   *   LogMetricName metricName = LogMetricName.of("[PROJECT]", "[METRIC]");
+   *   LogMetric metric = LogMetric.newBuilder().build();
+   *   LogMetric response = metricsServiceV2Client.updateLogMetric(metricName, metric);
+   * }
+   * 
+ * + * @param metricName Required. The resource name of the metric to update: + *

"projects/[PROJECT_ID]/metrics/[METRIC_ID]" + *

The updated metric must be provided in the request and it's `name` field must be the + * same as `[METRIC_ID]` If the metric does not exist in `[PROJECT_ID]`, then a new metric is + * created. + * @param metric Required. The updated metric. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogMetric updateLogMetric(LogMetricName metricName, LogMetric metric) { + UpdateLogMetricRequest request = + UpdateLogMetricRequest.newBuilder() + .setMetricName(metricName == null ? null : metricName.toString()) + .setMetric(metric) + .build(); + return updateLogMetric(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates or updates a logs-based metric. + * + *

Sample code: + * + *


+   * try (MetricsServiceV2Client metricsServiceV2Client = MetricsServiceV2Client.create()) {
+   *   LogMetricName metricName = LogMetricName.of("[PROJECT]", "[METRIC]");
+   *   LogMetric metric = LogMetric.newBuilder().build();
+   *   LogMetric response = metricsServiceV2Client.updateLogMetric(metricName.toString(), metric);
+   * }
+   * 
+ * + * @param metricName Required. The resource name of the metric to update: + *

"projects/[PROJECT_ID]/metrics/[METRIC_ID]" + *

The updated metric must be provided in the request and it's `name` field must be the + * same as `[METRIC_ID]` If the metric does not exist in `[PROJECT_ID]`, then a new metric is + * created. + * @param metric Required. The updated metric. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogMetric updateLogMetric(String metricName, LogMetric metric) { + UpdateLogMetricRequest request = + UpdateLogMetricRequest.newBuilder().setMetricName(metricName).setMetric(metric).build(); + return updateLogMetric(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates or updates a logs-based metric. + * + *

Sample code: + * + *


+   * try (MetricsServiceV2Client metricsServiceV2Client = MetricsServiceV2Client.create()) {
+   *   LogMetricName metricName = LogMetricName.of("[PROJECT]", "[METRIC]");
+   *   LogMetric metric = LogMetric.newBuilder().build();
+   *   UpdateLogMetricRequest request = UpdateLogMetricRequest.newBuilder()
+   *     .setMetricName(metricName.toString())
+   *     .setMetric(metric)
+   *     .build();
+   *   LogMetric response = metricsServiceV2Client.updateLogMetric(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogMetric updateLogMetric(UpdateLogMetricRequest request) { + return updateLogMetricCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates or updates a logs-based metric. + * + *

Sample code: + * + *


+   * try (MetricsServiceV2Client metricsServiceV2Client = MetricsServiceV2Client.create()) {
+   *   LogMetricName metricName = LogMetricName.of("[PROJECT]", "[METRIC]");
+   *   LogMetric metric = LogMetric.newBuilder().build();
+   *   UpdateLogMetricRequest request = UpdateLogMetricRequest.newBuilder()
+   *     .setMetricName(metricName.toString())
+   *     .setMetric(metric)
+   *     .build();
+   *   ApiFuture<LogMetric> future = metricsServiceV2Client.updateLogMetricCallable().futureCall(request);
+   *   // Do something
+   *   LogMetric response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable updateLogMetricCallable() { + return stub.updateLogMetricCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a logs-based metric. + * + *

Sample code: + * + *


+   * try (MetricsServiceV2Client metricsServiceV2Client = MetricsServiceV2Client.create()) {
+   *   LogMetricName metricName = LogMetricName.of("[PROJECT]", "[METRIC]");
+   *   metricsServiceV2Client.deleteLogMetric(metricName);
+   * }
+   * 
+ * + * @param metricName Required. The resource name of the metric to delete: + *

"projects/[PROJECT_ID]/metrics/[METRIC_ID]" + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteLogMetric(LogMetricName metricName) { + DeleteLogMetricRequest request = + DeleteLogMetricRequest.newBuilder() + .setMetricName(metricName == null ? null : metricName.toString()) + .build(); + deleteLogMetric(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a logs-based metric. + * + *

Sample code: + * + *


+   * try (MetricsServiceV2Client metricsServiceV2Client = MetricsServiceV2Client.create()) {
+   *   LogMetricName metricName = LogMetricName.of("[PROJECT]", "[METRIC]");
+   *   metricsServiceV2Client.deleteLogMetric(metricName.toString());
+   * }
+   * 
+ * + * @param metricName Required. The resource name of the metric to delete: + *

"projects/[PROJECT_ID]/metrics/[METRIC_ID]" + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteLogMetric(String metricName) { + DeleteLogMetricRequest request = + DeleteLogMetricRequest.newBuilder().setMetricName(metricName).build(); + deleteLogMetric(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a logs-based metric. + * + *

Sample code: + * + *


+   * try (MetricsServiceV2Client metricsServiceV2Client = MetricsServiceV2Client.create()) {
+   *   LogMetricName metricName = LogMetricName.of("[PROJECT]", "[METRIC]");
+   *   DeleteLogMetricRequest request = DeleteLogMetricRequest.newBuilder()
+   *     .setMetricName(metricName.toString())
+   *     .build();
+   *   metricsServiceV2Client.deleteLogMetric(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteLogMetric(DeleteLogMetricRequest request) { + deleteLogMetricCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a logs-based metric. + * + *

Sample code: + * + *


+   * try (MetricsServiceV2Client metricsServiceV2Client = MetricsServiceV2Client.create()) {
+   *   LogMetricName metricName = LogMetricName.of("[PROJECT]", "[METRIC]");
+   *   DeleteLogMetricRequest request = DeleteLogMetricRequest.newBuilder()
+   *     .setMetricName(metricName.toString())
+   *     .build();
+   *   ApiFuture<Void> future = metricsServiceV2Client.deleteLogMetricCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable deleteLogMetricCallable() { + return stub.deleteLogMetricCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListLogMetricsPagedResponse + extends AbstractPagedListResponse< + ListLogMetricsRequest, + ListLogMetricsResponse, + LogMetric, + ListLogMetricsPage, + ListLogMetricsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLogMetricsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListLogMetricsPagedResponse apply(ListLogMetricsPage input) { + return new ListLogMetricsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListLogMetricsPagedResponse(ListLogMetricsPage page) { + super(page, ListLogMetricsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLogMetricsPage + extends AbstractPage< + ListLogMetricsRequest, ListLogMetricsResponse, LogMetric, ListLogMetricsPage> { + + private ListLogMetricsPage( + PageContext context, + ListLogMetricsResponse response) { + super(context, response); + } + + private static ListLogMetricsPage createEmptyPage() { + return new ListLogMetricsPage(null, null); + } + + @Override + protected ListLogMetricsPage createPage( + PageContext context, + ListLogMetricsResponse response) { + return new ListLogMetricsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLogMetricsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLogMetricsRequest, + ListLogMetricsResponse, + LogMetric, + ListLogMetricsPage, + ListLogMetricsFixedSizeCollection> { + + private ListLogMetricsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLogMetricsFixedSizeCollection createEmptyCollection() { + return new ListLogMetricsFixedSizeCollection(null, 0); + } + + @Override + protected ListLogMetricsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLogMetricsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/MetricsServiceV2Settings.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/MetricsServiceV2Settings.java new file mode 100644 index 000000000..1ce6a4683 --- /dev/null +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/MetricsServiceV2Settings.java @@ -0,0 +1,234 @@ +/* + * Copyright 2020 Google LLC + * + * 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 + * + * https://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.cloud.logging.v2; + +import static com.google.cloud.logging.v2.MetricsServiceV2Client.ListLogMetricsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.logging.v2.stub.MetricsServiceV2StubSettings; +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 java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link MetricsServiceV2Client}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (logging.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of getLogMetric to 30 seconds: + * + *

+ * 
+ * MetricsServiceV2Settings.Builder metricsServiceV2SettingsBuilder =
+ *     MetricsServiceV2Settings.newBuilder();
+ * metricsServiceV2SettingsBuilder
+ *     .getLogMetricSettings()
+ *     .setRetrySettings(
+ *         metricsServiceV2SettingsBuilder.getLogMetricSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * MetricsServiceV2Settings metricsServiceV2Settings = metricsServiceV2SettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class MetricsServiceV2Settings extends ClientSettings { + /** Returns the object with the settings used for calls to listLogMetrics. */ + public PagedCallSettings< + ListLogMetricsRequest, ListLogMetricsResponse, ListLogMetricsPagedResponse> + listLogMetricsSettings() { + return ((MetricsServiceV2StubSettings) getStubSettings()).listLogMetricsSettings(); + } + + /** Returns the object with the settings used for calls to getLogMetric. */ + public UnaryCallSettings getLogMetricSettings() { + return ((MetricsServiceV2StubSettings) getStubSettings()).getLogMetricSettings(); + } + + /** Returns the object with the settings used for calls to createLogMetric. */ + public UnaryCallSettings createLogMetricSettings() { + return ((MetricsServiceV2StubSettings) getStubSettings()).createLogMetricSettings(); + } + + /** Returns the object with the settings used for calls to updateLogMetric. */ + public UnaryCallSettings updateLogMetricSettings() { + return ((MetricsServiceV2StubSettings) getStubSettings()).updateLogMetricSettings(); + } + + /** Returns the object with the settings used for calls to deleteLogMetric. */ + public UnaryCallSettings deleteLogMetricSettings() { + return ((MetricsServiceV2StubSettings) getStubSettings()).deleteLogMetricSettings(); + } + + public static final MetricsServiceV2Settings create(MetricsServiceV2StubSettings stub) + throws IOException { + return new MetricsServiceV2Settings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return MetricsServiceV2StubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return MetricsServiceV2StubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return MetricsServiceV2StubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return MetricsServiceV2StubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return MetricsServiceV2StubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return MetricsServiceV2StubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return MetricsServiceV2StubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected MetricsServiceV2Settings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for MetricsServiceV2Settings. */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(MetricsServiceV2StubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(MetricsServiceV2StubSettings.newBuilder()); + } + + protected Builder(MetricsServiceV2Settings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(MetricsServiceV2StubSettings.Builder stubSettings) { + super(stubSettings); + } + + public MetricsServiceV2StubSettings.Builder getStubSettingsBuilder() { + return ((MetricsServiceV2StubSettings.Builder) getStubSettings()); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to listLogMetrics. */ + public PagedCallSettings.Builder< + ListLogMetricsRequest, ListLogMetricsResponse, ListLogMetricsPagedResponse> + listLogMetricsSettings() { + return getStubSettingsBuilder().listLogMetricsSettings(); + } + + /** Returns the builder for the settings used for calls to getLogMetric. */ + public UnaryCallSettings.Builder getLogMetricSettings() { + return getStubSettingsBuilder().getLogMetricSettings(); + } + + /** Returns the builder for the settings used for calls to createLogMetric. */ + public UnaryCallSettings.Builder createLogMetricSettings() { + return getStubSettingsBuilder().createLogMetricSettings(); + } + + /** Returns the builder for the settings used for calls to updateLogMetric. */ + public UnaryCallSettings.Builder updateLogMetricSettings() { + return getStubSettingsBuilder().updateLogMetricSettings(); + } + + /** Returns the builder for the settings used for calls to deleteLogMetric. */ + public UnaryCallSettings.Builder deleteLogMetricSettings() { + return getStubSettingsBuilder().deleteLogMetricSettings(); + } + + @Override + public MetricsServiceV2Settings build() throws IOException { + return new MetricsServiceV2Settings(this); + } + } +} diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/package-info.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/package-info.java index c698c5ea1..70fb3c38f 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/package-info.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/package-info.java @@ -19,47 +19,47 @@ * *

The interfaces provided are listed below, along with usage samples. * - *

============ ConfigClient ============ + *

===================== ConfigServiceV2Client ===================== * *

Service Description: Service for configuring sinks used to route log entries. * - *

Sample for ConfigClient: + *

Sample for ConfigServiceV2Client: * *

  * 
- * try (ConfigClient configClient = ConfigClient.create()) {
- *   SinkName sinkName = ProjectSinkName.of("[PROJECT]", "[SINK]");
- *   LogSink response = configClient.getSink(sinkName);
+ * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+ *   LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]");
+ *   LogSink response = configServiceV2Client.getSink(sinkName);
  * }
  * 
  * 
* - * ============= LoggingClient ============= + * ====================== LoggingServiceV2Client ====================== * *

Service Description: Service for ingesting and querying logs. * - *

Sample for LoggingClient: + *

Sample for LoggingServiceV2Client: * *

  * 
- * try (LoggingClient loggingClient = LoggingClient.create()) {
- *   LogName logName = ProjectLogName.of("[PROJECT]", "[LOG]");
- *   loggingClient.deleteLog(logName);
+ * try (LoggingServiceV2Client loggingServiceV2Client = LoggingServiceV2Client.create()) {
+ *   LogName logName = LogName.ofProjectLogName("[PROJECT]", "[LOG]");
+ *   loggingServiceV2Client.deleteLog(logName);
  * }
  * 
  * 
* - * ============= MetricsClient ============= + * ====================== MetricsServiceV2Client ====================== * *

Service Description: Service for configuring logs-based metrics. * - *

Sample for MetricsClient: + *

Sample for MetricsServiceV2Client: * *

  * 
- * try (MetricsClient metricsClient = MetricsClient.create()) {
- *   MetricName metricName = ProjectMetricName.of("[PROJECT]", "[METRIC]");
- *   LogMetric response = metricsClient.getLogMetric(metricName);
+ * try (MetricsServiceV2Client metricsServiceV2Client = MetricsServiceV2Client.create()) {
+ *   LogMetricName metricName = LogMetricName.of("[PROJECT]", "[METRIC]");
+ *   LogMetric response = metricsServiceV2Client.getLogMetric(metricName);
  * }
  * 
  * 
diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/ConfigServiceV2Stub.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/ConfigServiceV2Stub.java index 703a3521a..5e4273fd2 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/ConfigServiceV2Stub.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/ConfigServiceV2Stub.java @@ -15,8 +15,9 @@ */ package com.google.cloud.logging.v2.stub; -import static com.google.cloud.logging.v2.ConfigClient.ListExclusionsPagedResponse; -import static com.google.cloud.logging.v2.ConfigClient.ListSinksPagedResponse; +import static com.google.cloud.logging.v2.ConfigServiceV2Client.ListBucketsPagedResponse; +import static com.google.cloud.logging.v2.ConfigServiceV2Client.ListExclusionsPagedResponse; +import static com.google.cloud.logging.v2.ConfigServiceV2Client.ListSinksPagedResponse; import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; @@ -26,15 +27,20 @@ import com.google.logging.v2.CreateSinkRequest; import com.google.logging.v2.DeleteExclusionRequest; import com.google.logging.v2.DeleteSinkRequest; +import com.google.logging.v2.GetBucketRequest; import com.google.logging.v2.GetCmekSettingsRequest; import com.google.logging.v2.GetExclusionRequest; import com.google.logging.v2.GetSinkRequest; +import com.google.logging.v2.ListBucketsRequest; +import com.google.logging.v2.ListBucketsResponse; import com.google.logging.v2.ListExclusionsRequest; import com.google.logging.v2.ListExclusionsResponse; import com.google.logging.v2.ListSinksRequest; import com.google.logging.v2.ListSinksResponse; +import com.google.logging.v2.LogBucket; import com.google.logging.v2.LogExclusion; import com.google.logging.v2.LogSink; +import com.google.logging.v2.UpdateBucketRequest; import com.google.logging.v2.UpdateCmekSettingsRequest; import com.google.logging.v2.UpdateExclusionRequest; import com.google.logging.v2.UpdateSinkRequest; @@ -51,6 +57,22 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class ConfigServiceV2Stub implements BackgroundResource { + public UnaryCallable listBucketsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listBucketsPagedCallable()"); + } + + public UnaryCallable listBucketsCallable() { + throw new UnsupportedOperationException("Not implemented: listBucketsCallable()"); + } + + public UnaryCallable getBucketCallable() { + throw new UnsupportedOperationException("Not implemented: getBucketCallable()"); + } + + public UnaryCallable updateBucketCallable() { + throw new UnsupportedOperationException("Not implemented: updateBucketCallable()"); + } + public UnaryCallable listSinksPagedCallable() { throw new UnsupportedOperationException("Not implemented: listSinksPagedCallable()"); } diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/ConfigServiceV2StubSettings.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/ConfigServiceV2StubSettings.java index 3953e3e5e..68bd5b2a1 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/ConfigServiceV2StubSettings.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/ConfigServiceV2StubSettings.java @@ -15,8 +15,9 @@ */ package com.google.cloud.logging.v2.stub; -import static com.google.cloud.logging.v2.ConfigClient.ListExclusionsPagedResponse; -import static com.google.cloud.logging.v2.ConfigClient.ListSinksPagedResponse; +import static com.google.cloud.logging.v2.ConfigServiceV2Client.ListBucketsPagedResponse; +import static com.google.cloud.logging.v2.ConfigServiceV2Client.ListExclusionsPagedResponse; +import static com.google.cloud.logging.v2.ConfigServiceV2Client.ListSinksPagedResponse; import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; @@ -49,15 +50,20 @@ import com.google.logging.v2.CreateSinkRequest; import com.google.logging.v2.DeleteExclusionRequest; import com.google.logging.v2.DeleteSinkRequest; +import com.google.logging.v2.GetBucketRequest; import com.google.logging.v2.GetCmekSettingsRequest; import com.google.logging.v2.GetExclusionRequest; import com.google.logging.v2.GetSinkRequest; +import com.google.logging.v2.ListBucketsRequest; +import com.google.logging.v2.ListBucketsResponse; import com.google.logging.v2.ListExclusionsRequest; import com.google.logging.v2.ListExclusionsResponse; import com.google.logging.v2.ListSinksRequest; import com.google.logging.v2.ListSinksResponse; +import com.google.logging.v2.LogBucket; import com.google.logging.v2.LogExclusion; import com.google.logging.v2.LogSink; +import com.google.logging.v2.UpdateBucketRequest; import com.google.logging.v2.UpdateCmekSettingsRequest; import com.google.logging.v2.UpdateExclusionRequest; import com.google.logging.v2.UpdateSinkRequest; @@ -86,15 +92,15 @@ * *
  * 
- * ConfigServiceV2StubSettings.Builder configSettingsBuilder =
+ * ConfigServiceV2StubSettings.Builder configServiceV2SettingsBuilder =
  *     ConfigServiceV2StubSettings.newBuilder();
- * configSettingsBuilder
+ * configServiceV2SettingsBuilder
  *     .getSinkSettings()
  *     .setRetrySettings(
- *         configSettingsBuilder.getSinkSettings().getRetrySettings().toBuilder()
+ *         configServiceV2SettingsBuilder.getSinkSettings().getRetrySettings().toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
- * ConfigServiceV2StubSettings configSettings = configSettingsBuilder.build();
+ * ConfigServiceV2StubSettings configServiceV2Settings = configServiceV2SettingsBuilder.build();
  * 
  * 
*/ @@ -111,6 +117,10 @@ public class ConfigServiceV2StubSettings extends StubSettings + listBucketsSettings; + private final UnaryCallSettings getBucketSettings; + private final UnaryCallSettings updateBucketSettings; private final PagedCallSettings listSinksSettings; private final UnaryCallSettings getSinkSettings; @@ -128,6 +138,22 @@ public class ConfigServiceV2StubSettings extends StubSettings updateCmekSettingsSettings; + /** Returns the object with the settings used for calls to listBuckets. */ + public PagedCallSettings + listBucketsSettings() { + return listBucketsSettings; + } + + /** Returns the object with the settings used for calls to getBucket. */ + public UnaryCallSettings getBucketSettings() { + return getBucketSettings; + } + + /** Returns the object with the settings used for calls to updateBucket. */ + public UnaryCallSettings updateBucketSettings() { + return updateBucketSettings; + } + /** Returns the object with the settings used for calls to listSinks. */ public PagedCallSettings listSinksSettings() { @@ -260,6 +286,9 @@ public Builder toBuilder() { protected ConfigServiceV2StubSettings(Builder settingsBuilder) throws IOException { super(settingsBuilder); + listBucketsSettings = settingsBuilder.listBucketsSettings().build(); + getBucketSettings = settingsBuilder.getBucketSettings().build(); + updateBucketSettings = settingsBuilder.updateBucketSettings().build(); listSinksSettings = settingsBuilder.listSinksSettings().build(); getSinkSettings = settingsBuilder.getSinkSettings().build(); createSinkSettings = settingsBuilder.createSinkSettings().build(); @@ -274,6 +303,42 @@ protected ConfigServiceV2StubSettings(Builder settingsBuilder) throws IOExceptio updateCmekSettingsSettings = settingsBuilder.updateCmekSettingsSettings().build(); } + private static final PagedListDescriptor + LIST_BUCKETS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListBucketsRequest injectToken(ListBucketsRequest payload, String token) { + return ListBucketsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListBucketsRequest injectPageSize(ListBucketsRequest payload, int pageSize) { + return ListBucketsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListBucketsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListBucketsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListBucketsResponse payload) { + return payload.getBucketsList() != null + ? payload.getBucketsList() + : ImmutableList.of(); + } + }; + private static final PagedListDescriptor LIST_SINKS_PAGE_STR_DESC = new PagedListDescriptor() { @@ -348,6 +413,23 @@ public Iterable extractResources(ListExclusionsResponse payload) { } }; + private static final PagedListResponseFactory< + ListBucketsRequest, ListBucketsResponse, ListBucketsPagedResponse> + LIST_BUCKETS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListBucketsRequest, ListBucketsResponse, ListBucketsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListBucketsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_BUCKETS_PAGE_STR_DESC, request, context); + return ListBucketsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + private static final PagedListResponseFactory< ListSinksRequest, ListSinksResponse, ListSinksPagedResponse> LIST_SINKS_PAGE_STR_FACT = @@ -386,6 +468,11 @@ public ApiFuture getFuturePagedResponse( public static class Builder extends StubSettings.Builder { private final ImmutableList> unaryMethodSettingsBuilders; + private final PagedCallSettings.Builder< + ListBucketsRequest, ListBucketsResponse, ListBucketsPagedResponse> + listBucketsSettings; + private final UnaryCallSettings.Builder getBucketSettings; + private final UnaryCallSettings.Builder updateBucketSettings; private final PagedCallSettings.Builder< ListSinksRequest, ListSinksResponse, ListSinksPagedResponse> listSinksSettings; @@ -415,17 +502,10 @@ public static class Builder extends StubSettings.BuildernewArrayList( - StatusCode.Code.DEADLINE_EXCEEDED, - StatusCode.Code.INTERNAL, - StatusCode.Code.UNAVAILABLE))); - definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList())); - definitions.put( - "idempotent2", ImmutableSet.copyOf( Lists.newArrayList( StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -445,17 +525,6 @@ public static class Builder extends StubSettings.Builder>of( + listBucketsSettings, + getBucketSettings, + updateBucketSettings, listSinksSettings, getSinkSettings, createSinkSettings, @@ -519,6 +597,21 @@ private static Builder createDefault() { private static Builder initDefaults(Builder builder) { + builder + .listBucketsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .getBucketSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .updateBucketSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder .listSinksSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) @@ -536,12 +629,12 @@ private static Builder initDefaults(Builder builder) { builder .updateSinkSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); builder .deleteSinkSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); builder @@ -566,12 +659,12 @@ private static Builder initDefaults(Builder builder) { builder .deleteExclusionSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); builder .getCmekSettingsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent2")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); builder @@ -585,6 +678,9 @@ private static Builder initDefaults(Builder builder) { protected Builder(ConfigServiceV2StubSettings settings) { super(settings); + listBucketsSettings = settings.listBucketsSettings.toBuilder(); + getBucketSettings = settings.getBucketSettings.toBuilder(); + updateBucketSettings = settings.updateBucketSettings.toBuilder(); listSinksSettings = settings.listSinksSettings.toBuilder(); getSinkSettings = settings.getSinkSettings.toBuilder(); createSinkSettings = settings.createSinkSettings.toBuilder(); @@ -600,6 +696,9 @@ protected Builder(ConfigServiceV2StubSettings settings) { unaryMethodSettingsBuilders = ImmutableList.>of( + listBucketsSettings, + getBucketSettings, + updateBucketSettings, listSinksSettings, getSinkSettings, createSinkSettings, @@ -630,6 +729,23 @@ public Builder applyToAllUnaryMethods( return unaryMethodSettingsBuilders; } + /** Returns the builder for the settings used for calls to listBuckets. */ + public PagedCallSettings.Builder< + ListBucketsRequest, ListBucketsResponse, ListBucketsPagedResponse> + listBucketsSettings() { + return listBucketsSettings; + } + + /** Returns the builder for the settings used for calls to getBucket. */ + public UnaryCallSettings.Builder getBucketSettings() { + return getBucketSettings; + } + + /** Returns the builder for the settings used for calls to updateBucket. */ + public UnaryCallSettings.Builder updateBucketSettings() { + return updateBucketSettings; + } + /** Returns the builder for the settings used for calls to listSinks. */ public PagedCallSettings.Builder listSinksSettings() { diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/GrpcConfigServiceV2Stub.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/GrpcConfigServiceV2Stub.java index 6e097337b..697d50590 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/GrpcConfigServiceV2Stub.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/GrpcConfigServiceV2Stub.java @@ -15,8 +15,9 @@ */ package com.google.cloud.logging.v2.stub; -import static com.google.cloud.logging.v2.ConfigClient.ListExclusionsPagedResponse; -import static com.google.cloud.logging.v2.ConfigClient.ListSinksPagedResponse; +import static com.google.cloud.logging.v2.ConfigServiceV2Client.ListBucketsPagedResponse; +import static com.google.cloud.logging.v2.ConfigServiceV2Client.ListExclusionsPagedResponse; +import static com.google.cloud.logging.v2.ConfigServiceV2Client.ListSinksPagedResponse; import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; @@ -32,15 +33,20 @@ import com.google.logging.v2.CreateSinkRequest; import com.google.logging.v2.DeleteExclusionRequest; import com.google.logging.v2.DeleteSinkRequest; +import com.google.logging.v2.GetBucketRequest; import com.google.logging.v2.GetCmekSettingsRequest; import com.google.logging.v2.GetExclusionRequest; import com.google.logging.v2.GetSinkRequest; +import com.google.logging.v2.ListBucketsRequest; +import com.google.logging.v2.ListBucketsResponse; import com.google.logging.v2.ListExclusionsRequest; import com.google.logging.v2.ListExclusionsResponse; import com.google.logging.v2.ListSinksRequest; import com.google.logging.v2.ListSinksResponse; +import com.google.logging.v2.LogBucket; import com.google.logging.v2.LogExclusion; import com.google.logging.v2.LogSink; +import com.google.logging.v2.UpdateBucketRequest; import com.google.logging.v2.UpdateCmekSettingsRequest; import com.google.logging.v2.UpdateExclusionRequest; import com.google.logging.v2.UpdateSinkRequest; @@ -62,6 +68,30 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public class GrpcConfigServiceV2Stub extends ConfigServiceV2Stub { + private static final MethodDescriptor + listBucketsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.logging.v2.ConfigServiceV2/ListBuckets") + .setRequestMarshaller(ProtoUtils.marshaller(ListBucketsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListBucketsResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor getBucketMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.logging.v2.ConfigServiceV2/GetBucket") + .setRequestMarshaller(ProtoUtils.marshaller(GetBucketRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(LogBucket.getDefaultInstance())) + .build(); + private static final MethodDescriptor + updateBucketMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.logging.v2.ConfigServiceV2/UpdateBucket") + .setRequestMarshaller(ProtoUtils.marshaller(UpdateBucketRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(LogBucket.getDefaultInstance())) + .build(); private static final MethodDescriptor listSinksMethodDescriptor = MethodDescriptor.newBuilder() @@ -164,6 +194,11 @@ public class GrpcConfigServiceV2Stub extends ConfigServiceV2Stub { private final BackgroundResource backgroundResources; + private final UnaryCallable listBucketsCallable; + private final UnaryCallable + listBucketsPagedCallable; + private final UnaryCallable getBucketCallable; + private final UnaryCallable updateBucketCallable; private final UnaryCallable listSinksCallable; private final UnaryCallable listSinksPagedCallable; private final UnaryCallable getSinkCallable; @@ -221,6 +256,45 @@ protected GrpcConfigServiceV2Stub( throws IOException { this.callableFactory = callableFactory; + GrpcCallSettings listBucketsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listBucketsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListBucketsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getBucketTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getBucketMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetBucketRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings updateBucketTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateBucketMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdateBucketRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); GrpcCallSettings listSinksTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listSinksMethodDescriptor) @@ -379,6 +453,18 @@ public Map extract(UpdateCmekSettingsRequest request) { }) .build(); + this.listBucketsCallable = + callableFactory.createUnaryCallable( + listBucketsTransportSettings, settings.listBucketsSettings(), clientContext); + this.listBucketsPagedCallable = + callableFactory.createPagedCallable( + listBucketsTransportSettings, settings.listBucketsSettings(), clientContext); + this.getBucketCallable = + callableFactory.createUnaryCallable( + getBucketTransportSettings, settings.getBucketSettings(), clientContext); + this.updateBucketCallable = + callableFactory.createUnaryCallable( + updateBucketTransportSettings, settings.updateBucketSettings(), clientContext); this.listSinksCallable = callableFactory.createUnaryCallable( listSinksTransportSettings, settings.listSinksSettings(), clientContext); @@ -427,6 +513,22 @@ public Map extract(UpdateCmekSettingsRequest request) { backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } + public UnaryCallable listBucketsPagedCallable() { + return listBucketsPagedCallable; + } + + public UnaryCallable listBucketsCallable() { + return listBucketsCallable; + } + + public UnaryCallable getBucketCallable() { + return getBucketCallable; + } + + public UnaryCallable updateBucketCallable() { + return updateBucketCallable; + } + public UnaryCallable listSinksPagedCallable() { return listSinksPagedCallable; } diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/GrpcLoggingServiceV2Stub.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/GrpcLoggingServiceV2Stub.java index 7ba813dca..5810432bb 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/GrpcLoggingServiceV2Stub.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/GrpcLoggingServiceV2Stub.java @@ -15,9 +15,9 @@ */ package com.google.cloud.logging.v2.stub; -import static com.google.cloud.logging.v2.LoggingClient.ListLogEntriesPagedResponse; -import static com.google.cloud.logging.v2.LoggingClient.ListLogsPagedResponse; -import static com.google.cloud.logging.v2.LoggingClient.ListMonitoredResourceDescriptorsPagedResponse; +import static com.google.cloud.logging.v2.LoggingServiceV2Client.ListLogEntriesPagedResponse; +import static com.google.cloud.logging.v2.LoggingServiceV2Client.ListLogsPagedResponse; +import static com.google.cloud.logging.v2.LoggingServiceV2Client.ListMonitoredResourceDescriptorsPagedResponse; import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; @@ -214,7 +214,7 @@ public Map extract(ListLogsRequest request) { callableFactory.createUnaryCallable( deleteLogTransportSettings, settings.deleteLogSettings(), clientContext); this.writeLogEntriesCallable = - callableFactory.createBatchingCallable( + callableFactory.createUnaryCallable( writeLogEntriesTransportSettings, settings.writeLogEntriesSettings(), clientContext); this.listLogEntriesCallable = callableFactory.createUnaryCallable( diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/GrpcMetricsServiceV2Stub.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/GrpcMetricsServiceV2Stub.java index d2022b0b2..7c8aa87af 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/GrpcMetricsServiceV2Stub.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/GrpcMetricsServiceV2Stub.java @@ -15,7 +15,7 @@ */ package com.google.cloud.logging.v2.stub; -import static com.google.cloud.logging.v2.MetricsClient.ListLogMetricsPagedResponse; +import static com.google.cloud.logging.v2.MetricsServiceV2Client.ListLogMetricsPagedResponse; import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/LoggingServiceV2Stub.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/LoggingServiceV2Stub.java index 5aff3df94..347732b71 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/LoggingServiceV2Stub.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/LoggingServiceV2Stub.java @@ -15,9 +15,9 @@ */ package com.google.cloud.logging.v2.stub; -import static com.google.cloud.logging.v2.LoggingClient.ListLogEntriesPagedResponse; -import static com.google.cloud.logging.v2.LoggingClient.ListLogsPagedResponse; -import static com.google.cloud.logging.v2.LoggingClient.ListMonitoredResourceDescriptorsPagedResponse; +import static com.google.cloud.logging.v2.LoggingServiceV2Client.ListLogEntriesPagedResponse; +import static com.google.cloud.logging.v2.LoggingServiceV2Client.ListLogsPagedResponse; +import static com.google.cloud.logging.v2.LoggingServiceV2Client.ListMonitoredResourceDescriptorsPagedResponse; import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/LoggingServiceV2StubSettings.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/LoggingServiceV2StubSettings.java index 4a8777ba5..7b79862d4 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/LoggingServiceV2StubSettings.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/LoggingServiceV2StubSettings.java @@ -15,19 +15,14 @@ */ package com.google.cloud.logging.v2.stub; -import static com.google.cloud.logging.v2.LoggingClient.ListLogEntriesPagedResponse; -import static com.google.cloud.logging.v2.LoggingClient.ListLogsPagedResponse; -import static com.google.cloud.logging.v2.LoggingClient.ListMonitoredResourceDescriptorsPagedResponse; +import static com.google.cloud.logging.v2.LoggingServiceV2Client.ListLogEntriesPagedResponse; +import static com.google.cloud.logging.v2.LoggingServiceV2Client.ListLogsPagedResponse; +import static com.google.cloud.logging.v2.LoggingServiceV2Client.ListMonitoredResourceDescriptorsPagedResponse; import com.google.api.MonitoredResourceDescriptor; import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; -import com.google.api.gax.batching.BatchingSettings; -import com.google.api.gax.batching.FlowControlSettings; -import com.google.api.gax.batching.FlowController.LimitExceededBehavior; -import com.google.api.gax.batching.PartitionKey; -import com.google.api.gax.batching.RequestBuilder; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; @@ -37,9 +32,6 @@ import com.google.api.gax.retrying.RetrySettings; import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.BatchedRequestIssuer; -import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BatchingDescriptor; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; @@ -66,7 +58,6 @@ import com.google.logging.v2.WriteLogEntriesResponse; import com.google.protobuf.Empty; import java.io.IOException; -import java.util.Collection; import java.util.List; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -90,15 +81,15 @@ * *
  * 
- * LoggingServiceV2StubSettings.Builder loggingSettingsBuilder =
+ * LoggingServiceV2StubSettings.Builder loggingServiceV2SettingsBuilder =
  *     LoggingServiceV2StubSettings.newBuilder();
- * loggingSettingsBuilder
+ * loggingServiceV2SettingsBuilder
  *     .deleteLogSettings()
  *     .setRetrySettings(
- *         loggingSettingsBuilder.deleteLogSettings().getRetrySettings().toBuilder()
+ *         loggingServiceV2SettingsBuilder.deleteLogSettings().getRetrySettings().toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
- * LoggingServiceV2StubSettings loggingSettings = loggingSettingsBuilder.build();
+ * LoggingServiceV2StubSettings loggingServiceV2Settings = loggingServiceV2SettingsBuilder.build();
  * 
  * 
*/ @@ -116,7 +107,7 @@ public class LoggingServiceV2StubSettings extends StubSettings deleteLogSettings; - private final BatchingCallSettings + private final UnaryCallSettings writeLogEntriesSettings; private final PagedCallSettings< ListLogEntriesRequest, ListLogEntriesResponse, ListLogEntriesPagedResponse> @@ -135,7 +126,7 @@ public UnaryCallSettings deleteLogSettings() { } /** Returns the object with the settings used for calls to writeLogEntries. */ - public BatchingCallSettings + public UnaryCallSettings writeLogEntriesSettings() { return writeLogEntriesSettings; } @@ -427,73 +418,12 @@ public ApiFuture getFuturePagedResponse( } }; - private static final BatchingDescriptor - WRITE_LOG_ENTRIES_BATCHING_DESC = - new BatchingDescriptor() { - @Override - public PartitionKey getBatchPartitionKey(WriteLogEntriesRequest request) { - return new PartitionKey( - request.getLogName(), request.getResource(), request.getLabelsMap()); - } - - @Override - public RequestBuilder getRequestBuilder() { - return new RequestBuilder() { - private WriteLogEntriesRequest.Builder builder; - - @Override - public void appendRequest(WriteLogEntriesRequest request) { - if (builder == null) { - builder = request.toBuilder(); - } else { - builder.addAllEntries(request.getEntriesList()); - } - } - - @Override - public WriteLogEntriesRequest build() { - return builder.build(); - } - }; - } - - @Override - public void splitResponse( - WriteLogEntriesResponse batchResponse, - Collection> batch) { - int batchMessageIndex = 0; - for (BatchedRequestIssuer responder : batch) { - WriteLogEntriesResponse response = WriteLogEntriesResponse.newBuilder().build(); - responder.setResponse(response); - } - } - - @Override - public void splitException( - Throwable throwable, - Collection> batch) { - for (BatchedRequestIssuer responder : batch) { - responder.setException(throwable); - } - } - - @Override - public long countElements(WriteLogEntriesRequest request) { - return request.getEntriesCount(); - } - - @Override - public long countBytes(WriteLogEntriesRequest request) { - return request.getSerializedSize(); - } - }; - /** Builder for LoggingServiceV2StubSettings. */ public static class Builder extends StubSettings.Builder { private final ImmutableList> unaryMethodSettingsBuilders; private final UnaryCallSettings.Builder deleteLogSettings; - private final BatchingCallSettings.Builder + private final UnaryCallSettings.Builder writeLogEntriesSettings; private final PagedCallSettings.Builder< ListLogEntriesRequest, ListLogEntriesResponse, ListLogEntriesPagedResponse> @@ -517,9 +447,7 @@ public static class Builder extends StubSettings.BuildernewArrayList( - StatusCode.Code.DEADLINE_EXCEEDED, - StatusCode.Code.INTERNAL, - StatusCode.Code.UNAVAILABLE))); + StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -540,17 +468,6 @@ public static class Builder extends StubSettings.Builder deleteLogSettings() { } /** Returns the builder for the settings used for calls to writeLogEntries. */ - public BatchingCallSettings.Builder + public UnaryCallSettings.Builder writeLogEntriesSettings() { return writeLogEntriesSettings; } diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/MetricsServiceV2Stub.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/MetricsServiceV2Stub.java index a14c69b79..7a18882c3 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/MetricsServiceV2Stub.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/MetricsServiceV2Stub.java @@ -15,7 +15,7 @@ */ package com.google.cloud.logging.v2.stub; -import static com.google.cloud.logging.v2.MetricsClient.ListLogMetricsPagedResponse; +import static com.google.cloud.logging.v2.MetricsServiceV2Client.ListLogMetricsPagedResponse; import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/MetricsServiceV2StubSettings.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/MetricsServiceV2StubSettings.java index 5327a9d9d..c1076ff64 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/MetricsServiceV2StubSettings.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/MetricsServiceV2StubSettings.java @@ -15,7 +15,7 @@ */ package com.google.cloud.logging.v2.stub; -import static com.google.cloud.logging.v2.MetricsClient.ListLogMetricsPagedResponse; +import static com.google.cloud.logging.v2.MetricsServiceV2Client.ListLogMetricsPagedResponse; import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; @@ -75,15 +75,15 @@ * *
  * 
- * MetricsServiceV2StubSettings.Builder metricsSettingsBuilder =
+ * MetricsServiceV2StubSettings.Builder metricsServiceV2SettingsBuilder =
  *     MetricsServiceV2StubSettings.newBuilder();
- * metricsSettingsBuilder
+ * metricsServiceV2SettingsBuilder
  *     .getLogMetricSettings()
  *     .setRetrySettings(
- *         metricsSettingsBuilder.getLogMetricSettings().getRetrySettings().toBuilder()
+ *         metricsServiceV2SettingsBuilder.getLogMetricSettings().getRetrySettings().toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
- * MetricsServiceV2StubSettings metricsSettings = metricsSettingsBuilder.build();
+ * MetricsServiceV2StubSettings metricsServiceV2Settings = metricsServiceV2SettingsBuilder.build();
  * 
  * 
*/ @@ -289,9 +289,7 @@ public static class Builder extends StubSettings.BuildernewArrayList( - StatusCode.Code.DEADLINE_EXCEEDED, - StatusCode.Code.INTERNAL, - StatusCode.Code.UNAVAILABLE))); + StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -371,12 +369,12 @@ private static Builder initDefaults(Builder builder) { builder .updateLogMetricSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); builder .deleteLogMetricSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); return builder; diff --git a/google-cloud-logging/src/test/java/com/google/cloud/logging/v2/ConfigServiceV2ClientTest.java b/google-cloud-logging/src/test/java/com/google/cloud/logging/v2/ConfigServiceV2ClientTest.java new file mode 100644 index 000000000..11dc69bfd --- /dev/null +++ b/google-cloud-logging/src/test/java/com/google/cloud/logging/v2/ConfigServiceV2ClientTest.java @@ -0,0 +1,938 @@ +/* + * Copyright 2020 Google LLC + * + * 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 + * + * https://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.cloud.logging.v2; + +import static com.google.cloud.logging.v2.ConfigServiceV2Client.ListBucketsPagedResponse; +import static com.google.cloud.logging.v2.ConfigServiceV2Client.ListExclusionsPagedResponse; +import static com.google.cloud.logging.v2.ConfigServiceV2Client.ListSinksPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.resourcenames.ResourceName; +import com.google.common.collect.Lists; +import com.google.logging.v2.BillingAccountName; +import com.google.logging.v2.CmekSettings; +import com.google.logging.v2.CmekSettingsName; +import com.google.logging.v2.CreateExclusionRequest; +import com.google.logging.v2.CreateSinkRequest; +import com.google.logging.v2.DeleteExclusionRequest; +import com.google.logging.v2.DeleteSinkRequest; +import com.google.logging.v2.GetBucketRequest; +import com.google.logging.v2.GetCmekSettingsRequest; +import com.google.logging.v2.GetExclusionRequest; +import com.google.logging.v2.GetSinkRequest; +import com.google.logging.v2.ListBucketsRequest; +import com.google.logging.v2.ListBucketsResponse; +import com.google.logging.v2.ListExclusionsRequest; +import com.google.logging.v2.ListExclusionsResponse; +import com.google.logging.v2.ListSinksRequest; +import com.google.logging.v2.ListSinksResponse; +import com.google.logging.v2.LogBucket; +import com.google.logging.v2.LogBucketName; +import com.google.logging.v2.LogExclusion; +import com.google.logging.v2.LogExclusionName; +import com.google.logging.v2.LogSink; +import com.google.logging.v2.LogSinkName; +import com.google.logging.v2.ProjectName; +import com.google.logging.v2.UpdateBucketRequest; +import com.google.logging.v2.UpdateCmekSettingsRequest; +import com.google.logging.v2.UpdateExclusionRequest; +import com.google.logging.v2.UpdateSinkRequest; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import io.grpc.Status; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class ConfigServiceV2ClientTest { + private static MockConfigServiceV2 mockConfigServiceV2; + private static MockLoggingServiceV2 mockLoggingServiceV2; + private static MockMetricsServiceV2 mockMetricsServiceV2; + private static MockServiceHelper serviceHelper; + private ConfigServiceV2Client client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockConfigServiceV2 = new MockConfigServiceV2(); + mockLoggingServiceV2 = new MockLoggingServiceV2(); + mockMetricsServiceV2 = new MockMetricsServiceV2(); + serviceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList( + mockConfigServiceV2, mockLoggingServiceV2, mockMetricsServiceV2)); + serviceHelper.start(); + } + + @AfterClass + public static void stopServer() { + serviceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + serviceHelper.reset(); + channelProvider = serviceHelper.createChannelProvider(); + ConfigServiceV2Settings settings = + ConfigServiceV2Settings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ConfigServiceV2Client.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void listBucketsTest() { + String nextPageToken = ""; + LogBucket bucketsElement = LogBucket.newBuilder().build(); + List buckets = Arrays.asList(bucketsElement); + ListBucketsResponse expectedResponse = + ListBucketsResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllBuckets(buckets) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListBucketsPagedResponse pagedListResponse = client.listBuckets(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBucketsList().get(0), resources.get(0)); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListBucketsRequest actualRequest = (ListBucketsRequest) actualRequests.get(0); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listBucketsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + String parent = "parent-995424086"; + + client.listBuckets(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getBucketTest() { + LogBucketName name2 = + LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]"); + String description = "description-1724546052"; + int retentionDays = 1544391896; + LogBucket expectedResponse = + LogBucket.newBuilder() + .setName(name2.toString()) + .setDescription(description) + .setRetentionDays(retentionDays) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + LogBucketName name = + LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]"); + GetBucketRequest request = GetBucketRequest.newBuilder().setName(name.toString()).build(); + + LogBucket actualResponse = client.getBucket(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetBucketRequest actualRequest = (GetBucketRequest) actualRequests.get(0); + + Assert.assertEquals(name, LogBucketName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getBucketExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + LogBucketName name = + LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]"); + GetBucketRequest request = GetBucketRequest.newBuilder().setName(name.toString()).build(); + + client.getBucket(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateBucketTest() { + LogBucketName name2 = + LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]"); + String description = "description-1724546052"; + int retentionDays = 1544391896; + LogBucket expectedResponse = + LogBucket.newBuilder() + .setName(name2.toString()) + .setDescription(description) + .setRetentionDays(retentionDays) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + LogBucketName name = + LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]"); + LogBucket bucket = LogBucket.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + UpdateBucketRequest request = + UpdateBucketRequest.newBuilder() + .setName(name.toString()) + .setBucket(bucket) + .setUpdateMask(updateMask) + .build(); + + LogBucket actualResponse = client.updateBucket(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateBucketRequest actualRequest = (UpdateBucketRequest) actualRequests.get(0); + + Assert.assertEquals(name, LogBucketName.parse(actualRequest.getName())); + Assert.assertEquals(bucket, actualRequest.getBucket()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateBucketExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + LogBucketName name = + LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]"); + LogBucket bucket = LogBucket.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + UpdateBucketRequest request = + UpdateBucketRequest.newBuilder() + .setName(name.toString()) + .setBucket(bucket) + .setUpdateMask(updateMask) + .build(); + + client.updateBucket(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listSinksTest() { + String nextPageToken = ""; + LogSink sinksElement = LogSink.newBuilder().build(); + List sinks = Arrays.asList(sinksElement); + ListSinksResponse expectedResponse = + ListSinksResponse.newBuilder().setNextPageToken(nextPageToken).addAllSinks(sinks).build(); + mockConfigServiceV2.addResponse(expectedResponse); + + ProjectName parent = ProjectName.of("[PROJECT]"); + + ListSinksPagedResponse pagedListResponse = client.listSinks(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSinksList().get(0), resources.get(0)); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListSinksRequest actualRequest = (ListSinksRequest) actualRequests.get(0); + + Assert.assertEquals(parent, ProjectName.parse(actualRequest.getParent())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listSinksExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + ProjectName parent = ProjectName.of("[PROJECT]"); + + client.listSinks(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getSinkTest() { + LogSinkName name = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]"); + ResourceName destination = BillingAccountName.of("[BILLING_ACCOUNT]"); + String filter = "filter-1274492040"; + String description = "description-1724546052"; + boolean disabled = true; + String writerIdentity = "writerIdentity775638794"; + boolean includeChildren = true; + LogSink expectedResponse = + LogSink.newBuilder() + .setName(name.toString()) + .setDestination(destination.toString()) + .setFilter(filter) + .setDescription(description) + .setDisabled(disabled) + .setWriterIdentity(writerIdentity) + .setIncludeChildren(includeChildren) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]"); + + LogSink actualResponse = client.getSink(sinkName); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetSinkRequest actualRequest = (GetSinkRequest) actualRequests.get(0); + + Assert.assertEquals(sinkName, LogSinkName.parse(actualRequest.getSinkName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getSinkExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]"); + + client.getSink(sinkName); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void createSinkTest() { + LogSinkName name = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]"); + ResourceName destination = BillingAccountName.of("[BILLING_ACCOUNT]"); + String filter = "filter-1274492040"; + String description = "description-1724546052"; + boolean disabled = true; + String writerIdentity = "writerIdentity775638794"; + boolean includeChildren = true; + LogSink expectedResponse = + LogSink.newBuilder() + .setName(name.toString()) + .setDestination(destination.toString()) + .setFilter(filter) + .setDescription(description) + .setDisabled(disabled) + .setWriterIdentity(writerIdentity) + .setIncludeChildren(includeChildren) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + ProjectName parent = ProjectName.of("[PROJECT]"); + LogSink sink = LogSink.newBuilder().build(); + + LogSink actualResponse = client.createSink(parent, sink); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateSinkRequest actualRequest = (CreateSinkRequest) actualRequests.get(0); + + Assert.assertEquals(parent, ProjectName.parse(actualRequest.getParent())); + Assert.assertEquals(sink, actualRequest.getSink()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void createSinkExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + ProjectName parent = ProjectName.of("[PROJECT]"); + LogSink sink = LogSink.newBuilder().build(); + + client.createSink(parent, sink); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateSinkTest() { + LogSinkName name = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]"); + ResourceName destination = BillingAccountName.of("[BILLING_ACCOUNT]"); + String filter = "filter-1274492040"; + String description = "description-1724546052"; + boolean disabled = true; + String writerIdentity = "writerIdentity775638794"; + boolean includeChildren = true; + LogSink expectedResponse = + LogSink.newBuilder() + .setName(name.toString()) + .setDestination(destination.toString()) + .setFilter(filter) + .setDescription(description) + .setDisabled(disabled) + .setWriterIdentity(writerIdentity) + .setIncludeChildren(includeChildren) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]"); + LogSink sink = LogSink.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + LogSink actualResponse = client.updateSink(sinkName, sink, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateSinkRequest actualRequest = (UpdateSinkRequest) actualRequests.get(0); + + Assert.assertEquals(sinkName, LogSinkName.parse(actualRequest.getSinkName())); + Assert.assertEquals(sink, actualRequest.getSink()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateSinkExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]"); + LogSink sink = LogSink.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + client.updateSink(sinkName, sink, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateSinkTest2() { + LogSinkName name = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]"); + ResourceName destination = BillingAccountName.of("[BILLING_ACCOUNT]"); + String filter = "filter-1274492040"; + String description = "description-1724546052"; + boolean disabled = true; + String writerIdentity = "writerIdentity775638794"; + boolean includeChildren = true; + LogSink expectedResponse = + LogSink.newBuilder() + .setName(name.toString()) + .setDestination(destination.toString()) + .setFilter(filter) + .setDescription(description) + .setDisabled(disabled) + .setWriterIdentity(writerIdentity) + .setIncludeChildren(includeChildren) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]"); + LogSink sink = LogSink.newBuilder().build(); + + LogSink actualResponse = client.updateSink(sinkName, sink); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateSinkRequest actualRequest = (UpdateSinkRequest) actualRequests.get(0); + + Assert.assertEquals(sinkName, LogSinkName.parse(actualRequest.getSinkName())); + Assert.assertEquals(sink, actualRequest.getSink()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateSinkExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]"); + LogSink sink = LogSink.newBuilder().build(); + + client.updateSink(sinkName, sink); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteSinkTest() { + Empty expectedResponse = Empty.newBuilder().build(); + mockConfigServiceV2.addResponse(expectedResponse); + + LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]"); + + client.deleteSink(sinkName); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteSinkRequest actualRequest = (DeleteSinkRequest) actualRequests.get(0); + + Assert.assertEquals(sinkName, LogSinkName.parse(actualRequest.getSinkName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void deleteSinkExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]"); + + client.deleteSink(sinkName); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listExclusionsTest() { + String nextPageToken = ""; + LogExclusion exclusionsElement = LogExclusion.newBuilder().build(); + List exclusions = Arrays.asList(exclusionsElement); + ListExclusionsResponse expectedResponse = + ListExclusionsResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllExclusions(exclusions) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + ProjectName parent = ProjectName.of("[PROJECT]"); + + ListExclusionsPagedResponse pagedListResponse = client.listExclusions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getExclusionsList().get(0), resources.get(0)); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListExclusionsRequest actualRequest = (ListExclusionsRequest) actualRequests.get(0); + + Assert.assertEquals(parent, ProjectName.parse(actualRequest.getParent())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listExclusionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + ProjectName parent = ProjectName.of("[PROJECT]"); + + client.listExclusions(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getExclusionTest() { + LogExclusionName name2 = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]"); + String description = "description-1724546052"; + String filter = "filter-1274492040"; + boolean disabled = true; + LogExclusion expectedResponse = + LogExclusion.newBuilder() + .setName(name2.toString()) + .setDescription(description) + .setFilter(filter) + .setDisabled(disabled) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + LogExclusionName name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]"); + + LogExclusion actualResponse = client.getExclusion(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetExclusionRequest actualRequest = (GetExclusionRequest) actualRequests.get(0); + + Assert.assertEquals(name, LogExclusionName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getExclusionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + LogExclusionName name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]"); + + client.getExclusion(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void createExclusionTest() { + LogExclusionName name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]"); + String description = "description-1724546052"; + String filter = "filter-1274492040"; + boolean disabled = true; + LogExclusion expectedResponse = + LogExclusion.newBuilder() + .setName(name.toString()) + .setDescription(description) + .setFilter(filter) + .setDisabled(disabled) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + ProjectName parent = ProjectName.of("[PROJECT]"); + LogExclusion exclusion = LogExclusion.newBuilder().build(); + + LogExclusion actualResponse = client.createExclusion(parent, exclusion); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateExclusionRequest actualRequest = (CreateExclusionRequest) actualRequests.get(0); + + Assert.assertEquals(parent, ProjectName.parse(actualRequest.getParent())); + Assert.assertEquals(exclusion, actualRequest.getExclusion()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void createExclusionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + ProjectName parent = ProjectName.of("[PROJECT]"); + LogExclusion exclusion = LogExclusion.newBuilder().build(); + + client.createExclusion(parent, exclusion); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateExclusionTest() { + LogExclusionName name2 = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]"); + String description = "description-1724546052"; + String filter = "filter-1274492040"; + boolean disabled = true; + LogExclusion expectedResponse = + LogExclusion.newBuilder() + .setName(name2.toString()) + .setDescription(description) + .setFilter(filter) + .setDisabled(disabled) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + LogExclusionName name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]"); + LogExclusion exclusion = LogExclusion.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + LogExclusion actualResponse = client.updateExclusion(name, exclusion, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateExclusionRequest actualRequest = (UpdateExclusionRequest) actualRequests.get(0); + + Assert.assertEquals(name, LogExclusionName.parse(actualRequest.getName())); + Assert.assertEquals(exclusion, actualRequest.getExclusion()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateExclusionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + LogExclusionName name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]"); + LogExclusion exclusion = LogExclusion.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + client.updateExclusion(name, exclusion, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteExclusionTest() { + Empty expectedResponse = Empty.newBuilder().build(); + mockConfigServiceV2.addResponse(expectedResponse); + + LogExclusionName name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]"); + + client.deleteExclusion(name); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteExclusionRequest actualRequest = (DeleteExclusionRequest) actualRequests.get(0); + + Assert.assertEquals(name, LogExclusionName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void deleteExclusionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + LogExclusionName name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]"); + + client.deleteExclusion(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getCmekSettingsTest() { + CmekSettingsName name2 = CmekSettingsName.ofProjectName("[PROJECT]"); + String kmsKeyName = "kmsKeyName2094986649"; + String serviceAccountId = "serviceAccountId-111486921"; + CmekSettings expectedResponse = + CmekSettings.newBuilder() + .setName(name2.toString()) + .setKmsKeyName(kmsKeyName) + .setServiceAccountId(serviceAccountId) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + CmekSettingsName name = CmekSettingsName.ofProjectName("[PROJECT]"); + GetCmekSettingsRequest request = + GetCmekSettingsRequest.newBuilder().setName(name.toString()).build(); + + CmekSettings actualResponse = client.getCmekSettings(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetCmekSettingsRequest actualRequest = (GetCmekSettingsRequest) actualRequests.get(0); + + Assert.assertEquals(name, CmekSettingsName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getCmekSettingsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + CmekSettingsName name = CmekSettingsName.ofProjectName("[PROJECT]"); + GetCmekSettingsRequest request = + GetCmekSettingsRequest.newBuilder().setName(name.toString()).build(); + + client.getCmekSettings(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateCmekSettingsTest() { + CmekSettingsName name2 = CmekSettingsName.ofProjectName("[PROJECT]"); + String kmsKeyName = "kmsKeyName2094986649"; + String serviceAccountId = "serviceAccountId-111486921"; + CmekSettings expectedResponse = + CmekSettings.newBuilder() + .setName(name2.toString()) + .setKmsKeyName(kmsKeyName) + .setServiceAccountId(serviceAccountId) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + String name = "name3373707"; + CmekSettings cmekSettings = CmekSettings.newBuilder().build(); + UpdateCmekSettingsRequest request = + UpdateCmekSettingsRequest.newBuilder().setName(name).setCmekSettings(cmekSettings).build(); + + CmekSettings actualResponse = client.updateCmekSettings(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateCmekSettingsRequest actualRequest = (UpdateCmekSettingsRequest) actualRequests.get(0); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(cmekSettings, actualRequest.getCmekSettings()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateCmekSettingsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + String name = "name3373707"; + CmekSettings cmekSettings = CmekSettings.newBuilder().build(); + UpdateCmekSettingsRequest request = + UpdateCmekSettingsRequest.newBuilder() + .setName(name) + .setCmekSettings(cmekSettings) + .build(); + + client.updateCmekSettings(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } +} diff --git a/google-cloud-logging/src/test/java/com/google/cloud/logging/v2/LoggingServiceV2ClientTest.java b/google-cloud-logging/src/test/java/com/google/cloud/logging/v2/LoggingServiceV2ClientTest.java new file mode 100644 index 000000000..096ecb0ab --- /dev/null +++ b/google-cloud-logging/src/test/java/com/google/cloud/logging/v2/LoggingServiceV2ClientTest.java @@ -0,0 +1,347 @@ +/* + * Copyright 2020 Google LLC + * + * 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 + * + * https://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.cloud.logging.v2; + +import static com.google.cloud.logging.v2.LoggingServiceV2Client.ListLogEntriesPagedResponse; +import static com.google.cloud.logging.v2.LoggingServiceV2Client.ListLogsPagedResponse; +import static com.google.cloud.logging.v2.LoggingServiceV2Client.ListMonitoredResourceDescriptorsPagedResponse; + +import com.google.api.MonitoredResource; +import com.google.api.MonitoredResourceDescriptor; +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.common.collect.Lists; +import com.google.logging.v2.DeleteLogRequest; +import com.google.logging.v2.ListLogEntriesRequest; +import com.google.logging.v2.ListLogEntriesResponse; +import com.google.logging.v2.ListLogsRequest; +import com.google.logging.v2.ListLogsResponse; +import com.google.logging.v2.ListMonitoredResourceDescriptorsRequest; +import com.google.logging.v2.ListMonitoredResourceDescriptorsResponse; +import com.google.logging.v2.LogEntry; +import com.google.logging.v2.LogName; +import com.google.logging.v2.ProjectName; +import com.google.logging.v2.WriteLogEntriesRequest; +import com.google.logging.v2.WriteLogEntriesResponse; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import io.grpc.Status; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class LoggingServiceV2ClientTest { + private static MockConfigServiceV2 mockConfigServiceV2; + private static MockLoggingServiceV2 mockLoggingServiceV2; + private static MockMetricsServiceV2 mockMetricsServiceV2; + private static MockServiceHelper serviceHelper; + private LoggingServiceV2Client client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockConfigServiceV2 = new MockConfigServiceV2(); + mockLoggingServiceV2 = new MockLoggingServiceV2(); + mockMetricsServiceV2 = new MockMetricsServiceV2(); + serviceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList( + mockConfigServiceV2, mockLoggingServiceV2, mockMetricsServiceV2)); + serviceHelper.start(); + } + + @AfterClass + public static void stopServer() { + serviceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + serviceHelper.reset(); + channelProvider = serviceHelper.createChannelProvider(); + LoggingServiceV2Settings settings = + LoggingServiceV2Settings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = LoggingServiceV2Client.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void deleteLogTest() { + Empty expectedResponse = Empty.newBuilder().build(); + mockLoggingServiceV2.addResponse(expectedResponse); + + LogName logName = LogName.ofProjectLogName("[PROJECT]", "[LOG]"); + + client.deleteLog(logName); + + List actualRequests = mockLoggingServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteLogRequest actualRequest = (DeleteLogRequest) actualRequests.get(0); + + Assert.assertEquals(logName, LogName.parse(actualRequest.getLogName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void deleteLogExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLoggingServiceV2.addException(exception); + + try { + LogName logName = LogName.ofProjectLogName("[PROJECT]", "[LOG]"); + + client.deleteLog(logName); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void writeLogEntriesTest() { + WriteLogEntriesResponse expectedResponse = WriteLogEntriesResponse.newBuilder().build(); + mockLoggingServiceV2.addResponse(expectedResponse); + + LogName logName = LogName.ofProjectLogName("[PROJECT]", "[LOG]"); + MonitoredResource resource = MonitoredResource.newBuilder().build(); + Map labels = new HashMap<>(); + List entries = new ArrayList<>(); + + WriteLogEntriesResponse actualResponse = + client.writeLogEntries(logName, resource, labels, entries); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLoggingServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + WriteLogEntriesRequest actualRequest = (WriteLogEntriesRequest) actualRequests.get(0); + + Assert.assertEquals(logName, LogName.parse(actualRequest.getLogName())); + Assert.assertEquals(resource, actualRequest.getResource()); + Assert.assertEquals(labels, actualRequest.getLabelsMap()); + Assert.assertEquals(entries, actualRequest.getEntriesList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void writeLogEntriesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLoggingServiceV2.addException(exception); + + try { + LogName logName = LogName.ofProjectLogName("[PROJECT]", "[LOG]"); + MonitoredResource resource = MonitoredResource.newBuilder().build(); + Map labels = new HashMap<>(); + List entries = new ArrayList<>(); + + client.writeLogEntries(logName, resource, labels, entries); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listLogEntriesTest() { + String nextPageToken = ""; + LogEntry entriesElement = LogEntry.newBuilder().build(); + List entries = Arrays.asList(entriesElement); + ListLogEntriesResponse expectedResponse = + ListLogEntriesResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllEntries(entries) + .build(); + mockLoggingServiceV2.addResponse(expectedResponse); + + List formattedResourceNames = new ArrayList<>(); + String filter = "filter-1274492040"; + String orderBy = "orderBy1234304744"; + + ListLogEntriesPagedResponse pagedListResponse = + client.listLogEntries(formattedResourceNames, filter, orderBy); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getEntriesList().get(0), resources.get(0)); + + List actualRequests = mockLoggingServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLogEntriesRequest actualRequest = (ListLogEntriesRequest) actualRequests.get(0); + + Assert.assertEquals(formattedResourceNames, actualRequest.getResourceNamesList()); + Assert.assertEquals(filter, actualRequest.getFilter()); + Assert.assertEquals(orderBy, actualRequest.getOrderBy()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listLogEntriesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLoggingServiceV2.addException(exception); + + try { + List formattedResourceNames = new ArrayList<>(); + String filter = "filter-1274492040"; + String orderBy = "orderBy1234304744"; + + client.listLogEntries(formattedResourceNames, filter, orderBy); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listMonitoredResourceDescriptorsTest() { + String nextPageToken = ""; + MonitoredResourceDescriptor resourceDescriptorsElement = + MonitoredResourceDescriptor.newBuilder().build(); + List resourceDescriptors = + Arrays.asList(resourceDescriptorsElement); + ListMonitoredResourceDescriptorsResponse expectedResponse = + ListMonitoredResourceDescriptorsResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllResourceDescriptors(resourceDescriptors) + .build(); + mockLoggingServiceV2.addResponse(expectedResponse); + + ListMonitoredResourceDescriptorsRequest request = + ListMonitoredResourceDescriptorsRequest.newBuilder().build(); + + ListMonitoredResourceDescriptorsPagedResponse pagedListResponse = + client.listMonitoredResourceDescriptors(request); + + List resources = + Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getResourceDescriptorsList().get(0), resources.get(0)); + + List actualRequests = mockLoggingServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListMonitoredResourceDescriptorsRequest actualRequest = + (ListMonitoredResourceDescriptorsRequest) actualRequests.get(0); + + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listMonitoredResourceDescriptorsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLoggingServiceV2.addException(exception); + + try { + ListMonitoredResourceDescriptorsRequest request = + ListMonitoredResourceDescriptorsRequest.newBuilder().build(); + + client.listMonitoredResourceDescriptors(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listLogsTest() { + String nextPageToken = ""; + String logNamesElement = "logNamesElement-1079688374"; + List logNames = Arrays.asList(logNamesElement); + ListLogsResponse expectedResponse = + ListLogsResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllLogNames(logNames) + .build(); + mockLoggingServiceV2.addResponse(expectedResponse); + + ProjectName parent = ProjectName.of("[PROJECT]"); + + ListLogsPagedResponse pagedListResponse = client.listLogs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLogNamesList().get(0), resources.get(0)); + + List actualRequests = mockLoggingServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLogsRequest actualRequest = (ListLogsRequest) actualRequests.get(0); + + Assert.assertEquals(parent, ProjectName.parse(actualRequest.getParent())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listLogsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLoggingServiceV2.addException(exception); + + try { + ProjectName parent = ProjectName.of("[PROJECT]"); + + client.listLogs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } +} diff --git a/google-cloud-logging/src/test/java/com/google/cloud/logging/v2/MetricsServiceV2ClientTest.java b/google-cloud-logging/src/test/java/com/google/cloud/logging/v2/MetricsServiceV2ClientTest.java new file mode 100644 index 000000000..c0cd9f84b --- /dev/null +++ b/google-cloud-logging/src/test/java/com/google/cloud/logging/v2/MetricsServiceV2ClientTest.java @@ -0,0 +1,330 @@ +/* + * Copyright 2020 Google LLC + * + * 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 + * + * https://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.cloud.logging.v2; + +import static com.google.cloud.logging.v2.MetricsServiceV2Client.ListLogMetricsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.common.collect.Lists; +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.LogMetricName; +import com.google.logging.v2.ProjectName; +import com.google.logging.v2.UpdateLogMetricRequest; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import io.grpc.Status; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class MetricsServiceV2ClientTest { + private static MockConfigServiceV2 mockConfigServiceV2; + private static MockLoggingServiceV2 mockLoggingServiceV2; + private static MockMetricsServiceV2 mockMetricsServiceV2; + private static MockServiceHelper serviceHelper; + private MetricsServiceV2Client client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockConfigServiceV2 = new MockConfigServiceV2(); + mockLoggingServiceV2 = new MockLoggingServiceV2(); + mockMetricsServiceV2 = new MockMetricsServiceV2(); + serviceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList( + mockConfigServiceV2, mockLoggingServiceV2, mockMetricsServiceV2)); + serviceHelper.start(); + } + + @AfterClass + public static void stopServer() { + serviceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + serviceHelper.reset(); + channelProvider = serviceHelper.createChannelProvider(); + MetricsServiceV2Settings settings = + MetricsServiceV2Settings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = MetricsServiceV2Client.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void listLogMetricsTest() { + String nextPageToken = ""; + LogMetric metricsElement = LogMetric.newBuilder().build(); + List metrics = Arrays.asList(metricsElement); + ListLogMetricsResponse expectedResponse = + ListLogMetricsResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllMetrics(metrics) + .build(); + mockMetricsServiceV2.addResponse(expectedResponse); + + ProjectName parent = ProjectName.of("[PROJECT]"); + + ListLogMetricsPagedResponse pagedListResponse = client.listLogMetrics(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getMetricsList().get(0), resources.get(0)); + + List actualRequests = mockMetricsServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLogMetricsRequest actualRequest = (ListLogMetricsRequest) actualRequests.get(0); + + Assert.assertEquals(parent, ProjectName.parse(actualRequest.getParent())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listLogMetricsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockMetricsServiceV2.addException(exception); + + try { + ProjectName parent = ProjectName.of("[PROJECT]"); + + client.listLogMetrics(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getLogMetricTest() { + LogMetricName name = LogMetricName.of("[PROJECT]", "[METRIC]"); + String description = "description-1724546052"; + String filter = "filter-1274492040"; + String valueExtractor = "valueExtractor2047672534"; + LogMetric expectedResponse = + LogMetric.newBuilder() + .setName(name.toString()) + .setDescription(description) + .setFilter(filter) + .setValueExtractor(valueExtractor) + .build(); + mockMetricsServiceV2.addResponse(expectedResponse); + + LogMetricName metricName = LogMetricName.of("[PROJECT]", "[METRIC]"); + + LogMetric actualResponse = client.getLogMetric(metricName); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMetricsServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLogMetricRequest actualRequest = (GetLogMetricRequest) actualRequests.get(0); + + Assert.assertEquals(metricName, LogMetricName.parse(actualRequest.getMetricName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getLogMetricExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockMetricsServiceV2.addException(exception); + + try { + LogMetricName metricName = LogMetricName.of("[PROJECT]", "[METRIC]"); + + client.getLogMetric(metricName); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void createLogMetricTest() { + LogMetricName name = LogMetricName.of("[PROJECT]", "[METRIC]"); + String description = "description-1724546052"; + String filter = "filter-1274492040"; + String valueExtractor = "valueExtractor2047672534"; + LogMetric expectedResponse = + LogMetric.newBuilder() + .setName(name.toString()) + .setDescription(description) + .setFilter(filter) + .setValueExtractor(valueExtractor) + .build(); + mockMetricsServiceV2.addResponse(expectedResponse); + + ProjectName parent = ProjectName.of("[PROJECT]"); + LogMetric metric = LogMetric.newBuilder().build(); + + LogMetric actualResponse = client.createLogMetric(parent, metric); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMetricsServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateLogMetricRequest actualRequest = (CreateLogMetricRequest) actualRequests.get(0); + + Assert.assertEquals(parent, ProjectName.parse(actualRequest.getParent())); + Assert.assertEquals(metric, actualRequest.getMetric()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void createLogMetricExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockMetricsServiceV2.addException(exception); + + try { + ProjectName parent = ProjectName.of("[PROJECT]"); + LogMetric metric = LogMetric.newBuilder().build(); + + client.createLogMetric(parent, metric); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateLogMetricTest() { + LogMetricName name = LogMetricName.of("[PROJECT]", "[METRIC]"); + String description = "description-1724546052"; + String filter = "filter-1274492040"; + String valueExtractor = "valueExtractor2047672534"; + LogMetric expectedResponse = + LogMetric.newBuilder() + .setName(name.toString()) + .setDescription(description) + .setFilter(filter) + .setValueExtractor(valueExtractor) + .build(); + mockMetricsServiceV2.addResponse(expectedResponse); + + LogMetricName metricName = LogMetricName.of("[PROJECT]", "[METRIC]"); + LogMetric metric = LogMetric.newBuilder().build(); + + LogMetric actualResponse = client.updateLogMetric(metricName, metric); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMetricsServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateLogMetricRequest actualRequest = (UpdateLogMetricRequest) actualRequests.get(0); + + Assert.assertEquals(metricName, LogMetricName.parse(actualRequest.getMetricName())); + Assert.assertEquals(metric, actualRequest.getMetric()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateLogMetricExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockMetricsServiceV2.addException(exception); + + try { + LogMetricName metricName = LogMetricName.of("[PROJECT]", "[METRIC]"); + LogMetric metric = LogMetric.newBuilder().build(); + + client.updateLogMetric(metricName, metric); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteLogMetricTest() { + Empty expectedResponse = Empty.newBuilder().build(); + mockMetricsServiceV2.addResponse(expectedResponse); + + LogMetricName metricName = LogMetricName.of("[PROJECT]", "[METRIC]"); + + client.deleteLogMetric(metricName); + + List actualRequests = mockMetricsServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteLogMetricRequest actualRequest = (DeleteLogMetricRequest) actualRequests.get(0); + + Assert.assertEquals(metricName, LogMetricName.parse(actualRequest.getMetricName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void deleteLogMetricExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockMetricsServiceV2.addException(exception); + + try { + LogMetricName metricName = LogMetricName.of("[PROJECT]", "[METRIC]"); + + client.deleteLogMetric(metricName); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } +} diff --git a/google-cloud-logging/src/test/java/com/google/cloud/logging/v2/MockConfigServiceV2Impl.java b/google-cloud-logging/src/test/java/com/google/cloud/logging/v2/MockConfigServiceV2Impl.java index 8addc0426..2ca8ed4f2 100644 --- a/google-cloud-logging/src/test/java/com/google/cloud/logging/v2/MockConfigServiceV2Impl.java +++ b/google-cloud-logging/src/test/java/com/google/cloud/logging/v2/MockConfigServiceV2Impl.java @@ -22,15 +22,20 @@ import com.google.logging.v2.CreateSinkRequest; import com.google.logging.v2.DeleteExclusionRequest; import com.google.logging.v2.DeleteSinkRequest; +import com.google.logging.v2.GetBucketRequest; import com.google.logging.v2.GetCmekSettingsRequest; import com.google.logging.v2.GetExclusionRequest; import com.google.logging.v2.GetSinkRequest; +import com.google.logging.v2.ListBucketsRequest; +import com.google.logging.v2.ListBucketsResponse; import com.google.logging.v2.ListExclusionsRequest; import com.google.logging.v2.ListExclusionsResponse; import com.google.logging.v2.ListSinksRequest; import com.google.logging.v2.ListSinksResponse; +import com.google.logging.v2.LogBucket; import com.google.logging.v2.LogExclusion; import com.google.logging.v2.LogSink; +import com.google.logging.v2.UpdateBucketRequest; import com.google.logging.v2.UpdateCmekSettingsRequest; import com.google.logging.v2.UpdateExclusionRequest; import com.google.logging.v2.UpdateSinkRequest; @@ -74,6 +79,50 @@ public void reset() { responses = new LinkedList<>(); } + @Override + public void listBuckets( + ListBucketsRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListBucketsResponse) { + requests.add(request); + responseObserver.onNext((ListBucketsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getBucket(GetBucketRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof LogBucket) { + requests.add(request); + responseObserver.onNext((LogBucket) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void updateBucket( + UpdateBucketRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof LogBucket) { + requests.add(request); + responseObserver.onNext((LogBucket) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + @Override public void listSinks( ListSinksRequest request, StreamObserver responseObserver) { diff --git a/grpc-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ConfigServiceV2Grpc.java b/grpc-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ConfigServiceV2Grpc.java index 96a57be0c..0b4ae4327 100644 --- a/grpc-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ConfigServiceV2Grpc.java +++ b/grpc-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ConfigServiceV2Grpc.java @@ -39,6 +39,158 @@ private ConfigServiceV2Grpc() {} public static final String SERVICE_NAME = "google.logging.v2.ConfigServiceV2"; // Static method descriptors that strictly reflect the proto. + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getListBucketsMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.logging.v2.ListBucketsRequest, com.google.logging.v2.ListBucketsResponse> + METHOD_LIST_BUCKETS = getListBucketsMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.logging.v2.ListBucketsRequest, com.google.logging.v2.ListBucketsResponse> + getListBucketsMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.logging.v2.ListBucketsRequest, com.google.logging.v2.ListBucketsResponse> + getListBucketsMethod() { + return getListBucketsMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.logging.v2.ListBucketsRequest, com.google.logging.v2.ListBucketsResponse> + getListBucketsMethodHelper() { + io.grpc.MethodDescriptor< + com.google.logging.v2.ListBucketsRequest, com.google.logging.v2.ListBucketsResponse> + getListBucketsMethod; + if ((getListBucketsMethod = ConfigServiceV2Grpc.getListBucketsMethod) == null) { + synchronized (ConfigServiceV2Grpc.class) { + if ((getListBucketsMethod = ConfigServiceV2Grpc.getListBucketsMethod) == null) { + ConfigServiceV2Grpc.getListBucketsMethod = + getListBucketsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.logging.v2.ConfigServiceV2", "ListBuckets")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.ListBucketsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.ListBucketsResponse.getDefaultInstance())) + .setSchemaDescriptor( + new ConfigServiceV2MethodDescriptorSupplier("ListBuckets")) + .build(); + } + } + } + return getListBucketsMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getGetBucketMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.logging.v2.GetBucketRequest, com.google.logging.v2.LogBucket> + METHOD_GET_BUCKET = getGetBucketMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.logging.v2.GetBucketRequest, com.google.logging.v2.LogBucket> + getGetBucketMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.logging.v2.GetBucketRequest, com.google.logging.v2.LogBucket> + getGetBucketMethod() { + return getGetBucketMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.logging.v2.GetBucketRequest, com.google.logging.v2.LogBucket> + getGetBucketMethodHelper() { + io.grpc.MethodDescriptor< + com.google.logging.v2.GetBucketRequest, com.google.logging.v2.LogBucket> + getGetBucketMethod; + if ((getGetBucketMethod = ConfigServiceV2Grpc.getGetBucketMethod) == null) { + synchronized (ConfigServiceV2Grpc.class) { + if ((getGetBucketMethod = ConfigServiceV2Grpc.getGetBucketMethod) == null) { + ConfigServiceV2Grpc.getGetBucketMethod = + getGetBucketMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName("google.logging.v2.ConfigServiceV2", "GetBucket")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.GetBucketRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.LogBucket.getDefaultInstance())) + .setSchemaDescriptor(new ConfigServiceV2MethodDescriptorSupplier("GetBucket")) + .build(); + } + } + } + return getGetBucketMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getUpdateBucketMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.logging.v2.UpdateBucketRequest, com.google.logging.v2.LogBucket> + METHOD_UPDATE_BUCKET = getUpdateBucketMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.logging.v2.UpdateBucketRequest, com.google.logging.v2.LogBucket> + getUpdateBucketMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.logging.v2.UpdateBucketRequest, com.google.logging.v2.LogBucket> + getUpdateBucketMethod() { + return getUpdateBucketMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.logging.v2.UpdateBucketRequest, com.google.logging.v2.LogBucket> + getUpdateBucketMethodHelper() { + io.grpc.MethodDescriptor< + com.google.logging.v2.UpdateBucketRequest, com.google.logging.v2.LogBucket> + getUpdateBucketMethod; + if ((getUpdateBucketMethod = ConfigServiceV2Grpc.getUpdateBucketMethod) == null) { + synchronized (ConfigServiceV2Grpc.class) { + if ((getUpdateBucketMethod = ConfigServiceV2Grpc.getUpdateBucketMethod) == null) { + ConfigServiceV2Grpc.getUpdateBucketMethod = + getUpdateBucketMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.logging.v2.ConfigServiceV2", "UpdateBucket")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.UpdateBucketRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.LogBucket.getDefaultInstance())) + .setSchemaDescriptor( + new ConfigServiceV2MethodDescriptorSupplier("UpdateBucket")) + .build(); + } + } + } + return getUpdateBucketMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") @java.lang.Deprecated // Use {@link #getListSinksMethod()} instead. public static final io.grpc.MethodDescriptor< @@ -675,6 +827,52 @@ public static ConfigServiceV2FutureStub newFutureStub(io.grpc.Channel channel) { */ public abstract static class ConfigServiceV2ImplBase implements io.grpc.BindableService { + /** + * + * + *
+     * Lists buckets (Beta).
+     * 
+ */ + public void listBuckets( + com.google.logging.v2.ListBucketsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getListBucketsMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Gets a bucket (Beta).
+     * 
+ */ + public void getBucket( + com.google.logging.v2.GetBucketRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getGetBucketMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Updates a bucket. This method replaces the following fields in the
+     * existing bucket with values from the new bucket: `retention_period`
+     * If the retention period is decreased and the bucket is locked,
+     * FAILED_PRECONDITION will be returned.
+     * If the bucket has a LifecycleState of DELETE_REQUESTED, FAILED_PRECONDITION
+     * will be returned.
+     * A buckets region may not be modified after it is created.
+     * This method is in Beta.
+     * 
+ */ + public void updateBucket( + com.google.logging.v2.UpdateBucketRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getUpdateBucketMethodHelper(), responseObserver); + } + /** * * @@ -859,6 +1057,24 @@ public void updateCmekSettings( @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListBucketsMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.ListBucketsRequest, + com.google.logging.v2.ListBucketsResponse>(this, METHODID_LIST_BUCKETS))) + .addMethod( + getGetBucketMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.GetBucketRequest, com.google.logging.v2.LogBucket>( + this, METHODID_GET_BUCKET))) + .addMethod( + getUpdateBucketMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.UpdateBucketRequest, com.google.logging.v2.LogBucket>( + this, METHODID_UPDATE_BUCKET))) .addMethod( getListSinksMethodHelper(), asyncUnaryCall( @@ -958,6 +1174,61 @@ protected ConfigServiceV2Stub build(io.grpc.Channel channel, io.grpc.CallOptions return new ConfigServiceV2Stub(channel, callOptions); } + /** + * + * + *
+     * Lists buckets (Beta).
+     * 
+ */ + public void listBuckets( + com.google.logging.v2.ListBucketsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListBucketsMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets a bucket (Beta).
+     * 
+ */ + public void getBucket( + com.google.logging.v2.GetBucketRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetBucketMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates a bucket. This method replaces the following fields in the
+     * existing bucket with values from the new bucket: `retention_period`
+     * If the retention period is decreased and the bucket is locked,
+     * FAILED_PRECONDITION will be returned.
+     * If the bucket has a LifecycleState of DELETE_REQUESTED, FAILED_PRECONDITION
+     * will be returned.
+     * A buckets region may not be modified after it is created.
+     * This method is in Beta.
+     * 
+ */ + public void updateBucket( + com.google.logging.v2.UpdateBucketRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateBucketMethodHelper(), getCallOptions()), + request, + responseObserver); + } + /** * * @@ -1199,6 +1470,51 @@ protected ConfigServiceV2BlockingStub build( return new ConfigServiceV2BlockingStub(channel, callOptions); } + /** + * + * + *
+     * Lists buckets (Beta).
+     * 
+ */ + public com.google.logging.v2.ListBucketsResponse listBuckets( + com.google.logging.v2.ListBucketsRequest request) { + return blockingUnaryCall( + getChannel(), getListBucketsMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a bucket (Beta).
+     * 
+ */ + public com.google.logging.v2.LogBucket getBucket( + com.google.logging.v2.GetBucketRequest request) { + return blockingUnaryCall(getChannel(), getGetBucketMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a bucket. This method replaces the following fields in the
+     * existing bucket with values from the new bucket: `retention_period`
+     * If the retention period is decreased and the bucket is locked,
+     * FAILED_PRECONDITION will be returned.
+     * If the bucket has a LifecycleState of DELETE_REQUESTED, FAILED_PRECONDITION
+     * will be returned.
+     * A buckets region may not be modified after it is created.
+     * This method is in Beta.
+     * 
+ */ + public com.google.logging.v2.LogBucket updateBucket( + com.google.logging.v2.UpdateBucketRequest request) { + return blockingUnaryCall( + getChannel(), getUpdateBucketMethodHelper(), getCallOptions(), request); + } + /** * * @@ -1399,6 +1715,53 @@ protected ConfigServiceV2FutureStub build( return new ConfigServiceV2FutureStub(channel, callOptions); } + /** + * + * + *
+     * Lists buckets (Beta).
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.logging.v2.ListBucketsResponse> + listBuckets(com.google.logging.v2.ListBucketsRequest request) { + return futureUnaryCall( + getChannel().newCall(getListBucketsMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets a bucket (Beta).
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getBucket(com.google.logging.v2.GetBucketRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetBucketMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates a bucket. This method replaces the following fields in the
+     * existing bucket with values from the new bucket: `retention_period`
+     * If the retention period is decreased and the bucket is locked,
+     * FAILED_PRECONDITION will be returned.
+     * If the bucket has a LifecycleState of DELETE_REQUESTED, FAILED_PRECONDITION
+     * will be returned.
+     * A buckets region may not be modified after it is created.
+     * This method is in Beta.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateBucket(com.google.logging.v2.UpdateBucketRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateBucketMethodHelper(), getCallOptions()), request); + } + /** * * @@ -1582,18 +1945,21 @@ public com.google.common.util.concurrent.ListenableFuture implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -1612,6 +1978,22 @@ private static final class MethodHandlers @java.lang.SuppressWarnings("unchecked") public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { switch (methodId) { + case METHODID_LIST_BUCKETS: + serviceImpl.listBuckets( + (com.google.logging.v2.ListBucketsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_BUCKET: + serviceImpl.getBucket( + (com.google.logging.v2.GetBucketRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_BUCKET: + serviceImpl.updateBucket( + (com.google.logging.v2.UpdateBucketRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; case METHODID_LIST_SINKS: serviceImpl.listSinks( (com.google.logging.v2.ListSinksRequest) request, @@ -1738,6 +2120,9 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) .setSchemaDescriptor(new ConfigServiceV2FileDescriptorSupplier()) + .addMethod(getListBucketsMethodHelper()) + .addMethod(getGetBucketMethodHelper()) + .addMethod(getUpdateBucketMethodHelper()) .addMethod(getListSinksMethodHelper()) .addMethod(getGetSinkMethodHelper()) .addMethod(getCreateSinkMethodHelper()) diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/type/BillingAccountName.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/type/BillingAccountName.java new file mode 100644 index 000000000..d6371d6b3 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/type/BillingAccountName.java @@ -0,0 +1,162 @@ +/* + * Copyright 2020 Google LLC + * + * 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 + * + * https://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.logging.type; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** AUTO-GENERATED DOCUMENTATION AND CLASS */ +@javax.annotation.Generated("by GAPIC protoc plugin") +public class BillingAccountName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("billingAccounts/{billing_account}"); + + private volatile Map fieldValuesMap; + + private final String billingAccount; + + public String getBillingAccount() { + return billingAccount; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private BillingAccountName(Builder builder) { + billingAccount = Preconditions.checkNotNull(builder.getBillingAccount()); + } + + public static BillingAccountName of(String billingAccount) { + return newBuilder().setBillingAccount(billingAccount).build(); + } + + public static String format(String billingAccount) { + return newBuilder().setBillingAccount(billingAccount).build().toString(); + } + + public static BillingAccountName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "BillingAccountName.parse: formattedString not in valid format"); + return of(matchMap.get("billing_account")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (BillingAccountName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("billingAccount", billingAccount); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("billing_account", billingAccount); + } + + /** Builder for BillingAccountName. */ + public static class Builder { + + private String billingAccount; + + public String getBillingAccount() { + return billingAccount; + } + + public Builder setBillingAccount(String billingAccount) { + this.billingAccount = billingAccount; + return this; + } + + private Builder() {} + + private Builder(BillingAccountName billingAccountName) { + billingAccount = billingAccountName.billingAccount; + } + + public BillingAccountName build() { + return new BillingAccountName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof BillingAccountName) { + BillingAccountName that = (BillingAccountName) o; + return (this.billingAccount.equals(that.billingAccount)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= billingAccount.hashCode(); + return h; + } +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/type/CmekSettingsName.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/type/CmekSettingsName.java new file mode 100644 index 000000000..ce51f37ca --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/type/CmekSettingsName.java @@ -0,0 +1,375 @@ +/* + * Copyright 2020 Google LLC + * + * 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 + * + * https://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.logging.type; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.pathtemplate.ValidationException; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** AUTO-GENERATED DOCUMENTATION AND CLASS */ +@javax.annotation.Generated("by GAPIC protoc plugin") +public class CmekSettingsName implements ResourceName { + + @Deprecated + protected CmekSettingsName() {} + + private static final PathTemplate PROJECT_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/cmekSettings"); + private static final PathTemplate ORGANIZATION_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("organizations/{organization}/cmekSettings"); + private static final PathTemplate FOLDER_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("folders/{folder}/cmekSettings"); + private static final PathTemplate BILLING_ACCOUNT_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("billingAccounts/{billing_account}/cmekSettings"); + + private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; + + private String project; + private String organization; + private String folder; + private String billingAccount; + + public String getProject() { + return project; + } + + public String getOrganization() { + return organization; + } + + public String getFolder() { + return folder; + } + + public String getBillingAccount() { + return billingAccount; + } + + private CmekSettingsName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + pathTemplate = PROJECT_PATH_TEMPLATE; + } + + private CmekSettingsName(OrganizationBuilder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + pathTemplate = ORGANIZATION_PATH_TEMPLATE; + } + + private CmekSettingsName(FolderBuilder builder) { + folder = Preconditions.checkNotNull(builder.getFolder()); + pathTemplate = FOLDER_PATH_TEMPLATE; + } + + private CmekSettingsName(BillingAccountBuilder builder) { + billingAccount = Preconditions.checkNotNull(builder.getBillingAccount()); + pathTemplate = BILLING_ACCOUNT_PATH_TEMPLATE; + } + + public static Builder newBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static Builder newProjectBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static OrganizationBuilder newOrganizationBuilder() { + return new OrganizationBuilder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static FolderBuilder newFolderBuilder() { + return new FolderBuilder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static BillingAccountBuilder newBillingAccountBuilder() { + return new BillingAccountBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static CmekSettingsName of(String project) { + return newProjectBuilder().setProject(project).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static CmekSettingsName ofProjectName(String project) { + return newProjectBuilder().setProject(project).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static CmekSettingsName ofOrganizationName(String organization) { + return newOrganizationBuilder().setOrganization(organization).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static CmekSettingsName ofFolderName(String folder) { + return newFolderBuilder().setFolder(folder).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static CmekSettingsName ofBillingAccountName(String billingAccount) { + return newBillingAccountBuilder().setBillingAccount(billingAccount).build(); + } + + public static String format(String project) { + return newBuilder().setProject(project).build().toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatProjectName(String project) { + return newBuilder().setProject(project).build().toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatOrganizationName(String organization) { + return newOrganizationBuilder().setOrganization(organization).build().toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatFolderName(String folder) { + return newFolderBuilder().setFolder(folder).build().toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatBillingAccountName(String billingAccount) { + return newBillingAccountBuilder().setBillingAccount(billingAccount).build().toString(); + } + + public static CmekSettingsName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + if (PROJECT_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = PROJECT_PATH_TEMPLATE.match(formattedString); + return ofProjectName(matchMap.get("project")); + } else if (ORGANIZATION_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = ORGANIZATION_PATH_TEMPLATE.match(formattedString); + return ofOrganizationName(matchMap.get("organization")); + } else if (FOLDER_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = FOLDER_PATH_TEMPLATE.match(formattedString); + return ofFolderName(matchMap.get("folder")); + } else if (BILLING_ACCOUNT_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = BILLING_ACCOUNT_PATH_TEMPLATE.match(formattedString); + return ofBillingAccountName(matchMap.get("billing_account")); + } + throw new ValidationException("JobName.parse: formattedString not in valid format"); + } + + @BetaApi("The method will be renamed to parseList after subclasses of this class are removed.") + public static List parse(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + @BetaApi("The method will be renamed to toStringList after subclasses of this class are removed.") + public static List toStrings(List values) { + List list = new ArrayList<>(values.size()); + for (CmekSettingsName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_PATH_TEMPLATE.matches(formattedString) + || ORGANIZATION_PATH_TEMPLATE.matches(formattedString) + || FOLDER_PATH_TEMPLATE.matches(formattedString) + || BILLING_ACCOUNT_PATH_TEMPLATE.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + if (folder != null) { + fieldMapBuilder.put("folder", folder); + } + if (billingAccount != null) { + fieldMapBuilder.put("billing_account", billingAccount); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + } + + /** Builder for projects/{project}/cmekSettings. */ + public static class Builder { + + private String project; + + protected Builder() {} + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + private Builder(CmekSettingsName cmekSettingsName) { + Preconditions.checkArgument( + cmekSettingsName.pathTemplate == PROJECT_PATH_TEMPLATE, + "toBuilder is only supported when CmekSettingsName has the pattern of " + + "projects/{project}/cmekSettings."); + project = cmekSettingsName.project; + } + + public CmekSettingsName build() { + return new CmekSettingsName(this); + } + } + + /** Builder for organizations/{organization}/cmekSettings. */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class OrganizationBuilder { + + private String organization; + + private OrganizationBuilder() {} + + public String getOrganization() { + return organization; + } + + public OrganizationBuilder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public CmekSettingsName build() { + return new CmekSettingsName(this); + } + } + + /** Builder for folders/{folder}/cmekSettings. */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class FolderBuilder { + + private String folder; + + private FolderBuilder() {} + + public String getFolder() { + return folder; + } + + public FolderBuilder setFolder(String folder) { + this.folder = folder; + return this; + } + + public CmekSettingsName build() { + return new CmekSettingsName(this); + } + } + + /** Builder for billingAccounts/{billing_account}/cmekSettings. */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class BillingAccountBuilder { + + private String billingAccount; + + private BillingAccountBuilder() {} + + public String getBillingAccount() { + return billingAccount; + } + + public BillingAccountBuilder setBillingAccount(String billingAccount) { + this.billingAccount = billingAccount; + return this; + } + + public CmekSettingsName build() { + return new CmekSettingsName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + CmekSettingsName that = (CmekSettingsName) o; + return (Objects.equals(this.project, that.project)) + && (Objects.equals(this.organization, that.organization)) + && (Objects.equals(this.folder, that.folder)) + && (Objects.equals(this.billingAccount, that.billingAccount)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(organization); + h *= 1000003; + h ^= Objects.hashCode(folder); + h *= 1000003; + h ^= Objects.hashCode(billingAccount); + return h; + } +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/type/FolderName.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/type/FolderName.java index 5477ffdde..57a0c7027 100644 --- a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/type/FolderName.java +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/type/FolderName.java @@ -17,6 +17,7 @@ package com.google.logging.type; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; import java.util.ArrayList; @@ -25,7 +26,7 @@ /** AUTO-GENERATED DOCUMENTATION AND CLASS */ @javax.annotation.Generated("by GAPIC protoc plugin") -public class FolderName extends ParentName { +public class FolderName implements ResourceName { private static final PathTemplate PATH_TEMPLATE = PathTemplate.createWithoutUrlEncoding("folders/{folder}"); diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/type/LogBucketName.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/type/LogBucketName.java new file mode 100644 index 000000000..c0bdcdbe2 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/type/LogBucketName.java @@ -0,0 +1,550 @@ +/* + * Copyright 2020 Google LLC + * + * 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 + * + * https://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.logging.type; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.pathtemplate.ValidationException; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** AUTO-GENERATED DOCUMENTATION AND CLASS */ +@javax.annotation.Generated("by GAPIC protoc plugin") +public class LogBucketName implements ResourceName { + + @Deprecated + protected LogBucketName() {} + + private static final PathTemplate PROJECT_LOCATION_BUCKET_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/buckets/{bucket}"); + private static final PathTemplate ORGANIZATION_LOCATION_BUCKET_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "organizations/{organization}/locations/{location}/buckets/{bucket}"); + private static final PathTemplate FOLDER_LOCATION_BUCKET_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "folders/{folder}/locations/{location}/buckets/{bucket}"); + private static final PathTemplate BILLING_ACCOUNT_LOCATION_BUCKET_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}"); + + private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; + + private String project; + private String location; + private String bucket; + private String organization; + private String folder; + private String billingAccount; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getBucket() { + return bucket; + } + + public String getOrganization() { + return organization; + } + + public String getFolder() { + return folder; + } + + public String getBillingAccount() { + return billingAccount; + } + + private LogBucketName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + bucket = Preconditions.checkNotNull(builder.getBucket()); + pathTemplate = PROJECT_LOCATION_BUCKET_PATH_TEMPLATE; + } + + private LogBucketName(OrganizationLocationBucketBuilder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + location = Preconditions.checkNotNull(builder.getLocation()); + bucket = Preconditions.checkNotNull(builder.getBucket()); + pathTemplate = ORGANIZATION_LOCATION_BUCKET_PATH_TEMPLATE; + } + + private LogBucketName(FolderLocationBucketBuilder builder) { + folder = Preconditions.checkNotNull(builder.getFolder()); + location = Preconditions.checkNotNull(builder.getLocation()); + bucket = Preconditions.checkNotNull(builder.getBucket()); + pathTemplate = FOLDER_LOCATION_BUCKET_PATH_TEMPLATE; + } + + private LogBucketName(BillingAccountLocationBucketBuilder builder) { + billingAccount = Preconditions.checkNotNull(builder.getBillingAccount()); + location = Preconditions.checkNotNull(builder.getLocation()); + bucket = Preconditions.checkNotNull(builder.getBucket()); + pathTemplate = BILLING_ACCOUNT_LOCATION_BUCKET_PATH_TEMPLATE; + } + + public static Builder newBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static Builder newProjectLocationBucketBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static OrganizationLocationBucketBuilder newOrganizationLocationBucketBuilder() { + return new OrganizationLocationBucketBuilder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static FolderLocationBucketBuilder newFolderLocationBucketBuilder() { + return new FolderLocationBucketBuilder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static BillingAccountLocationBucketBuilder newBillingAccountLocationBucketBuilder() { + return new BillingAccountLocationBucketBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static LogBucketName of(String project, String location, String bucket) { + return newProjectLocationBucketBuilder() + .setProject(project) + .setLocation(location) + .setBucket(bucket) + .build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static LogBucketName ofProjectLocationBucketName( + String project, String location, String bucket) { + return newProjectLocationBucketBuilder() + .setProject(project) + .setLocation(location) + .setBucket(bucket) + .build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static LogBucketName ofOrganizationLocationBucketName( + String organization, String location, String bucket) { + return newOrganizationLocationBucketBuilder() + .setOrganization(organization) + .setLocation(location) + .setBucket(bucket) + .build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static LogBucketName ofFolderLocationBucketName( + String folder, String location, String bucket) { + return newFolderLocationBucketBuilder() + .setFolder(folder) + .setLocation(location) + .setBucket(bucket) + .build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static LogBucketName ofBillingAccountLocationBucketName( + String billingAccount, String location, String bucket) { + return newBillingAccountLocationBucketBuilder() + .setBillingAccount(billingAccount) + .setLocation(location) + .setBucket(bucket) + .build(); + } + + public static String format(String project, String location, String bucket) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setBucket(bucket) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatProjectLocationBucketName( + String project, String location, String bucket) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setBucket(bucket) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatOrganizationLocationBucketName( + String organization, String location, String bucket) { + return newOrganizationLocationBucketBuilder() + .setOrganization(organization) + .setLocation(location) + .setBucket(bucket) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatFolderLocationBucketName( + String folder, String location, String bucket) { + return newFolderLocationBucketBuilder() + .setFolder(folder) + .setLocation(location) + .setBucket(bucket) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatBillingAccountLocationBucketName( + String billingAccount, String location, String bucket) { + return newBillingAccountLocationBucketBuilder() + .setBillingAccount(billingAccount) + .setLocation(location) + .setBucket(bucket) + .build() + .toString(); + } + + public static LogBucketName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + if (PROJECT_LOCATION_BUCKET_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = PROJECT_LOCATION_BUCKET_PATH_TEMPLATE.match(formattedString); + return ofProjectLocationBucketName( + matchMap.get("project"), matchMap.get("location"), matchMap.get("bucket")); + } else if (ORGANIZATION_LOCATION_BUCKET_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = + ORGANIZATION_LOCATION_BUCKET_PATH_TEMPLATE.match(formattedString); + return ofOrganizationLocationBucketName( + matchMap.get("organization"), matchMap.get("location"), matchMap.get("bucket")); + } else if (FOLDER_LOCATION_BUCKET_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = FOLDER_LOCATION_BUCKET_PATH_TEMPLATE.match(formattedString); + return ofFolderLocationBucketName( + matchMap.get("folder"), matchMap.get("location"), matchMap.get("bucket")); + } else if (BILLING_ACCOUNT_LOCATION_BUCKET_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = + BILLING_ACCOUNT_LOCATION_BUCKET_PATH_TEMPLATE.match(formattedString); + return ofBillingAccountLocationBucketName( + matchMap.get("billing_account"), matchMap.get("location"), matchMap.get("bucket")); + } + throw new ValidationException("JobName.parse: formattedString not in valid format"); + } + + @BetaApi("The method will be renamed to parseList after subclasses of this class are removed.") + public static List parse(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + @BetaApi("The method will be renamed to toStringList after subclasses of this class are removed.") + public static List toStrings(List values) { + List list = new ArrayList<>(values.size()); + for (LogBucketName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_BUCKET_PATH_TEMPLATE.matches(formattedString) + || ORGANIZATION_LOCATION_BUCKET_PATH_TEMPLATE.matches(formattedString) + || FOLDER_LOCATION_BUCKET_PATH_TEMPLATE.matches(formattedString) + || BILLING_ACCOUNT_LOCATION_BUCKET_PATH_TEMPLATE.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (bucket != null) { + fieldMapBuilder.put("bucket", bucket); + } + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + if (folder != null) { + fieldMapBuilder.put("folder", folder); + } + if (billingAccount != null) { + fieldMapBuilder.put("billing_account", billingAccount); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + } + + /** Builder for projects/{project}/locations/{location}/buckets/{bucket}. */ + public static class Builder { + + private String project; + private String location; + private String bucket; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getBucket() { + return bucket; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setBucket(String bucket) { + this.bucket = bucket; + return this; + } + + private Builder(LogBucketName logBucketName) { + Preconditions.checkArgument( + logBucketName.pathTemplate == PROJECT_LOCATION_BUCKET_PATH_TEMPLATE, + "toBuilder is only supported when LogBucketName has the pattern of " + + "projects/{project}/locations/{location}/buckets/{bucket}."); + project = logBucketName.project; + location = logBucketName.location; + bucket = logBucketName.bucket; + } + + public LogBucketName build() { + return new LogBucketName(this); + } + } + + /** Builder for organizations/{organization}/locations/{location}/buckets/{bucket}. */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class OrganizationLocationBucketBuilder { + + private String organization; + private String location; + private String bucket; + + private OrganizationLocationBucketBuilder() {} + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getBucket() { + return bucket; + } + + public OrganizationLocationBucketBuilder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public OrganizationLocationBucketBuilder setLocation(String location) { + this.location = location; + return this; + } + + public OrganizationLocationBucketBuilder setBucket(String bucket) { + this.bucket = bucket; + return this; + } + + public LogBucketName build() { + return new LogBucketName(this); + } + } + + /** Builder for folders/{folder}/locations/{location}/buckets/{bucket}. */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class FolderLocationBucketBuilder { + + private String folder; + private String location; + private String bucket; + + private FolderLocationBucketBuilder() {} + + public String getFolder() { + return folder; + } + + public String getLocation() { + return location; + } + + public String getBucket() { + return bucket; + } + + public FolderLocationBucketBuilder setFolder(String folder) { + this.folder = folder; + return this; + } + + public FolderLocationBucketBuilder setLocation(String location) { + this.location = location; + return this; + } + + public FolderLocationBucketBuilder setBucket(String bucket) { + this.bucket = bucket; + return this; + } + + public LogBucketName build() { + return new LogBucketName(this); + } + } + + /** Builder for billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}. */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class BillingAccountLocationBucketBuilder { + + private String billingAccount; + private String location; + private String bucket; + + private BillingAccountLocationBucketBuilder() {} + + public String getBillingAccount() { + return billingAccount; + } + + public String getLocation() { + return location; + } + + public String getBucket() { + return bucket; + } + + public BillingAccountLocationBucketBuilder setBillingAccount(String billingAccount) { + this.billingAccount = billingAccount; + return this; + } + + public BillingAccountLocationBucketBuilder setLocation(String location) { + this.location = location; + return this; + } + + public BillingAccountLocationBucketBuilder setBucket(String bucket) { + this.bucket = bucket; + return this; + } + + public LogBucketName build() { + return new LogBucketName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + LogBucketName that = (LogBucketName) o; + return (Objects.equals(this.project, that.project)) + && (Objects.equals(this.location, that.location)) + && (Objects.equals(this.bucket, that.bucket)) + && (Objects.equals(this.organization, that.organization)) + && (Objects.equals(this.folder, that.folder)) + && (Objects.equals(this.billingAccount, that.billingAccount)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(bucket); + h *= 1000003; + h ^= Objects.hashCode(organization); + h *= 1000003; + h ^= Objects.hashCode(folder); + h *= 1000003; + h ^= Objects.hashCode(billingAccount); + return h; + } +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/type/LogExclusionName.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/type/LogExclusionName.java new file mode 100644 index 000000000..f00dcd517 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/type/LogExclusionName.java @@ -0,0 +1,449 @@ +/* + * Copyright 2020 Google LLC + * + * 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 + * + * https://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.logging.type; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.pathtemplate.ValidationException; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** AUTO-GENERATED DOCUMENTATION AND CLASS */ +@javax.annotation.Generated("by GAPIC protoc plugin") +public class LogExclusionName implements ResourceName { + + @Deprecated + protected LogExclusionName() {} + + private static final PathTemplate PROJECT_EXCLUSION_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/exclusions/{exclusion}"); + private static final PathTemplate ORGANIZATION_EXCLUSION_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("organizations/{organization}/exclusions/{exclusion}"); + private static final PathTemplate FOLDER_EXCLUSION_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("folders/{folder}/exclusions/{exclusion}"); + private static final PathTemplate BILLING_ACCOUNT_EXCLUSION_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "billingAccounts/{billing_account}/exclusions/{exclusion}"); + + private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; + + private String project; + private String exclusion; + private String organization; + private String folder; + private String billingAccount; + + public String getProject() { + return project; + } + + public String getExclusion() { + return exclusion; + } + + public String getOrganization() { + return organization; + } + + public String getFolder() { + return folder; + } + + public String getBillingAccount() { + return billingAccount; + } + + private LogExclusionName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + exclusion = Preconditions.checkNotNull(builder.getExclusion()); + pathTemplate = PROJECT_EXCLUSION_PATH_TEMPLATE; + } + + private LogExclusionName(OrganizationExclusionBuilder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + exclusion = Preconditions.checkNotNull(builder.getExclusion()); + pathTemplate = ORGANIZATION_EXCLUSION_PATH_TEMPLATE; + } + + private LogExclusionName(FolderExclusionBuilder builder) { + folder = Preconditions.checkNotNull(builder.getFolder()); + exclusion = Preconditions.checkNotNull(builder.getExclusion()); + pathTemplate = FOLDER_EXCLUSION_PATH_TEMPLATE; + } + + private LogExclusionName(BillingAccountExclusionBuilder builder) { + billingAccount = Preconditions.checkNotNull(builder.getBillingAccount()); + exclusion = Preconditions.checkNotNull(builder.getExclusion()); + pathTemplate = BILLING_ACCOUNT_EXCLUSION_PATH_TEMPLATE; + } + + public static Builder newBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static Builder newProjectExclusionBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static OrganizationExclusionBuilder newOrganizationExclusionBuilder() { + return new OrganizationExclusionBuilder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static FolderExclusionBuilder newFolderExclusionBuilder() { + return new FolderExclusionBuilder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static BillingAccountExclusionBuilder newBillingAccountExclusionBuilder() { + return new BillingAccountExclusionBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static LogExclusionName of(String project, String exclusion) { + return newProjectExclusionBuilder().setProject(project).setExclusion(exclusion).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static LogExclusionName ofProjectExclusionName(String project, String exclusion) { + return newProjectExclusionBuilder().setProject(project).setExclusion(exclusion).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static LogExclusionName ofOrganizationExclusionName( + String organization, String exclusion) { + return newOrganizationExclusionBuilder() + .setOrganization(organization) + .setExclusion(exclusion) + .build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static LogExclusionName ofFolderExclusionName(String folder, String exclusion) { + return newFolderExclusionBuilder().setFolder(folder).setExclusion(exclusion).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static LogExclusionName ofBillingAccountExclusionName( + String billingAccount, String exclusion) { + return newBillingAccountExclusionBuilder() + .setBillingAccount(billingAccount) + .setExclusion(exclusion) + .build(); + } + + public static String format(String project, String exclusion) { + return newBuilder().setProject(project).setExclusion(exclusion).build().toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatProjectExclusionName(String project, String exclusion) { + return newBuilder().setProject(project).setExclusion(exclusion).build().toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatOrganizationExclusionName(String organization, String exclusion) { + return newOrganizationExclusionBuilder() + .setOrganization(organization) + .setExclusion(exclusion) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatFolderExclusionName(String folder, String exclusion) { + return newFolderExclusionBuilder().setFolder(folder).setExclusion(exclusion).build().toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatBillingAccountExclusionName(String billingAccount, String exclusion) { + return newBillingAccountExclusionBuilder() + .setBillingAccount(billingAccount) + .setExclusion(exclusion) + .build() + .toString(); + } + + public static LogExclusionName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + if (PROJECT_EXCLUSION_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = PROJECT_EXCLUSION_PATH_TEMPLATE.match(formattedString); + return ofProjectExclusionName(matchMap.get("project"), matchMap.get("exclusion")); + } else if (ORGANIZATION_EXCLUSION_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = ORGANIZATION_EXCLUSION_PATH_TEMPLATE.match(formattedString); + return ofOrganizationExclusionName(matchMap.get("organization"), matchMap.get("exclusion")); + } else if (FOLDER_EXCLUSION_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = FOLDER_EXCLUSION_PATH_TEMPLATE.match(formattedString); + return ofFolderExclusionName(matchMap.get("folder"), matchMap.get("exclusion")); + } else if (BILLING_ACCOUNT_EXCLUSION_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = BILLING_ACCOUNT_EXCLUSION_PATH_TEMPLATE.match(formattedString); + return ofBillingAccountExclusionName( + matchMap.get("billing_account"), matchMap.get("exclusion")); + } + throw new ValidationException("JobName.parse: formattedString not in valid format"); + } + + @BetaApi("The method will be renamed to parseList after subclasses of this class are removed.") + public static List parse(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + @BetaApi("The method will be renamed to toStringList after subclasses of this class are removed.") + public static List toStrings(List values) { + List list = new ArrayList<>(values.size()); + for (LogExclusionName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_EXCLUSION_PATH_TEMPLATE.matches(formattedString) + || ORGANIZATION_EXCLUSION_PATH_TEMPLATE.matches(formattedString) + || FOLDER_EXCLUSION_PATH_TEMPLATE.matches(formattedString) + || BILLING_ACCOUNT_EXCLUSION_PATH_TEMPLATE.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (exclusion != null) { + fieldMapBuilder.put("exclusion", exclusion); + } + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + if (folder != null) { + fieldMapBuilder.put("folder", folder); + } + if (billingAccount != null) { + fieldMapBuilder.put("billing_account", billingAccount); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + } + + /** Builder for projects/{project}/exclusions/{exclusion}. */ + public static class Builder { + + private String project; + private String exclusion; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getExclusion() { + return exclusion; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setExclusion(String exclusion) { + this.exclusion = exclusion; + return this; + } + + private Builder(LogExclusionName logExclusionName) { + Preconditions.checkArgument( + logExclusionName.pathTemplate == PROJECT_EXCLUSION_PATH_TEMPLATE, + "toBuilder is only supported when LogExclusionName has the pattern of " + + "projects/{project}/exclusions/{exclusion}."); + project = logExclusionName.project; + exclusion = logExclusionName.exclusion; + } + + public LogExclusionName build() { + return new LogExclusionName(this); + } + } + + /** Builder for organizations/{organization}/exclusions/{exclusion}. */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class OrganizationExclusionBuilder { + + private String organization; + private String exclusion; + + private OrganizationExclusionBuilder() {} + + public String getOrganization() { + return organization; + } + + public String getExclusion() { + return exclusion; + } + + public OrganizationExclusionBuilder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public OrganizationExclusionBuilder setExclusion(String exclusion) { + this.exclusion = exclusion; + return this; + } + + public LogExclusionName build() { + return new LogExclusionName(this); + } + } + + /** Builder for folders/{folder}/exclusions/{exclusion}. */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class FolderExclusionBuilder { + + private String folder; + private String exclusion; + + private FolderExclusionBuilder() {} + + public String getFolder() { + return folder; + } + + public String getExclusion() { + return exclusion; + } + + public FolderExclusionBuilder setFolder(String folder) { + this.folder = folder; + return this; + } + + public FolderExclusionBuilder setExclusion(String exclusion) { + this.exclusion = exclusion; + return this; + } + + public LogExclusionName build() { + return new LogExclusionName(this); + } + } + + /** Builder for billingAccounts/{billing_account}/exclusions/{exclusion}. */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class BillingAccountExclusionBuilder { + + private String billingAccount; + private String exclusion; + + private BillingAccountExclusionBuilder() {} + + public String getBillingAccount() { + return billingAccount; + } + + public String getExclusion() { + return exclusion; + } + + public BillingAccountExclusionBuilder setBillingAccount(String billingAccount) { + this.billingAccount = billingAccount; + return this; + } + + public BillingAccountExclusionBuilder setExclusion(String exclusion) { + this.exclusion = exclusion; + return this; + } + + public LogExclusionName build() { + return new LogExclusionName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + LogExclusionName that = (LogExclusionName) o; + return (Objects.equals(this.project, that.project)) + && (Objects.equals(this.exclusion, that.exclusion)) + && (Objects.equals(this.organization, that.organization)) + && (Objects.equals(this.folder, that.folder)) + && (Objects.equals(this.billingAccount, that.billingAccount)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(exclusion); + h *= 1000003; + h ^= Objects.hashCode(organization); + h *= 1000003; + h ^= Objects.hashCode(folder); + h *= 1000003; + h ^= Objects.hashCode(billingAccount); + return h; + } +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/type/LogMetricName.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/type/LogMetricName.java new file mode 100644 index 000000000..5afdf4550 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/type/LogMetricName.java @@ -0,0 +1,182 @@ +/* + * Copyright 2020 Google LLC + * + * 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 + * + * https://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.logging.type; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** AUTO-GENERATED DOCUMENTATION AND CLASS */ +@javax.annotation.Generated("by GAPIC protoc plugin") +public class LogMetricName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/metrics/{metric}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String metric; + + public String getProject() { + return project; + } + + public String getMetric() { + return metric; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private LogMetricName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + metric = Preconditions.checkNotNull(builder.getMetric()); + } + + public static LogMetricName of(String project, String metric) { + return newBuilder().setProject(project).setMetric(metric).build(); + } + + public static String format(String project, String metric) { + return newBuilder().setProject(project).setMetric(metric).build().toString(); + } + + public static LogMetricName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "LogMetricName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("metric")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (LogMetricName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("metric", metric); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("project", project, "metric", metric); + } + + /** Builder for LogMetricName. */ + public static class Builder { + + private String project; + private String metric; + + public String getProject() { + return project; + } + + public String getMetric() { + return metric; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setMetric(String metric) { + this.metric = metric; + return this; + } + + private Builder() {} + + private Builder(LogMetricName logMetricName) { + project = logMetricName.project; + metric = logMetricName.metric; + } + + public LogMetricName build() { + return new LogMetricName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof LogMetricName) { + LogMetricName that = (LogMetricName) o; + return (this.project.equals(that.project)) && (this.metric.equals(that.metric)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= metric.hashCode(); + return h; + } +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/type/LogName.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/type/LogName.java index 89dc2ce9c..b79b07e72 100644 --- a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/type/LogName.java +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/type/LogName.java @@ -16,10 +16,420 @@ package com.google.logging.type; +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.pathtemplate.ValidationException; import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; /** AUTO-GENERATED DOCUMENTATION AND CLASS */ @javax.annotation.Generated("by GAPIC protoc plugin") -public abstract class LogName implements ResourceName { +public class LogName implements ResourceName { + + @Deprecated protected LogName() {} + + private static final PathTemplate PROJECT_LOG_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/logs/{log}"); + private static final PathTemplate ORGANIZATION_LOG_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("organizations/{organization}/logs/{log}"); + private static final PathTemplate FOLDER_LOG_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("folders/{folder}/logs/{log}"); + private static final PathTemplate BILLING_ACCOUNT_LOG_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("billingAccounts/{billing_account}/logs/{log}"); + + private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; + + private String project; + private String log; + private String organization; + private String folder; + private String billingAccount; + + public String getProject() { + return project; + } + + public String getLog() { + return log; + } + + public String getOrganization() { + return organization; + } + + public String getFolder() { + return folder; + } + + public String getBillingAccount() { + return billingAccount; + } + + private LogName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + log = Preconditions.checkNotNull(builder.getLog()); + pathTemplate = PROJECT_LOG_PATH_TEMPLATE; + } + + private LogName(OrganizationLogBuilder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + log = Preconditions.checkNotNull(builder.getLog()); + pathTemplate = ORGANIZATION_LOG_PATH_TEMPLATE; + } + + private LogName(FolderLogBuilder builder) { + folder = Preconditions.checkNotNull(builder.getFolder()); + log = Preconditions.checkNotNull(builder.getLog()); + pathTemplate = FOLDER_LOG_PATH_TEMPLATE; + } + + private LogName(BillingAccountLogBuilder builder) { + billingAccount = Preconditions.checkNotNull(builder.getBillingAccount()); + log = Preconditions.checkNotNull(builder.getLog()); + pathTemplate = BILLING_ACCOUNT_LOG_PATH_TEMPLATE; + } + + public static Builder newBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static Builder newProjectLogBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static OrganizationLogBuilder newOrganizationLogBuilder() { + return new OrganizationLogBuilder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static FolderLogBuilder newFolderLogBuilder() { + return new FolderLogBuilder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static BillingAccountLogBuilder newBillingAccountLogBuilder() { + return new BillingAccountLogBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static LogName of(String project, String log) { + return newProjectLogBuilder().setProject(project).setLog(log).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static LogName ofProjectLogName(String project, String log) { + return newProjectLogBuilder().setProject(project).setLog(log).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static LogName ofOrganizationLogName(String organization, String log) { + return newOrganizationLogBuilder().setOrganization(organization).setLog(log).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static LogName ofFolderLogName(String folder, String log) { + return newFolderLogBuilder().setFolder(folder).setLog(log).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static LogName ofBillingAccountLogName(String billingAccount, String log) { + return newBillingAccountLogBuilder().setBillingAccount(billingAccount).setLog(log).build(); + } + + public static String format(String project, String log) { + return newBuilder().setProject(project).setLog(log).build().toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatProjectLogName(String project, String log) { + return newBuilder().setProject(project).setLog(log).build().toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatOrganizationLogName(String organization, String log) { + return newOrganizationLogBuilder().setOrganization(organization).setLog(log).build().toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatFolderLogName(String folder, String log) { + return newFolderLogBuilder().setFolder(folder).setLog(log).build().toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatBillingAccountLogName(String billingAccount, String log) { + return newBillingAccountLogBuilder() + .setBillingAccount(billingAccount) + .setLog(log) + .build() + .toString(); + } + + public static LogName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + if (PROJECT_LOG_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = PROJECT_LOG_PATH_TEMPLATE.match(formattedString); + return ofProjectLogName(matchMap.get("project"), matchMap.get("log")); + } else if (ORGANIZATION_LOG_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = ORGANIZATION_LOG_PATH_TEMPLATE.match(formattedString); + return ofOrganizationLogName(matchMap.get("organization"), matchMap.get("log")); + } else if (FOLDER_LOG_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = FOLDER_LOG_PATH_TEMPLATE.match(formattedString); + return ofFolderLogName(matchMap.get("folder"), matchMap.get("log")); + } else if (BILLING_ACCOUNT_LOG_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = BILLING_ACCOUNT_LOG_PATH_TEMPLATE.match(formattedString); + return ofBillingAccountLogName(matchMap.get("billing_account"), matchMap.get("log")); + } + throw new ValidationException("JobName.parse: formattedString not in valid format"); + } + + @BetaApi("The method will be renamed to parseList after subclasses of this class are removed.") + public static List parse(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + @BetaApi("The method will be renamed to toStringList after subclasses of this class are removed.") + public static List toStrings(List values) { + List list = new ArrayList<>(values.size()); + for (LogName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOG_PATH_TEMPLATE.matches(formattedString) + || ORGANIZATION_LOG_PATH_TEMPLATE.matches(formattedString) + || FOLDER_LOG_PATH_TEMPLATE.matches(formattedString) + || BILLING_ACCOUNT_LOG_PATH_TEMPLATE.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (log != null) { + fieldMapBuilder.put("log", log); + } + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + if (folder != null) { + fieldMapBuilder.put("folder", folder); + } + if (billingAccount != null) { + fieldMapBuilder.put("billing_account", billingAccount); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + } + + /** Builder for projects/{project}/logs/{log}. */ + public static class Builder { + + private String project; + private String log; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLog() { + return log; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLog(String log) { + this.log = log; + return this; + } + + private Builder(LogName logName) { + Preconditions.checkArgument( + logName.pathTemplate == PROJECT_LOG_PATH_TEMPLATE, + "toBuilder is only supported when LogName has the pattern of " + + "projects/{project}/logs/{log}."); + project = logName.project; + log = logName.log; + } + + public LogName build() { + return new LogName(this); + } + } + + /** Builder for organizations/{organization}/logs/{log}. */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class OrganizationLogBuilder { + + private String organization; + private String log; + + private OrganizationLogBuilder() {} + + public String getOrganization() { + return organization; + } + + public String getLog() { + return log; + } + + public OrganizationLogBuilder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public OrganizationLogBuilder setLog(String log) { + this.log = log; + return this; + } + + public LogName build() { + return new LogName(this); + } + } + + /** Builder for folders/{folder}/logs/{log}. */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class FolderLogBuilder { + + private String folder; + private String log; + + private FolderLogBuilder() {} + + public String getFolder() { + return folder; + } + + public String getLog() { + return log; + } + + public FolderLogBuilder setFolder(String folder) { + this.folder = folder; + return this; + } + + public FolderLogBuilder setLog(String log) { + this.log = log; + return this; + } + + public LogName build() { + return new LogName(this); + } + } + + /** Builder for billingAccounts/{billing_account}/logs/{log}. */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class BillingAccountLogBuilder { + + private String billingAccount; + private String log; + + private BillingAccountLogBuilder() {} + + public String getBillingAccount() { + return billingAccount; + } + + public String getLog() { + return log; + } + + public BillingAccountLogBuilder setBillingAccount(String billingAccount) { + this.billingAccount = billingAccount; + return this; + } + + public BillingAccountLogBuilder setLog(String log) { + this.log = log; + return this; + } + + public LogName build() { + return new LogName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + LogName that = (LogName) o; + return (Objects.equals(this.project, that.project)) + && (Objects.equals(this.log, that.log)) + && (Objects.equals(this.organization, that.organization)) + && (Objects.equals(this.folder, that.folder)) + && (Objects.equals(this.billingAccount, that.billingAccount)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(log); + h *= 1000003; + h ^= Objects.hashCode(organization); + h *= 1000003; + h ^= Objects.hashCode(folder); + h *= 1000003; + h ^= Objects.hashCode(billingAccount); + return h; + } } diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/type/LogSinkName.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/type/LogSinkName.java new file mode 100644 index 000000000..f533b11d3 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/type/LogSinkName.java @@ -0,0 +1,439 @@ +/* + * Copyright 2020 Google LLC + * + * 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 + * + * https://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.logging.type; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.pathtemplate.ValidationException; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** AUTO-GENERATED DOCUMENTATION AND CLASS */ +@javax.annotation.Generated("by GAPIC protoc plugin") +public class LogSinkName implements ResourceName { + + @Deprecated + protected LogSinkName() {} + + private static final PathTemplate PROJECT_SINK_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/sinks/{sink}"); + private static final PathTemplate ORGANIZATION_SINK_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("organizations/{organization}/sinks/{sink}"); + private static final PathTemplate FOLDER_SINK_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("folders/{folder}/sinks/{sink}"); + private static final PathTemplate BILLING_ACCOUNT_SINK_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("billingAccounts/{billing_account}/sinks/{sink}"); + + private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; + + private String project; + private String sink; + private String organization; + private String folder; + private String billingAccount; + + public String getProject() { + return project; + } + + public String getSink() { + return sink; + } + + public String getOrganization() { + return organization; + } + + public String getFolder() { + return folder; + } + + public String getBillingAccount() { + return billingAccount; + } + + private LogSinkName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + sink = Preconditions.checkNotNull(builder.getSink()); + pathTemplate = PROJECT_SINK_PATH_TEMPLATE; + } + + private LogSinkName(OrganizationSinkBuilder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + sink = Preconditions.checkNotNull(builder.getSink()); + pathTemplate = ORGANIZATION_SINK_PATH_TEMPLATE; + } + + private LogSinkName(FolderSinkBuilder builder) { + folder = Preconditions.checkNotNull(builder.getFolder()); + sink = Preconditions.checkNotNull(builder.getSink()); + pathTemplate = FOLDER_SINK_PATH_TEMPLATE; + } + + private LogSinkName(BillingAccountSinkBuilder builder) { + billingAccount = Preconditions.checkNotNull(builder.getBillingAccount()); + sink = Preconditions.checkNotNull(builder.getSink()); + pathTemplate = BILLING_ACCOUNT_SINK_PATH_TEMPLATE; + } + + public static Builder newBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static Builder newProjectSinkBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static OrganizationSinkBuilder newOrganizationSinkBuilder() { + return new OrganizationSinkBuilder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static FolderSinkBuilder newFolderSinkBuilder() { + return new FolderSinkBuilder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static BillingAccountSinkBuilder newBillingAccountSinkBuilder() { + return new BillingAccountSinkBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static LogSinkName of(String project, String sink) { + return newProjectSinkBuilder().setProject(project).setSink(sink).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static LogSinkName ofProjectSinkName(String project, String sink) { + return newProjectSinkBuilder().setProject(project).setSink(sink).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static LogSinkName ofOrganizationSinkName(String organization, String sink) { + return newOrganizationSinkBuilder().setOrganization(organization).setSink(sink).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static LogSinkName ofFolderSinkName(String folder, String sink) { + return newFolderSinkBuilder().setFolder(folder).setSink(sink).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static LogSinkName ofBillingAccountSinkName(String billingAccount, String sink) { + return newBillingAccountSinkBuilder().setBillingAccount(billingAccount).setSink(sink).build(); + } + + public static String format(String project, String sink) { + return newBuilder().setProject(project).setSink(sink).build().toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatProjectSinkName(String project, String sink) { + return newBuilder().setProject(project).setSink(sink).build().toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatOrganizationSinkName(String organization, String sink) { + return newOrganizationSinkBuilder() + .setOrganization(organization) + .setSink(sink) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatFolderSinkName(String folder, String sink) { + return newFolderSinkBuilder().setFolder(folder).setSink(sink).build().toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatBillingAccountSinkName(String billingAccount, String sink) { + return newBillingAccountSinkBuilder() + .setBillingAccount(billingAccount) + .setSink(sink) + .build() + .toString(); + } + + public static LogSinkName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + if (PROJECT_SINK_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = PROJECT_SINK_PATH_TEMPLATE.match(formattedString); + return ofProjectSinkName(matchMap.get("project"), matchMap.get("sink")); + } else if (ORGANIZATION_SINK_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = ORGANIZATION_SINK_PATH_TEMPLATE.match(formattedString); + return ofOrganizationSinkName(matchMap.get("organization"), matchMap.get("sink")); + } else if (FOLDER_SINK_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = FOLDER_SINK_PATH_TEMPLATE.match(formattedString); + return ofFolderSinkName(matchMap.get("folder"), matchMap.get("sink")); + } else if (BILLING_ACCOUNT_SINK_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = BILLING_ACCOUNT_SINK_PATH_TEMPLATE.match(formattedString); + return ofBillingAccountSinkName(matchMap.get("billing_account"), matchMap.get("sink")); + } + throw new ValidationException("JobName.parse: formattedString not in valid format"); + } + + @BetaApi("The method will be renamed to parseList after subclasses of this class are removed.") + public static List parse(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + @BetaApi("The method will be renamed to toStringList after subclasses of this class are removed.") + public static List toStrings(List values) { + List list = new ArrayList<>(values.size()); + for (LogSinkName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_SINK_PATH_TEMPLATE.matches(formattedString) + || ORGANIZATION_SINK_PATH_TEMPLATE.matches(formattedString) + || FOLDER_SINK_PATH_TEMPLATE.matches(formattedString) + || BILLING_ACCOUNT_SINK_PATH_TEMPLATE.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (sink != null) { + fieldMapBuilder.put("sink", sink); + } + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + if (folder != null) { + fieldMapBuilder.put("folder", folder); + } + if (billingAccount != null) { + fieldMapBuilder.put("billing_account", billingAccount); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + } + + /** Builder for projects/{project}/sinks/{sink}. */ + public static class Builder { + + private String project; + private String sink; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getSink() { + return sink; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setSink(String sink) { + this.sink = sink; + return this; + } + + private Builder(LogSinkName logSinkName) { + Preconditions.checkArgument( + logSinkName.pathTemplate == PROJECT_SINK_PATH_TEMPLATE, + "toBuilder is only supported when LogSinkName has the pattern of " + + "projects/{project}/sinks/{sink}."); + project = logSinkName.project; + sink = logSinkName.sink; + } + + public LogSinkName build() { + return new LogSinkName(this); + } + } + + /** Builder for organizations/{organization}/sinks/{sink}. */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class OrganizationSinkBuilder { + + private String organization; + private String sink; + + private OrganizationSinkBuilder() {} + + public String getOrganization() { + return organization; + } + + public String getSink() { + return sink; + } + + public OrganizationSinkBuilder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public OrganizationSinkBuilder setSink(String sink) { + this.sink = sink; + return this; + } + + public LogSinkName build() { + return new LogSinkName(this); + } + } + + /** Builder for folders/{folder}/sinks/{sink}. */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class FolderSinkBuilder { + + private String folder; + private String sink; + + private FolderSinkBuilder() {} + + public String getFolder() { + return folder; + } + + public String getSink() { + return sink; + } + + public FolderSinkBuilder setFolder(String folder) { + this.folder = folder; + return this; + } + + public FolderSinkBuilder setSink(String sink) { + this.sink = sink; + return this; + } + + public LogSinkName build() { + return new LogSinkName(this); + } + } + + /** Builder for billingAccounts/{billing_account}/sinks/{sink}. */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class BillingAccountSinkBuilder { + + private String billingAccount; + private String sink; + + private BillingAccountSinkBuilder() {} + + public String getBillingAccount() { + return billingAccount; + } + + public String getSink() { + return sink; + } + + public BillingAccountSinkBuilder setBillingAccount(String billingAccount) { + this.billingAccount = billingAccount; + return this; + } + + public BillingAccountSinkBuilder setSink(String sink) { + this.sink = sink; + return this; + } + + public LogSinkName build() { + return new LogSinkName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + LogSinkName that = (LogSinkName) o; + return (Objects.equals(this.project, that.project)) + && (Objects.equals(this.sink, that.sink)) + && (Objects.equals(this.organization, that.organization)) + && (Objects.equals(this.folder, that.folder)) + && (Objects.equals(this.billingAccount, that.billingAccount)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(sink); + h *= 1000003; + h ^= Objects.hashCode(organization); + h *= 1000003; + h ^= Objects.hashCode(folder); + h *= 1000003; + h ^= Objects.hashCode(billingAccount); + return h; + } +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/type/OrganizationName.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/type/OrganizationName.java index f723eac60..2e4945b30 100644 --- a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/type/OrganizationName.java +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/type/OrganizationName.java @@ -17,6 +17,7 @@ package com.google.logging.type; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; import java.util.ArrayList; @@ -25,7 +26,7 @@ /** AUTO-GENERATED DOCUMENTATION AND CLASS */ @javax.annotation.Generated("by GAPIC protoc plugin") -public class OrganizationName extends ParentName { +public class OrganizationName implements ResourceName { private static final PathTemplate PATH_TEMPLATE = PathTemplate.createWithoutUrlEncoding("organizations/{organization}"); diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/type/ProjectName.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/type/ProjectName.java index c673be5c7..d25dec750 100644 --- a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/type/ProjectName.java +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/type/ProjectName.java @@ -17,6 +17,7 @@ package com.google.logging.type; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; import java.util.ArrayList; @@ -25,7 +26,7 @@ /** AUTO-GENERATED DOCUMENTATION AND CLASS */ @javax.annotation.Generated("by GAPIC protoc plugin") -public class ProjectName extends ParentName { +public class ProjectName implements ResourceName { private static final PathTemplate PATH_TEMPLATE = PathTemplate.createWithoutUrlEncoding("projects/{project}"); diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/BigQueryOptions.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/BigQueryOptions.java index 15eefcc8c..b0d39dcd5 100644 --- a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/BigQueryOptions.java +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/BigQueryOptions.java @@ -127,7 +127,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * In both cases, tables are sharded based on UTC timezone. * * - * bool use_partitioned_tables = 1; + * bool use_partitioned_tables = 1 [(.google.api.field_behavior) = OPTIONAL]; * * @return The usePartitionedTables. */ @@ -505,7 +505,7 @@ public Builder mergeFrom( * In both cases, tables are sharded based on UTC timezone. * * - * bool use_partitioned_tables = 1; + * bool use_partitioned_tables = 1 [(.google.api.field_behavior) = OPTIONAL]; * * @return The usePartitionedTables. */ @@ -525,7 +525,7 @@ public boolean getUsePartitionedTables() { * In both cases, tables are sharded based on UTC timezone. * * - * bool use_partitioned_tables = 1; + * bool use_partitioned_tables = 1 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The usePartitionedTables to set. * @return This builder for chaining. @@ -549,7 +549,7 @@ public Builder setUsePartitionedTables(boolean value) { * In both cases, tables are sharded based on UTC timezone. * * - * bool use_partitioned_tables = 1; + * bool use_partitioned_tables = 1 [(.google.api.field_behavior) = OPTIONAL]; * * @return This builder for chaining. */ diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/BigQueryOptionsOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/BigQueryOptionsOrBuilder.java index 6dc10ffb4..df1b85352 100644 --- a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/BigQueryOptionsOrBuilder.java +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/BigQueryOptionsOrBuilder.java @@ -36,7 +36,7 @@ public interface BigQueryOptionsOrBuilder * In both cases, tables are sharded based on UTC timezone. * * - * bool use_partitioned_tables = 1; + * bool use_partitioned_tables = 1 [(.google.api.field_behavior) = OPTIONAL]; * * @return The usePartitionedTables. */ diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/BillingAccountName.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/BillingAccountName.java new file mode 100644 index 000000000..f2432babc --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/BillingAccountName.java @@ -0,0 +1,162 @@ +/* + * Copyright 2020 Google LLC + * + * 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 + * + * https://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.logging.v2; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** AUTO-GENERATED DOCUMENTATION AND CLASS */ +@javax.annotation.Generated("by GAPIC protoc plugin") +public class BillingAccountName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("billingAccounts/{billing_account}"); + + private volatile Map fieldValuesMap; + + private final String billingAccount; + + public String getBillingAccount() { + return billingAccount; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private BillingAccountName(Builder builder) { + billingAccount = Preconditions.checkNotNull(builder.getBillingAccount()); + } + + public static BillingAccountName of(String billingAccount) { + return newBuilder().setBillingAccount(billingAccount).build(); + } + + public static String format(String billingAccount) { + return newBuilder().setBillingAccount(billingAccount).build().toString(); + } + + public static BillingAccountName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "BillingAccountName.parse: formattedString not in valid format"); + return of(matchMap.get("billing_account")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (BillingAccountName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("billingAccount", billingAccount); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("billing_account", billingAccount); + } + + /** Builder for BillingAccountName. */ + public static class Builder { + + private String billingAccount; + + public String getBillingAccount() { + return billingAccount; + } + + public Builder setBillingAccount(String billingAccount) { + this.billingAccount = billingAccount; + return this; + } + + private Builder() {} + + private Builder(BillingAccountName billingAccountName) { + billingAccount = billingAccountName.billingAccount; + } + + public BillingAccountName build() { + return new BillingAccountName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof BillingAccountName) { + BillingAccountName that = (BillingAccountName) o; + return (this.billingAccount.equals(that.billingAccount)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= billingAccount.hashCode(); + return h; + } +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettings.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettings.java index 846faf270..ad081e7c9 100644 --- a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettings.java +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettings.java @@ -139,10 +139,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * Output Only. The resource name of the CMEK settings.
+   * Output only. The resource name of the CMEK settings.
    * 
* - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; * * @return The name. */ @@ -161,10 +161,10 @@ public java.lang.String getName() { * * *
-   * Output Only. The resource name of the CMEK settings.
+   * Output only. The resource name of the CMEK settings.
    * 
* - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; * * @return The bytes for name. */ @@ -263,8 +263,8 @@ public com.google.protobuf.ByteString getKmsKeyNameBytes() { * * *
-   * Output Only. The service account that will be used by the Logs Router to
-   * access your Cloud KMS key.
+   * Output only. The service account that will be used by the Logs Router to access your
+   * Cloud KMS key.
    * Before enabling CMEK for Logs Router, you must first assign the role
    * `roles/cloudkms.cryptoKeyEncrypterDecrypter` to the service account that
    * the Logs Router will use to access your Cloud KMS key. Use
@@ -274,7 +274,7 @@ public com.google.protobuf.ByteString getKmsKeyNameBytes() {
    * Router](/logging/docs/routing/managed-encryption) for more information.
    * 
* - * string service_account_id = 3; + * string service_account_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; * * @return The serviceAccountId. */ @@ -293,8 +293,8 @@ public java.lang.String getServiceAccountId() { * * *
-   * Output Only. The service account that will be used by the Logs Router to
-   * access your Cloud KMS key.
+   * Output only. The service account that will be used by the Logs Router to access your
+   * Cloud KMS key.
    * Before enabling CMEK for Logs Router, you must first assign the role
    * `roles/cloudkms.cryptoKeyEncrypterDecrypter` to the service account that
    * the Logs Router will use to access your Cloud KMS key. Use
@@ -304,7 +304,7 @@ public java.lang.String getServiceAccountId() {
    * Router](/logging/docs/routing/managed-encryption) for more information.
    * 
* - * string service_account_id = 3; + * string service_account_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; * * @return The bytes for serviceAccountId. */ @@ -676,10 +676,10 @@ public Builder mergeFrom( * * *
-     * Output Only. The resource name of the CMEK settings.
+     * Output only. The resource name of the CMEK settings.
      * 
* - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; * * @return The name. */ @@ -698,10 +698,10 @@ public java.lang.String getName() { * * *
-     * Output Only. The resource name of the CMEK settings.
+     * Output only. The resource name of the CMEK settings.
      * 
* - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; * * @return The bytes for name. */ @@ -720,10 +720,10 @@ public com.google.protobuf.ByteString getNameBytes() { * * *
-     * Output Only. The resource name of the CMEK settings.
+     * Output only. The resource name of the CMEK settings.
      * 
* - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; * * @param value The name to set. * @return This builder for chaining. @@ -741,10 +741,10 @@ public Builder setName(java.lang.String value) { * * *
-     * Output Only. The resource name of the CMEK settings.
+     * Output only. The resource name of the CMEK settings.
      * 
* - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; * * @return This builder for chaining. */ @@ -758,10 +758,10 @@ public Builder clearName() { * * *
-     * Output Only. The resource name of the CMEK settings.
+     * Output only. The resource name of the CMEK settings.
      * 
* - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; * * @param value The bytes for name to set. * @return This builder for chaining. @@ -963,8 +963,8 @@ public Builder setKmsKeyNameBytes(com.google.protobuf.ByteString value) { * * *
-     * Output Only. The service account that will be used by the Logs Router to
-     * access your Cloud KMS key.
+     * Output only. The service account that will be used by the Logs Router to access your
+     * Cloud KMS key.
      * Before enabling CMEK for Logs Router, you must first assign the role
      * `roles/cloudkms.cryptoKeyEncrypterDecrypter` to the service account that
      * the Logs Router will use to access your Cloud KMS key. Use
@@ -974,7 +974,7 @@ public Builder setKmsKeyNameBytes(com.google.protobuf.ByteString value) {
      * Router](/logging/docs/routing/managed-encryption) for more information.
      * 
* - * string service_account_id = 3; + * string service_account_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; * * @return The serviceAccountId. */ @@ -993,8 +993,8 @@ public java.lang.String getServiceAccountId() { * * *
-     * Output Only. The service account that will be used by the Logs Router to
-     * access your Cloud KMS key.
+     * Output only. The service account that will be used by the Logs Router to access your
+     * Cloud KMS key.
      * Before enabling CMEK for Logs Router, you must first assign the role
      * `roles/cloudkms.cryptoKeyEncrypterDecrypter` to the service account that
      * the Logs Router will use to access your Cloud KMS key. Use
@@ -1004,7 +1004,7 @@ public java.lang.String getServiceAccountId() {
      * Router](/logging/docs/routing/managed-encryption) for more information.
      * 
* - * string service_account_id = 3; + * string service_account_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; * * @return The bytes for serviceAccountId. */ @@ -1023,8 +1023,8 @@ public com.google.protobuf.ByteString getServiceAccountIdBytes() { * * *
-     * Output Only. The service account that will be used by the Logs Router to
-     * access your Cloud KMS key.
+     * Output only. The service account that will be used by the Logs Router to access your
+     * Cloud KMS key.
      * Before enabling CMEK for Logs Router, you must first assign the role
      * `roles/cloudkms.cryptoKeyEncrypterDecrypter` to the service account that
      * the Logs Router will use to access your Cloud KMS key. Use
@@ -1034,7 +1034,7 @@ public com.google.protobuf.ByteString getServiceAccountIdBytes() {
      * Router](/logging/docs/routing/managed-encryption) for more information.
      * 
* - * string service_account_id = 3; + * string service_account_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; * * @param value The serviceAccountId to set. * @return This builder for chaining. @@ -1052,8 +1052,8 @@ public Builder setServiceAccountId(java.lang.String value) { * * *
-     * Output Only. The service account that will be used by the Logs Router to
-     * access your Cloud KMS key.
+     * Output only. The service account that will be used by the Logs Router to access your
+     * Cloud KMS key.
      * Before enabling CMEK for Logs Router, you must first assign the role
      * `roles/cloudkms.cryptoKeyEncrypterDecrypter` to the service account that
      * the Logs Router will use to access your Cloud KMS key. Use
@@ -1063,7 +1063,7 @@ public Builder setServiceAccountId(java.lang.String value) {
      * Router](/logging/docs/routing/managed-encryption) for more information.
      * 
* - * string service_account_id = 3; + * string service_account_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; * * @return This builder for chaining. */ @@ -1077,8 +1077,8 @@ public Builder clearServiceAccountId() { * * *
-     * Output Only. The service account that will be used by the Logs Router to
-     * access your Cloud KMS key.
+     * Output only. The service account that will be used by the Logs Router to access your
+     * Cloud KMS key.
      * Before enabling CMEK for Logs Router, you must first assign the role
      * `roles/cloudkms.cryptoKeyEncrypterDecrypter` to the service account that
      * the Logs Router will use to access your Cloud KMS key. Use
@@ -1088,7 +1088,7 @@ public Builder clearServiceAccountId() {
      * Router](/logging/docs/routing/managed-encryption) for more information.
      * 
* - * string service_account_id = 3; + * string service_account_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; * * @param value The bytes for serviceAccountId to set. * @return This builder for chaining. diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java new file mode 100644 index 000000000..f5235d80e --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java @@ -0,0 +1,375 @@ +/* + * Copyright 2020 Google LLC + * + * 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 + * + * https://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.logging.v2; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.pathtemplate.ValidationException; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** AUTO-GENERATED DOCUMENTATION AND CLASS */ +@javax.annotation.Generated("by GAPIC protoc plugin") +public class CmekSettingsName implements ResourceName { + + @Deprecated + protected CmekSettingsName() {} + + private static final PathTemplate PROJECT_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/cmekSettings"); + private static final PathTemplate ORGANIZATION_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("organizations/{organization}/cmekSettings"); + private static final PathTemplate FOLDER_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("folders/{folder}/cmekSettings"); + private static final PathTemplate BILLING_ACCOUNT_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("billingAccounts/{billing_account}/cmekSettings"); + + private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; + + private String project; + private String organization; + private String folder; + private String billingAccount; + + public String getProject() { + return project; + } + + public String getOrganization() { + return organization; + } + + public String getFolder() { + return folder; + } + + public String getBillingAccount() { + return billingAccount; + } + + private CmekSettingsName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + pathTemplate = PROJECT_PATH_TEMPLATE; + } + + private CmekSettingsName(OrganizationBuilder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + pathTemplate = ORGANIZATION_PATH_TEMPLATE; + } + + private CmekSettingsName(FolderBuilder builder) { + folder = Preconditions.checkNotNull(builder.getFolder()); + pathTemplate = FOLDER_PATH_TEMPLATE; + } + + private CmekSettingsName(BillingAccountBuilder builder) { + billingAccount = Preconditions.checkNotNull(builder.getBillingAccount()); + pathTemplate = BILLING_ACCOUNT_PATH_TEMPLATE; + } + + public static Builder newBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static Builder newProjectBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static OrganizationBuilder newOrganizationBuilder() { + return new OrganizationBuilder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static FolderBuilder newFolderBuilder() { + return new FolderBuilder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static BillingAccountBuilder newBillingAccountBuilder() { + return new BillingAccountBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static CmekSettingsName of(String project) { + return newProjectBuilder().setProject(project).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static CmekSettingsName ofProjectName(String project) { + return newProjectBuilder().setProject(project).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static CmekSettingsName ofOrganizationName(String organization) { + return newOrganizationBuilder().setOrganization(organization).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static CmekSettingsName ofFolderName(String folder) { + return newFolderBuilder().setFolder(folder).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static CmekSettingsName ofBillingAccountName(String billingAccount) { + return newBillingAccountBuilder().setBillingAccount(billingAccount).build(); + } + + public static String format(String project) { + return newBuilder().setProject(project).build().toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatProjectName(String project) { + return newBuilder().setProject(project).build().toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatOrganizationName(String organization) { + return newOrganizationBuilder().setOrganization(organization).build().toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatFolderName(String folder) { + return newFolderBuilder().setFolder(folder).build().toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatBillingAccountName(String billingAccount) { + return newBillingAccountBuilder().setBillingAccount(billingAccount).build().toString(); + } + + public static CmekSettingsName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + if (PROJECT_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = PROJECT_PATH_TEMPLATE.match(formattedString); + return ofProjectName(matchMap.get("project")); + } else if (ORGANIZATION_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = ORGANIZATION_PATH_TEMPLATE.match(formattedString); + return ofOrganizationName(matchMap.get("organization")); + } else if (FOLDER_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = FOLDER_PATH_TEMPLATE.match(formattedString); + return ofFolderName(matchMap.get("folder")); + } else if (BILLING_ACCOUNT_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = BILLING_ACCOUNT_PATH_TEMPLATE.match(formattedString); + return ofBillingAccountName(matchMap.get("billing_account")); + } + throw new ValidationException("JobName.parse: formattedString not in valid format"); + } + + @BetaApi("The method will be renamed to parseList after subclasses of this class are removed.") + public static List parse(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + @BetaApi("The method will be renamed to toStringList after subclasses of this class are removed.") + public static List toStrings(List values) { + List list = new ArrayList<>(values.size()); + for (CmekSettingsName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_PATH_TEMPLATE.matches(formattedString) + || ORGANIZATION_PATH_TEMPLATE.matches(formattedString) + || FOLDER_PATH_TEMPLATE.matches(formattedString) + || BILLING_ACCOUNT_PATH_TEMPLATE.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + if (folder != null) { + fieldMapBuilder.put("folder", folder); + } + if (billingAccount != null) { + fieldMapBuilder.put("billing_account", billingAccount); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + } + + /** Builder for projects/{project}/cmekSettings. */ + public static class Builder { + + private String project; + + protected Builder() {} + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + private Builder(CmekSettingsName cmekSettingsName) { + Preconditions.checkArgument( + cmekSettingsName.pathTemplate == PROJECT_PATH_TEMPLATE, + "toBuilder is only supported when CmekSettingsName has the pattern of " + + "projects/{project}/cmekSettings."); + project = cmekSettingsName.project; + } + + public CmekSettingsName build() { + return new CmekSettingsName(this); + } + } + + /** Builder for organizations/{organization}/cmekSettings. */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class OrganizationBuilder { + + private String organization; + + private OrganizationBuilder() {} + + public String getOrganization() { + return organization; + } + + public OrganizationBuilder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public CmekSettingsName build() { + return new CmekSettingsName(this); + } + } + + /** Builder for folders/{folder}/cmekSettings. */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class FolderBuilder { + + private String folder; + + private FolderBuilder() {} + + public String getFolder() { + return folder; + } + + public FolderBuilder setFolder(String folder) { + this.folder = folder; + return this; + } + + public CmekSettingsName build() { + return new CmekSettingsName(this); + } + } + + /** Builder for billingAccounts/{billing_account}/cmekSettings. */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class BillingAccountBuilder { + + private String billingAccount; + + private BillingAccountBuilder() {} + + public String getBillingAccount() { + return billingAccount; + } + + public BillingAccountBuilder setBillingAccount(String billingAccount) { + this.billingAccount = billingAccount; + return this; + } + + public CmekSettingsName build() { + return new CmekSettingsName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + CmekSettingsName that = (CmekSettingsName) o; + return (Objects.equals(this.project, that.project)) + && (Objects.equals(this.organization, that.organization)) + && (Objects.equals(this.folder, that.folder)) + && (Objects.equals(this.billingAccount, that.billingAccount)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(organization); + h *= 1000003; + h ^= Objects.hashCode(folder); + h *= 1000003; + h ^= Objects.hashCode(billingAccount); + return h; + } +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsOrBuilder.java index 799066402..bd053a11b 100644 --- a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsOrBuilder.java +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsOrBuilder.java @@ -27,10 +27,10 @@ public interface CmekSettingsOrBuilder * * *
-   * Output Only. The resource name of the CMEK settings.
+   * Output only. The resource name of the CMEK settings.
    * 
* - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; * * @return The name. */ @@ -39,10 +39,10 @@ public interface CmekSettingsOrBuilder * * *
-   * Output Only. The resource name of the CMEK settings.
+   * Output only. The resource name of the CMEK settings.
    * 
* - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; * * @return The bytes for name. */ @@ -107,8 +107,8 @@ public interface CmekSettingsOrBuilder * * *
-   * Output Only. The service account that will be used by the Logs Router to
-   * access your Cloud KMS key.
+   * Output only. The service account that will be used by the Logs Router to access your
+   * Cloud KMS key.
    * Before enabling CMEK for Logs Router, you must first assign the role
    * `roles/cloudkms.cryptoKeyEncrypterDecrypter` to the service account that
    * the Logs Router will use to access your Cloud KMS key. Use
@@ -118,7 +118,7 @@ public interface CmekSettingsOrBuilder
    * Router](/logging/docs/routing/managed-encryption) for more information.
    * 
* - * string service_account_id = 3; + * string service_account_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; * * @return The serviceAccountId. */ @@ -127,8 +127,8 @@ public interface CmekSettingsOrBuilder * * *
-   * Output Only. The service account that will be used by the Logs Router to
-   * access your Cloud KMS key.
+   * Output only. The service account that will be used by the Logs Router to access your
+   * Cloud KMS key.
    * Before enabling CMEK for Logs Router, you must first assign the role
    * `roles/cloudkms.cryptoKeyEncrypterDecrypter` to the service account that
    * the Logs Router will use to access your Cloud KMS key. Use
@@ -138,7 +138,7 @@ public interface CmekSettingsOrBuilder
    * Router](/logging/docs/routing/managed-encryption) for more information.
    * 
* - * string service_account_id = 3; + * string service_account_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; * * @return The bytes for serviceAccountId. */ diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateExclusionRequest.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateExclusionRequest.java index 63a1c0cfd..d3e39046b 100644 --- a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateExclusionRequest.java +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateExclusionRequest.java @@ -197,7 +197,8 @@ public com.google.protobuf.ByteString getParentBytes() { * that is not already used in the parent resource. * * - * .google.logging.v2.LogExclusion exclusion = 2; + * .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; + * * * @return Whether the exclusion field is set. */ @@ -212,7 +213,8 @@ public boolean hasExclusion() { * that is not already used in the parent resource. * * - * .google.logging.v2.LogExclusion exclusion = 2; + * .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; + * * * @return The exclusion. */ @@ -229,7 +231,8 @@ public com.google.logging.v2.LogExclusion getExclusion() { * that is not already used in the parent resource. * * - * .google.logging.v2.LogExclusion exclusion = 2; + * .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; + * */ public com.google.logging.v2.LogExclusionOrBuilder getExclusionOrBuilder() { return getExclusion(); @@ -734,7 +737,9 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { * that is not already used in the parent resource. * * - * .google.logging.v2.LogExclusion exclusion = 2; + * + * .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; + * * * @return Whether the exclusion field is set. */ @@ -749,7 +754,9 @@ public boolean hasExclusion() { * that is not already used in the parent resource. * * - * .google.logging.v2.LogExclusion exclusion = 2; + * + * .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; + * * * @return The exclusion. */ @@ -770,7 +777,9 @@ public com.google.logging.v2.LogExclusion getExclusion() { * that is not already used in the parent resource. * * - * .google.logging.v2.LogExclusion exclusion = 2; + * + * .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; + * */ public Builder setExclusion(com.google.logging.v2.LogExclusion value) { if (exclusionBuilder_ == null) { @@ -793,7 +802,9 @@ public Builder setExclusion(com.google.logging.v2.LogExclusion value) { * that is not already used in the parent resource. * * - * .google.logging.v2.LogExclusion exclusion = 2; + * + * .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; + * */ public Builder setExclusion(com.google.logging.v2.LogExclusion.Builder builderForValue) { if (exclusionBuilder_ == null) { @@ -813,7 +824,9 @@ public Builder setExclusion(com.google.logging.v2.LogExclusion.Builder builderFo * that is not already used in the parent resource. * * - * .google.logging.v2.LogExclusion exclusion = 2; + * + * .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; + * */ public Builder mergeExclusion(com.google.logging.v2.LogExclusion value) { if (exclusionBuilder_ == null) { @@ -840,7 +853,9 @@ public Builder mergeExclusion(com.google.logging.v2.LogExclusion value) { * that is not already used in the parent resource. * * - * .google.logging.v2.LogExclusion exclusion = 2; + * + * .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; + * */ public Builder clearExclusion() { if (exclusionBuilder_ == null) { @@ -861,7 +876,9 @@ public Builder clearExclusion() { * that is not already used in the parent resource. * * - * .google.logging.v2.LogExclusion exclusion = 2; + * + * .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; + * */ public com.google.logging.v2.LogExclusion.Builder getExclusionBuilder() { @@ -876,7 +893,9 @@ public com.google.logging.v2.LogExclusion.Builder getExclusionBuilder() { * that is not already used in the parent resource. * * - * .google.logging.v2.LogExclusion exclusion = 2; + * + * .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; + * */ public com.google.logging.v2.LogExclusionOrBuilder getExclusionOrBuilder() { if (exclusionBuilder_ != null) { @@ -895,7 +914,9 @@ public com.google.logging.v2.LogExclusionOrBuilder getExclusionOrBuilder() { * that is not already used in the parent resource. * * - * .google.logging.v2.LogExclusion exclusion = 2; + * + * .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; + * */ private com.google.protobuf.SingleFieldBuilderV3< com.google.logging.v2.LogExclusion, diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateExclusionRequestOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateExclusionRequestOrBuilder.java index 569bcc87e..c9f581052 100644 --- a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateExclusionRequestOrBuilder.java +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateExclusionRequestOrBuilder.java @@ -70,7 +70,8 @@ public interface CreateExclusionRequestOrBuilder * that is not already used in the parent resource. * * - * .google.logging.v2.LogExclusion exclusion = 2; + * .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; + * * * @return Whether the exclusion field is set. */ @@ -83,7 +84,8 @@ public interface CreateExclusionRequestOrBuilder * that is not already used in the parent resource. * * - * .google.logging.v2.LogExclusion exclusion = 2; + * .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; + * * * @return The exclusion. */ @@ -96,7 +98,8 @@ public interface CreateExclusionRequestOrBuilder * that is not already used in the parent resource. * * - * .google.logging.v2.LogExclusion exclusion = 2; + * .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; + * */ com.google.logging.v2.LogExclusionOrBuilder getExclusionOrBuilder(); } diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateSinkRequest.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateSinkRequest.java index 3c816fb16..3427c0db1 100644 --- a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateSinkRequest.java +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateSinkRequest.java @@ -255,7 +255,7 @@ public com.google.logging.v2.LogSinkOrBuilder getSinkOrBuilder() { * more information, see `writer_identity` in [LogSink][google.logging.v2.LogSink]. * * - * bool unique_writer_identity = 3; + * bool unique_writer_identity = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return The uniqueWriterIdentity. */ @@ -966,7 +966,7 @@ public com.google.logging.v2.LogSinkOrBuilder getSinkOrBuilder() { * more information, see `writer_identity` in [LogSink][google.logging.v2.LogSink]. * * - * bool unique_writer_identity = 3; + * bool unique_writer_identity = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return The uniqueWriterIdentity. */ @@ -989,7 +989,7 @@ public boolean getUniqueWriterIdentity() { * more information, see `writer_identity` in [LogSink][google.logging.v2.LogSink]. * * - * bool unique_writer_identity = 3; + * bool unique_writer_identity = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The uniqueWriterIdentity to set. * @return This builder for chaining. @@ -1016,7 +1016,7 @@ public Builder setUniqueWriterIdentity(boolean value) { * more information, see `writer_identity` in [LogSink][google.logging.v2.LogSink]. * * - * bool unique_writer_identity = 3; + * bool unique_writer_identity = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return This builder for chaining. */ diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateSinkRequestOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateSinkRequestOrBuilder.java index 09ae70c30..360545587 100644 --- a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateSinkRequestOrBuilder.java +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateSinkRequestOrBuilder.java @@ -116,7 +116,7 @@ public interface CreateSinkRequestOrBuilder * more information, see `writer_identity` in [LogSink][google.logging.v2.LogSink]. * * - * bool unique_writer_identity = 3; + * bool unique_writer_identity = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return The uniqueWriterIdentity. */ diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteSinkRequest.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteSinkRequest.java index 2439372be..1ee95e702 100644 --- a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteSinkRequest.java +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteSinkRequest.java @@ -117,8 +117,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * Required. The full resource name of the sink to delete, including the
-   * parent resource and the sink identifier:
+   * Required. The full resource name of the sink to delete, including the parent
+   * resource and the sink identifier:
    *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
    *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
    *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
@@ -147,8 +147,8 @@ public java.lang.String getSinkName() {
    *
    *
    * 
-   * Required. The full resource name of the sink to delete, including the
-   * parent resource and the sink identifier:
+   * Required. The full resource name of the sink to delete, including the parent
+   * resource and the sink identifier:
    *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
    *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
    *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
@@ -494,8 +494,8 @@ public Builder mergeFrom(
      *
      *
      * 
-     * Required. The full resource name of the sink to delete, including the
-     * parent resource and the sink identifier:
+     * Required. The full resource name of the sink to delete, including the parent
+     * resource and the sink identifier:
      *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
      *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
      *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
@@ -524,8 +524,8 @@ public java.lang.String getSinkName() {
      *
      *
      * 
-     * Required. The full resource name of the sink to delete, including the
-     * parent resource and the sink identifier:
+     * Required. The full resource name of the sink to delete, including the parent
+     * resource and the sink identifier:
      *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
      *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
      *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
@@ -554,8 +554,8 @@ public com.google.protobuf.ByteString getSinkNameBytes() {
      *
      *
      * 
-     * Required. The full resource name of the sink to delete, including the
-     * parent resource and the sink identifier:
+     * Required. The full resource name of the sink to delete, including the parent
+     * resource and the sink identifier:
      *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
      *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
      *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
@@ -583,8 +583,8 @@ public Builder setSinkName(java.lang.String value) {
      *
      *
      * 
-     * Required. The full resource name of the sink to delete, including the
-     * parent resource and the sink identifier:
+     * Required. The full resource name of the sink to delete, including the parent
+     * resource and the sink identifier:
      *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
      *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
      *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
@@ -608,8 +608,8 @@ public Builder clearSinkName() {
      *
      *
      * 
-     * Required. The full resource name of the sink to delete, including the
-     * parent resource and the sink identifier:
+     * Required. The full resource name of the sink to delete, including the parent
+     * resource and the sink identifier:
      *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
      *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
      *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteSinkRequestOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteSinkRequestOrBuilder.java
index 7cb0e5079..75186cb69 100644
--- a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteSinkRequestOrBuilder.java
+++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteSinkRequestOrBuilder.java
@@ -27,8 +27,8 @@ public interface DeleteSinkRequestOrBuilder
    *
    *
    * 
-   * Required. The full resource name of the sink to delete, including the
-   * parent resource and the sink identifier:
+   * Required. The full resource name of the sink to delete, including the parent
+   * resource and the sink identifier:
    *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
    *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
    *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
@@ -47,8 +47,8 @@ public interface DeleteSinkRequestOrBuilder
    *
    *
    * 
-   * Required. The full resource name of the sink to delete, including the
-   * parent resource and the sink identifier:
+   * Required. The full resource name of the sink to delete, including the parent
+   * resource and the sink identifier:
    *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
    *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
    *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/FolderName.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/FolderName.java
index f70ece0ee..f6b5aba2b 100644
--- a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/FolderName.java
+++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/FolderName.java
@@ -17,6 +17,7 @@
 package com.google.logging.v2;
 
 import com.google.api.pathtemplate.PathTemplate;
+import com.google.api.resourcenames.ResourceName;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableMap;
 import java.util.ArrayList;
@@ -25,7 +26,7 @@
 
 /** AUTO-GENERATED DOCUMENTATION AND CLASS */
 @javax.annotation.Generated("by GAPIC protoc plugin")
-public class FolderName extends ParentName {
+public class FolderName implements ResourceName {
 
   private static final PathTemplate PATH_TEMPLATE =
       PathTemplate.createWithoutUrlEncoding("folders/{folder}");
diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetBucketRequest.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetBucketRequest.java
new file mode 100644
index 000000000..b0690027c
--- /dev/null
+++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetBucketRequest.java
@@ -0,0 +1,687 @@
+/*
+ * Copyright 2020 Google LLC
+ *
+ * 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
+ *
+ *     https://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.
+ */
+// Generated by the protocol buffer compiler.  DO NOT EDIT!
+// source: google/logging/v2/logging_config.proto
+
+package com.google.logging.v2;
+
+/**
+ *
+ *
+ * 
+ * The parameters to `GetBucket` (Beta).
+ * 
+ * + * Protobuf type {@code google.logging.v2.GetBucketRequest} + */ +public final class GetBucketRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.GetBucketRequest) + GetBucketRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetBucketRequest.newBuilder() to construct. + private GetBucketRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetBucketRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetBucketRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetBucketRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_GetBucketRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_GetBucketRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.GetBucketRequest.class, + com.google.logging.v2.GetBucketRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The resource name of the bucket:
+   *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   * Example:
+   * `"projects/my-project-id/locations/my-location/buckets/my-bucket-id"`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return 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; + } + } + /** + * + * + *
+   * Required. The resource name of the bucket:
+   *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   * Example:
+   * `"projects/my-project-id/locations/my-location/buckets/my-bucket-id"`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for 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; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.logging.v2.GetBucketRequest)) { + return super.equals(obj); + } + com.google.logging.v2.GetBucketRequest other = (com.google.logging.v2.GetBucketRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.GetBucketRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.GetBucketRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.GetBucketRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.GetBucketRequest 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.GetBucketRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.GetBucketRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.GetBucketRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.GetBucketRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.logging.v2.GetBucketRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.GetBucketRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.logging.v2.GetBucketRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.GetBucketRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.logging.v2.GetBucketRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The parameters to `GetBucket` (Beta).
+   * 
+ * + * Protobuf type {@code google.logging.v2.GetBucketRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.GetBucketRequest) + com.google.logging.v2.GetBucketRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_GetBucketRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_GetBucketRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.GetBucketRequest.class, + com.google.logging.v2.GetBucketRequest.Builder.class); + } + + // Construct using com.google.logging.v2.GetBucketRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_GetBucketRequest_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.GetBucketRequest getDefaultInstanceForType() { + return com.google.logging.v2.GetBucketRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.GetBucketRequest build() { + com.google.logging.v2.GetBucketRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.GetBucketRequest buildPartial() { + com.google.logging.v2.GetBucketRequest result = + new com.google.logging.v2.GetBucketRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.logging.v2.GetBucketRequest) { + return mergeFrom((com.google.logging.v2.GetBucketRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.GetBucketRequest other) { + if (other == com.google.logging.v2.GetBucketRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.logging.v2.GetBucketRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.logging.v2.GetBucketRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The resource name of the bucket:
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     * Example:
+     * `"projects/my-project-id/locations/my-location/buckets/my-bucket-id"`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return 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; + } + } + /** + * + * + *
+     * Required. The resource name of the bucket:
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     * Example:
+     * `"projects/my-project-id/locations/my-location/buckets/my-bucket-id"`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for 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; + } + } + /** + * + * + *
+     * Required. The resource name of the bucket:
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     * Example:
+     * `"projects/my-project-id/locations/my-location/buckets/my-bucket-id"`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the bucket:
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     * Example:
+     * `"projects/my-project-id/locations/my-location/buckets/my-bucket-id"`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the bucket:
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     * Example:
+     * `"projects/my-project-id/locations/my-location/buckets/my-bucket-id"`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.logging.v2.GetBucketRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.GetBucketRequest) + private static final com.google.logging.v2.GetBucketRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.GetBucketRequest(); + } + + public static com.google.logging.v2.GetBucketRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetBucketRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetBucketRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.logging.v2.GetBucketRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetBucketRequestOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetBucketRequestOrBuilder.java new file mode 100644 index 000000000..41d68d9a1 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetBucketRequestOrBuilder.java @@ -0,0 +1,66 @@ +/* + * Copyright 2020 Google LLC + * + * 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 + * + * https://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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging_config.proto + +package com.google.logging.v2; + +public interface GetBucketRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.GetBucketRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the bucket:
+   *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   * Example:
+   * `"projects/my-project-id/locations/my-location/buckets/my-bucket-id"`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The resource name of the bucket:
+   *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   * Example:
+   * `"projects/my-project-id/locations/my-location/buckets/my-bucket-id"`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetCmekSettingsRequest.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetCmekSettingsRequest.java index 4669202d1..adf4a3d55 100644 --- a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetCmekSettingsRequest.java +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetCmekSettingsRequest.java @@ -131,7 +131,9 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * the GCP organization. *
* - * string name = 1; + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The name. */ @@ -161,7 +163,9 @@ public java.lang.String getName() { * the GCP organization. *
* - * string name = 1; + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The bytes for name. */ @@ -512,7 +516,9 @@ public Builder mergeFrom( * the GCP organization. *
* - * string name = 1; + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The name. */ @@ -542,7 +548,9 @@ public java.lang.String getName() { * the GCP organization. *
* - * string name = 1; + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The bytes for name. */ @@ -572,7 +580,9 @@ public com.google.protobuf.ByteString getNameBytes() { * the GCP organization. *
* - * string name = 1; + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @param value The name to set. * @return This builder for chaining. @@ -601,7 +611,9 @@ public Builder setName(java.lang.String value) { * the GCP organization. *
* - * string name = 1; + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return This builder for chaining. */ @@ -626,7 +638,9 @@ public Builder clearName() { * the GCP organization. *
* - * string name = 1; + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @param value The bytes for name to set. * @return This builder for chaining. diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetCmekSettingsRequestOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetCmekSettingsRequestOrBuilder.java index 5934e8f48..f1be32ee6 100644 --- a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetCmekSettingsRequestOrBuilder.java +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetCmekSettingsRequestOrBuilder.java @@ -38,7 +38,9 @@ public interface GetCmekSettingsRequestOrBuilder * the GCP organization. *
* - * string name = 1; + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The name. */ @@ -58,7 +60,9 @@ public interface GetCmekSettingsRequestOrBuilder * the GCP organization. *
* - * string name = 1; + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The bytes for name. */ diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LifecycleState.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LifecycleState.java new file mode 100644 index 000000000..2f6fac3c0 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LifecycleState.java @@ -0,0 +1,174 @@ +/* + * Copyright 2020 Google LLC + * + * 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 + * + * https://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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging_config.proto + +package com.google.logging.v2; + +/** + * + * + *
+ * LogBucket lifecycle states (Beta).
+ * 
+ * + * Protobuf enum {@code google.logging.v2.LifecycleState} + */ +public enum LifecycleState implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Unspecified state.  This is only used/useful for distinguishing
+   * unset values.
+   * 
+ * + * LIFECYCLE_STATE_UNSPECIFIED = 0; + */ + LIFECYCLE_STATE_UNSPECIFIED(0), + /** + * + * + *
+   * The normal and active state.
+   * 
+ * + * ACTIVE = 1; + */ + ACTIVE(1), + /** + * + * + *
+   * The bucket has been marked for deletion by the user.
+   * 
+ * + * DELETE_REQUESTED = 2; + */ + DELETE_REQUESTED(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * Unspecified state.  This is only used/useful for distinguishing
+   * unset values.
+   * 
+ * + * LIFECYCLE_STATE_UNSPECIFIED = 0; + */ + public static final int LIFECYCLE_STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * The normal and active state.
+   * 
+ * + * ACTIVE = 1; + */ + public static final int ACTIVE_VALUE = 1; + /** + * + * + *
+   * The bucket has been marked for deletion by the user.
+   * 
+ * + * DELETE_REQUESTED = 2; + */ + public static final int DELETE_REQUESTED_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static LifecycleState valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static LifecycleState forNumber(int value) { + switch (value) { + case 0: + return LIFECYCLE_STATE_UNSPECIFIED; + case 1: + return ACTIVE; + case 2: + return DELETE_REQUESTED; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public LifecycleState findValueByNumber(int number) { + return LifecycleState.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto.getDescriptor().getEnumTypes().get(0); + } + + private static final LifecycleState[] VALUES = values(); + + public static LifecycleState 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 value; + + private LifecycleState(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.logging.v2.LifecycleState) +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListBucketsRequest.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListBucketsRequest.java new file mode 100644 index 000000000..5ffec09cf --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListBucketsRequest.java @@ -0,0 +1,988 @@ +/* + * Copyright 2020 Google LLC + * + * 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 + * + * https://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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging_config.proto + +package com.google.logging.v2; + +/** + * + * + *
+ * The parameters to `ListBuckets` (Beta).
+ * 
+ * + * Protobuf type {@code google.logging.v2.ListBucketsRequest} + */ +public final class ListBucketsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.ListBucketsRequest) + ListBucketsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListBucketsRequest.newBuilder() to construct. + private ListBucketsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListBucketsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListBucketsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListBucketsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 24: + { + pageSize_ = input.readInt32(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_ListBucketsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_ListBucketsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListBucketsRequest.class, + com.google.logging.v2.ListBucketsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent resource whose buckets are to be listed:
+   *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]"
+   *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]"
+   *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]"
+   * Note: The locations portion of the resource must be specified, but
+   * supplying the character `-` in place of [LOCATION_ID] will return all
+   * buckets.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + 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(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent resource whose buckets are to be listed:
+   *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]"
+   *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]"
+   *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]"
+   * Note: The locations portion of the resource must be specified, but
+   * supplying the character `-` in place of [LOCATION_ID] will return all
+   * buckets.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = 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. If present, then retrieve the next batch of results from the
+   * preceding call to this method. `pageToken` must be the value of
+   * `nextPageToken` from the previous response. The values of other method
+   * parameters should be identical to those in the previous call.
+   * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + 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. If present, then retrieve the next batch of results from the
+   * preceding call to this method. `pageToken` must be the value of
+   * `nextPageToken` from the previous response. The values of other method
+   * parameters should be identical to those in the previous call.
+   * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + 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. The maximum number of results to return from this request.
+   * Non-positive values are ignored. The presence of `nextPageToken` in the
+   * response indicates that more results might be available.
+   * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + public int getPageSize() { + return pageSize_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, pageToken_); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, pageToken_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, pageSize_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.logging.v2.ListBucketsRequest)) { + return super.equals(obj); + } + com.google.logging.v2.ListBucketsRequest other = (com.google.logging.v2.ListBucketsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.ListBucketsRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.ListBucketsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.ListBucketsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.ListBucketsRequest 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.ListBucketsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.ListBucketsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.ListBucketsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.ListBucketsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.logging.v2.ListBucketsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.ListBucketsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.logging.v2.ListBucketsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.ListBucketsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.logging.v2.ListBucketsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The parameters to `ListBuckets` (Beta).
+   * 
+ * + * Protobuf type {@code google.logging.v2.ListBucketsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.ListBucketsRequest) + com.google.logging.v2.ListBucketsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_ListBucketsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_ListBucketsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListBucketsRequest.class, + com.google.logging.v2.ListBucketsRequest.Builder.class); + } + + // Construct using com.google.logging.v2.ListBucketsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageToken_ = ""; + + pageSize_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_ListBucketsRequest_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.ListBucketsRequest getDefaultInstanceForType() { + return com.google.logging.v2.ListBucketsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.ListBucketsRequest build() { + com.google.logging.v2.ListBucketsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.ListBucketsRequest buildPartial() { + com.google.logging.v2.ListBucketsRequest result = + new com.google.logging.v2.ListBucketsRequest(this); + result.parent_ = parent_; + result.pageToken_ = pageToken_; + result.pageSize_ = pageSize_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.logging.v2.ListBucketsRequest) { + return mergeFrom((com.google.logging.v2.ListBucketsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.ListBucketsRequest other) { + if (other == com.google.logging.v2.ListBucketsRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.logging.v2.ListBucketsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.logging.v2.ListBucketsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent resource whose buckets are to be listed:
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]"
+     *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]"
+     *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]"
+     * Note: The locations portion of the resource must be specified, but
+     * supplying the character `-` in place of [LOCATION_ID] will return all
+     * buckets.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent resource whose buckets are to be listed:
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]"
+     *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]"
+     *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]"
+     * Note: The locations portion of the resource must be specified, but
+     * supplying the character `-` in place of [LOCATION_ID] will return all
+     * buckets.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent resource whose buckets are to be listed:
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]"
+     *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]"
+     *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]"
+     * Note: The locations portion of the resource must be specified, but
+     * supplying the character `-` in place of [LOCATION_ID] will return all
+     * buckets.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource whose buckets are to be listed:
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]"
+     *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]"
+     *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]"
+     * Note: The locations portion of the resource must be specified, but
+     * supplying the character `-` in place of [LOCATION_ID] will return all
+     * buckets.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource whose buckets are to be listed:
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]"
+     *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]"
+     *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]"
+     * Note: The locations portion of the resource must be specified, but
+     * supplying the character `-` in place of [LOCATION_ID] will return all
+     * buckets.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method. `pageToken` must be the value of
+     * `nextPageToken` from the previous response. The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + 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. If present, then retrieve the next batch of results from the
+     * preceding call to this method. `pageToken` must be the value of
+     * `nextPageToken` from the previous response. The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + 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. If present, then retrieve the next batch of results from the
+     * preceding call to this method. `pageToken` must be the value of
+     * `nextPageToken` from the previous response. The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method. `pageToken` must be the value of
+     * `nextPageToken` from the previous response. The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method. `pageToken` must be the value of
+     * `nextPageToken` from the previous response. The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + 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. The maximum number of results to return from this request.
+     * Non-positive values are ignored. The presence of `nextPageToken` in the
+     * response indicates that more results might be available.
+     * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Optional. The maximum number of results to return from this request.
+     * Non-positive values are ignored. The presence of `nextPageToken` in the
+     * response indicates that more results might be available.
+     * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The maximum number of results to return from this request.
+     * Non-positive values are ignored. The presence of `nextPageToken` in the
+     * response indicates that more results might be available.
+     * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.logging.v2.ListBucketsRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.ListBucketsRequest) + private static final com.google.logging.v2.ListBucketsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.ListBucketsRequest(); + } + + public static com.google.logging.v2.ListBucketsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListBucketsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListBucketsRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.logging.v2.ListBucketsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListBucketsRequestOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListBucketsRequestOrBuilder.java new file mode 100644 index 000000000..0f895cf02 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListBucketsRequestOrBuilder.java @@ -0,0 +1,114 @@ +/* + * Copyright 2020 Google LLC + * + * 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 + * + * https://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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging_config.proto + +package com.google.logging.v2; + +public interface ListBucketsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.ListBucketsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource whose buckets are to be listed:
+   *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]"
+   *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]"
+   *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]"
+   * Note: The locations portion of the resource must be specified, but
+   * supplying the character `-` in place of [LOCATION_ID] will return all
+   * buckets.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent resource whose buckets are to be listed:
+   *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]"
+   *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]"
+   *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]"
+   * Note: The locations portion of the resource must be specified, but
+   * supplying the character `-` in place of [LOCATION_ID] will return all
+   * buckets.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method. `pageToken` must be the value of
+   * `nextPageToken` from the previous response. The values of other method
+   * parameters should be identical to those in the previous call.
+   * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method. `pageToken` must be the value of
+   * `nextPageToken` from the previous response. The values of other method
+   * parameters should be identical to those in the previous call.
+   * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. The maximum number of results to return from this request.
+   * Non-positive values are ignored. The presence of `nextPageToken` in the
+   * response indicates that more results might be available.
+   * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListBucketsResponse.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListBucketsResponse.java new file mode 100644 index 000000000..7c5d7fbcf --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListBucketsResponse.java @@ -0,0 +1,1129 @@ +/* + * Copyright 2020 Google LLC + * + * 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 + * + * https://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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging_config.proto + +package com.google.logging.v2; + +/** + * + * + *
+ * The response from ListBuckets (Beta).
+ * 
+ * + * Protobuf type {@code google.logging.v2.ListBucketsResponse} + */ +public final class ListBucketsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.ListBucketsResponse) + ListBucketsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListBucketsResponse.newBuilder() to construct. + private ListBucketsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListBucketsResponse() { + buckets_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListBucketsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListBucketsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + buckets_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + buckets_.add( + input.readMessage(com.google.logging.v2.LogBucket.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + buckets_ = java.util.Collections.unmodifiableList(buckets_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_ListBucketsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_ListBucketsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListBucketsResponse.class, + com.google.logging.v2.ListBucketsResponse.Builder.class); + } + + public static final int BUCKETS_FIELD_NUMBER = 1; + private java.util.List buckets_; + /** + * + * + *
+   * A list of buckets.
+   * 
+ * + * repeated .google.logging.v2.LogBucket buckets = 1; + */ + public java.util.List getBucketsList() { + return buckets_; + } + /** + * + * + *
+   * A list of buckets.
+   * 
+ * + * repeated .google.logging.v2.LogBucket buckets = 1; + */ + public java.util.List + getBucketsOrBuilderList() { + return buckets_; + } + /** + * + * + *
+   * A list of buckets.
+   * 
+ * + * repeated .google.logging.v2.LogBucket buckets = 1; + */ + public int getBucketsCount() { + return buckets_.size(); + } + /** + * + * + *
+   * A list of buckets.
+   * 
+ * + * repeated .google.logging.v2.LogBucket buckets = 1; + */ + public com.google.logging.v2.LogBucket getBuckets(int index) { + return buckets_.get(index); + } + /** + * + * + *
+   * A list of buckets.
+   * 
+ * + * repeated .google.logging.v2.LogBucket buckets = 1; + */ + public com.google.logging.v2.LogBucketOrBuilder getBucketsOrBuilder(int index) { + return buckets_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * If there might be more results than appear in this response, then
+   * `nextPageToken` is included. To get the next set of results, call the same
+   * method again using the value of `nextPageToken` as `pageToken`.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + 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; + } + } + /** + * + * + *
+   * If there might be more results than appear in this response, then
+   * `nextPageToken` is included. To get the next set of results, call the same
+   * method again using the value of `nextPageToken` as `pageToken`.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + 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; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < buckets_.size(); i++) { + output.writeMessage(1, buckets_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < buckets_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, buckets_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.logging.v2.ListBucketsResponse)) { + return super.equals(obj); + } + com.google.logging.v2.ListBucketsResponse other = + (com.google.logging.v2.ListBucketsResponse) obj; + + if (!getBucketsList().equals(other.getBucketsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getBucketsCount() > 0) { + hash = (37 * hash) + BUCKETS_FIELD_NUMBER; + hash = (53 * hash) + getBucketsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.ListBucketsResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.ListBucketsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.ListBucketsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.ListBucketsResponse 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.ListBucketsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.ListBucketsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.ListBucketsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.ListBucketsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.logging.v2.ListBucketsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.ListBucketsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.logging.v2.ListBucketsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.ListBucketsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.logging.v2.ListBucketsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The response from ListBuckets (Beta).
+   * 
+ * + * Protobuf type {@code google.logging.v2.ListBucketsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.ListBucketsResponse) + com.google.logging.v2.ListBucketsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_ListBucketsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_ListBucketsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListBucketsResponse.class, + com.google.logging.v2.ListBucketsResponse.Builder.class); + } + + // Construct using com.google.logging.v2.ListBucketsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getBucketsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (bucketsBuilder_ == null) { + buckets_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + bucketsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_ListBucketsResponse_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.ListBucketsResponse getDefaultInstanceForType() { + return com.google.logging.v2.ListBucketsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.ListBucketsResponse build() { + com.google.logging.v2.ListBucketsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.ListBucketsResponse buildPartial() { + com.google.logging.v2.ListBucketsResponse result = + new com.google.logging.v2.ListBucketsResponse(this); + int from_bitField0_ = bitField0_; + if (bucketsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + buckets_ = java.util.Collections.unmodifiableList(buckets_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.buckets_ = buckets_; + } else { + result.buckets_ = bucketsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.logging.v2.ListBucketsResponse) { + return mergeFrom((com.google.logging.v2.ListBucketsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.ListBucketsResponse other) { + if (other == com.google.logging.v2.ListBucketsResponse.getDefaultInstance()) return this; + if (bucketsBuilder_ == null) { + if (!other.buckets_.isEmpty()) { + if (buckets_.isEmpty()) { + buckets_ = other.buckets_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureBucketsIsMutable(); + buckets_.addAll(other.buckets_); + } + onChanged(); + } + } else { + if (!other.buckets_.isEmpty()) { + if (bucketsBuilder_.isEmpty()) { + bucketsBuilder_.dispose(); + bucketsBuilder_ = null; + buckets_ = other.buckets_; + bitField0_ = (bitField0_ & ~0x00000001); + bucketsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getBucketsFieldBuilder() + : null; + } else { + bucketsBuilder_.addAllMessages(other.buckets_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.logging.v2.ListBucketsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.logging.v2.ListBucketsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List buckets_ = + java.util.Collections.emptyList(); + + private void ensureBucketsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + buckets_ = new java.util.ArrayList(buckets_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.logging.v2.LogBucket, + com.google.logging.v2.LogBucket.Builder, + com.google.logging.v2.LogBucketOrBuilder> + bucketsBuilder_; + + /** + * + * + *
+     * A list of buckets.
+     * 
+ * + * repeated .google.logging.v2.LogBucket buckets = 1; + */ + public java.util.List getBucketsList() { + if (bucketsBuilder_ == null) { + return java.util.Collections.unmodifiableList(buckets_); + } else { + return bucketsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A list of buckets.
+     * 
+ * + * repeated .google.logging.v2.LogBucket buckets = 1; + */ + public int getBucketsCount() { + if (bucketsBuilder_ == null) { + return buckets_.size(); + } else { + return bucketsBuilder_.getCount(); + } + } + /** + * + * + *
+     * A list of buckets.
+     * 
+ * + * repeated .google.logging.v2.LogBucket buckets = 1; + */ + public com.google.logging.v2.LogBucket getBuckets(int index) { + if (bucketsBuilder_ == null) { + return buckets_.get(index); + } else { + return bucketsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A list of buckets.
+     * 
+ * + * repeated .google.logging.v2.LogBucket buckets = 1; + */ + public Builder setBuckets(int index, com.google.logging.v2.LogBucket value) { + if (bucketsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBucketsIsMutable(); + buckets_.set(index, value); + onChanged(); + } else { + bucketsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of buckets.
+     * 
+ * + * repeated .google.logging.v2.LogBucket buckets = 1; + */ + public Builder setBuckets(int index, com.google.logging.v2.LogBucket.Builder builderForValue) { + if (bucketsBuilder_ == null) { + ensureBucketsIsMutable(); + buckets_.set(index, builderForValue.build()); + onChanged(); + } else { + bucketsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of buckets.
+     * 
+ * + * repeated .google.logging.v2.LogBucket buckets = 1; + */ + public Builder addBuckets(com.google.logging.v2.LogBucket value) { + if (bucketsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBucketsIsMutable(); + buckets_.add(value); + onChanged(); + } else { + bucketsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A list of buckets.
+     * 
+ * + * repeated .google.logging.v2.LogBucket buckets = 1; + */ + public Builder addBuckets(int index, com.google.logging.v2.LogBucket value) { + if (bucketsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBucketsIsMutable(); + buckets_.add(index, value); + onChanged(); + } else { + bucketsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of buckets.
+     * 
+ * + * repeated .google.logging.v2.LogBucket buckets = 1; + */ + public Builder addBuckets(com.google.logging.v2.LogBucket.Builder builderForValue) { + if (bucketsBuilder_ == null) { + ensureBucketsIsMutable(); + buckets_.add(builderForValue.build()); + onChanged(); + } else { + bucketsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of buckets.
+     * 
+ * + * repeated .google.logging.v2.LogBucket buckets = 1; + */ + public Builder addBuckets(int index, com.google.logging.v2.LogBucket.Builder builderForValue) { + if (bucketsBuilder_ == null) { + ensureBucketsIsMutable(); + buckets_.add(index, builderForValue.build()); + onChanged(); + } else { + bucketsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of buckets.
+     * 
+ * + * repeated .google.logging.v2.LogBucket buckets = 1; + */ + public Builder addAllBuckets( + java.lang.Iterable values) { + if (bucketsBuilder_ == null) { + ensureBucketsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, buckets_); + onChanged(); + } else { + bucketsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A list of buckets.
+     * 
+ * + * repeated .google.logging.v2.LogBucket buckets = 1; + */ + public Builder clearBuckets() { + if (bucketsBuilder_ == null) { + buckets_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + bucketsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A list of buckets.
+     * 
+ * + * repeated .google.logging.v2.LogBucket buckets = 1; + */ + public Builder removeBuckets(int index) { + if (bucketsBuilder_ == null) { + ensureBucketsIsMutable(); + buckets_.remove(index); + onChanged(); + } else { + bucketsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A list of buckets.
+     * 
+ * + * repeated .google.logging.v2.LogBucket buckets = 1; + */ + public com.google.logging.v2.LogBucket.Builder getBucketsBuilder(int index) { + return getBucketsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A list of buckets.
+     * 
+ * + * repeated .google.logging.v2.LogBucket buckets = 1; + */ + public com.google.logging.v2.LogBucketOrBuilder getBucketsOrBuilder(int index) { + if (bucketsBuilder_ == null) { + return buckets_.get(index); + } else { + return bucketsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A list of buckets.
+     * 
+ * + * repeated .google.logging.v2.LogBucket buckets = 1; + */ + public java.util.List + getBucketsOrBuilderList() { + if (bucketsBuilder_ != null) { + return bucketsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(buckets_); + } + } + /** + * + * + *
+     * A list of buckets.
+     * 
+ * + * repeated .google.logging.v2.LogBucket buckets = 1; + */ + public com.google.logging.v2.LogBucket.Builder addBucketsBuilder() { + return getBucketsFieldBuilder() + .addBuilder(com.google.logging.v2.LogBucket.getDefaultInstance()); + } + /** + * + * + *
+     * A list of buckets.
+     * 
+ * + * repeated .google.logging.v2.LogBucket buckets = 1; + */ + public com.google.logging.v2.LogBucket.Builder addBucketsBuilder(int index) { + return getBucketsFieldBuilder() + .addBuilder(index, com.google.logging.v2.LogBucket.getDefaultInstance()); + } + /** + * + * + *
+     * A list of buckets.
+     * 
+ * + * repeated .google.logging.v2.LogBucket buckets = 1; + */ + public java.util.List getBucketsBuilderList() { + return getBucketsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.logging.v2.LogBucket, + com.google.logging.v2.LogBucket.Builder, + com.google.logging.v2.LogBucketOrBuilder> + getBucketsFieldBuilder() { + if (bucketsBuilder_ == null) { + bucketsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.logging.v2.LogBucket, + com.google.logging.v2.LogBucket.Builder, + com.google.logging.v2.LogBucketOrBuilder>( + buckets_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + buckets_ = null; + } + return bucketsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * If there might be more results than appear in this response, then
+     * `nextPageToken` is included. To get the next set of results, call the same
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + 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; + } + } + /** + * + * + *
+     * If there might be more results than appear in this response, then
+     * `nextPageToken` is included. To get the next set of results, call the same
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + 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; + } + } + /** + * + * + *
+     * If there might be more results than appear in this response, then
+     * `nextPageToken` is included. To get the next set of results, call the same
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If there might be more results than appear in this response, then
+     * `nextPageToken` is included. To get the next set of results, call the same
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * If there might be more results than appear in this response, then
+     * `nextPageToken` is included. To get the next set of results, call the same
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.logging.v2.ListBucketsResponse) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.ListBucketsResponse) + private static final com.google.logging.v2.ListBucketsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.ListBucketsResponse(); + } + + public static com.google.logging.v2.ListBucketsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListBucketsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListBucketsResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.logging.v2.ListBucketsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListBucketsResponseOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListBucketsResponseOrBuilder.java new file mode 100644 index 000000000..2133deb62 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListBucketsResponseOrBuilder.java @@ -0,0 +1,105 @@ +/* + * Copyright 2020 Google LLC + * + * 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 + * + * https://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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging_config.proto + +package com.google.logging.v2; + +public interface ListBucketsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.ListBucketsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A list of buckets.
+   * 
+ * + * repeated .google.logging.v2.LogBucket buckets = 1; + */ + java.util.List getBucketsList(); + /** + * + * + *
+   * A list of buckets.
+   * 
+ * + * repeated .google.logging.v2.LogBucket buckets = 1; + */ + com.google.logging.v2.LogBucket getBuckets(int index); + /** + * + * + *
+   * A list of buckets.
+   * 
+ * + * repeated .google.logging.v2.LogBucket buckets = 1; + */ + int getBucketsCount(); + /** + * + * + *
+   * A list of buckets.
+   * 
+ * + * repeated .google.logging.v2.LogBucket buckets = 1; + */ + java.util.List getBucketsOrBuilderList(); + /** + * + * + *
+   * A list of buckets.
+   * 
+ * + * repeated .google.logging.v2.LogBucket buckets = 1; + */ + com.google.logging.v2.LogBucketOrBuilder getBucketsOrBuilder(int index); + + /** + * + * + *
+   * If there might be more results than appear in this response, then
+   * `nextPageToken` is included. To get the next set of results, call the same
+   * method again using the value of `nextPageToken` as `pageToken`.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * If there might be more results than appear in this response, then
+   * `nextPageToken` is included. To get the next set of results, call the same
+   * method again using the value of `nextPageToken` as `pageToken`.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListExclusionsRequest.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListExclusionsRequest.java index cbed3c001..31f63367b 100644 --- a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListExclusionsRequest.java +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListExclusionsRequest.java @@ -195,7 +195,7 @@ public com.google.protobuf.ByteString getParentBytes() { * parameters should be identical to those in the previous call. * * - * string page_token = 2; + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return The pageToken. */ @@ -220,7 +220,7 @@ public java.lang.String getPageToken() { * parameters should be identical to those in the previous call. * * - * string page_token = 2; + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for pageToken. */ @@ -247,7 +247,7 @@ public com.google.protobuf.ByteString getPageTokenBytes() { * response indicates that more results might be available. * * - * int32 page_size = 3; + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return The pageSize. */ @@ -749,7 +749,7 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { * parameters should be identical to those in the previous call. * * - * string page_token = 2; + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return The pageToken. */ @@ -774,7 +774,7 @@ public java.lang.String getPageToken() { * parameters should be identical to those in the previous call. * * - * string page_token = 2; + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for pageToken. */ @@ -799,7 +799,7 @@ public com.google.protobuf.ByteString getPageTokenBytes() { * parameters should be identical to those in the previous call. * * - * string page_token = 2; + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The pageToken to set. * @return This builder for chaining. @@ -823,7 +823,7 @@ public Builder setPageToken(java.lang.String value) { * parameters should be identical to those in the previous call. * * - * string page_token = 2; + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return This builder for chaining. */ @@ -843,7 +843,7 @@ public Builder clearPageToken() { * parameters should be identical to those in the previous call. * * - * string page_token = 2; + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The bytes for pageToken to set. * @return This builder for chaining. @@ -869,7 +869,7 @@ public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { * response indicates that more results might be available. * * - * int32 page_size = 3; + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return The pageSize. */ @@ -885,7 +885,7 @@ public int getPageSize() { * response indicates that more results might be available. * * - * int32 page_size = 3; + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The pageSize to set. * @return This builder for chaining. @@ -905,7 +905,7 @@ public Builder setPageSize(int value) { * response indicates that more results might be available. * * - * int32 page_size = 3; + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return This builder for chaining. */ diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListExclusionsRequestOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListExclusionsRequestOrBuilder.java index 2bc5ae78b..3f41330e7 100644 --- a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListExclusionsRequestOrBuilder.java +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListExclusionsRequestOrBuilder.java @@ -70,7 +70,7 @@ public interface ListExclusionsRequestOrBuilder * parameters should be identical to those in the previous call. * * - * string page_token = 2; + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return The pageToken. */ @@ -85,7 +85,7 @@ public interface ListExclusionsRequestOrBuilder * parameters should be identical to those in the previous call. * * - * string page_token = 2; + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for pageToken. */ @@ -100,7 +100,7 @@ public interface ListExclusionsRequestOrBuilder * response indicates that more results might be available. * * - * int32 page_size = 3; + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return The pageSize. */ diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogEntriesRequest.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogEntriesRequest.java index 445f5cb2e..86dd7737a 100644 --- a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogEntriesRequest.java +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogEntriesRequest.java @@ -38,7 +38,6 @@ private ListLogEntriesRequest(com.google.protobuf.GeneratedMessageV3.Builder } private ListLogEntriesRequest() { - projectIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; resourceNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; filter_ = ""; orderBy_ = ""; @@ -75,16 +74,6 @@ private ListLogEntriesRequest( case 0: done = true; break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - projectIds_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - projectIds_.add(s); - break; - } case 18: { java.lang.String s = input.readStringRequireUtf8(); @@ -114,9 +103,9 @@ private ListLogEntriesRequest( case 66: { java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000002) != 0)) { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { resourceNames_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000002; + mutable_bitField0_ |= 0x00000001; } resourceNames_.add(s); break; @@ -136,9 +125,6 @@ private ListLogEntriesRequest( throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000001) != 0)) { - projectIds_ = projectIds_.getUnmodifiableView(); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { resourceNames_ = resourceNames_.getUnmodifiableView(); } this.unknownFields = unknownFields.build(); @@ -161,79 +147,6 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.logging.v2.ListLogEntriesRequest.Builder.class); } - public static final int PROJECT_IDS_FIELD_NUMBER = 1; - private com.google.protobuf.LazyStringList projectIds_; - /** - * - * - *
-   * Deprecated. Use `resource_names` instead.  One or more project identifiers
-   * or project numbers from which to retrieve log entries.  Example:
-   * `"my-project-1A"`.
-   * 
- * - * repeated string project_ids = 1 [deprecated = true]; - * - * @return A list containing the projectIds. - */ - @java.lang.Deprecated - public com.google.protobuf.ProtocolStringList getProjectIdsList() { - return projectIds_; - } - /** - * - * - *
-   * Deprecated. Use `resource_names` instead.  One or more project identifiers
-   * or project numbers from which to retrieve log entries.  Example:
-   * `"my-project-1A"`.
-   * 
- * - * repeated string project_ids = 1 [deprecated = true]; - * - * @return The count of projectIds. - */ - @java.lang.Deprecated - public int getProjectIdsCount() { - return projectIds_.size(); - } - /** - * - * - *
-   * Deprecated. Use `resource_names` instead.  One or more project identifiers
-   * or project numbers from which to retrieve log entries.  Example:
-   * `"my-project-1A"`.
-   * 
- * - * repeated string project_ids = 1 [deprecated = true]; - * - * @param index The index of the element to return. - * @return The projectIds at the given index. - */ - @java.lang.Deprecated - public java.lang.String getProjectIds(int index) { - return projectIds_.get(index); - } - /** - * - * - *
-   * Deprecated. Use `resource_names` instead.  One or more project identifiers
-   * or project numbers from which to retrieve log entries.  Example:
-   * `"my-project-1A"`.
-   * 
- * - * repeated string project_ids = 1 [deprecated = true]; - * - * @param index The index of the value to return. - * @return The bytes of the projectIds at the given index. - */ - @java.lang.Deprecated - public com.google.protobuf.ByteString getProjectIdsBytes(int index) { - return projectIds_.getByteString(index); - } - public static final int RESOURCE_NAMES_FIELD_NUMBER = 8; private com.google.protobuf.LazyStringList resourceNames_; /** @@ -342,7 +255,7 @@ public com.google.protobuf.ByteString getResourceNamesBytes(int index) { * The maximum length of the filter is 20000 characters. * * - * string filter = 2; + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return The filter. */ @@ -370,7 +283,7 @@ public java.lang.String getFilter() { * The maximum length of the filter is 20000 characters. * * - * string filter = 2; + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for filter. */ @@ -400,7 +313,7 @@ public com.google.protobuf.ByteString getFilterBytes() { * timestamps are returned in order of their `insert_id` values. * * - * string order_by = 3; + * string order_by = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return The orderBy. */ @@ -427,7 +340,7 @@ public java.lang.String getOrderBy() { * timestamps are returned in order of their `insert_id` values. * * - * string order_by = 3; + * string order_by = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for orderBy. */ @@ -454,7 +367,7 @@ public com.google.protobuf.ByteString getOrderByBytes() { * response indicates that more results might be available. * * - * int32 page_size = 4; + * int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; * * @return The pageSize. */ @@ -474,7 +387,7 @@ public int getPageSize() { * parameters should be identical to those in the previous call. * * - * string page_token = 5; + * string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; * * @return The pageToken. */ @@ -499,7 +412,7 @@ public java.lang.String getPageToken() { * parameters should be identical to those in the previous call. * * - * string page_token = 5; + * string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for pageToken. */ @@ -529,9 +442,6 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - for (int i = 0; i < projectIds_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, projectIds_.getRaw(i)); - } if (!getFilterBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, filter_); } @@ -556,14 +466,6 @@ public int getSerializedSize() { 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.GeneratedMessageV3.computeStringSize(2, filter_); } @@ -600,7 +502,6 @@ public boolean equals(final java.lang.Object obj) { com.google.logging.v2.ListLogEntriesRequest other = (com.google.logging.v2.ListLogEntriesRequest) obj; - if (!getProjectIdsList().equals(other.getProjectIdsList())) return false; if (!getResourceNamesList().equals(other.getResourceNamesList())) return false; if (!getFilter().equals(other.getFilter())) return false; if (!getOrderBy().equals(other.getOrderBy())) return false; @@ -617,10 +518,6 @@ public int hashCode() { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (getProjectIdsCount() > 0) { - hash = (37 * hash) + PROJECT_IDS_FIELD_NUMBER; - hash = (53 * hash) + getProjectIdsList().hashCode(); - } if (getResourceNamesCount() > 0) { hash = (37 * hash) + RESOURCE_NAMES_FIELD_NUMBER; hash = (53 * hash) + getResourceNamesList().hashCode(); @@ -778,10 +675,8 @@ private void maybeForceBuilderInitialization() { @java.lang.Override public Builder clear() { super.clear(); - projectIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); resourceNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); filter_ = ""; orderBy_ = ""; @@ -819,13 +714,8 @@ public com.google.logging.v2.ListLogEntriesRequest buildPartial() { new com.google.logging.v2.ListLogEntriesRequest(this); int from_bitField0_ = bitField0_; if (((bitField0_ & 0x00000001) != 0)) { - projectIds_ = projectIds_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.projectIds_ = projectIds_; - if (((bitField0_ & 0x00000002) != 0)) { resourceNames_ = resourceNames_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); } result.resourceNames_ = resourceNames_; result.filter_ = filter_; @@ -881,20 +771,10 @@ public Builder mergeFrom(com.google.protobuf.Message other) { 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.resourceNames_.isEmpty()) { if (resourceNames_.isEmpty()) { resourceNames_ = other.resourceNames_; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); } else { ensureResourceNamesIsMutable(); resourceNames_.addAll(other.resourceNames_); @@ -947,208 +827,13 @@ public Builder mergeFrom( private int bitField0_; - private com.google.protobuf.LazyStringList projectIds_ = - com.google.protobuf.LazyStringArrayList.EMPTY; - - private void ensureProjectIdsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - projectIds_ = new com.google.protobuf.LazyStringArrayList(projectIds_); - bitField0_ |= 0x00000001; - } - } - /** - * - * - *
-     * Deprecated. Use `resource_names` instead.  One or more project identifiers
-     * or project numbers from which to retrieve log entries.  Example:
-     * `"my-project-1A"`.
-     * 
- * - * repeated string project_ids = 1 [deprecated = true]; - * - * @return A list containing the projectIds. - */ - @java.lang.Deprecated - public com.google.protobuf.ProtocolStringList getProjectIdsList() { - return projectIds_.getUnmodifiableView(); - } - /** - * - * - *
-     * Deprecated. Use `resource_names` instead.  One or more project identifiers
-     * or project numbers from which to retrieve log entries.  Example:
-     * `"my-project-1A"`.
-     * 
- * - * repeated string project_ids = 1 [deprecated = true]; - * - * @return The count of projectIds. - */ - @java.lang.Deprecated - public int getProjectIdsCount() { - return projectIds_.size(); - } - /** - * - * - *
-     * Deprecated. Use `resource_names` instead.  One or more project identifiers
-     * or project numbers from which to retrieve log entries.  Example:
-     * `"my-project-1A"`.
-     * 
- * - * repeated string project_ids = 1 [deprecated = true]; - * - * @param index The index of the element to return. - * @return The projectIds at the given index. - */ - @java.lang.Deprecated - public java.lang.String getProjectIds(int index) { - return projectIds_.get(index); - } - /** - * - * - *
-     * Deprecated. Use `resource_names` instead.  One or more project identifiers
-     * or project numbers from which to retrieve log entries.  Example:
-     * `"my-project-1A"`.
-     * 
- * - * repeated string project_ids = 1 [deprecated = true]; - * - * @param index The index of the value to return. - * @return The bytes of the projectIds at the given index. - */ - @java.lang.Deprecated - public com.google.protobuf.ByteString getProjectIdsBytes(int index) { - return projectIds_.getByteString(index); - } - /** - * - * - *
-     * Deprecated. Use `resource_names` instead.  One or more project identifiers
-     * or project numbers from which to retrieve log entries.  Example:
-     * `"my-project-1A"`.
-     * 
- * - * repeated string project_ids = 1 [deprecated = true]; - * - * @param index The index to set the value at. - * @param value The projectIds to set. - * @return This builder for chaining. - */ - @java.lang.Deprecated - public Builder setProjectIds(int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureProjectIdsIsMutable(); - projectIds_.set(index, value); - onChanged(); - return this; - } - /** - * - * - *
-     * Deprecated. Use `resource_names` instead.  One or more project identifiers
-     * or project numbers from which to retrieve log entries.  Example:
-     * `"my-project-1A"`.
-     * 
- * - * repeated string project_ids = 1 [deprecated = true]; - * - * @param value The projectIds to add. - * @return This builder for chaining. - */ - @java.lang.Deprecated - public Builder addProjectIds(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureProjectIdsIsMutable(); - projectIds_.add(value); - onChanged(); - return this; - } - /** - * - * - *
-     * Deprecated. Use `resource_names` instead.  One or more project identifiers
-     * or project numbers from which to retrieve log entries.  Example:
-     * `"my-project-1A"`.
-     * 
- * - * repeated string project_ids = 1 [deprecated = true]; - * - * @param values The projectIds to add. - * @return This builder for chaining. - */ - @java.lang.Deprecated - public Builder addAllProjectIds(java.lang.Iterable values) { - ensureProjectIdsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, projectIds_); - onChanged(); - return this; - } - /** - * - * - *
-     * Deprecated. Use `resource_names` instead.  One or more project identifiers
-     * or project numbers from which to retrieve log entries.  Example:
-     * `"my-project-1A"`.
-     * 
- * - * repeated string project_ids = 1 [deprecated = true]; - * - * @return This builder for chaining. - */ - @java.lang.Deprecated - public Builder clearProjectIds() { - projectIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * - * - *
-     * Deprecated. Use `resource_names` instead.  One or more project identifiers
-     * or project numbers from which to retrieve log entries.  Example:
-     * `"my-project-1A"`.
-     * 
- * - * repeated string project_ids = 1 [deprecated = true]; - * - * @param value The bytes of the projectIds to add. - * @return This builder for chaining. - */ - @java.lang.Deprecated - public Builder addProjectIdsBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureProjectIdsIsMutable(); - projectIds_.add(value); - onChanged(); - return this; - } - private com.google.protobuf.LazyStringList resourceNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; private void ensureResourceNamesIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { + if (!((bitField0_ & 0x00000001) != 0)) { resourceNames_ = new com.google.protobuf.LazyStringArrayList(resourceNames_); - bitField0_ |= 0x00000002; + bitField0_ |= 0x00000001; } } /** @@ -1347,7 +1032,7 @@ public Builder addAllResourceNames(java.lang.Iterable values) */ public Builder clearResourceNames() { resourceNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } @@ -1396,7 +1081,7 @@ public Builder addResourceNamesBytes(com.google.protobuf.ByteString value) { * The maximum length of the filter is 20000 characters. * * - * string filter = 2; + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return The filter. */ @@ -1424,7 +1109,7 @@ public java.lang.String getFilter() { * The maximum length of the filter is 20000 characters. * * - * string filter = 2; + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for filter. */ @@ -1452,7 +1137,7 @@ public com.google.protobuf.ByteString getFilterBytes() { * The maximum length of the filter is 20000 characters. * * - * string filter = 2; + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The filter to set. * @return This builder for chaining. @@ -1479,7 +1164,7 @@ public Builder setFilter(java.lang.String value) { * The maximum length of the filter is 20000 characters. * * - * string filter = 2; + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return This builder for chaining. */ @@ -1502,7 +1187,7 @@ public Builder clearFilter() { * The maximum length of the filter is 20000 characters. * * - * string filter = 2; + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The bytes for filter to set. * @return This builder for chaining. @@ -1531,7 +1216,7 @@ public Builder setFilterBytes(com.google.protobuf.ByteString value) { * timestamps are returned in order of their `insert_id` values. * * - * string order_by = 3; + * string order_by = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return The orderBy. */ @@ -1558,7 +1243,7 @@ public java.lang.String getOrderBy() { * timestamps are returned in order of their `insert_id` values. * * - * string order_by = 3; + * string order_by = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for orderBy. */ @@ -1585,7 +1270,7 @@ public com.google.protobuf.ByteString getOrderByBytes() { * timestamps are returned in order of their `insert_id` values. * * - * string order_by = 3; + * string order_by = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The orderBy to set. * @return This builder for chaining. @@ -1611,7 +1296,7 @@ public Builder setOrderBy(java.lang.String value) { * timestamps are returned in order of their `insert_id` values. * * - * string order_by = 3; + * string order_by = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return This builder for chaining. */ @@ -1633,7 +1318,7 @@ public Builder clearOrderBy() { * timestamps are returned in order of their `insert_id` values. * * - * string order_by = 3; + * string order_by = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The bytes for orderBy to set. * @return This builder for chaining. @@ -1659,7 +1344,7 @@ public Builder setOrderByBytes(com.google.protobuf.ByteString value) { * response indicates that more results might be available. * * - * int32 page_size = 4; + * int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; * * @return The pageSize. */ @@ -1675,7 +1360,7 @@ public int getPageSize() { * response indicates that more results might be available. * * - * int32 page_size = 4; + * int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The pageSize to set. * @return This builder for chaining. @@ -1695,7 +1380,7 @@ public Builder setPageSize(int value) { * response indicates that more results might be available. * * - * int32 page_size = 4; + * int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; * * @return This builder for chaining. */ @@ -1717,7 +1402,7 @@ public Builder clearPageSize() { * parameters should be identical to those in the previous call. * * - * string page_token = 5; + * string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; * * @return The pageToken. */ @@ -1742,7 +1427,7 @@ public java.lang.String getPageToken() { * parameters should be identical to those in the previous call. * * - * string page_token = 5; + * string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for pageToken. */ @@ -1767,7 +1452,7 @@ public com.google.protobuf.ByteString getPageTokenBytes() { * parameters should be identical to those in the previous call. * * - * string page_token = 5; + * string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The pageToken to set. * @return This builder for chaining. @@ -1791,7 +1476,7 @@ public Builder setPageToken(java.lang.String value) { * parameters should be identical to those in the previous call. * * - * string page_token = 5; + * string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; * * @return This builder for chaining. */ @@ -1811,7 +1496,7 @@ public Builder clearPageToken() { * parameters should be identical to those in the previous call. * * - * string page_token = 5; + * string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The bytes for pageToken to set. * @return This builder for chaining. diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogEntriesRequestOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogEntriesRequestOrBuilder.java index c067f3206..8df3f48b4 100644 --- a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogEntriesRequestOrBuilder.java +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogEntriesRequestOrBuilder.java @@ -23,69 +23,6 @@ public interface ListLogEntriesRequestOrBuilder // @@protoc_insertion_point(interface_extends:google.logging.v2.ListLogEntriesRequest) com.google.protobuf.MessageOrBuilder { - /** - * - * - *
-   * Deprecated. Use `resource_names` instead.  One or more project identifiers
-   * or project numbers from which to retrieve log entries.  Example:
-   * `"my-project-1A"`.
-   * 
- * - * repeated string project_ids = 1 [deprecated = true]; - * - * @return A list containing the projectIds. - */ - @java.lang.Deprecated - java.util.List getProjectIdsList(); - /** - * - * - *
-   * Deprecated. Use `resource_names` instead.  One or more project identifiers
-   * or project numbers from which to retrieve log entries.  Example:
-   * `"my-project-1A"`.
-   * 
- * - * repeated string project_ids = 1 [deprecated = true]; - * - * @return The count of projectIds. - */ - @java.lang.Deprecated - int getProjectIdsCount(); - /** - * - * - *
-   * Deprecated. Use `resource_names` instead.  One or more project identifiers
-   * or project numbers from which to retrieve log entries.  Example:
-   * `"my-project-1A"`.
-   * 
- * - * repeated string project_ids = 1 [deprecated = true]; - * - * @param index The index of the element to return. - * @return The projectIds at the given index. - */ - @java.lang.Deprecated - java.lang.String getProjectIds(int index); - /** - * - * - *
-   * Deprecated. Use `resource_names` instead.  One or more project identifiers
-   * or project numbers from which to retrieve log entries.  Example:
-   * `"my-project-1A"`.
-   * 
- * - * repeated string project_ids = 1 [deprecated = true]; - * - * @param index The index of the value to return. - * @return The bytes of the projectIds at the given index. - */ - @java.lang.Deprecated - com.google.protobuf.ByteString getProjectIdsBytes(int index); - /** * * @@ -182,7 +119,7 @@ public interface ListLogEntriesRequestOrBuilder * The maximum length of the filter is 20000 characters. * * - * string filter = 2; + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return The filter. */ @@ -200,7 +137,7 @@ public interface ListLogEntriesRequestOrBuilder * The maximum length of the filter is 20000 characters. * * - * string filter = 2; + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for filter. */ @@ -218,7 +155,7 @@ public interface ListLogEntriesRequestOrBuilder * timestamps are returned in order of their `insert_id` values. * * - * string order_by = 3; + * string order_by = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return The orderBy. */ @@ -235,7 +172,7 @@ public interface ListLogEntriesRequestOrBuilder * timestamps are returned in order of their `insert_id` values. * * - * string order_by = 3; + * string order_by = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for orderBy. */ @@ -250,7 +187,7 @@ public interface ListLogEntriesRequestOrBuilder * response indicates that more results might be available. * * - * int32 page_size = 4; + * int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; * * @return The pageSize. */ @@ -266,7 +203,7 @@ public interface ListLogEntriesRequestOrBuilder * parameters should be identical to those in the previous call. * * - * string page_token = 5; + * string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; * * @return The pageToken. */ @@ -281,7 +218,7 @@ public interface ListLogEntriesRequestOrBuilder * parameters should be identical to those in the previous call. * * - * string page_token = 5; + * string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for pageToken. */ diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogMetricsRequest.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogMetricsRequest.java index 72635c53f..590e294ab 100644 --- a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogMetricsRequest.java +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogMetricsRequest.java @@ -189,7 +189,7 @@ public com.google.protobuf.ByteString getParentBytes() { * parameters should be identical to those in the previous call. * * - * string page_token = 2; + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return The pageToken. */ @@ -214,7 +214,7 @@ public java.lang.String getPageToken() { * parameters should be identical to those in the previous call. * * - * string page_token = 2; + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for pageToken. */ @@ -241,7 +241,7 @@ public com.google.protobuf.ByteString getPageTokenBytes() { * response indicates that more results might be available. * * - * int32 page_size = 3; + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return The pageSize. */ @@ -728,7 +728,7 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { * parameters should be identical to those in the previous call. * * - * string page_token = 2; + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return The pageToken. */ @@ -753,7 +753,7 @@ public java.lang.String getPageToken() { * parameters should be identical to those in the previous call. * * - * string page_token = 2; + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for pageToken. */ @@ -778,7 +778,7 @@ public com.google.protobuf.ByteString getPageTokenBytes() { * parameters should be identical to those in the previous call. * * - * string page_token = 2; + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The pageToken to set. * @return This builder for chaining. @@ -802,7 +802,7 @@ public Builder setPageToken(java.lang.String value) { * parameters should be identical to those in the previous call. * * - * string page_token = 2; + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return This builder for chaining. */ @@ -822,7 +822,7 @@ public Builder clearPageToken() { * parameters should be identical to those in the previous call. * * - * string page_token = 2; + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The bytes for pageToken to set. * @return This builder for chaining. @@ -848,7 +848,7 @@ public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { * response indicates that more results might be available. * * - * int32 page_size = 3; + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return The pageSize. */ @@ -864,7 +864,7 @@ public int getPageSize() { * response indicates that more results might be available. * * - * int32 page_size = 3; + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The pageSize to set. * @return This builder for chaining. @@ -884,7 +884,7 @@ public Builder setPageSize(int value) { * response indicates that more results might be available. * * - * int32 page_size = 3; + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return This builder for chaining. */ diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogMetricsRequestOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogMetricsRequestOrBuilder.java index 14421f91e..7bc9456dc 100644 --- a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogMetricsRequestOrBuilder.java +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogMetricsRequestOrBuilder.java @@ -64,7 +64,7 @@ public interface ListLogMetricsRequestOrBuilder * parameters should be identical to those in the previous call. * * - * string page_token = 2; + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return The pageToken. */ @@ -79,7 +79,7 @@ public interface ListLogMetricsRequestOrBuilder * parameters should be identical to those in the previous call. * * - * string page_token = 2; + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for pageToken. */ @@ -94,7 +94,7 @@ public interface ListLogMetricsRequestOrBuilder * response indicates that more results might be available. * * - * int32 page_size = 3; + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return The pageSize. */ diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogsRequest.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogsRequest.java index 0fafc8d35..96f81158d 100644 --- a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogsRequest.java +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogsRequest.java @@ -137,7 +137,9 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * "folders/[FOLDER_ID]" * * - * string parent = 1 [(.google.api.resource_reference) = { ... } + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The parent. */ @@ -163,7 +165,9 @@ public java.lang.String getParent() { * "folders/[FOLDER_ID]" * * - * string parent = 1 [(.google.api.resource_reference) = { ... } + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The bytes for parent. */ @@ -190,7 +194,7 @@ public com.google.protobuf.ByteString getParentBytes() { * response indicates that more results might be available. * * - * int32 page_size = 2; + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return The pageSize. */ @@ -210,7 +214,7 @@ public int getPageSize() { * parameters should be identical to those in the previous call. * * - * string page_token = 3; + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return The pageToken. */ @@ -235,7 +239,7 @@ public java.lang.String getPageToken() { * parameters should be identical to those in the previous call. * * - * string page_token = 3; + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for pageToken. */ @@ -608,7 +612,9 @@ public Builder mergeFrom( * "folders/[FOLDER_ID]" * * - * string parent = 1 [(.google.api.resource_reference) = { ... } + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The parent. */ @@ -634,7 +640,9 @@ public java.lang.String getParent() { * "folders/[FOLDER_ID]" * * - * string parent = 1 [(.google.api.resource_reference) = { ... } + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The bytes for parent. */ @@ -660,7 +668,9 @@ public com.google.protobuf.ByteString getParentBytes() { * "folders/[FOLDER_ID]" * * - * string parent = 1 [(.google.api.resource_reference) = { ... } + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @param value The parent to set. * @return This builder for chaining. @@ -685,7 +695,9 @@ public Builder setParent(java.lang.String value) { * "folders/[FOLDER_ID]" * * - * string parent = 1 [(.google.api.resource_reference) = { ... } + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return This builder for chaining. */ @@ -706,7 +718,9 @@ public Builder clearParent() { * "folders/[FOLDER_ID]" * * - * string parent = 1 [(.google.api.resource_reference) = { ... } + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @param value The bytes for parent to set. * @return This builder for chaining. @@ -732,7 +746,7 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { * response indicates that more results might be available. * * - * int32 page_size = 2; + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return The pageSize. */ @@ -748,7 +762,7 @@ public int getPageSize() { * response indicates that more results might be available. * * - * int32 page_size = 2; + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The pageSize to set. * @return This builder for chaining. @@ -768,7 +782,7 @@ public Builder setPageSize(int value) { * response indicates that more results might be available. * * - * int32 page_size = 2; + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return This builder for chaining. */ @@ -790,7 +804,7 @@ public Builder clearPageSize() { * parameters should be identical to those in the previous call. * * - * string page_token = 3; + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return The pageToken. */ @@ -815,7 +829,7 @@ public java.lang.String getPageToken() { * parameters should be identical to those in the previous call. * * - * string page_token = 3; + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for pageToken. */ @@ -840,7 +854,7 @@ public com.google.protobuf.ByteString getPageTokenBytes() { * parameters should be identical to those in the previous call. * * - * string page_token = 3; + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The pageToken to set. * @return This builder for chaining. @@ -864,7 +878,7 @@ public Builder setPageToken(java.lang.String value) { * parameters should be identical to those in the previous call. * * - * string page_token = 3; + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return This builder for chaining. */ @@ -884,7 +898,7 @@ public Builder clearPageToken() { * parameters should be identical to those in the previous call. * * - * string page_token = 3; + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The bytes for pageToken to set. * @return This builder for chaining. diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogsRequestOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogsRequestOrBuilder.java index 7d0c51c5c..bee958f74 100644 --- a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogsRequestOrBuilder.java +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogsRequestOrBuilder.java @@ -34,7 +34,9 @@ public interface ListLogsRequestOrBuilder * "folders/[FOLDER_ID]" * * - * string parent = 1 [(.google.api.resource_reference) = { ... } + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The parent. */ @@ -50,7 +52,9 @@ public interface ListLogsRequestOrBuilder * "folders/[FOLDER_ID]" * * - * string parent = 1 [(.google.api.resource_reference) = { ... } + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The bytes for parent. */ @@ -65,7 +69,7 @@ public interface ListLogsRequestOrBuilder * response indicates that more results might be available. * * - * int32 page_size = 2; + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return The pageSize. */ @@ -81,7 +85,7 @@ public interface ListLogsRequestOrBuilder * parameters should be identical to those in the previous call. * * - * string page_token = 3; + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return The pageToken. */ @@ -96,7 +100,7 @@ public interface ListLogsRequestOrBuilder * parameters should be identical to those in the previous call. * * - * string page_token = 3; + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for pageToken. */ diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListMonitoredResourceDescriptorsRequest.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListMonitoredResourceDescriptorsRequest.java index 691cf0298..9f6c19873 100644 --- a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListMonitoredResourceDescriptorsRequest.java +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListMonitoredResourceDescriptorsRequest.java @@ -129,7 +129,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * response indicates that more results might be available. * * - * int32 page_size = 1; + * int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; * * @return The pageSize. */ @@ -149,7 +149,7 @@ public int getPageSize() { * parameters should be identical to those in the previous call. * * - * string page_token = 2; + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return The pageToken. */ @@ -174,7 +174,7 @@ public java.lang.String getPageToken() { * parameters should be identical to those in the previous call. * * - * string page_token = 2; + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for pageToken. */ @@ -537,7 +537,7 @@ public Builder mergeFrom( * response indicates that more results might be available. * * - * int32 page_size = 1; + * int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; * * @return The pageSize. */ @@ -553,7 +553,7 @@ public int getPageSize() { * response indicates that more results might be available. * * - * int32 page_size = 1; + * int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The pageSize to set. * @return This builder for chaining. @@ -573,7 +573,7 @@ public Builder setPageSize(int value) { * response indicates that more results might be available. * * - * int32 page_size = 1; + * int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; * * @return This builder for chaining. */ @@ -595,7 +595,7 @@ public Builder clearPageSize() { * parameters should be identical to those in the previous call. * * - * string page_token = 2; + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return The pageToken. */ @@ -620,7 +620,7 @@ public java.lang.String getPageToken() { * parameters should be identical to those in the previous call. * * - * string page_token = 2; + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for pageToken. */ @@ -645,7 +645,7 @@ public com.google.protobuf.ByteString getPageTokenBytes() { * parameters should be identical to those in the previous call. * * - * string page_token = 2; + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The pageToken to set. * @return This builder for chaining. @@ -669,7 +669,7 @@ public Builder setPageToken(java.lang.String value) { * parameters should be identical to those in the previous call. * * - * string page_token = 2; + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return This builder for chaining. */ @@ -689,7 +689,7 @@ public Builder clearPageToken() { * parameters should be identical to those in the previous call. * * - * string page_token = 2; + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The bytes for pageToken to set. * @return This builder for chaining. diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListMonitoredResourceDescriptorsRequestOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListMonitoredResourceDescriptorsRequestOrBuilder.java index 649f4f49a..193bf02e2 100644 --- a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListMonitoredResourceDescriptorsRequestOrBuilder.java +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListMonitoredResourceDescriptorsRequestOrBuilder.java @@ -32,7 +32,7 @@ public interface ListMonitoredResourceDescriptorsRequestOrBuilder * response indicates that more results might be available. * * - * int32 page_size = 1; + * int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; * * @return The pageSize. */ @@ -48,7 +48,7 @@ public interface ListMonitoredResourceDescriptorsRequestOrBuilder * parameters should be identical to those in the previous call. * * - * string page_token = 2; + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return The pageToken. */ @@ -63,7 +63,7 @@ public interface ListMonitoredResourceDescriptorsRequestOrBuilder * parameters should be identical to those in the previous call. * * - * string page_token = 2; + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for pageToken. */ diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListSinksRequest.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListSinksRequest.java index 058865e97..2cc349254 100644 --- a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListSinksRequest.java +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListSinksRequest.java @@ -195,7 +195,7 @@ public com.google.protobuf.ByteString getParentBytes() { * parameters should be identical to those in the previous call. * * - * string page_token = 2; + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return The pageToken. */ @@ -220,7 +220,7 @@ public java.lang.String getPageToken() { * parameters should be identical to those in the previous call. * * - * string page_token = 2; + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for pageToken. */ @@ -247,7 +247,7 @@ public com.google.protobuf.ByteString getPageTokenBytes() { * response indicates that more results might be available. * * - * int32 page_size = 3; + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return The pageSize. */ @@ -748,7 +748,7 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { * parameters should be identical to those in the previous call. * * - * string page_token = 2; + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return The pageToken. */ @@ -773,7 +773,7 @@ public java.lang.String getPageToken() { * parameters should be identical to those in the previous call. * * - * string page_token = 2; + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for pageToken. */ @@ -798,7 +798,7 @@ public com.google.protobuf.ByteString getPageTokenBytes() { * parameters should be identical to those in the previous call. * * - * string page_token = 2; + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The pageToken to set. * @return This builder for chaining. @@ -822,7 +822,7 @@ public Builder setPageToken(java.lang.String value) { * parameters should be identical to those in the previous call. * * - * string page_token = 2; + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return This builder for chaining. */ @@ -842,7 +842,7 @@ public Builder clearPageToken() { * parameters should be identical to those in the previous call. * * - * string page_token = 2; + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The bytes for pageToken to set. * @return This builder for chaining. @@ -868,7 +868,7 @@ public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { * response indicates that more results might be available. * * - * int32 page_size = 3; + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return The pageSize. */ @@ -884,7 +884,7 @@ public int getPageSize() { * response indicates that more results might be available. * * - * int32 page_size = 3; + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The pageSize to set. * @return This builder for chaining. @@ -904,7 +904,7 @@ public Builder setPageSize(int value) { * response indicates that more results might be available. * * - * int32 page_size = 3; + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return This builder for chaining. */ diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListSinksRequestOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListSinksRequestOrBuilder.java index 8db43b5be..d59e4ff79 100644 --- a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListSinksRequestOrBuilder.java +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListSinksRequestOrBuilder.java @@ -70,7 +70,7 @@ public interface ListSinksRequestOrBuilder * parameters should be identical to those in the previous call. * * - * string page_token = 2; + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return The pageToken. */ @@ -85,7 +85,7 @@ public interface ListSinksRequestOrBuilder * parameters should be identical to those in the previous call. * * - * string page_token = 2; + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for pageToken. */ @@ -100,7 +100,7 @@ public interface ListSinksRequestOrBuilder * response indicates that more results might be available. * * - * int32 page_size = 3; + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return The pageSize. */ diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogBucket.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogBucket.java new file mode 100644 index 000000000..013cafdc5 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogBucket.java @@ -0,0 +1,1713 @@ +/* + * Copyright 2020 Google LLC + * + * 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 + * + * https://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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging_config.proto + +package com.google.logging.v2; + +/** + * + * + *
+ * Describes a repository of logs (Beta).
+ * 
+ * + * Protobuf type {@code google.logging.v2.LogBucket} + */ +public final class LogBucket extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.LogBucket) + LogBucketOrBuilder { + private static final long serialVersionUID = 0L; + // Use LogBucket.newBuilder() to construct. + private LogBucket(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private LogBucket() { + name_ = ""; + description_ = ""; + lifecycleState_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new LogBucket(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private LogBucket( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 34: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 42: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (updateTime_ != null) { + subBuilder = updateTime_.toBuilder(); + } + updateTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateTime_); + updateTime_ = subBuilder.buildPartial(); + } + + break; + } + case 88: + { + retentionDays_ = input.readInt32(); + break; + } + case 96: + { + int rawValue = input.readEnum(); + + lifecycleState_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_LogBucket_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_LogBucket_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.LogBucket.class, com.google.logging.v2.LogBucket.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The resource name of the bucket.
+   * For example:
+   * "projects/my-project-id/locations/my-location/buckets/my-bucket-id The
+   * supported locations are:
+   *   "global"
+   *   "us-central1"
+   * For the location of `global` it is unspecified where logs are actually
+   * stored.
+   * Once a bucket has been created, the location can not be changed.
+   * 
+ * + * string name = 1; + * + * @return 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; + } + } + /** + * + * + *
+   * The resource name of the bucket.
+   * For example:
+   * "projects/my-project-id/locations/my-location/buckets/my-bucket-id The
+   * supported locations are:
+   *   "global"
+   *   "us-central1"
+   * For the location of `global` it is unspecified where logs are actually
+   * stored.
+   * Once a bucket has been created, the location can not be changed.
+   * 
+ * + * string name = 1; + * + * @return The bytes for 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 = 3; + private volatile java.lang.Object description_; + /** + * + * + *
+   * Describes this bucket.
+   * 
+ * + * string description = 3; + * + * @return The description. + */ + 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; + } + } + /** + * + * + *
+   * Describes this bucket.
+   * 
+ * + * string description = 3; + * + * @return The bytes for description. + */ + 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 CREATE_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The creation timestamp of the bucket. This is not set for any of the
+   * default buckets.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. The creation timestamp of the bucket. This is not set for any of the
+   * default buckets.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Output only. The creation timestamp of the bucket. This is not set for any of the
+   * default buckets.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. The last update timestamp of the bucket.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Output only. The last update timestamp of the bucket.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Output only. The last update timestamp of the bucket.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + public static final int RETENTION_DAYS_FIELD_NUMBER = 11; + private int retentionDays_; + /** + * + * + *
+   * Logs will be retained by default for this amount of time, after which they
+   * will automatically be deleted. The minimum retention period is 1 day.
+   * If this value is set to zero at bucket creation time, the default time of
+   * 30 days will be used.
+   * 
+ * + * int32 retention_days = 11; + * + * @return The retentionDays. + */ + public int getRetentionDays() { + return retentionDays_; + } + + public static final int LIFECYCLE_STATE_FIELD_NUMBER = 12; + private int lifecycleState_; + /** + * + * + *
+   * Output only. The bucket lifecycle state.
+   * 
+ * + * + * .google.logging.v2.LifecycleState lifecycle_state = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for lifecycleState. + */ + public int getLifecycleStateValue() { + return lifecycleState_; + } + /** + * + * + *
+   * Output only. The bucket lifecycle state.
+   * 
+ * + * + * .google.logging.v2.LifecycleState lifecycle_state = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The lifecycleState. + */ + public com.google.logging.v2.LifecycleState getLifecycleState() { + @SuppressWarnings("deprecation") + com.google.logging.v2.LifecycleState result = + com.google.logging.v2.LifecycleState.valueOf(lifecycleState_); + return result == null ? com.google.logging.v2.LifecycleState.UNRECOGNIZED : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); + } + if (createTime_ != null) { + output.writeMessage(4, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(5, getUpdateTime()); + } + if (retentionDays_ != 0) { + output.writeInt32(11, retentionDays_); + } + if (lifecycleState_ + != com.google.logging.v2.LifecycleState.LIFECYCLE_STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(12, lifecycleState_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getUpdateTime()); + } + if (retentionDays_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(11, retentionDays_); + } + if (lifecycleState_ + != com.google.logging.v2.LifecycleState.LIFECYCLE_STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(12, lifecycleState_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.logging.v2.LogBucket)) { + return super.equals(obj); + } + com.google.logging.v2.LogBucket other = (com.google.logging.v2.LogBucket) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (getRetentionDays() != other.getRetentionDays()) return false; + if (lifecycleState_ != other.lifecycleState_) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + hash = (37 * hash) + RETENTION_DAYS_FIELD_NUMBER; + hash = (53 * hash) + getRetentionDays(); + hash = (37 * hash) + LIFECYCLE_STATE_FIELD_NUMBER; + hash = (53 * hash) + lifecycleState_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.LogBucket parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.LogBucket parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.LogBucket parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.LogBucket 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.LogBucket parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.LogBucket parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.LogBucket parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.LogBucket parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.logging.v2.LogBucket parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.LogBucket parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.logging.v2.LogBucket parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.LogBucket parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.logging.v2.LogBucket prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Describes a repository of logs (Beta).
+   * 
+ * + * Protobuf type {@code google.logging.v2.LogBucket} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.LogBucket) + com.google.logging.v2.LogBucketOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_LogBucket_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_LogBucket_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.LogBucket.class, com.google.logging.v2.LogBucket.Builder.class); + } + + // Construct using com.google.logging.v2.LogBucket.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + description_ = ""; + + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + retentionDays_ = 0; + + lifecycleState_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_LogBucket_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.LogBucket getDefaultInstanceForType() { + return com.google.logging.v2.LogBucket.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.LogBucket build() { + com.google.logging.v2.LogBucket result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.LogBucket buildPartial() { + com.google.logging.v2.LogBucket result = new com.google.logging.v2.LogBucket(this); + result.name_ = name_; + result.description_ = description_; + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + result.retentionDays_ = retentionDays_; + result.lifecycleState_ = lifecycleState_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.logging.v2.LogBucket) { + return mergeFrom((com.google.logging.v2.LogBucket) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.LogBucket other) { + if (other == com.google.logging.v2.LogBucket.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.getRetentionDays() != 0) { + setRetentionDays(other.getRetentionDays()); + } + if (other.lifecycleState_ != 0) { + setLifecycleStateValue(other.getLifecycleStateValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.logging.v2.LogBucket parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.logging.v2.LogBucket) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The resource name of the bucket.
+     * For example:
+     * "projects/my-project-id/locations/my-location/buckets/my-bucket-id The
+     * supported locations are:
+     *   "global"
+     *   "us-central1"
+     * For the location of `global` it is unspecified where logs are actually
+     * stored.
+     * Once a bucket has been created, the location can not be changed.
+     * 
+ * + * string name = 1; + * + * @return 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; + } + } + /** + * + * + *
+     * The resource name of the bucket.
+     * For example:
+     * "projects/my-project-id/locations/my-location/buckets/my-bucket-id The
+     * supported locations are:
+     *   "global"
+     *   "us-central1"
+     * For the location of `global` it is unspecified where logs are actually
+     * stored.
+     * Once a bucket has been created, the location can not be changed.
+     * 
+ * + * string name = 1; + * + * @return The bytes for 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; + } + } + /** + * + * + *
+     * The resource name of the bucket.
+     * For example:
+     * "projects/my-project-id/locations/my-location/buckets/my-bucket-id The
+     * supported locations are:
+     *   "global"
+     *   "us-central1"
+     * For the location of `global` it is unspecified where logs are actually
+     * stored.
+     * Once a bucket has been created, the location can not be changed.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the bucket.
+     * For example:
+     * "projects/my-project-id/locations/my-location/buckets/my-bucket-id The
+     * supported locations are:
+     *   "global"
+     *   "us-central1"
+     * For the location of `global` it is unspecified where logs are actually
+     * stored.
+     * Once a bucket has been created, the location can not be changed.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the bucket.
+     * For example:
+     * "projects/my-project-id/locations/my-location/buckets/my-bucket-id The
+     * supported locations are:
+     *   "global"
+     *   "us-central1"
+     * For the location of `global` it is unspecified where logs are actually
+     * stored.
+     * Once a bucket has been created, the location can not be changed.
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + 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_ = ""; + /** + * + * + *
+     * Describes this bucket.
+     * 
+ * + * string description = 3; + * + * @return The description. + */ + 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; + } + } + /** + * + * + *
+     * Describes this bucket.
+     * 
+ * + * string description = 3; + * + * @return The bytes for description. + */ + 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; + } + } + /** + * + * + *
+     * Describes this bucket.
+     * 
+ * + * string description = 3; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Describes this bucket.
+     * 
+ * + * string description = 3; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * + * + *
+     * Describes this bucket.
+     * 
+ * + * string description = 3; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. The creation timestamp of the bucket. This is not set for any of the
+     * default buckets.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Output only. The creation timestamp of the bucket. This is not set for any of the
+     * default buckets.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The creation timestamp of the bucket. This is not set for any of the
+     * default buckets.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The creation timestamp of the bucket. This is not set for any of the
+     * default buckets.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The creation timestamp of the bucket. This is not set for any of the
+     * default buckets.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The creation timestamp of the bucket. This is not set for any of the
+     * default buckets.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The creation timestamp of the bucket. This is not set for any of the
+     * default buckets.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The creation timestamp of the bucket. This is not set for any of the
+     * default buckets.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Output only. The creation timestamp of the bucket. This is not set for any of the
+     * default buckets.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. The last update timestamp of the bucket.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
+     * Output only. The last update timestamp of the bucket.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The last update timestamp of the bucket.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + onChanged(); + } else { + updateTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The last update timestamp of the bucket.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The last update timestamp of the bucket.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (updateTime_ != null) { + updateTime_ = + com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); + } else { + updateTime_ = value; + } + onChanged(); + } else { + updateTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The last update timestamp of the bucket.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The last update timestamp of the bucket.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The last update timestamp of the bucket.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Output only. The last update timestamp of the bucket.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private int retentionDays_; + /** + * + * + *
+     * Logs will be retained by default for this amount of time, after which they
+     * will automatically be deleted. The minimum retention period is 1 day.
+     * If this value is set to zero at bucket creation time, the default time of
+     * 30 days will be used.
+     * 
+ * + * int32 retention_days = 11; + * + * @return The retentionDays. + */ + public int getRetentionDays() { + return retentionDays_; + } + /** + * + * + *
+     * Logs will be retained by default for this amount of time, after which they
+     * will automatically be deleted. The minimum retention period is 1 day.
+     * If this value is set to zero at bucket creation time, the default time of
+     * 30 days will be used.
+     * 
+ * + * int32 retention_days = 11; + * + * @param value The retentionDays to set. + * @return This builder for chaining. + */ + public Builder setRetentionDays(int value) { + + retentionDays_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Logs will be retained by default for this amount of time, after which they
+     * will automatically be deleted. The minimum retention period is 1 day.
+     * If this value is set to zero at bucket creation time, the default time of
+     * 30 days will be used.
+     * 
+ * + * int32 retention_days = 11; + * + * @return This builder for chaining. + */ + public Builder clearRetentionDays() { + + retentionDays_ = 0; + onChanged(); + return this; + } + + private int lifecycleState_ = 0; + /** + * + * + *
+     * Output only. The bucket lifecycle state.
+     * 
+ * + * + * .google.logging.v2.LifecycleState lifecycle_state = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for lifecycleState. + */ + public int getLifecycleStateValue() { + return lifecycleState_; + } + /** + * + * + *
+     * Output only. The bucket lifecycle state.
+     * 
+ * + * + * .google.logging.v2.LifecycleState lifecycle_state = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for lifecycleState to set. + * @return This builder for chaining. + */ + public Builder setLifecycleStateValue(int value) { + lifecycleState_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The bucket lifecycle state.
+     * 
+ * + * + * .google.logging.v2.LifecycleState lifecycle_state = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The lifecycleState. + */ + public com.google.logging.v2.LifecycleState getLifecycleState() { + @SuppressWarnings("deprecation") + com.google.logging.v2.LifecycleState result = + com.google.logging.v2.LifecycleState.valueOf(lifecycleState_); + return result == null ? com.google.logging.v2.LifecycleState.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Output only. The bucket lifecycle state.
+     * 
+ * + * + * .google.logging.v2.LifecycleState lifecycle_state = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The lifecycleState to set. + * @return This builder for chaining. + */ + public Builder setLifecycleState(com.google.logging.v2.LifecycleState value) { + if (value == null) { + throw new NullPointerException(); + } + + lifecycleState_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The bucket lifecycle state.
+     * 
+ * + * + * .google.logging.v2.LifecycleState lifecycle_state = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearLifecycleState() { + + lifecycleState_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.logging.v2.LogBucket) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.LogBucket) + private static final com.google.logging.v2.LogBucket DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.LogBucket(); + } + + public static com.google.logging.v2.LogBucket getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LogBucket parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new LogBucket(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.logging.v2.LogBucket getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogBucketName.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogBucketName.java new file mode 100644 index 000000000..da9f9fd80 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogBucketName.java @@ -0,0 +1,550 @@ +/* + * Copyright 2020 Google LLC + * + * 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 + * + * https://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.logging.v2; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.pathtemplate.ValidationException; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** AUTO-GENERATED DOCUMENTATION AND CLASS */ +@javax.annotation.Generated("by GAPIC protoc plugin") +public class LogBucketName implements ResourceName { + + @Deprecated + protected LogBucketName() {} + + private static final PathTemplate PROJECT_LOCATION_BUCKET_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/buckets/{bucket}"); + private static final PathTemplate ORGANIZATION_LOCATION_BUCKET_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "organizations/{organization}/locations/{location}/buckets/{bucket}"); + private static final PathTemplate FOLDER_LOCATION_BUCKET_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "folders/{folder}/locations/{location}/buckets/{bucket}"); + private static final PathTemplate BILLING_ACCOUNT_LOCATION_BUCKET_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}"); + + private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; + + private String project; + private String location; + private String bucket; + private String organization; + private String folder; + private String billingAccount; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getBucket() { + return bucket; + } + + public String getOrganization() { + return organization; + } + + public String getFolder() { + return folder; + } + + public String getBillingAccount() { + return billingAccount; + } + + private LogBucketName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + bucket = Preconditions.checkNotNull(builder.getBucket()); + pathTemplate = PROJECT_LOCATION_BUCKET_PATH_TEMPLATE; + } + + private LogBucketName(OrganizationLocationBucketBuilder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + location = Preconditions.checkNotNull(builder.getLocation()); + bucket = Preconditions.checkNotNull(builder.getBucket()); + pathTemplate = ORGANIZATION_LOCATION_BUCKET_PATH_TEMPLATE; + } + + private LogBucketName(FolderLocationBucketBuilder builder) { + folder = Preconditions.checkNotNull(builder.getFolder()); + location = Preconditions.checkNotNull(builder.getLocation()); + bucket = Preconditions.checkNotNull(builder.getBucket()); + pathTemplate = FOLDER_LOCATION_BUCKET_PATH_TEMPLATE; + } + + private LogBucketName(BillingAccountLocationBucketBuilder builder) { + billingAccount = Preconditions.checkNotNull(builder.getBillingAccount()); + location = Preconditions.checkNotNull(builder.getLocation()); + bucket = Preconditions.checkNotNull(builder.getBucket()); + pathTemplate = BILLING_ACCOUNT_LOCATION_BUCKET_PATH_TEMPLATE; + } + + public static Builder newBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static Builder newProjectLocationBucketBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static OrganizationLocationBucketBuilder newOrganizationLocationBucketBuilder() { + return new OrganizationLocationBucketBuilder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static FolderLocationBucketBuilder newFolderLocationBucketBuilder() { + return new FolderLocationBucketBuilder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static BillingAccountLocationBucketBuilder newBillingAccountLocationBucketBuilder() { + return new BillingAccountLocationBucketBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static LogBucketName of(String project, String location, String bucket) { + return newProjectLocationBucketBuilder() + .setProject(project) + .setLocation(location) + .setBucket(bucket) + .build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static LogBucketName ofProjectLocationBucketName( + String project, String location, String bucket) { + return newProjectLocationBucketBuilder() + .setProject(project) + .setLocation(location) + .setBucket(bucket) + .build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static LogBucketName ofOrganizationLocationBucketName( + String organization, String location, String bucket) { + return newOrganizationLocationBucketBuilder() + .setOrganization(organization) + .setLocation(location) + .setBucket(bucket) + .build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static LogBucketName ofFolderLocationBucketName( + String folder, String location, String bucket) { + return newFolderLocationBucketBuilder() + .setFolder(folder) + .setLocation(location) + .setBucket(bucket) + .build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static LogBucketName ofBillingAccountLocationBucketName( + String billingAccount, String location, String bucket) { + return newBillingAccountLocationBucketBuilder() + .setBillingAccount(billingAccount) + .setLocation(location) + .setBucket(bucket) + .build(); + } + + public static String format(String project, String location, String bucket) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setBucket(bucket) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatProjectLocationBucketName( + String project, String location, String bucket) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setBucket(bucket) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatOrganizationLocationBucketName( + String organization, String location, String bucket) { + return newOrganizationLocationBucketBuilder() + .setOrganization(organization) + .setLocation(location) + .setBucket(bucket) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatFolderLocationBucketName( + String folder, String location, String bucket) { + return newFolderLocationBucketBuilder() + .setFolder(folder) + .setLocation(location) + .setBucket(bucket) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatBillingAccountLocationBucketName( + String billingAccount, String location, String bucket) { + return newBillingAccountLocationBucketBuilder() + .setBillingAccount(billingAccount) + .setLocation(location) + .setBucket(bucket) + .build() + .toString(); + } + + public static LogBucketName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + if (PROJECT_LOCATION_BUCKET_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = PROJECT_LOCATION_BUCKET_PATH_TEMPLATE.match(formattedString); + return ofProjectLocationBucketName( + matchMap.get("project"), matchMap.get("location"), matchMap.get("bucket")); + } else if (ORGANIZATION_LOCATION_BUCKET_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = + ORGANIZATION_LOCATION_BUCKET_PATH_TEMPLATE.match(formattedString); + return ofOrganizationLocationBucketName( + matchMap.get("organization"), matchMap.get("location"), matchMap.get("bucket")); + } else if (FOLDER_LOCATION_BUCKET_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = FOLDER_LOCATION_BUCKET_PATH_TEMPLATE.match(formattedString); + return ofFolderLocationBucketName( + matchMap.get("folder"), matchMap.get("location"), matchMap.get("bucket")); + } else if (BILLING_ACCOUNT_LOCATION_BUCKET_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = + BILLING_ACCOUNT_LOCATION_BUCKET_PATH_TEMPLATE.match(formattedString); + return ofBillingAccountLocationBucketName( + matchMap.get("billing_account"), matchMap.get("location"), matchMap.get("bucket")); + } + throw new ValidationException("JobName.parse: formattedString not in valid format"); + } + + @BetaApi("The method will be renamed to parseList after subclasses of this class are removed.") + public static List parse(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + @BetaApi("The method will be renamed to toStringList after subclasses of this class are removed.") + public static List toStrings(List values) { + List list = new ArrayList<>(values.size()); + for (LogBucketName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_BUCKET_PATH_TEMPLATE.matches(formattedString) + || ORGANIZATION_LOCATION_BUCKET_PATH_TEMPLATE.matches(formattedString) + || FOLDER_LOCATION_BUCKET_PATH_TEMPLATE.matches(formattedString) + || BILLING_ACCOUNT_LOCATION_BUCKET_PATH_TEMPLATE.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (bucket != null) { + fieldMapBuilder.put("bucket", bucket); + } + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + if (folder != null) { + fieldMapBuilder.put("folder", folder); + } + if (billingAccount != null) { + fieldMapBuilder.put("billing_account", billingAccount); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + } + + /** Builder for projects/{project}/locations/{location}/buckets/{bucket}. */ + public static class Builder { + + private String project; + private String location; + private String bucket; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getBucket() { + return bucket; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setBucket(String bucket) { + this.bucket = bucket; + return this; + } + + private Builder(LogBucketName logBucketName) { + Preconditions.checkArgument( + logBucketName.pathTemplate == PROJECT_LOCATION_BUCKET_PATH_TEMPLATE, + "toBuilder is only supported when LogBucketName has the pattern of " + + "projects/{project}/locations/{location}/buckets/{bucket}."); + project = logBucketName.project; + location = logBucketName.location; + bucket = logBucketName.bucket; + } + + public LogBucketName build() { + return new LogBucketName(this); + } + } + + /** Builder for organizations/{organization}/locations/{location}/buckets/{bucket}. */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class OrganizationLocationBucketBuilder { + + private String organization; + private String location; + private String bucket; + + private OrganizationLocationBucketBuilder() {} + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getBucket() { + return bucket; + } + + public OrganizationLocationBucketBuilder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public OrganizationLocationBucketBuilder setLocation(String location) { + this.location = location; + return this; + } + + public OrganizationLocationBucketBuilder setBucket(String bucket) { + this.bucket = bucket; + return this; + } + + public LogBucketName build() { + return new LogBucketName(this); + } + } + + /** Builder for folders/{folder}/locations/{location}/buckets/{bucket}. */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class FolderLocationBucketBuilder { + + private String folder; + private String location; + private String bucket; + + private FolderLocationBucketBuilder() {} + + public String getFolder() { + return folder; + } + + public String getLocation() { + return location; + } + + public String getBucket() { + return bucket; + } + + public FolderLocationBucketBuilder setFolder(String folder) { + this.folder = folder; + return this; + } + + public FolderLocationBucketBuilder setLocation(String location) { + this.location = location; + return this; + } + + public FolderLocationBucketBuilder setBucket(String bucket) { + this.bucket = bucket; + return this; + } + + public LogBucketName build() { + return new LogBucketName(this); + } + } + + /** Builder for billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}. */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class BillingAccountLocationBucketBuilder { + + private String billingAccount; + private String location; + private String bucket; + + private BillingAccountLocationBucketBuilder() {} + + public String getBillingAccount() { + return billingAccount; + } + + public String getLocation() { + return location; + } + + public String getBucket() { + return bucket; + } + + public BillingAccountLocationBucketBuilder setBillingAccount(String billingAccount) { + this.billingAccount = billingAccount; + return this; + } + + public BillingAccountLocationBucketBuilder setLocation(String location) { + this.location = location; + return this; + } + + public BillingAccountLocationBucketBuilder setBucket(String bucket) { + this.bucket = bucket; + return this; + } + + public LogBucketName build() { + return new LogBucketName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + LogBucketName that = (LogBucketName) o; + return (Objects.equals(this.project, that.project)) + && (Objects.equals(this.location, that.location)) + && (Objects.equals(this.bucket, that.bucket)) + && (Objects.equals(this.organization, that.organization)) + && (Objects.equals(this.folder, that.folder)) + && (Objects.equals(this.billingAccount, that.billingAccount)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(bucket); + h *= 1000003; + h ^= Objects.hashCode(organization); + h *= 1000003; + h ^= Objects.hashCode(folder); + h *= 1000003; + h ^= Objects.hashCode(billingAccount); + return h; + } +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogBucketOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogBucketOrBuilder.java new file mode 100644 index 000000000..d67d519b6 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogBucketOrBuilder.java @@ -0,0 +1,215 @@ +/* + * Copyright 2020 Google LLC + * + * 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 + * + * https://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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging_config.proto + +package com.google.logging.v2; + +public interface LogBucketOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.LogBucket) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The resource name of the bucket.
+   * For example:
+   * "projects/my-project-id/locations/my-location/buckets/my-bucket-id The
+   * supported locations are:
+   *   "global"
+   *   "us-central1"
+   * For the location of `global` it is unspecified where logs are actually
+   * stored.
+   * Once a bucket has been created, the location can not be changed.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * The resource name of the bucket.
+   * For example:
+   * "projects/my-project-id/locations/my-location/buckets/my-bucket-id The
+   * supported locations are:
+   *   "global"
+   *   "us-central1"
+   * For the location of `global` it is unspecified where logs are actually
+   * stored.
+   * Once a bucket has been created, the location can not be changed.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Describes this bucket.
+   * 
+ * + * string description = 3; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * Describes this bucket.
+   * 
+ * + * string description = 3; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Output only. The creation timestamp of the bucket. This is not set for any of the
+   * default buckets.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The creation timestamp of the bucket. This is not set for any of the
+   * default buckets.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The creation timestamp of the bucket. This is not set for any of the
+   * default buckets.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The last update timestamp of the bucket.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. The last update timestamp of the bucket.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. The last update timestamp of the bucket.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Logs will be retained by default for this amount of time, after which they
+   * will automatically be deleted. The minimum retention period is 1 day.
+   * If this value is set to zero at bucket creation time, the default time of
+   * 30 days will be used.
+   * 
+ * + * int32 retention_days = 11; + * + * @return The retentionDays. + */ + int getRetentionDays(); + + /** + * + * + *
+   * Output only. The bucket lifecycle state.
+   * 
+ * + * + * .google.logging.v2.LifecycleState lifecycle_state = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for lifecycleState. + */ + int getLifecycleStateValue(); + /** + * + * + *
+   * Output only. The bucket lifecycle state.
+   * 
+ * + * + * .google.logging.v2.LifecycleState lifecycle_state = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The lifecycleState. + */ + com.google.logging.v2.LifecycleState getLifecycleState(); +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntry.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntry.java index 3138e7279..f07648f98 100644 --- a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntry.java +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntry.java @@ -242,22 +242,6 @@ private LogEntry( receiveTimestamp_ = subBuilder.buildPartial(); } - break; - } - case 202: - { - com.google.api.MonitoredResourceMetadata.Builder subBuilder = null; - if (metadata_ != null) { - subBuilder = metadata_.toBuilder(); - } - metadata_ = - input.readMessage( - com.google.api.MonitoredResourceMetadata.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(metadata_); - metadata_ = subBuilder.buildPartial(); - } - break; } case 218: @@ -377,9 +361,9 @@ public PayloadCase getPayloadCase() { * "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" * "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" * "folders/[FOLDER_ID]/logs/[LOG_ID]" - * A project number may optionally be used in place of PROJECT_ID. The project - * number is translated to its corresponding PROJECT_ID internally and the - * `log_name` field will contain PROJECT_ID in queries and exports. + * A project number may be used in place of PROJECT_ID. The project number is + * translated to its corresponding PROJECT_ID internally and the `log_name` + * field will contain PROJECT_ID in queries and exports. * `[LOG_ID]` must be URL-encoded within `log_name`. Example: * `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`. * `[LOG_ID]` must be less than 512 characters long and can only include the @@ -392,7 +376,7 @@ public PayloadCase getPayloadCase() { * any results. * * - * string log_name = 12; + * string log_name = 12 [(.google.api.field_behavior) = REQUIRED]; * * @return The logName. */ @@ -416,9 +400,9 @@ public java.lang.String getLogName() { * "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" * "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" * "folders/[FOLDER_ID]/logs/[LOG_ID]" - * A project number may optionally be used in place of PROJECT_ID. The project - * number is translated to its corresponding PROJECT_ID internally and the - * `log_name` field will contain PROJECT_ID in queries and exports. + * A project number may be used in place of PROJECT_ID. The project number is + * translated to its corresponding PROJECT_ID internally and the `log_name` + * field will contain PROJECT_ID in queries and exports. * `[LOG_ID]` must be URL-encoded within `log_name`. Example: * `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`. * `[LOG_ID]` must be less than 512 characters long and can only include the @@ -431,7 +415,7 @@ public java.lang.String getLogName() { * any results. * * - * string log_name = 12; + * string log_name = 12 [(.google.api.field_behavior) = REQUIRED]; * * @return The bytes for logName. */ @@ -459,7 +443,8 @@ public com.google.protobuf.ByteString getLogNameBytes() { * the error. * * - * .google.api.MonitoredResource resource = 8; + * .google.api.MonitoredResource resource = 8 [(.google.api.field_behavior) = REQUIRED]; + * * * @return Whether the resource field is set. */ @@ -476,7 +461,8 @@ public boolean hasResource() { * the error. * * - * .google.api.MonitoredResource resource = 8; + * .google.api.MonitoredResource resource = 8 [(.google.api.field_behavior) = REQUIRED]; + * * * @return The resource. */ @@ -493,7 +479,8 @@ public com.google.api.MonitoredResource getResource() { * the error. * * - * .google.api.MonitoredResource resource = 8; + * .google.api.MonitoredResource resource = 8 [(.google.api.field_behavior) = REQUIRED]; + * */ public com.google.api.MonitoredResourceOrBuilder getResourceOrBuilder() { return getResource(); @@ -675,12 +662,11 @@ public com.google.protobuf.StructOrBuilder getJsonPayloadOrBuilder() { * * *
-   * Optional. The time the event described by the log entry occurred.  This
-   * time is used to compute the log entry's age and to enforce the logs
-   * retention period. If this field is omitted in a new log entry, then Logging
-   * assigns it the current time.  Timestamps have nanosecond accuracy, but
-   * trailing zeros in the fractional seconds might be omitted when the
-   * timestamp is displayed.
+   * Optional. The time the event described by the log entry occurred. This time is used
+   * to compute the log entry's age and to enforce the logs retention period.
+   * If this field is omitted in a new log entry, then Logging assigns it the
+   * current time. Timestamps have nanosecond accuracy, but trailing zeros in
+   * the fractional seconds might be omitted when the timestamp is displayed.
    * Incoming log entries should have timestamps that are no more than the [logs
    * retention period](/logging/quotas) in the past, and no more than 24 hours
    * in the future. Log entries outside those time boundaries will not be
@@ -688,7 +674,8 @@ public com.google.protobuf.StructOrBuilder getJsonPayloadOrBuilder() {
    * [exported with LogSinks](/logging/docs/api/tasks/exporting-logs).
    * 
* - * .google.protobuf.Timestamp timestamp = 9; + * .google.protobuf.Timestamp timestamp = 9 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return Whether the timestamp field is set. */ @@ -699,12 +686,11 @@ public boolean hasTimestamp() { * * *
-   * Optional. The time the event described by the log entry occurred.  This
-   * time is used to compute the log entry's age and to enforce the logs
-   * retention period. If this field is omitted in a new log entry, then Logging
-   * assigns it the current time.  Timestamps have nanosecond accuracy, but
-   * trailing zeros in the fractional seconds might be omitted when the
-   * timestamp is displayed.
+   * Optional. The time the event described by the log entry occurred. This time is used
+   * to compute the log entry's age and to enforce the logs retention period.
+   * If this field is omitted in a new log entry, then Logging assigns it the
+   * current time. Timestamps have nanosecond accuracy, but trailing zeros in
+   * the fractional seconds might be omitted when the timestamp is displayed.
    * Incoming log entries should have timestamps that are no more than the [logs
    * retention period](/logging/quotas) in the past, and no more than 24 hours
    * in the future. Log entries outside those time boundaries will not be
@@ -712,7 +698,8 @@ public boolean hasTimestamp() {
    * [exported with LogSinks](/logging/docs/api/tasks/exporting-logs).
    * 
* - * .google.protobuf.Timestamp timestamp = 9; + * .google.protobuf.Timestamp timestamp = 9 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return The timestamp. */ @@ -723,12 +710,11 @@ public com.google.protobuf.Timestamp getTimestamp() { * * *
-   * Optional. The time the event described by the log entry occurred.  This
-   * time is used to compute the log entry's age and to enforce the logs
-   * retention period. If this field is omitted in a new log entry, then Logging
-   * assigns it the current time.  Timestamps have nanosecond accuracy, but
-   * trailing zeros in the fractional seconds might be omitted when the
-   * timestamp is displayed.
+   * Optional. The time the event described by the log entry occurred. This time is used
+   * to compute the log entry's age and to enforce the logs retention period.
+   * If this field is omitted in a new log entry, then Logging assigns it the
+   * current time. Timestamps have nanosecond accuracy, but trailing zeros in
+   * the fractional seconds might be omitted when the timestamp is displayed.
    * Incoming log entries should have timestamps that are no more than the [logs
    * retention period](/logging/quotas) in the past, and no more than 24 hours
    * in the future. Log entries outside those time boundaries will not be
@@ -736,7 +722,8 @@ public com.google.protobuf.Timestamp getTimestamp() {
    * [exported with LogSinks](/logging/docs/api/tasks/exporting-logs).
    * 
* - * .google.protobuf.Timestamp timestamp = 9; + * .google.protobuf.Timestamp timestamp = 9 [(.google.api.field_behavior) = OPTIONAL]; + * */ public com.google.protobuf.TimestampOrBuilder getTimestampOrBuilder() { return getTimestamp(); @@ -751,7 +738,9 @@ public com.google.protobuf.TimestampOrBuilder getTimestampOrBuilder() { * Output only. The time the log entry was received by Logging. * * - * .google.protobuf.Timestamp receive_timestamp = 24; + * + * .google.protobuf.Timestamp receive_timestamp = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return Whether the receiveTimestamp field is set. */ @@ -765,7 +754,9 @@ public boolean hasReceiveTimestamp() { * Output only. The time the log entry was received by Logging. * * - * .google.protobuf.Timestamp receive_timestamp = 24; + * + * .google.protobuf.Timestamp receive_timestamp = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return The receiveTimestamp. */ @@ -781,7 +772,9 @@ public com.google.protobuf.Timestamp getReceiveTimestamp() { * Output only. The time the log entry was received by Logging. * * - * .google.protobuf.Timestamp receive_timestamp = 24; + * + * .google.protobuf.Timestamp receive_timestamp = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ public com.google.protobuf.TimestampOrBuilder getReceiveTimestampOrBuilder() { return getReceiveTimestamp(); @@ -793,11 +786,11 @@ public com.google.protobuf.TimestampOrBuilder getReceiveTimestampOrBuilder() { * * *
-   * Optional. The severity of the log entry. The default value is
-   * `LogSeverity.DEFAULT`.
+   * Optional. The severity of the log entry. The default value is `LogSeverity.DEFAULT`.
    * 
* - * .google.logging.type.LogSeverity severity = 10; + * .google.logging.type.LogSeverity severity = 10 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return The enum numeric value on the wire for severity. */ @@ -808,11 +801,11 @@ public int getSeverityValue() { * * *
-   * Optional. The severity of the log entry. The default value is
-   * `LogSeverity.DEFAULT`.
+   * Optional. The severity of the log entry. The default value is `LogSeverity.DEFAULT`.
    * 
* - * .google.logging.type.LogSeverity severity = 10; + * .google.logging.type.LogSeverity severity = 10 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return The severity. */ @@ -829,8 +822,8 @@ public com.google.logging.type.LogSeverity getSeverity() { * * *
-   * Optional. A unique identifier for the log entry. If you provide a value,
-   * then Logging considers other log entries in the same project, with the same
+   * Optional. A unique identifier for the log entry. If you provide a value, then
+   * Logging considers other log entries in the same project, with the same
    * `timestamp`, and with the same `insert_id` to be duplicates which are
    * removed in a single query result. However, there are no guarantees of
    * de-duplication in the export of logs.
@@ -840,7 +833,7 @@ public com.google.logging.type.LogSeverity getSeverity() {
    * the same `log_name` and `timestamp` values.
    * 
* - * string insert_id = 4; + * string insert_id = 4 [(.google.api.field_behavior) = OPTIONAL]; * * @return The insertId. */ @@ -859,8 +852,8 @@ public java.lang.String getInsertId() { * * *
-   * Optional. A unique identifier for the log entry. If you provide a value,
-   * then Logging considers other log entries in the same project, with the same
+   * Optional. A unique identifier for the log entry. If you provide a value, then
+   * Logging considers other log entries in the same project, with the same
    * `timestamp`, and with the same `insert_id` to be duplicates which are
    * removed in a single query result. However, there are no guarantees of
    * de-duplication in the export of logs.
@@ -870,7 +863,7 @@ public java.lang.String getInsertId() {
    * the same `log_name` and `timestamp` values.
    * 
* - * string insert_id = 4; + * string insert_id = 4 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for insertId. */ @@ -892,11 +885,13 @@ public com.google.protobuf.ByteString getInsertIdBytes() { * * *
-   * Optional. Information about the HTTP request associated with this log
-   * entry, if applicable.
+   * Optional. Information about the HTTP request associated with this log entry, if
+   * applicable.
    * 
* - * .google.logging.type.HttpRequest http_request = 7; + * + * .google.logging.type.HttpRequest http_request = 7 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return Whether the httpRequest field is set. */ @@ -907,11 +902,13 @@ public boolean hasHttpRequest() { * * *
-   * Optional. Information about the HTTP request associated with this log
-   * entry, if applicable.
+   * Optional. Information about the HTTP request associated with this log entry, if
+   * applicable.
    * 
* - * .google.logging.type.HttpRequest http_request = 7; + * + * .google.logging.type.HttpRequest http_request = 7 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return The httpRequest. */ @@ -924,11 +921,13 @@ public com.google.logging.type.HttpRequest getHttpRequest() { * * *
-   * Optional. Information about the HTTP request associated with this log
-   * entry, if applicable.
+   * Optional. Information about the HTTP request associated with this log entry, if
+   * applicable.
    * 
* - * .google.logging.type.HttpRequest http_request = 7; + * + * .google.logging.type.HttpRequest http_request = 7 [(.google.api.field_behavior) = OPTIONAL]; + * */ public com.google.logging.type.HttpRequestOrBuilder getHttpRequestOrBuilder() { return getHttpRequest(); @@ -967,7 +966,7 @@ public int getLabelsCount() { * information about the log entry. * * - * map<string, string> labels = 11; + * map<string, string> labels = 11 [(.google.api.field_behavior) = OPTIONAL]; */ public boolean containsLabels(java.lang.String key) { if (key == null) { @@ -988,7 +987,7 @@ public java.util.Map getLabels() { * information about the log entry. * * - * map<string, string> labels = 11; + * map<string, string> labels = 11 [(.google.api.field_behavior) = OPTIONAL]; */ public java.util.Map getLabelsMap() { return internalGetLabels().getMap(); @@ -1001,7 +1000,7 @@ public java.util.Map getLabelsMap() { * information about the log entry. * * - * map<string, string> labels = 11; + * map<string, string> labels = 11 [(.google.api.field_behavior) = OPTIONAL]; */ public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { if (key == null) { @@ -1018,7 +1017,7 @@ public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.Strin * information about the log entry. * * - * map<string, string> labels = 11; + * map<string, string> labels = 11 [(.google.api.field_behavior) = OPTIONAL]; */ public java.lang.String getLabelsOrThrow(java.lang.String key) { if (key == null) { @@ -1031,75 +1030,6 @@ public java.lang.String getLabelsOrThrow(java.lang.String key) { return map.get(key); } - public static final int METADATA_FIELD_NUMBER = 25; - private com.google.api.MonitoredResourceMetadata metadata_; - /** - * - * - *
-   * Deprecated. Output only. Additional metadata about the monitored resource.
-   * Only `k8s_container`, `k8s_pod`, and `k8s_node` MonitoredResources have
-   * this field populated for GKE versions older than 1.12.6. For GKE versions
-   * 1.12.6 and above, the `metadata` field has been deprecated. The Kubernetes
-   * pod labels that used to be in `metadata.userLabels` will now be present in
-   * the `labels` field with a key prefix of `k8s-pod/`. The Stackdriver system
-   * labels that were present in the `metadata.systemLabels` field will no
-   * longer be available in the LogEntry.
-   * 
- * - * .google.api.MonitoredResourceMetadata metadata = 25 [deprecated = true]; - * - * @return Whether the metadata field is set. - */ - @java.lang.Deprecated - public boolean hasMetadata() { - return metadata_ != null; - } - /** - * - * - *
-   * Deprecated. Output only. Additional metadata about the monitored resource.
-   * Only `k8s_container`, `k8s_pod`, and `k8s_node` MonitoredResources have
-   * this field populated for GKE versions older than 1.12.6. For GKE versions
-   * 1.12.6 and above, the `metadata` field has been deprecated. The Kubernetes
-   * pod labels that used to be in `metadata.userLabels` will now be present in
-   * the `labels` field with a key prefix of `k8s-pod/`. The Stackdriver system
-   * labels that were present in the `metadata.systemLabels` field will no
-   * longer be available in the LogEntry.
-   * 
- * - * .google.api.MonitoredResourceMetadata metadata = 25 [deprecated = true]; - * - * @return The metadata. - */ - @java.lang.Deprecated - public com.google.api.MonitoredResourceMetadata getMetadata() { - return metadata_ == null - ? com.google.api.MonitoredResourceMetadata.getDefaultInstance() - : metadata_; - } - /** - * - * - *
-   * Deprecated. Output only. Additional metadata about the monitored resource.
-   * Only `k8s_container`, `k8s_pod`, and `k8s_node` MonitoredResources have
-   * this field populated for GKE versions older than 1.12.6. For GKE versions
-   * 1.12.6 and above, the `metadata` field has been deprecated. The Kubernetes
-   * pod labels that used to be in `metadata.userLabels` will now be present in
-   * the `labels` field with a key prefix of `k8s-pod/`. The Stackdriver system
-   * labels that were present in the `metadata.systemLabels` field will no
-   * longer be available in the LogEntry.
-   * 
- * - * .google.api.MonitoredResourceMetadata metadata = 25 [deprecated = true]; - */ - @java.lang.Deprecated - public com.google.api.MonitoredResourceMetadataOrBuilder getMetadataOrBuilder() { - return getMetadata(); - } - public static final int OPERATION_FIELD_NUMBER = 15; private com.google.logging.v2.LogEntryOperation operation_; /** @@ -1110,7 +1040,9 @@ public com.google.api.MonitoredResourceMetadataOrBuilder getMetadataOrBuilder() * applicable. * * - * .google.logging.v2.LogEntryOperation operation = 15; + * + * .google.logging.v2.LogEntryOperation operation = 15 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return Whether the operation field is set. */ @@ -1125,7 +1057,9 @@ public boolean hasOperation() { * applicable. * * - * .google.logging.v2.LogEntryOperation operation = 15; + * + * .google.logging.v2.LogEntryOperation operation = 15 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return The operation. */ @@ -1142,7 +1076,9 @@ public com.google.logging.v2.LogEntryOperation getOperation() { * applicable. * * - * .google.logging.v2.LogEntryOperation operation = 15; + * + * .google.logging.v2.LogEntryOperation operation = 15 [(.google.api.field_behavior) = OPTIONAL]; + * */ public com.google.logging.v2.LogEntryOperationOrBuilder getOperationOrBuilder() { return getOperation(); @@ -1154,13 +1090,13 @@ public com.google.logging.v2.LogEntryOperationOrBuilder getOperationOrBuilder() * * *
-   * Optional. Resource name of the trace associated with the log entry, if any.
-   * If it contains a relative resource name, the name is assumed to be relative
-   * to `//tracing.googleapis.com`. Example:
+   * Optional. Resource name of the trace associated with the log entry, if any. If it
+   * contains a relative resource name, the name is assumed to be relative to
+   * `//tracing.googleapis.com`. Example:
    * `projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824`
    * 
* - * string trace = 22; + * string trace = 22 [(.google.api.field_behavior) = OPTIONAL]; * * @return The trace. */ @@ -1179,13 +1115,13 @@ public java.lang.String getTrace() { * * *
-   * Optional. Resource name of the trace associated with the log entry, if any.
-   * If it contains a relative resource name, the name is assumed to be relative
-   * to `//tracing.googleapis.com`. Example:
+   * Optional. Resource name of the trace associated with the log entry, if any. If it
+   * contains a relative resource name, the name is assumed to be relative to
+   * `//tracing.googleapis.com`. Example:
    * `projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824`
    * 
* - * string trace = 22; + * string trace = 22 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for trace. */ @@ -1210,10 +1146,10 @@ public com.google.protobuf.ByteString getTraceBytes() { * Optional. The span ID within the trace associated with the log entry. * For Trace spans, this is the same format that the Trace API v2 uses: a * 16-character hexadecimal encoding of an 8-byte array, such as - * <code>"000000000000004a"</code>. + * `000000000000004a`. * * - * string span_id = 27; + * string span_id = 27 [(.google.api.field_behavior) = OPTIONAL]; * * @return The spanId. */ @@ -1235,10 +1171,10 @@ public java.lang.String getSpanId() { * Optional. The span ID within the trace associated with the log entry. * For Trace spans, this is the same format that the Trace API v2 uses: a * 16-character hexadecimal encoding of an 8-byte array, such as - * <code>"000000000000004a"</code>. + * `000000000000004a`. * * - * string span_id = 27; + * string span_id = 27 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for spanId. */ @@ -1268,7 +1204,7 @@ public com.google.protobuf.ByteString getSpanIdBytes() { * request correlation identifier. The default is False. * * - * bool trace_sampled = 30; + * bool trace_sampled = 30 [(.google.api.field_behavior) = OPTIONAL]; * * @return The traceSampled. */ @@ -1282,11 +1218,12 @@ public boolean getTraceSampled() { * * *
-   * Optional. Source code location information associated with the log entry,
-   * if any.
+   * Optional. Source code location information associated with the log entry, if any.
    * 
* - * .google.logging.v2.LogEntrySourceLocation source_location = 23; + * + * .google.logging.v2.LogEntrySourceLocation source_location = 23 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return Whether the sourceLocation field is set. */ @@ -1297,11 +1234,12 @@ public boolean hasSourceLocation() { * * *
-   * Optional. Source code location information associated with the log entry,
-   * if any.
+   * Optional. Source code location information associated with the log entry, if any.
    * 
* - * .google.logging.v2.LogEntrySourceLocation source_location = 23; + * + * .google.logging.v2.LogEntrySourceLocation source_location = 23 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return The sourceLocation. */ @@ -1314,11 +1252,12 @@ public com.google.logging.v2.LogEntrySourceLocation getSourceLocation() { * * *
-   * Optional. Source code location information associated with the log entry,
-   * if any.
+   * Optional. Source code location information associated with the log entry, if any.
    * 
* - * .google.logging.v2.LogEntrySourceLocation source_location = 23; + * + * .google.logging.v2.LogEntrySourceLocation source_location = 23 [(.google.api.field_behavior) = OPTIONAL]; + * */ public com.google.logging.v2.LogEntrySourceLocationOrBuilder getSourceLocationOrBuilder() { return getSourceLocation(); @@ -1379,9 +1318,6 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (receiveTimestamp_ != null) { output.writeMessage(24, getReceiveTimestamp()); } - if (metadata_ != null) { - output.writeMessage(25, getMetadata()); - } if (!getSpanIdBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 27, spanId_); } @@ -1450,9 +1386,6 @@ public int getSerializedSize() { if (receiveTimestamp_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(24, getReceiveTimestamp()); } - if (metadata_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(25, getMetadata()); - } if (!getSpanIdBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(27, spanId_); } @@ -1494,10 +1427,6 @@ public boolean equals(final java.lang.Object obj) { if (!getHttpRequest().equals(other.getHttpRequest())) return false; } if (!internalGetLabels().equals(other.internalGetLabels())) return false; - if (hasMetadata() != other.hasMetadata()) return false; - if (hasMetadata()) { - if (!getMetadata().equals(other.getMetadata())) return false; - } if (hasOperation() != other.hasOperation()) return false; if (hasOperation()) { if (!getOperation().equals(other.getOperation())) return false; @@ -1560,10 +1489,6 @@ public int hashCode() { hash = (37 * hash) + LABELS_FIELD_NUMBER; hash = (53 * hash) + internalGetLabels().hashCode(); } - if (hasMetadata()) { - hash = (37 * hash) + METADATA_FIELD_NUMBER; - hash = (53 * hash) + getMetadata().hashCode(); - } if (hasOperation()) { hash = (37 * hash) + OPERATION_FIELD_NUMBER; hash = (53 * hash) + getOperation().hashCode(); @@ -1788,12 +1713,6 @@ public Builder clear() { httpRequestBuilder_ = null; } internalGetMutableLabels().clear(); - if (metadataBuilder_ == null) { - metadata_ = null; - } else { - metadata_ = null; - metadataBuilder_ = null; - } if (operationBuilder_ == null) { operation_ = null; } else { @@ -1883,11 +1802,6 @@ public com.google.logging.v2.LogEntry buildPartial() { } result.labels_ = internalGetLabels(); result.labels_.makeImmutable(); - if (metadataBuilder_ == null) { - result.metadata_ = metadata_; - } else { - result.metadata_ = metadataBuilder_.build(); - } if (operationBuilder_ == null) { result.operation_ = operation_; } else { @@ -1975,9 +1889,6 @@ public Builder mergeFrom(com.google.logging.v2.LogEntry other) { mergeHttpRequest(other.getHttpRequest()); } internalGetMutableLabels().mergeFrom(other.internalGetLabels()); - if (other.hasMetadata()) { - mergeMetadata(other.getMetadata()); - } if (other.hasOperation()) { mergeOperation(other.getOperation()); } @@ -2073,9 +1984,9 @@ public Builder clearPayload() { * "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" * "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" * "folders/[FOLDER_ID]/logs/[LOG_ID]" - * A project number may optionally be used in place of PROJECT_ID. The project - * number is translated to its corresponding PROJECT_ID internally and the - * `log_name` field will contain PROJECT_ID in queries and exports. + * A project number may be used in place of PROJECT_ID. The project number is + * translated to its corresponding PROJECT_ID internally and the `log_name` + * field will contain PROJECT_ID in queries and exports. * `[LOG_ID]` must be URL-encoded within `log_name`. Example: * `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`. * `[LOG_ID]` must be less than 512 characters long and can only include the @@ -2088,7 +1999,7 @@ public Builder clearPayload() { * any results. * * - * string log_name = 12; + * string log_name = 12 [(.google.api.field_behavior) = REQUIRED]; * * @return The logName. */ @@ -2112,9 +2023,9 @@ public java.lang.String getLogName() { * "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" * "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" * "folders/[FOLDER_ID]/logs/[LOG_ID]" - * A project number may optionally be used in place of PROJECT_ID. The project - * number is translated to its corresponding PROJECT_ID internally and the - * `log_name` field will contain PROJECT_ID in queries and exports. + * A project number may be used in place of PROJECT_ID. The project number is + * translated to its corresponding PROJECT_ID internally and the `log_name` + * field will contain PROJECT_ID in queries and exports. * `[LOG_ID]` must be URL-encoded within `log_name`. Example: * `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`. * `[LOG_ID]` must be less than 512 characters long and can only include the @@ -2127,7 +2038,7 @@ public java.lang.String getLogName() { * any results. * * - * string log_name = 12; + * string log_name = 12 [(.google.api.field_behavior) = REQUIRED]; * * @return The bytes for logName. */ @@ -2151,9 +2062,9 @@ public com.google.protobuf.ByteString getLogNameBytes() { * "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" * "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" * "folders/[FOLDER_ID]/logs/[LOG_ID]" - * A project number may optionally be used in place of PROJECT_ID. The project - * number is translated to its corresponding PROJECT_ID internally and the - * `log_name` field will contain PROJECT_ID in queries and exports. + * A project number may be used in place of PROJECT_ID. The project number is + * translated to its corresponding PROJECT_ID internally and the `log_name` + * field will contain PROJECT_ID in queries and exports. * `[LOG_ID]` must be URL-encoded within `log_name`. Example: * `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`. * `[LOG_ID]` must be less than 512 characters long and can only include the @@ -2166,7 +2077,7 @@ public com.google.protobuf.ByteString getLogNameBytes() { * any results. * * - * string log_name = 12; + * string log_name = 12 [(.google.api.field_behavior) = REQUIRED]; * * @param value The logName to set. * @return This builder for chaining. @@ -2189,9 +2100,9 @@ public Builder setLogName(java.lang.String value) { * "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" * "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" * "folders/[FOLDER_ID]/logs/[LOG_ID]" - * A project number may optionally be used in place of PROJECT_ID. The project - * number is translated to its corresponding PROJECT_ID internally and the - * `log_name` field will contain PROJECT_ID in queries and exports. + * A project number may be used in place of PROJECT_ID. The project number is + * translated to its corresponding PROJECT_ID internally and the `log_name` + * field will contain PROJECT_ID in queries and exports. * `[LOG_ID]` must be URL-encoded within `log_name`. Example: * `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`. * `[LOG_ID]` must be less than 512 characters long and can only include the @@ -2204,7 +2115,7 @@ public Builder setLogName(java.lang.String value) { * any results. * * - * string log_name = 12; + * string log_name = 12 [(.google.api.field_behavior) = REQUIRED]; * * @return This builder for chaining. */ @@ -2223,9 +2134,9 @@ public Builder clearLogName() { * "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" * "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" * "folders/[FOLDER_ID]/logs/[LOG_ID]" - * A project number may optionally be used in place of PROJECT_ID. The project - * number is translated to its corresponding PROJECT_ID internally and the - * `log_name` field will contain PROJECT_ID in queries and exports. + * A project number may be used in place of PROJECT_ID. The project number is + * translated to its corresponding PROJECT_ID internally and the `log_name` + * field will contain PROJECT_ID in queries and exports. * `[LOG_ID]` must be URL-encoded within `log_name`. Example: * `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`. * `[LOG_ID]` must be less than 512 characters long and can only include the @@ -2238,7 +2149,7 @@ public Builder clearLogName() { * any results. * * - * string log_name = 12; + * string log_name = 12 [(.google.api.field_behavior) = REQUIRED]; * * @param value The bytes for logName to set. * @return This builder for chaining. @@ -2270,7 +2181,8 @@ public Builder setLogNameBytes(com.google.protobuf.ByteString value) { * the error. * * - * .google.api.MonitoredResource resource = 8; + * .google.api.MonitoredResource resource = 8 [(.google.api.field_behavior) = REQUIRED]; + * * * @return Whether the resource field is set. */ @@ -2287,7 +2199,8 @@ public boolean hasResource() { * the error. * * - * .google.api.MonitoredResource resource = 8; + * .google.api.MonitoredResource resource = 8 [(.google.api.field_behavior) = REQUIRED]; + * * * @return The resource. */ @@ -2310,7 +2223,8 @@ public com.google.api.MonitoredResource getResource() { * the error. * * - * .google.api.MonitoredResource resource = 8; + * .google.api.MonitoredResource resource = 8 [(.google.api.field_behavior) = REQUIRED]; + * */ public Builder setResource(com.google.api.MonitoredResource value) { if (resourceBuilder_ == null) { @@ -2335,7 +2249,8 @@ public Builder setResource(com.google.api.MonitoredResource value) { * the error. * * - * .google.api.MonitoredResource resource = 8; + * .google.api.MonitoredResource resource = 8 [(.google.api.field_behavior) = REQUIRED]; + * */ public Builder setResource(com.google.api.MonitoredResource.Builder builderForValue) { if (resourceBuilder_ == null) { @@ -2357,7 +2272,8 @@ public Builder setResource(com.google.api.MonitoredResource.Builder builderForVa * the error. * * - * .google.api.MonitoredResource resource = 8; + * .google.api.MonitoredResource resource = 8 [(.google.api.field_behavior) = REQUIRED]; + * */ public Builder mergeResource(com.google.api.MonitoredResource value) { if (resourceBuilder_ == null) { @@ -2386,7 +2302,8 @@ public Builder mergeResource(com.google.api.MonitoredResource value) { * the error. * * - * .google.api.MonitoredResource resource = 8; + * .google.api.MonitoredResource resource = 8 [(.google.api.field_behavior) = REQUIRED]; + * */ public Builder clearResource() { if (resourceBuilder_ == null) { @@ -2409,7 +2326,8 @@ public Builder clearResource() { * the error. * * - * .google.api.MonitoredResource resource = 8; + * .google.api.MonitoredResource resource = 8 [(.google.api.field_behavior) = REQUIRED]; + * */ public com.google.api.MonitoredResource.Builder getResourceBuilder() { @@ -2426,7 +2344,8 @@ public com.google.api.MonitoredResource.Builder getResourceBuilder() { * the error. * * - * .google.api.MonitoredResource resource = 8; + * .google.api.MonitoredResource resource = 8 [(.google.api.field_behavior) = REQUIRED]; + * */ public com.google.api.MonitoredResourceOrBuilder getResourceOrBuilder() { if (resourceBuilder_ != null) { @@ -2447,7 +2366,8 @@ public com.google.api.MonitoredResourceOrBuilder getResourceOrBuilder() { * the error. * * - * .google.api.MonitoredResource resource = 8; + * .google.api.MonitoredResource resource = 8 [(.google.api.field_behavior) = REQUIRED]; + * */ private com.google.protobuf.SingleFieldBuilderV3< com.google.api.MonitoredResource, @@ -3049,12 +2969,11 @@ public com.google.protobuf.StructOrBuilder getJsonPayloadOrBuilder() { * * *
-     * Optional. The time the event described by the log entry occurred.  This
-     * time is used to compute the log entry's age and to enforce the logs
-     * retention period. If this field is omitted in a new log entry, then Logging
-     * assigns it the current time.  Timestamps have nanosecond accuracy, but
-     * trailing zeros in the fractional seconds might be omitted when the
-     * timestamp is displayed.
+     * Optional. The time the event described by the log entry occurred. This time is used
+     * to compute the log entry's age and to enforce the logs retention period.
+     * If this field is omitted in a new log entry, then Logging assigns it the
+     * current time. Timestamps have nanosecond accuracy, but trailing zeros in
+     * the fractional seconds might be omitted when the timestamp is displayed.
      * Incoming log entries should have timestamps that are no more than the [logs
      * retention period](/logging/quotas) in the past, and no more than 24 hours
      * in the future. Log entries outside those time boundaries will not be
@@ -3062,7 +2981,8 @@ public com.google.protobuf.StructOrBuilder getJsonPayloadOrBuilder() {
      * [exported with LogSinks](/logging/docs/api/tasks/exporting-logs).
      * 
* - * .google.protobuf.Timestamp timestamp = 9; + * .google.protobuf.Timestamp timestamp = 9 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return Whether the timestamp field is set. */ @@ -3073,12 +2993,11 @@ public boolean hasTimestamp() { * * *
-     * Optional. The time the event described by the log entry occurred.  This
-     * time is used to compute the log entry's age and to enforce the logs
-     * retention period. If this field is omitted in a new log entry, then Logging
-     * assigns it the current time.  Timestamps have nanosecond accuracy, but
-     * trailing zeros in the fractional seconds might be omitted when the
-     * timestamp is displayed.
+     * Optional. The time the event described by the log entry occurred. This time is used
+     * to compute the log entry's age and to enforce the logs retention period.
+     * If this field is omitted in a new log entry, then Logging assigns it the
+     * current time. Timestamps have nanosecond accuracy, but trailing zeros in
+     * the fractional seconds might be omitted when the timestamp is displayed.
      * Incoming log entries should have timestamps that are no more than the [logs
      * retention period](/logging/quotas) in the past, and no more than 24 hours
      * in the future. Log entries outside those time boundaries will not be
@@ -3086,7 +3005,8 @@ public boolean hasTimestamp() {
      * [exported with LogSinks](/logging/docs/api/tasks/exporting-logs).
      * 
* - * .google.protobuf.Timestamp timestamp = 9; + * .google.protobuf.Timestamp timestamp = 9 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return The timestamp. */ @@ -3101,12 +3021,11 @@ public com.google.protobuf.Timestamp getTimestamp() { * * *
-     * Optional. The time the event described by the log entry occurred.  This
-     * time is used to compute the log entry's age and to enforce the logs
-     * retention period. If this field is omitted in a new log entry, then Logging
-     * assigns it the current time.  Timestamps have nanosecond accuracy, but
-     * trailing zeros in the fractional seconds might be omitted when the
-     * timestamp is displayed.
+     * Optional. The time the event described by the log entry occurred. This time is used
+     * to compute the log entry's age and to enforce the logs retention period.
+     * If this field is omitted in a new log entry, then Logging assigns it the
+     * current time. Timestamps have nanosecond accuracy, but trailing zeros in
+     * the fractional seconds might be omitted when the timestamp is displayed.
      * Incoming log entries should have timestamps that are no more than the [logs
      * retention period](/logging/quotas) in the past, and no more than 24 hours
      * in the future. Log entries outside those time boundaries will not be
@@ -3114,7 +3033,8 @@ public com.google.protobuf.Timestamp getTimestamp() {
      * [exported with LogSinks](/logging/docs/api/tasks/exporting-logs).
      * 
* - * .google.protobuf.Timestamp timestamp = 9; + * .google.protobuf.Timestamp timestamp = 9 [(.google.api.field_behavior) = OPTIONAL]; + * */ public Builder setTimestamp(com.google.protobuf.Timestamp value) { if (timestampBuilder_ == null) { @@ -3133,12 +3053,11 @@ public Builder setTimestamp(com.google.protobuf.Timestamp value) { * * *
-     * Optional. The time the event described by the log entry occurred.  This
-     * time is used to compute the log entry's age and to enforce the logs
-     * retention period. If this field is omitted in a new log entry, then Logging
-     * assigns it the current time.  Timestamps have nanosecond accuracy, but
-     * trailing zeros in the fractional seconds might be omitted when the
-     * timestamp is displayed.
+     * Optional. The time the event described by the log entry occurred. This time is used
+     * to compute the log entry's age and to enforce the logs retention period.
+     * If this field is omitted in a new log entry, then Logging assigns it the
+     * current time. Timestamps have nanosecond accuracy, but trailing zeros in
+     * the fractional seconds might be omitted when the timestamp is displayed.
      * Incoming log entries should have timestamps that are no more than the [logs
      * retention period](/logging/quotas) in the past, and no more than 24 hours
      * in the future. Log entries outside those time boundaries will not be
@@ -3146,7 +3065,8 @@ public Builder setTimestamp(com.google.protobuf.Timestamp value) {
      * [exported with LogSinks](/logging/docs/api/tasks/exporting-logs).
      * 
* - * .google.protobuf.Timestamp timestamp = 9; + * .google.protobuf.Timestamp timestamp = 9 [(.google.api.field_behavior) = OPTIONAL]; + * */ public Builder setTimestamp(com.google.protobuf.Timestamp.Builder builderForValue) { if (timestampBuilder_ == null) { @@ -3162,12 +3082,11 @@ public Builder setTimestamp(com.google.protobuf.Timestamp.Builder builderForValu * * *
-     * Optional. The time the event described by the log entry occurred.  This
-     * time is used to compute the log entry's age and to enforce the logs
-     * retention period. If this field is omitted in a new log entry, then Logging
-     * assigns it the current time.  Timestamps have nanosecond accuracy, but
-     * trailing zeros in the fractional seconds might be omitted when the
-     * timestamp is displayed.
+     * Optional. The time the event described by the log entry occurred. This time is used
+     * to compute the log entry's age and to enforce the logs retention period.
+     * If this field is omitted in a new log entry, then Logging assigns it the
+     * current time. Timestamps have nanosecond accuracy, but trailing zeros in
+     * the fractional seconds might be omitted when the timestamp is displayed.
      * Incoming log entries should have timestamps that are no more than the [logs
      * retention period](/logging/quotas) in the past, and no more than 24 hours
      * in the future. Log entries outside those time boundaries will not be
@@ -3175,7 +3094,8 @@ public Builder setTimestamp(com.google.protobuf.Timestamp.Builder builderForValu
      * [exported with LogSinks](/logging/docs/api/tasks/exporting-logs).
      * 
* - * .google.protobuf.Timestamp timestamp = 9; + * .google.protobuf.Timestamp timestamp = 9 [(.google.api.field_behavior) = OPTIONAL]; + * */ public Builder mergeTimestamp(com.google.protobuf.Timestamp value) { if (timestampBuilder_ == null) { @@ -3196,12 +3116,11 @@ public Builder mergeTimestamp(com.google.protobuf.Timestamp value) { * * *
-     * Optional. The time the event described by the log entry occurred.  This
-     * time is used to compute the log entry's age and to enforce the logs
-     * retention period. If this field is omitted in a new log entry, then Logging
-     * assigns it the current time.  Timestamps have nanosecond accuracy, but
-     * trailing zeros in the fractional seconds might be omitted when the
-     * timestamp is displayed.
+     * Optional. The time the event described by the log entry occurred. This time is used
+     * to compute the log entry's age and to enforce the logs retention period.
+     * If this field is omitted in a new log entry, then Logging assigns it the
+     * current time. Timestamps have nanosecond accuracy, but trailing zeros in
+     * the fractional seconds might be omitted when the timestamp is displayed.
      * Incoming log entries should have timestamps that are no more than the [logs
      * retention period](/logging/quotas) in the past, and no more than 24 hours
      * in the future. Log entries outside those time boundaries will not be
@@ -3209,7 +3128,8 @@ public Builder mergeTimestamp(com.google.protobuf.Timestamp value) {
      * [exported with LogSinks](/logging/docs/api/tasks/exporting-logs).
      * 
* - * .google.protobuf.Timestamp timestamp = 9; + * .google.protobuf.Timestamp timestamp = 9 [(.google.api.field_behavior) = OPTIONAL]; + * */ public Builder clearTimestamp() { if (timestampBuilder_ == null) { @@ -3226,12 +3146,11 @@ public Builder clearTimestamp() { * * *
-     * Optional. The time the event described by the log entry occurred.  This
-     * time is used to compute the log entry's age and to enforce the logs
-     * retention period. If this field is omitted in a new log entry, then Logging
-     * assigns it the current time.  Timestamps have nanosecond accuracy, but
-     * trailing zeros in the fractional seconds might be omitted when the
-     * timestamp is displayed.
+     * Optional. The time the event described by the log entry occurred. This time is used
+     * to compute the log entry's age and to enforce the logs retention period.
+     * If this field is omitted in a new log entry, then Logging assigns it the
+     * current time. Timestamps have nanosecond accuracy, but trailing zeros in
+     * the fractional seconds might be omitted when the timestamp is displayed.
      * Incoming log entries should have timestamps that are no more than the [logs
      * retention period](/logging/quotas) in the past, and no more than 24 hours
      * in the future. Log entries outside those time boundaries will not be
@@ -3239,7 +3158,8 @@ public Builder clearTimestamp() {
      * [exported with LogSinks](/logging/docs/api/tasks/exporting-logs).
      * 
* - * .google.protobuf.Timestamp timestamp = 9; + * .google.protobuf.Timestamp timestamp = 9 [(.google.api.field_behavior) = OPTIONAL]; + * */ public com.google.protobuf.Timestamp.Builder getTimestampBuilder() { @@ -3250,12 +3170,11 @@ public com.google.protobuf.Timestamp.Builder getTimestampBuilder() { * * *
-     * Optional. The time the event described by the log entry occurred.  This
-     * time is used to compute the log entry's age and to enforce the logs
-     * retention period. If this field is omitted in a new log entry, then Logging
-     * assigns it the current time.  Timestamps have nanosecond accuracy, but
-     * trailing zeros in the fractional seconds might be omitted when the
-     * timestamp is displayed.
+     * Optional. The time the event described by the log entry occurred. This time is used
+     * to compute the log entry's age and to enforce the logs retention period.
+     * If this field is omitted in a new log entry, then Logging assigns it the
+     * current time. Timestamps have nanosecond accuracy, but trailing zeros in
+     * the fractional seconds might be omitted when the timestamp is displayed.
      * Incoming log entries should have timestamps that are no more than the [logs
      * retention period](/logging/quotas) in the past, and no more than 24 hours
      * in the future. Log entries outside those time boundaries will not be
@@ -3263,7 +3182,8 @@ public com.google.protobuf.Timestamp.Builder getTimestampBuilder() {
      * [exported with LogSinks](/logging/docs/api/tasks/exporting-logs).
      * 
* - * .google.protobuf.Timestamp timestamp = 9; + * .google.protobuf.Timestamp timestamp = 9 [(.google.api.field_behavior) = OPTIONAL]; + * */ public com.google.protobuf.TimestampOrBuilder getTimestampOrBuilder() { if (timestampBuilder_ != null) { @@ -3276,12 +3196,11 @@ public com.google.protobuf.TimestampOrBuilder getTimestampOrBuilder() { * * *
-     * Optional. The time the event described by the log entry occurred.  This
-     * time is used to compute the log entry's age and to enforce the logs
-     * retention period. If this field is omitted in a new log entry, then Logging
-     * assigns it the current time.  Timestamps have nanosecond accuracy, but
-     * trailing zeros in the fractional seconds might be omitted when the
-     * timestamp is displayed.
+     * Optional. The time the event described by the log entry occurred. This time is used
+     * to compute the log entry's age and to enforce the logs retention period.
+     * If this field is omitted in a new log entry, then Logging assigns it the
+     * current time. Timestamps have nanosecond accuracy, but trailing zeros in
+     * the fractional seconds might be omitted when the timestamp is displayed.
      * Incoming log entries should have timestamps that are no more than the [logs
      * retention period](/logging/quotas) in the past, and no more than 24 hours
      * in the future. Log entries outside those time boundaries will not be
@@ -3289,7 +3208,8 @@ public com.google.protobuf.TimestampOrBuilder getTimestampOrBuilder() {
      * [exported with LogSinks](/logging/docs/api/tasks/exporting-logs).
      * 
* - * .google.protobuf.Timestamp timestamp = 9; + * .google.protobuf.Timestamp timestamp = 9 [(.google.api.field_behavior) = OPTIONAL]; + * */ private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Timestamp, @@ -3321,7 +3241,9 @@ public com.google.protobuf.TimestampOrBuilder getTimestampOrBuilder() { * Output only. The time the log entry was received by Logging. * * - * .google.protobuf.Timestamp receive_timestamp = 24; + * + * .google.protobuf.Timestamp receive_timestamp = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return Whether the receiveTimestamp field is set. */ @@ -3335,7 +3257,9 @@ public boolean hasReceiveTimestamp() { * Output only. The time the log entry was received by Logging. * * - * .google.protobuf.Timestamp receive_timestamp = 24; + * + * .google.protobuf.Timestamp receive_timestamp = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return The receiveTimestamp. */ @@ -3355,7 +3279,9 @@ public com.google.protobuf.Timestamp getReceiveTimestamp() { * Output only. The time the log entry was received by Logging. * * - * .google.protobuf.Timestamp receive_timestamp = 24; + * + * .google.protobuf.Timestamp receive_timestamp = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ public Builder setReceiveTimestamp(com.google.protobuf.Timestamp value) { if (receiveTimestampBuilder_ == null) { @@ -3377,7 +3303,9 @@ public Builder setReceiveTimestamp(com.google.protobuf.Timestamp value) { * Output only. The time the log entry was received by Logging. * * - * .google.protobuf.Timestamp receive_timestamp = 24; + * + * .google.protobuf.Timestamp receive_timestamp = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ public Builder setReceiveTimestamp(com.google.protobuf.Timestamp.Builder builderForValue) { if (receiveTimestampBuilder_ == null) { @@ -3396,7 +3324,9 @@ public Builder setReceiveTimestamp(com.google.protobuf.Timestamp.Builder builder * Output only. The time the log entry was received by Logging. * * - * .google.protobuf.Timestamp receive_timestamp = 24; + * + * .google.protobuf.Timestamp receive_timestamp = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ public Builder mergeReceiveTimestamp(com.google.protobuf.Timestamp value) { if (receiveTimestampBuilder_ == null) { @@ -3422,7 +3352,9 @@ public Builder mergeReceiveTimestamp(com.google.protobuf.Timestamp value) { * Output only. The time the log entry was received by Logging. * * - * .google.protobuf.Timestamp receive_timestamp = 24; + * + * .google.protobuf.Timestamp receive_timestamp = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ public Builder clearReceiveTimestamp() { if (receiveTimestampBuilder_ == null) { @@ -3442,7 +3374,9 @@ public Builder clearReceiveTimestamp() { * Output only. The time the log entry was received by Logging. * * - * .google.protobuf.Timestamp receive_timestamp = 24; + * + * .google.protobuf.Timestamp receive_timestamp = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ public com.google.protobuf.Timestamp.Builder getReceiveTimestampBuilder() { @@ -3456,7 +3390,9 @@ public com.google.protobuf.Timestamp.Builder getReceiveTimestampBuilder() { * Output only. The time the log entry was received by Logging. * * - * .google.protobuf.Timestamp receive_timestamp = 24; + * + * .google.protobuf.Timestamp receive_timestamp = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ public com.google.protobuf.TimestampOrBuilder getReceiveTimestampOrBuilder() { if (receiveTimestampBuilder_ != null) { @@ -3474,7 +3410,9 @@ public com.google.protobuf.TimestampOrBuilder getReceiveTimestampOrBuilder() { * Output only. The time the log entry was received by Logging. * * - * .google.protobuf.Timestamp receive_timestamp = 24; + * + * .google.protobuf.Timestamp receive_timestamp = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Timestamp, @@ -3498,11 +3436,12 @@ public com.google.protobuf.TimestampOrBuilder getReceiveTimestampOrBuilder() { * * *
-     * Optional. The severity of the log entry. The default value is
-     * `LogSeverity.DEFAULT`.
+     * Optional. The severity of the log entry. The default value is `LogSeverity.DEFAULT`.
      * 
* - * .google.logging.type.LogSeverity severity = 10; + * + * .google.logging.type.LogSeverity severity = 10 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return The enum numeric value on the wire for severity. */ @@ -3513,11 +3452,12 @@ public int getSeverityValue() { * * *
-     * Optional. The severity of the log entry. The default value is
-     * `LogSeverity.DEFAULT`.
+     * Optional. The severity of the log entry. The default value is `LogSeverity.DEFAULT`.
      * 
* - * .google.logging.type.LogSeverity severity = 10; + * + * .google.logging.type.LogSeverity severity = 10 [(.google.api.field_behavior) = OPTIONAL]; + * * * @param value The enum numeric value on the wire for severity to set. * @return This builder for chaining. @@ -3531,11 +3471,12 @@ public Builder setSeverityValue(int value) { * * *
-     * Optional. The severity of the log entry. The default value is
-     * `LogSeverity.DEFAULT`.
+     * Optional. The severity of the log entry. The default value is `LogSeverity.DEFAULT`.
      * 
* - * .google.logging.type.LogSeverity severity = 10; + * + * .google.logging.type.LogSeverity severity = 10 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return The severity. */ @@ -3549,11 +3490,12 @@ public com.google.logging.type.LogSeverity getSeverity() { * * *
-     * Optional. The severity of the log entry. The default value is
-     * `LogSeverity.DEFAULT`.
+     * Optional. The severity of the log entry. The default value is `LogSeverity.DEFAULT`.
      * 
* - * .google.logging.type.LogSeverity severity = 10; + * + * .google.logging.type.LogSeverity severity = 10 [(.google.api.field_behavior) = OPTIONAL]; + * * * @param value The severity to set. * @return This builder for chaining. @@ -3571,11 +3513,12 @@ public Builder setSeverity(com.google.logging.type.LogSeverity value) { * * *
-     * Optional. The severity of the log entry. The default value is
-     * `LogSeverity.DEFAULT`.
+     * Optional. The severity of the log entry. The default value is `LogSeverity.DEFAULT`.
      * 
* - * .google.logging.type.LogSeverity severity = 10; + * + * .google.logging.type.LogSeverity severity = 10 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return This builder for chaining. */ @@ -3591,8 +3534,8 @@ public Builder clearSeverity() { * * *
-     * Optional. A unique identifier for the log entry. If you provide a value,
-     * then Logging considers other log entries in the same project, with the same
+     * Optional. A unique identifier for the log entry. If you provide a value, then
+     * Logging considers other log entries in the same project, with the same
      * `timestamp`, and with the same `insert_id` to be duplicates which are
      * removed in a single query result. However, there are no guarantees of
      * de-duplication in the export of logs.
@@ -3602,7 +3545,7 @@ public Builder clearSeverity() {
      * the same `log_name` and `timestamp` values.
      * 
* - * string insert_id = 4; + * string insert_id = 4 [(.google.api.field_behavior) = OPTIONAL]; * * @return The insertId. */ @@ -3621,8 +3564,8 @@ public java.lang.String getInsertId() { * * *
-     * Optional. A unique identifier for the log entry. If you provide a value,
-     * then Logging considers other log entries in the same project, with the same
+     * Optional. A unique identifier for the log entry. If you provide a value, then
+     * Logging considers other log entries in the same project, with the same
      * `timestamp`, and with the same `insert_id` to be duplicates which are
      * removed in a single query result. However, there are no guarantees of
      * de-duplication in the export of logs.
@@ -3632,7 +3575,7 @@ public java.lang.String getInsertId() {
      * the same `log_name` and `timestamp` values.
      * 
* - * string insert_id = 4; + * string insert_id = 4 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for insertId. */ @@ -3651,8 +3594,8 @@ public com.google.protobuf.ByteString getInsertIdBytes() { * * *
-     * Optional. A unique identifier for the log entry. If you provide a value,
-     * then Logging considers other log entries in the same project, with the same
+     * Optional. A unique identifier for the log entry. If you provide a value, then
+     * Logging considers other log entries in the same project, with the same
      * `timestamp`, and with the same `insert_id` to be duplicates which are
      * removed in a single query result. However, there are no guarantees of
      * de-duplication in the export of logs.
@@ -3662,7 +3605,7 @@ public com.google.protobuf.ByteString getInsertIdBytes() {
      * the same `log_name` and `timestamp` values.
      * 
* - * string insert_id = 4; + * string insert_id = 4 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The insertId to set. * @return This builder for chaining. @@ -3680,8 +3623,8 @@ public Builder setInsertId(java.lang.String value) { * * *
-     * Optional. A unique identifier for the log entry. If you provide a value,
-     * then Logging considers other log entries in the same project, with the same
+     * Optional. A unique identifier for the log entry. If you provide a value, then
+     * Logging considers other log entries in the same project, with the same
      * `timestamp`, and with the same `insert_id` to be duplicates which are
      * removed in a single query result. However, there are no guarantees of
      * de-duplication in the export of logs.
@@ -3691,7 +3634,7 @@ public Builder setInsertId(java.lang.String value) {
      * the same `log_name` and `timestamp` values.
      * 
* - * string insert_id = 4; + * string insert_id = 4 [(.google.api.field_behavior) = OPTIONAL]; * * @return This builder for chaining. */ @@ -3705,8 +3648,8 @@ public Builder clearInsertId() { * * *
-     * Optional. A unique identifier for the log entry. If you provide a value,
-     * then Logging considers other log entries in the same project, with the same
+     * Optional. A unique identifier for the log entry. If you provide a value, then
+     * Logging considers other log entries in the same project, with the same
      * `timestamp`, and with the same `insert_id` to be duplicates which are
      * removed in a single query result. However, there are no guarantees of
      * de-duplication in the export of logs.
@@ -3716,7 +3659,7 @@ public Builder clearInsertId() {
      * the same `log_name` and `timestamp` values.
      * 
* - * string insert_id = 4; + * string insert_id = 4 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The bytes for insertId to set. * @return This builder for chaining. @@ -3742,11 +3685,13 @@ public Builder setInsertIdBytes(com.google.protobuf.ByteString value) { * * *
-     * Optional. Information about the HTTP request associated with this log
-     * entry, if applicable.
+     * Optional. Information about the HTTP request associated with this log entry, if
+     * applicable.
      * 
* - * .google.logging.type.HttpRequest http_request = 7; + * + * .google.logging.type.HttpRequest http_request = 7 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return Whether the httpRequest field is set. */ @@ -3757,11 +3702,13 @@ public boolean hasHttpRequest() { * * *
-     * Optional. Information about the HTTP request associated with this log
-     * entry, if applicable.
+     * Optional. Information about the HTTP request associated with this log entry, if
+     * applicable.
      * 
* - * .google.logging.type.HttpRequest http_request = 7; + * + * .google.logging.type.HttpRequest http_request = 7 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return The httpRequest. */ @@ -3778,11 +3725,13 @@ public com.google.logging.type.HttpRequest getHttpRequest() { * * *
-     * Optional. Information about the HTTP request associated with this log
-     * entry, if applicable.
+     * Optional. Information about the HTTP request associated with this log entry, if
+     * applicable.
      * 
* - * .google.logging.type.HttpRequest http_request = 7; + * + * .google.logging.type.HttpRequest http_request = 7 [(.google.api.field_behavior) = OPTIONAL]; + * */ public Builder setHttpRequest(com.google.logging.type.HttpRequest value) { if (httpRequestBuilder_ == null) { @@ -3801,11 +3750,13 @@ public Builder setHttpRequest(com.google.logging.type.HttpRequest value) { * * *
-     * Optional. Information about the HTTP request associated with this log
-     * entry, if applicable.
+     * Optional. Information about the HTTP request associated with this log entry, if
+     * applicable.
      * 
* - * .google.logging.type.HttpRequest http_request = 7; + * + * .google.logging.type.HttpRequest http_request = 7 [(.google.api.field_behavior) = OPTIONAL]; + * */ public Builder setHttpRequest(com.google.logging.type.HttpRequest.Builder builderForValue) { if (httpRequestBuilder_ == null) { @@ -3821,11 +3772,13 @@ public Builder setHttpRequest(com.google.logging.type.HttpRequest.Builder builde * * *
-     * Optional. Information about the HTTP request associated with this log
-     * entry, if applicable.
+     * Optional. Information about the HTTP request associated with this log entry, if
+     * applicable.
      * 
* - * .google.logging.type.HttpRequest http_request = 7; + * + * .google.logging.type.HttpRequest http_request = 7 [(.google.api.field_behavior) = OPTIONAL]; + * */ public Builder mergeHttpRequest(com.google.logging.type.HttpRequest value) { if (httpRequestBuilder_ == null) { @@ -3848,11 +3801,13 @@ public Builder mergeHttpRequest(com.google.logging.type.HttpRequest value) { * * *
-     * Optional. Information about the HTTP request associated with this log
-     * entry, if applicable.
+     * Optional. Information about the HTTP request associated with this log entry, if
+     * applicable.
      * 
* - * .google.logging.type.HttpRequest http_request = 7; + * + * .google.logging.type.HttpRequest http_request = 7 [(.google.api.field_behavior) = OPTIONAL]; + * */ public Builder clearHttpRequest() { if (httpRequestBuilder_ == null) { @@ -3869,11 +3824,13 @@ public Builder clearHttpRequest() { * * *
-     * Optional. Information about the HTTP request associated with this log
-     * entry, if applicable.
+     * Optional. Information about the HTTP request associated with this log entry, if
+     * applicable.
      * 
* - * .google.logging.type.HttpRequest http_request = 7; + * + * .google.logging.type.HttpRequest http_request = 7 [(.google.api.field_behavior) = OPTIONAL]; + * */ public com.google.logging.type.HttpRequest.Builder getHttpRequestBuilder() { @@ -3884,11 +3841,13 @@ public com.google.logging.type.HttpRequest.Builder getHttpRequestBuilder() { * * *
-     * Optional. Information about the HTTP request associated with this log
-     * entry, if applicable.
+     * Optional. Information about the HTTP request associated with this log entry, if
+     * applicable.
      * 
* - * .google.logging.type.HttpRequest http_request = 7; + * + * .google.logging.type.HttpRequest http_request = 7 [(.google.api.field_behavior) = OPTIONAL]; + * */ public com.google.logging.type.HttpRequestOrBuilder getHttpRequestOrBuilder() { if (httpRequestBuilder_ != null) { @@ -3903,11 +3862,13 @@ public com.google.logging.type.HttpRequestOrBuilder getHttpRequestOrBuilder() { * * *
-     * Optional. Information about the HTTP request associated with this log
-     * entry, if applicable.
+     * Optional. Information about the HTTP request associated with this log entry, if
+     * applicable.
      * 
* - * .google.logging.type.HttpRequest http_request = 7; + * + * .google.logging.type.HttpRequest http_request = 7 [(.google.api.field_behavior) = OPTIONAL]; + * */ private com.google.protobuf.SingleFieldBuilderV3< com.google.logging.type.HttpRequest, @@ -3959,7 +3920,7 @@ public int getLabelsCount() { * information about the log entry. * * - * map<string, string> labels = 11; + * map<string, string> labels = 11 [(.google.api.field_behavior) = OPTIONAL]; */ public boolean containsLabels(java.lang.String key) { if (key == null) { @@ -3980,7 +3941,7 @@ public java.util.Map getLabels() { * information about the log entry. * * - * map<string, string> labels = 11; + * map<string, string> labels = 11 [(.google.api.field_behavior) = OPTIONAL]; */ public java.util.Map getLabelsMap() { return internalGetLabels().getMap(); @@ -3993,7 +3954,7 @@ public java.util.Map getLabelsMap() { * information about the log entry. * * - * map<string, string> labels = 11; + * map<string, string> labels = 11 [(.google.api.field_behavior) = OPTIONAL]; */ public java.lang.String getLabelsOrDefault( java.lang.String key, java.lang.String defaultValue) { @@ -4011,7 +3972,7 @@ public java.lang.String getLabelsOrDefault( * information about the log entry. * * - * map<string, string> labels = 11; + * map<string, string> labels = 11 [(.google.api.field_behavior) = OPTIONAL]; */ public java.lang.String getLabelsOrThrow(java.lang.String key) { if (key == null) { @@ -4036,7 +3997,7 @@ public Builder clearLabels() { * information about the log entry. * * - * map<string, string> labels = 11; + * map<string, string> labels = 11 [(.google.api.field_behavior) = OPTIONAL]; */ public Builder removeLabels(java.lang.String key) { if (key == null) { @@ -4058,7 +4019,7 @@ public java.util.Map getMutableLabels() { * information about the log entry. * * - * map<string, string> labels = 11; + * map<string, string> labels = 11 [(.google.api.field_behavior) = OPTIONAL]; */ public Builder putLabels(java.lang.String key, java.lang.String value) { if (key == null) { @@ -4078,269 +4039,13 @@ public Builder putLabels(java.lang.String key, java.lang.String value) { * information about the log entry. * * - * map<string, string> labels = 11; + * map<string, string> labels = 11 [(.google.api.field_behavior) = OPTIONAL]; */ public Builder putAllLabels(java.util.Map values) { internalGetMutableLabels().getMutableMap().putAll(values); return this; } - private com.google.api.MonitoredResourceMetadata metadata_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.api.MonitoredResourceMetadata, - com.google.api.MonitoredResourceMetadata.Builder, - com.google.api.MonitoredResourceMetadataOrBuilder> - metadataBuilder_; - /** - * - * - *
-     * Deprecated. Output only. Additional metadata about the monitored resource.
-     * Only `k8s_container`, `k8s_pod`, and `k8s_node` MonitoredResources have
-     * this field populated for GKE versions older than 1.12.6. For GKE versions
-     * 1.12.6 and above, the `metadata` field has been deprecated. The Kubernetes
-     * pod labels that used to be in `metadata.userLabels` will now be present in
-     * the `labels` field with a key prefix of `k8s-pod/`. The Stackdriver system
-     * labels that were present in the `metadata.systemLabels` field will no
-     * longer be available in the LogEntry.
-     * 
- * - * .google.api.MonitoredResourceMetadata metadata = 25 [deprecated = true]; - * - * @return Whether the metadata field is set. - */ - @java.lang.Deprecated - public boolean hasMetadata() { - return metadataBuilder_ != null || metadata_ != null; - } - /** - * - * - *
-     * Deprecated. Output only. Additional metadata about the monitored resource.
-     * Only `k8s_container`, `k8s_pod`, and `k8s_node` MonitoredResources have
-     * this field populated for GKE versions older than 1.12.6. For GKE versions
-     * 1.12.6 and above, the `metadata` field has been deprecated. The Kubernetes
-     * pod labels that used to be in `metadata.userLabels` will now be present in
-     * the `labels` field with a key prefix of `k8s-pod/`. The Stackdriver system
-     * labels that were present in the `metadata.systemLabels` field will no
-     * longer be available in the LogEntry.
-     * 
- * - * .google.api.MonitoredResourceMetadata metadata = 25 [deprecated = true]; - * - * @return The metadata. - */ - @java.lang.Deprecated - public com.google.api.MonitoredResourceMetadata getMetadata() { - if (metadataBuilder_ == null) { - return metadata_ == null - ? com.google.api.MonitoredResourceMetadata.getDefaultInstance() - : metadata_; - } else { - return metadataBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Deprecated. Output only. Additional metadata about the monitored resource.
-     * Only `k8s_container`, `k8s_pod`, and `k8s_node` MonitoredResources have
-     * this field populated for GKE versions older than 1.12.6. For GKE versions
-     * 1.12.6 and above, the `metadata` field has been deprecated. The Kubernetes
-     * pod labels that used to be in `metadata.userLabels` will now be present in
-     * the `labels` field with a key prefix of `k8s-pod/`. The Stackdriver system
-     * labels that were present in the `metadata.systemLabels` field will no
-     * longer be available in the LogEntry.
-     * 
- * - * .google.api.MonitoredResourceMetadata metadata = 25 [deprecated = true]; - */ - @java.lang.Deprecated - public Builder setMetadata(com.google.api.MonitoredResourceMetadata value) { - if (metadataBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - metadata_ = value; - onChanged(); - } else { - metadataBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Deprecated. Output only. Additional metadata about the monitored resource.
-     * Only `k8s_container`, `k8s_pod`, and `k8s_node` MonitoredResources have
-     * this field populated for GKE versions older than 1.12.6. For GKE versions
-     * 1.12.6 and above, the `metadata` field has been deprecated. The Kubernetes
-     * pod labels that used to be in `metadata.userLabels` will now be present in
-     * the `labels` field with a key prefix of `k8s-pod/`. The Stackdriver system
-     * labels that were present in the `metadata.systemLabels` field will no
-     * longer be available in the LogEntry.
-     * 
- * - * .google.api.MonitoredResourceMetadata metadata = 25 [deprecated = true]; - */ - @java.lang.Deprecated - public Builder setMetadata(com.google.api.MonitoredResourceMetadata.Builder builderForValue) { - if (metadataBuilder_ == null) { - metadata_ = builderForValue.build(); - onChanged(); - } else { - metadataBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Deprecated. Output only. Additional metadata about the monitored resource.
-     * Only `k8s_container`, `k8s_pod`, and `k8s_node` MonitoredResources have
-     * this field populated for GKE versions older than 1.12.6. For GKE versions
-     * 1.12.6 and above, the `metadata` field has been deprecated. The Kubernetes
-     * pod labels that used to be in `metadata.userLabels` will now be present in
-     * the `labels` field with a key prefix of `k8s-pod/`. The Stackdriver system
-     * labels that were present in the `metadata.systemLabels` field will no
-     * longer be available in the LogEntry.
-     * 
- * - * .google.api.MonitoredResourceMetadata metadata = 25 [deprecated = true]; - */ - @java.lang.Deprecated - public Builder mergeMetadata(com.google.api.MonitoredResourceMetadata value) { - if (metadataBuilder_ == null) { - if (metadata_ != null) { - metadata_ = - com.google.api.MonitoredResourceMetadata.newBuilder(metadata_) - .mergeFrom(value) - .buildPartial(); - } else { - metadata_ = value; - } - onChanged(); - } else { - metadataBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Deprecated. Output only. Additional metadata about the monitored resource.
-     * Only `k8s_container`, `k8s_pod`, and `k8s_node` MonitoredResources have
-     * this field populated for GKE versions older than 1.12.6. For GKE versions
-     * 1.12.6 and above, the `metadata` field has been deprecated. The Kubernetes
-     * pod labels that used to be in `metadata.userLabels` will now be present in
-     * the `labels` field with a key prefix of `k8s-pod/`. The Stackdriver system
-     * labels that were present in the `metadata.systemLabels` field will no
-     * longer be available in the LogEntry.
-     * 
- * - * .google.api.MonitoredResourceMetadata metadata = 25 [deprecated = true]; - */ - @java.lang.Deprecated - public Builder clearMetadata() { - if (metadataBuilder_ == null) { - metadata_ = null; - onChanged(); - } else { - metadata_ = null; - metadataBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Deprecated. Output only. Additional metadata about the monitored resource.
-     * Only `k8s_container`, `k8s_pod`, and `k8s_node` MonitoredResources have
-     * this field populated for GKE versions older than 1.12.6. For GKE versions
-     * 1.12.6 and above, the `metadata` field has been deprecated. The Kubernetes
-     * pod labels that used to be in `metadata.userLabels` will now be present in
-     * the `labels` field with a key prefix of `k8s-pod/`. The Stackdriver system
-     * labels that were present in the `metadata.systemLabels` field will no
-     * longer be available in the LogEntry.
-     * 
- * - * .google.api.MonitoredResourceMetadata metadata = 25 [deprecated = true]; - */ - @java.lang.Deprecated - public com.google.api.MonitoredResourceMetadata.Builder getMetadataBuilder() { - - onChanged(); - return getMetadataFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Deprecated. Output only. Additional metadata about the monitored resource.
-     * Only `k8s_container`, `k8s_pod`, and `k8s_node` MonitoredResources have
-     * this field populated for GKE versions older than 1.12.6. For GKE versions
-     * 1.12.6 and above, the `metadata` field has been deprecated. The Kubernetes
-     * pod labels that used to be in `metadata.userLabels` will now be present in
-     * the `labels` field with a key prefix of `k8s-pod/`. The Stackdriver system
-     * labels that were present in the `metadata.systemLabels` field will no
-     * longer be available in the LogEntry.
-     * 
- * - * .google.api.MonitoredResourceMetadata metadata = 25 [deprecated = true]; - */ - @java.lang.Deprecated - public com.google.api.MonitoredResourceMetadataOrBuilder getMetadataOrBuilder() { - if (metadataBuilder_ != null) { - return metadataBuilder_.getMessageOrBuilder(); - } else { - return metadata_ == null - ? com.google.api.MonitoredResourceMetadata.getDefaultInstance() - : metadata_; - } - } - /** - * - * - *
-     * Deprecated. Output only. Additional metadata about the monitored resource.
-     * Only `k8s_container`, `k8s_pod`, and `k8s_node` MonitoredResources have
-     * this field populated for GKE versions older than 1.12.6. For GKE versions
-     * 1.12.6 and above, the `metadata` field has been deprecated. The Kubernetes
-     * pod labels that used to be in `metadata.userLabels` will now be present in
-     * the `labels` field with a key prefix of `k8s-pod/`. The Stackdriver system
-     * labels that were present in the `metadata.systemLabels` field will no
-     * longer be available in the LogEntry.
-     * 
- * - * .google.api.MonitoredResourceMetadata metadata = 25 [deprecated = true]; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.api.MonitoredResourceMetadata, - com.google.api.MonitoredResourceMetadata.Builder, - com.google.api.MonitoredResourceMetadataOrBuilder> - getMetadataFieldBuilder() { - if (metadataBuilder_ == null) { - metadataBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.api.MonitoredResourceMetadata, - com.google.api.MonitoredResourceMetadata.Builder, - com.google.api.MonitoredResourceMetadataOrBuilder>( - getMetadata(), getParentForChildren(), isClean()); - metadata_ = null; - } - return metadataBuilder_; - } - private com.google.logging.v2.LogEntryOperation operation_; private com.google.protobuf.SingleFieldBuilderV3< com.google.logging.v2.LogEntryOperation, @@ -4355,7 +4060,9 @@ public com.google.api.MonitoredResourceMetadataOrBuilder getMetadataOrBuilder() * applicable. * * - * .google.logging.v2.LogEntryOperation operation = 15; + * + * .google.logging.v2.LogEntryOperation operation = 15 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return Whether the operation field is set. */ @@ -4370,7 +4077,9 @@ public boolean hasOperation() { * applicable. * * - * .google.logging.v2.LogEntryOperation operation = 15; + * + * .google.logging.v2.LogEntryOperation operation = 15 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return The operation. */ @@ -4391,7 +4100,9 @@ public com.google.logging.v2.LogEntryOperation getOperation() { * applicable. * * - * .google.logging.v2.LogEntryOperation operation = 15; + * + * .google.logging.v2.LogEntryOperation operation = 15 [(.google.api.field_behavior) = OPTIONAL]; + * */ public Builder setOperation(com.google.logging.v2.LogEntryOperation value) { if (operationBuilder_ == null) { @@ -4414,7 +4125,9 @@ public Builder setOperation(com.google.logging.v2.LogEntryOperation value) { * applicable. * * - * .google.logging.v2.LogEntryOperation operation = 15; + * + * .google.logging.v2.LogEntryOperation operation = 15 [(.google.api.field_behavior) = OPTIONAL]; + * */ public Builder setOperation(com.google.logging.v2.LogEntryOperation.Builder builderForValue) { if (operationBuilder_ == null) { @@ -4434,7 +4147,9 @@ public Builder setOperation(com.google.logging.v2.LogEntryOperation.Builder buil * applicable. * * - * .google.logging.v2.LogEntryOperation operation = 15; + * + * .google.logging.v2.LogEntryOperation operation = 15 [(.google.api.field_behavior) = OPTIONAL]; + * */ public Builder mergeOperation(com.google.logging.v2.LogEntryOperation value) { if (operationBuilder_ == null) { @@ -4461,7 +4176,9 @@ public Builder mergeOperation(com.google.logging.v2.LogEntryOperation value) { * applicable. * * - * .google.logging.v2.LogEntryOperation operation = 15; + * + * .google.logging.v2.LogEntryOperation operation = 15 [(.google.api.field_behavior) = OPTIONAL]; + * */ public Builder clearOperation() { if (operationBuilder_ == null) { @@ -4482,7 +4199,9 @@ public Builder clearOperation() { * applicable. * * - * .google.logging.v2.LogEntryOperation operation = 15; + * + * .google.logging.v2.LogEntryOperation operation = 15 [(.google.api.field_behavior) = OPTIONAL]; + * */ public com.google.logging.v2.LogEntryOperation.Builder getOperationBuilder() { @@ -4497,7 +4216,9 @@ public com.google.logging.v2.LogEntryOperation.Builder getOperationBuilder() { * applicable. * * - * .google.logging.v2.LogEntryOperation operation = 15; + * + * .google.logging.v2.LogEntryOperation operation = 15 [(.google.api.field_behavior) = OPTIONAL]; + * */ public com.google.logging.v2.LogEntryOperationOrBuilder getOperationOrBuilder() { if (operationBuilder_ != null) { @@ -4516,7 +4237,9 @@ public com.google.logging.v2.LogEntryOperationOrBuilder getOperationOrBuilder() * applicable. * * - * .google.logging.v2.LogEntryOperation operation = 15; + * + * .google.logging.v2.LogEntryOperation operation = 15 [(.google.api.field_behavior) = OPTIONAL]; + * */ private com.google.protobuf.SingleFieldBuilderV3< com.google.logging.v2.LogEntryOperation, @@ -4540,13 +4263,13 @@ public com.google.logging.v2.LogEntryOperationOrBuilder getOperationOrBuilder() * * *
-     * Optional. Resource name of the trace associated with the log entry, if any.
-     * If it contains a relative resource name, the name is assumed to be relative
-     * to `//tracing.googleapis.com`. Example:
+     * Optional. Resource name of the trace associated with the log entry, if any. If it
+     * contains a relative resource name, the name is assumed to be relative to
+     * `//tracing.googleapis.com`. Example:
      * `projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824`
      * 
* - * string trace = 22; + * string trace = 22 [(.google.api.field_behavior) = OPTIONAL]; * * @return The trace. */ @@ -4565,13 +4288,13 @@ public java.lang.String getTrace() { * * *
-     * Optional. Resource name of the trace associated with the log entry, if any.
-     * If it contains a relative resource name, the name is assumed to be relative
-     * to `//tracing.googleapis.com`. Example:
+     * Optional. Resource name of the trace associated with the log entry, if any. If it
+     * contains a relative resource name, the name is assumed to be relative to
+     * `//tracing.googleapis.com`. Example:
      * `projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824`
      * 
* - * string trace = 22; + * string trace = 22 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for trace. */ @@ -4590,13 +4313,13 @@ public com.google.protobuf.ByteString getTraceBytes() { * * *
-     * Optional. Resource name of the trace associated with the log entry, if any.
-     * If it contains a relative resource name, the name is assumed to be relative
-     * to `//tracing.googleapis.com`. Example:
+     * Optional. Resource name of the trace associated with the log entry, if any. If it
+     * contains a relative resource name, the name is assumed to be relative to
+     * `//tracing.googleapis.com`. Example:
      * `projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824`
      * 
* - * string trace = 22; + * string trace = 22 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The trace to set. * @return This builder for chaining. @@ -4614,13 +4337,13 @@ public Builder setTrace(java.lang.String value) { * * *
-     * Optional. Resource name of the trace associated with the log entry, if any.
-     * If it contains a relative resource name, the name is assumed to be relative
-     * to `//tracing.googleapis.com`. Example:
+     * Optional. Resource name of the trace associated with the log entry, if any. If it
+     * contains a relative resource name, the name is assumed to be relative to
+     * `//tracing.googleapis.com`. Example:
      * `projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824`
      * 
* - * string trace = 22; + * string trace = 22 [(.google.api.field_behavior) = OPTIONAL]; * * @return This builder for chaining. */ @@ -4634,13 +4357,13 @@ public Builder clearTrace() { * * *
-     * Optional. Resource name of the trace associated with the log entry, if any.
-     * If it contains a relative resource name, the name is assumed to be relative
-     * to `//tracing.googleapis.com`. Example:
+     * Optional. Resource name of the trace associated with the log entry, if any. If it
+     * contains a relative resource name, the name is assumed to be relative to
+     * `//tracing.googleapis.com`. Example:
      * `projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824`
      * 
* - * string trace = 22; + * string trace = 22 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The bytes for trace to set. * @return This builder for chaining. @@ -4664,10 +4387,10 @@ public Builder setTraceBytes(com.google.protobuf.ByteString value) { * Optional. The span ID within the trace associated with the log entry. * For Trace spans, this is the same format that the Trace API v2 uses: a * 16-character hexadecimal encoding of an 8-byte array, such as - * <code>"000000000000004a"</code>. + * `000000000000004a`. * * - * string span_id = 27; + * string span_id = 27 [(.google.api.field_behavior) = OPTIONAL]; * * @return The spanId. */ @@ -4689,10 +4412,10 @@ public java.lang.String getSpanId() { * Optional. The span ID within the trace associated with the log entry. * For Trace spans, this is the same format that the Trace API v2 uses: a * 16-character hexadecimal encoding of an 8-byte array, such as - * <code>"000000000000004a"</code>. + * `000000000000004a`. * * - * string span_id = 27; + * string span_id = 27 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for spanId. */ @@ -4714,10 +4437,10 @@ public com.google.protobuf.ByteString getSpanIdBytes() { * Optional. The span ID within the trace associated with the log entry. * For Trace spans, this is the same format that the Trace API v2 uses: a * 16-character hexadecimal encoding of an 8-byte array, such as - * <code>"000000000000004a"</code>. + * `000000000000004a`. * * - * string span_id = 27; + * string span_id = 27 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The spanId to set. * @return This builder for chaining. @@ -4738,10 +4461,10 @@ public Builder setSpanId(java.lang.String value) { * Optional. The span ID within the trace associated with the log entry. * For Trace spans, this is the same format that the Trace API v2 uses: a * 16-character hexadecimal encoding of an 8-byte array, such as - * <code>"000000000000004a"</code>. + * `000000000000004a`. * * - * string span_id = 27; + * string span_id = 27 [(.google.api.field_behavior) = OPTIONAL]; * * @return This builder for chaining. */ @@ -4758,10 +4481,10 @@ public Builder clearSpanId() { * Optional. The span ID within the trace associated with the log entry. * For Trace spans, this is the same format that the Trace API v2 uses: a * 16-character hexadecimal encoding of an 8-byte array, such as - * <code>"000000000000004a"</code>. + * `000000000000004a`. * * - * string span_id = 27; + * string span_id = 27 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The bytes for spanId to set. * @return This builder for chaining. @@ -4790,7 +4513,7 @@ public Builder setSpanIdBytes(com.google.protobuf.ByteString value) { * request correlation identifier. The default is False. * * - * bool trace_sampled = 30; + * bool trace_sampled = 30 [(.google.api.field_behavior) = OPTIONAL]; * * @return The traceSampled. */ @@ -4809,7 +4532,7 @@ public boolean getTraceSampled() { * request correlation identifier. The default is False. * * - * bool trace_sampled = 30; + * bool trace_sampled = 30 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The traceSampled to set. * @return This builder for chaining. @@ -4832,7 +4555,7 @@ public Builder setTraceSampled(boolean value) { * request correlation identifier. The default is False. * * - * bool trace_sampled = 30; + * bool trace_sampled = 30 [(.google.api.field_behavior) = OPTIONAL]; * * @return This builder for chaining. */ @@ -4853,11 +4576,12 @@ public Builder clearTraceSampled() { * * *
-     * Optional. Source code location information associated with the log entry,
-     * if any.
+     * Optional. Source code location information associated with the log entry, if any.
      * 
* - * .google.logging.v2.LogEntrySourceLocation source_location = 23; + * + * .google.logging.v2.LogEntrySourceLocation source_location = 23 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return Whether the sourceLocation field is set. */ @@ -4868,11 +4592,12 @@ public boolean hasSourceLocation() { * * *
-     * Optional. Source code location information associated with the log entry,
-     * if any.
+     * Optional. Source code location information associated with the log entry, if any.
      * 
* - * .google.logging.v2.LogEntrySourceLocation source_location = 23; + * + * .google.logging.v2.LogEntrySourceLocation source_location = 23 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return The sourceLocation. */ @@ -4889,11 +4614,12 @@ public com.google.logging.v2.LogEntrySourceLocation getSourceLocation() { * * *
-     * Optional. Source code location information associated with the log entry,
-     * if any.
+     * Optional. Source code location information associated with the log entry, if any.
      * 
* - * .google.logging.v2.LogEntrySourceLocation source_location = 23; + * + * .google.logging.v2.LogEntrySourceLocation source_location = 23 [(.google.api.field_behavior) = OPTIONAL]; + * */ public Builder setSourceLocation(com.google.logging.v2.LogEntrySourceLocation value) { if (sourceLocationBuilder_ == null) { @@ -4912,11 +4638,12 @@ public Builder setSourceLocation(com.google.logging.v2.LogEntrySourceLocation va * * *
-     * Optional. Source code location information associated with the log entry,
-     * if any.
+     * Optional. Source code location information associated with the log entry, if any.
      * 
* - * .google.logging.v2.LogEntrySourceLocation source_location = 23; + * + * .google.logging.v2.LogEntrySourceLocation source_location = 23 [(.google.api.field_behavior) = OPTIONAL]; + * */ public Builder setSourceLocation( com.google.logging.v2.LogEntrySourceLocation.Builder builderForValue) { @@ -4933,11 +4660,12 @@ public Builder setSourceLocation( * * *
-     * Optional. Source code location information associated with the log entry,
-     * if any.
+     * Optional. Source code location information associated with the log entry, if any.
      * 
* - * .google.logging.v2.LogEntrySourceLocation source_location = 23; + * + * .google.logging.v2.LogEntrySourceLocation source_location = 23 [(.google.api.field_behavior) = OPTIONAL]; + * */ public Builder mergeSourceLocation(com.google.logging.v2.LogEntrySourceLocation value) { if (sourceLocationBuilder_ == null) { @@ -4960,11 +4688,12 @@ public Builder mergeSourceLocation(com.google.logging.v2.LogEntrySourceLocation * * *
-     * Optional. Source code location information associated with the log entry,
-     * if any.
+     * Optional. Source code location information associated with the log entry, if any.
      * 
* - * .google.logging.v2.LogEntrySourceLocation source_location = 23; + * + * .google.logging.v2.LogEntrySourceLocation source_location = 23 [(.google.api.field_behavior) = OPTIONAL]; + * */ public Builder clearSourceLocation() { if (sourceLocationBuilder_ == null) { @@ -4981,11 +4710,12 @@ public Builder clearSourceLocation() { * * *
-     * Optional. Source code location information associated with the log entry,
-     * if any.
+     * Optional. Source code location information associated with the log entry, if any.
      * 
* - * .google.logging.v2.LogEntrySourceLocation source_location = 23; + * + * .google.logging.v2.LogEntrySourceLocation source_location = 23 [(.google.api.field_behavior) = OPTIONAL]; + * */ public com.google.logging.v2.LogEntrySourceLocation.Builder getSourceLocationBuilder() { @@ -4996,11 +4726,12 @@ public com.google.logging.v2.LogEntrySourceLocation.Builder getSourceLocationBui * * *
-     * Optional. Source code location information associated with the log entry,
-     * if any.
+     * Optional. Source code location information associated with the log entry, if any.
      * 
* - * .google.logging.v2.LogEntrySourceLocation source_location = 23; + * + * .google.logging.v2.LogEntrySourceLocation source_location = 23 [(.google.api.field_behavior) = OPTIONAL]; + * */ public com.google.logging.v2.LogEntrySourceLocationOrBuilder getSourceLocationOrBuilder() { if (sourceLocationBuilder_ != null) { @@ -5015,11 +4746,12 @@ public com.google.logging.v2.LogEntrySourceLocationOrBuilder getSourceLocationOr * * *
-     * Optional. Source code location information associated with the log entry,
-     * if any.
+     * Optional. Source code location information associated with the log entry, if any.
      * 
* - * .google.logging.v2.LogEntrySourceLocation source_location = 23; + * + * .google.logging.v2.LogEntrySourceLocation source_location = 23 [(.google.api.field_behavior) = OPTIONAL]; + * */ private com.google.protobuf.SingleFieldBuilderV3< com.google.logging.v2.LogEntrySourceLocation, diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntryOperation.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntryOperation.java index 7eadb6a1e..bada2819c 100644 --- a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntryOperation.java +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntryOperation.java @@ -140,7 +140,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * identifier are assumed to be part of the same operation. * * - * string id = 1; + * string id = 1 [(.google.api.field_behavior) = OPTIONAL]; * * @return The id. */ @@ -163,7 +163,7 @@ public java.lang.String getId() { * identifier are assumed to be part of the same operation. * * - * string id = 1; + * string id = 1 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for id. */ @@ -190,7 +190,7 @@ public com.google.protobuf.ByteString getIdBytes() { * `"MyDivision.MyBigCompany.com"`, `"github.com/MyProject/MyApplication"`. * * - * string producer = 2; + * string producer = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return The producer. */ @@ -214,7 +214,7 @@ public java.lang.String getProducer() { * `"MyDivision.MyBigCompany.com"`, `"github.com/MyProject/MyApplication"`. * * - * string producer = 2; + * string producer = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for producer. */ @@ -239,7 +239,7 @@ public com.google.protobuf.ByteString getProducerBytes() { * Optional. Set this to True if this is the first log entry in the operation. * * - * bool first = 3; + * bool first = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return The first. */ @@ -256,7 +256,7 @@ public boolean getFirst() { * Optional. Set this to True if this is the last log entry in the operation. * * - * bool last = 4; + * bool last = 4 [(.google.api.field_behavior) = OPTIONAL]; * * @return The last. */ @@ -635,7 +635,7 @@ public Builder mergeFrom( * identifier are assumed to be part of the same operation. * * - * string id = 1; + * string id = 1 [(.google.api.field_behavior) = OPTIONAL]; * * @return The id. */ @@ -658,7 +658,7 @@ public java.lang.String getId() { * identifier are assumed to be part of the same operation. * * - * string id = 1; + * string id = 1 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for id. */ @@ -681,7 +681,7 @@ public com.google.protobuf.ByteString getIdBytes() { * identifier are assumed to be part of the same operation. * * - * string id = 1; + * string id = 1 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The id to set. * @return This builder for chaining. @@ -703,7 +703,7 @@ public Builder setId(java.lang.String value) { * identifier are assumed to be part of the same operation. * * - * string id = 1; + * string id = 1 [(.google.api.field_behavior) = OPTIONAL]; * * @return This builder for chaining. */ @@ -721,7 +721,7 @@ public Builder clearId() { * identifier are assumed to be part of the same operation. * * - * string id = 1; + * string id = 1 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The bytes for id to set. * @return This builder for chaining. @@ -747,7 +747,7 @@ public Builder setIdBytes(com.google.protobuf.ByteString value) { * `"MyDivision.MyBigCompany.com"`, `"github.com/MyProject/MyApplication"`. * * - * string producer = 2; + * string producer = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return The producer. */ @@ -771,7 +771,7 @@ public java.lang.String getProducer() { * `"MyDivision.MyBigCompany.com"`, `"github.com/MyProject/MyApplication"`. * * - * string producer = 2; + * string producer = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for producer. */ @@ -795,7 +795,7 @@ public com.google.protobuf.ByteString getProducerBytes() { * `"MyDivision.MyBigCompany.com"`, `"github.com/MyProject/MyApplication"`. * * - * string producer = 2; + * string producer = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The producer to set. * @return This builder for chaining. @@ -818,7 +818,7 @@ public Builder setProducer(java.lang.String value) { * `"MyDivision.MyBigCompany.com"`, `"github.com/MyProject/MyApplication"`. * * - * string producer = 2; + * string producer = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return This builder for chaining. */ @@ -837,7 +837,7 @@ public Builder clearProducer() { * `"MyDivision.MyBigCompany.com"`, `"github.com/MyProject/MyApplication"`. * * - * string producer = 2; + * string producer = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The bytes for producer to set. * @return This builder for chaining. @@ -861,7 +861,7 @@ public Builder setProducerBytes(com.google.protobuf.ByteString value) { * Optional. Set this to True if this is the first log entry in the operation. * * - * bool first = 3; + * bool first = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return The first. */ @@ -875,7 +875,7 @@ public boolean getFirst() { * Optional. Set this to True if this is the first log entry in the operation. * * - * bool first = 3; + * bool first = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The first to set. * @return This builder for chaining. @@ -893,7 +893,7 @@ public Builder setFirst(boolean value) { * Optional. Set this to True if this is the first log entry in the operation. * * - * bool first = 3; + * bool first = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return This builder for chaining. */ @@ -912,7 +912,7 @@ public Builder clearFirst() { * Optional. Set this to True if this is the last log entry in the operation. * * - * bool last = 4; + * bool last = 4 [(.google.api.field_behavior) = OPTIONAL]; * * @return The last. */ @@ -926,7 +926,7 @@ public boolean getLast() { * Optional. Set this to True if this is the last log entry in the operation. * * - * bool last = 4; + * bool last = 4 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The last to set. * @return This builder for chaining. @@ -944,7 +944,7 @@ public Builder setLast(boolean value) { * Optional. Set this to True if this is the last log entry in the operation. * * - * bool last = 4; + * bool last = 4 [(.google.api.field_behavior) = OPTIONAL]; * * @return This builder for chaining. */ diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntryOperationOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntryOperationOrBuilder.java index 5e7242102..2ed903f6e 100644 --- a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntryOperationOrBuilder.java +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntryOperationOrBuilder.java @@ -31,7 +31,7 @@ public interface LogEntryOperationOrBuilder * identifier are assumed to be part of the same operation. * * - * string id = 1; + * string id = 1 [(.google.api.field_behavior) = OPTIONAL]; * * @return The id. */ @@ -44,7 +44,7 @@ public interface LogEntryOperationOrBuilder * identifier are assumed to be part of the same operation. * * - * string id = 1; + * string id = 1 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for id. */ @@ -59,7 +59,7 @@ public interface LogEntryOperationOrBuilder * `"MyDivision.MyBigCompany.com"`, `"github.com/MyProject/MyApplication"`. * * - * string producer = 2; + * string producer = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return The producer. */ @@ -73,7 +73,7 @@ public interface LogEntryOperationOrBuilder * `"MyDivision.MyBigCompany.com"`, `"github.com/MyProject/MyApplication"`. * * - * string producer = 2; + * string producer = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for producer. */ @@ -86,7 +86,7 @@ public interface LogEntryOperationOrBuilder * Optional. Set this to True if this is the first log entry in the operation. * * - * bool first = 3; + * bool first = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return The first. */ @@ -99,7 +99,7 @@ public interface LogEntryOperationOrBuilder * Optional. Set this to True if this is the last log entry in the operation. * * - * bool last = 4; + * bool last = 4 [(.google.api.field_behavior) = OPTIONAL]; * * @return The last. */ diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntryOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntryOrBuilder.java index 4ce3fea2e..3e6d1937d 100644 --- a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntryOrBuilder.java +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntryOrBuilder.java @@ -32,9 +32,9 @@ public interface LogEntryOrBuilder * "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" * "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" * "folders/[FOLDER_ID]/logs/[LOG_ID]" - * A project number may optionally be used in place of PROJECT_ID. The project - * number is translated to its corresponding PROJECT_ID internally and the - * `log_name` field will contain PROJECT_ID in queries and exports. + * A project number may be used in place of PROJECT_ID. The project number is + * translated to its corresponding PROJECT_ID internally and the `log_name` + * field will contain PROJECT_ID in queries and exports. * `[LOG_ID]` must be URL-encoded within `log_name`. Example: * `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`. * `[LOG_ID]` must be less than 512 characters long and can only include the @@ -47,7 +47,7 @@ public interface LogEntryOrBuilder * any results. * * - * string log_name = 12; + * string log_name = 12 [(.google.api.field_behavior) = REQUIRED]; * * @return The logName. */ @@ -61,9 +61,9 @@ public interface LogEntryOrBuilder * "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" * "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" * "folders/[FOLDER_ID]/logs/[LOG_ID]" - * A project number may optionally be used in place of PROJECT_ID. The project - * number is translated to its corresponding PROJECT_ID internally and the - * `log_name` field will contain PROJECT_ID in queries and exports. + * A project number may be used in place of PROJECT_ID. The project number is + * translated to its corresponding PROJECT_ID internally and the `log_name` + * field will contain PROJECT_ID in queries and exports. * `[LOG_ID]` must be URL-encoded within `log_name`. Example: * `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`. * `[LOG_ID]` must be less than 512 characters long and can only include the @@ -76,7 +76,7 @@ public interface LogEntryOrBuilder * any results. * * - * string log_name = 12; + * string log_name = 12 [(.google.api.field_behavior) = REQUIRED]; * * @return The bytes for logName. */ @@ -92,7 +92,8 @@ public interface LogEntryOrBuilder * the error. * * - * .google.api.MonitoredResource resource = 8; + * .google.api.MonitoredResource resource = 8 [(.google.api.field_behavior) = REQUIRED]; + * * * @return Whether the resource field is set. */ @@ -107,7 +108,8 @@ public interface LogEntryOrBuilder * the error. * * - * .google.api.MonitoredResource resource = 8; + * .google.api.MonitoredResource resource = 8 [(.google.api.field_behavior) = REQUIRED]; + * * * @return The resource. */ @@ -122,7 +124,8 @@ public interface LogEntryOrBuilder * the error. * * - * .google.api.MonitoredResource resource = 8; + * .google.api.MonitoredResource resource = 8 [(.google.api.field_behavior) = REQUIRED]; + * */ com.google.api.MonitoredResourceOrBuilder getResourceOrBuilder(); @@ -243,12 +246,11 @@ public interface LogEntryOrBuilder * * *
-   * Optional. The time the event described by the log entry occurred.  This
-   * time is used to compute the log entry's age and to enforce the logs
-   * retention period. If this field is omitted in a new log entry, then Logging
-   * assigns it the current time.  Timestamps have nanosecond accuracy, but
-   * trailing zeros in the fractional seconds might be omitted when the
-   * timestamp is displayed.
+   * Optional. The time the event described by the log entry occurred. This time is used
+   * to compute the log entry's age and to enforce the logs retention period.
+   * If this field is omitted in a new log entry, then Logging assigns it the
+   * current time. Timestamps have nanosecond accuracy, but trailing zeros in
+   * the fractional seconds might be omitted when the timestamp is displayed.
    * Incoming log entries should have timestamps that are no more than the [logs
    * retention period](/logging/quotas) in the past, and no more than 24 hours
    * in the future. Log entries outside those time boundaries will not be
@@ -256,7 +258,8 @@ public interface LogEntryOrBuilder
    * [exported with LogSinks](/logging/docs/api/tasks/exporting-logs).
    * 
* - * .google.protobuf.Timestamp timestamp = 9; + * .google.protobuf.Timestamp timestamp = 9 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return Whether the timestamp field is set. */ @@ -265,12 +268,11 @@ public interface LogEntryOrBuilder * * *
-   * Optional. The time the event described by the log entry occurred.  This
-   * time is used to compute the log entry's age and to enforce the logs
-   * retention period. If this field is omitted in a new log entry, then Logging
-   * assigns it the current time.  Timestamps have nanosecond accuracy, but
-   * trailing zeros in the fractional seconds might be omitted when the
-   * timestamp is displayed.
+   * Optional. The time the event described by the log entry occurred. This time is used
+   * to compute the log entry's age and to enforce the logs retention period.
+   * If this field is omitted in a new log entry, then Logging assigns it the
+   * current time. Timestamps have nanosecond accuracy, but trailing zeros in
+   * the fractional seconds might be omitted when the timestamp is displayed.
    * Incoming log entries should have timestamps that are no more than the [logs
    * retention period](/logging/quotas) in the past, and no more than 24 hours
    * in the future. Log entries outside those time boundaries will not be
@@ -278,7 +280,8 @@ public interface LogEntryOrBuilder
    * [exported with LogSinks](/logging/docs/api/tasks/exporting-logs).
    * 
* - * .google.protobuf.Timestamp timestamp = 9; + * .google.protobuf.Timestamp timestamp = 9 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return The timestamp. */ @@ -287,12 +290,11 @@ public interface LogEntryOrBuilder * * *
-   * Optional. The time the event described by the log entry occurred.  This
-   * time is used to compute the log entry's age and to enforce the logs
-   * retention period. If this field is omitted in a new log entry, then Logging
-   * assigns it the current time.  Timestamps have nanosecond accuracy, but
-   * trailing zeros in the fractional seconds might be omitted when the
-   * timestamp is displayed.
+   * Optional. The time the event described by the log entry occurred. This time is used
+   * to compute the log entry's age and to enforce the logs retention period.
+   * If this field is omitted in a new log entry, then Logging assigns it the
+   * current time. Timestamps have nanosecond accuracy, but trailing zeros in
+   * the fractional seconds might be omitted when the timestamp is displayed.
    * Incoming log entries should have timestamps that are no more than the [logs
    * retention period](/logging/quotas) in the past, and no more than 24 hours
    * in the future. Log entries outside those time boundaries will not be
@@ -300,7 +302,8 @@ public interface LogEntryOrBuilder
    * [exported with LogSinks](/logging/docs/api/tasks/exporting-logs).
    * 
* - * .google.protobuf.Timestamp timestamp = 9; + * .google.protobuf.Timestamp timestamp = 9 [(.google.api.field_behavior) = OPTIONAL]; + * */ com.google.protobuf.TimestampOrBuilder getTimestampOrBuilder(); @@ -311,7 +314,9 @@ public interface LogEntryOrBuilder * Output only. The time the log entry was received by Logging. * * - * .google.protobuf.Timestamp receive_timestamp = 24; + * + * .google.protobuf.Timestamp receive_timestamp = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return Whether the receiveTimestamp field is set. */ @@ -323,7 +328,9 @@ public interface LogEntryOrBuilder * Output only. The time the log entry was received by Logging. * * - * .google.protobuf.Timestamp receive_timestamp = 24; + * + * .google.protobuf.Timestamp receive_timestamp = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return The receiveTimestamp. */ @@ -335,7 +342,9 @@ public interface LogEntryOrBuilder * Output only. The time the log entry was received by Logging. * * - * .google.protobuf.Timestamp receive_timestamp = 24; + * + * .google.protobuf.Timestamp receive_timestamp = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ com.google.protobuf.TimestampOrBuilder getReceiveTimestampOrBuilder(); @@ -343,11 +352,11 @@ public interface LogEntryOrBuilder * * *
-   * Optional. The severity of the log entry. The default value is
-   * `LogSeverity.DEFAULT`.
+   * Optional. The severity of the log entry. The default value is `LogSeverity.DEFAULT`.
    * 
* - * .google.logging.type.LogSeverity severity = 10; + * .google.logging.type.LogSeverity severity = 10 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return The enum numeric value on the wire for severity. */ @@ -356,11 +365,11 @@ public interface LogEntryOrBuilder * * *
-   * Optional. The severity of the log entry. The default value is
-   * `LogSeverity.DEFAULT`.
+   * Optional. The severity of the log entry. The default value is `LogSeverity.DEFAULT`.
    * 
* - * .google.logging.type.LogSeverity severity = 10; + * .google.logging.type.LogSeverity severity = 10 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return The severity. */ @@ -370,8 +379,8 @@ public interface LogEntryOrBuilder * * *
-   * Optional. A unique identifier for the log entry. If you provide a value,
-   * then Logging considers other log entries in the same project, with the same
+   * Optional. A unique identifier for the log entry. If you provide a value, then
+   * Logging considers other log entries in the same project, with the same
    * `timestamp`, and with the same `insert_id` to be duplicates which are
    * removed in a single query result. However, there are no guarantees of
    * de-duplication in the export of logs.
@@ -381,7 +390,7 @@ public interface LogEntryOrBuilder
    * the same `log_name` and `timestamp` values.
    * 
* - * string insert_id = 4; + * string insert_id = 4 [(.google.api.field_behavior) = OPTIONAL]; * * @return The insertId. */ @@ -390,8 +399,8 @@ public interface LogEntryOrBuilder * * *
-   * Optional. A unique identifier for the log entry. If you provide a value,
-   * then Logging considers other log entries in the same project, with the same
+   * Optional. A unique identifier for the log entry. If you provide a value, then
+   * Logging considers other log entries in the same project, with the same
    * `timestamp`, and with the same `insert_id` to be duplicates which are
    * removed in a single query result. However, there are no guarantees of
    * de-duplication in the export of logs.
@@ -401,7 +410,7 @@ public interface LogEntryOrBuilder
    * the same `log_name` and `timestamp` values.
    * 
* - * string insert_id = 4; + * string insert_id = 4 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for insertId. */ @@ -411,11 +420,13 @@ public interface LogEntryOrBuilder * * *
-   * Optional. Information about the HTTP request associated with this log
-   * entry, if applicable.
+   * Optional. Information about the HTTP request associated with this log entry, if
+   * applicable.
    * 
* - * .google.logging.type.HttpRequest http_request = 7; + * + * .google.logging.type.HttpRequest http_request = 7 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return Whether the httpRequest field is set. */ @@ -424,11 +435,13 @@ public interface LogEntryOrBuilder * * *
-   * Optional. Information about the HTTP request associated with this log
-   * entry, if applicable.
+   * Optional. Information about the HTTP request associated with this log entry, if
+   * applicable.
    * 
* - * .google.logging.type.HttpRequest http_request = 7; + * + * .google.logging.type.HttpRequest http_request = 7 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return The httpRequest. */ @@ -437,11 +450,13 @@ public interface LogEntryOrBuilder * * *
-   * Optional. Information about the HTTP request associated with this log
-   * entry, if applicable.
+   * Optional. Information about the HTTP request associated with this log entry, if
+   * applicable.
    * 
* - * .google.logging.type.HttpRequest http_request = 7; + * + * .google.logging.type.HttpRequest http_request = 7 [(.google.api.field_behavior) = OPTIONAL]; + * */ com.google.logging.type.HttpRequestOrBuilder getHttpRequestOrBuilder(); @@ -453,7 +468,7 @@ public interface LogEntryOrBuilder * information about the log entry. * * - * map<string, string> labels = 11; + * map<string, string> labels = 11 [(.google.api.field_behavior) = OPTIONAL]; */ int getLabelsCount(); /** @@ -464,7 +479,7 @@ public interface LogEntryOrBuilder * information about the log entry. * * - * map<string, string> labels = 11; + * map<string, string> labels = 11 [(.google.api.field_behavior) = OPTIONAL]; */ boolean containsLabels(java.lang.String key); /** Use {@link #getLabelsMap()} instead. */ @@ -478,7 +493,7 @@ public interface LogEntryOrBuilder * information about the log entry. * * - * map<string, string> labels = 11; + * map<string, string> labels = 11 [(.google.api.field_behavior) = OPTIONAL]; */ java.util.Map getLabelsMap(); /** @@ -489,7 +504,7 @@ public interface LogEntryOrBuilder * information about the log entry. * * - * map<string, string> labels = 11; + * map<string, string> labels = 11 [(.google.api.field_behavior) = OPTIONAL]; */ java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue); /** @@ -500,69 +515,10 @@ public interface LogEntryOrBuilder * information about the log entry. * * - * map<string, string> labels = 11; + * map<string, string> labels = 11 [(.google.api.field_behavior) = OPTIONAL]; */ java.lang.String getLabelsOrThrow(java.lang.String key); - /** - * - * - *
-   * Deprecated. Output only. Additional metadata about the monitored resource.
-   * Only `k8s_container`, `k8s_pod`, and `k8s_node` MonitoredResources have
-   * this field populated for GKE versions older than 1.12.6. For GKE versions
-   * 1.12.6 and above, the `metadata` field has been deprecated. The Kubernetes
-   * pod labels that used to be in `metadata.userLabels` will now be present in
-   * the `labels` field with a key prefix of `k8s-pod/`. The Stackdriver system
-   * labels that were present in the `metadata.systemLabels` field will no
-   * longer be available in the LogEntry.
-   * 
- * - * .google.api.MonitoredResourceMetadata metadata = 25 [deprecated = true]; - * - * @return Whether the metadata field is set. - */ - @java.lang.Deprecated - boolean hasMetadata(); - /** - * - * - *
-   * Deprecated. Output only. Additional metadata about the monitored resource.
-   * Only `k8s_container`, `k8s_pod`, and `k8s_node` MonitoredResources have
-   * this field populated for GKE versions older than 1.12.6. For GKE versions
-   * 1.12.6 and above, the `metadata` field has been deprecated. The Kubernetes
-   * pod labels that used to be in `metadata.userLabels` will now be present in
-   * the `labels` field with a key prefix of `k8s-pod/`. The Stackdriver system
-   * labels that were present in the `metadata.systemLabels` field will no
-   * longer be available in the LogEntry.
-   * 
- * - * .google.api.MonitoredResourceMetadata metadata = 25 [deprecated = true]; - * - * @return The metadata. - */ - @java.lang.Deprecated - com.google.api.MonitoredResourceMetadata getMetadata(); - /** - * - * - *
-   * Deprecated. Output only. Additional metadata about the monitored resource.
-   * Only `k8s_container`, `k8s_pod`, and `k8s_node` MonitoredResources have
-   * this field populated for GKE versions older than 1.12.6. For GKE versions
-   * 1.12.6 and above, the `metadata` field has been deprecated. The Kubernetes
-   * pod labels that used to be in `metadata.userLabels` will now be present in
-   * the `labels` field with a key prefix of `k8s-pod/`. The Stackdriver system
-   * labels that were present in the `metadata.systemLabels` field will no
-   * longer be available in the LogEntry.
-   * 
- * - * .google.api.MonitoredResourceMetadata metadata = 25 [deprecated = true]; - */ - @java.lang.Deprecated - com.google.api.MonitoredResourceMetadataOrBuilder getMetadataOrBuilder(); - /** * * @@ -571,7 +527,9 @@ public interface LogEntryOrBuilder * applicable. * * - * .google.logging.v2.LogEntryOperation operation = 15; + * + * .google.logging.v2.LogEntryOperation operation = 15 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return Whether the operation field is set. */ @@ -584,7 +542,9 @@ public interface LogEntryOrBuilder * applicable. * * - * .google.logging.v2.LogEntryOperation operation = 15; + * + * .google.logging.v2.LogEntryOperation operation = 15 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return The operation. */ @@ -597,7 +557,9 @@ public interface LogEntryOrBuilder * applicable. * * - * .google.logging.v2.LogEntryOperation operation = 15; + * + * .google.logging.v2.LogEntryOperation operation = 15 [(.google.api.field_behavior) = OPTIONAL]; + * */ com.google.logging.v2.LogEntryOperationOrBuilder getOperationOrBuilder(); @@ -605,13 +567,13 @@ public interface LogEntryOrBuilder * * *
-   * Optional. Resource name of the trace associated with the log entry, if any.
-   * If it contains a relative resource name, the name is assumed to be relative
-   * to `//tracing.googleapis.com`. Example:
+   * Optional. Resource name of the trace associated with the log entry, if any. If it
+   * contains a relative resource name, the name is assumed to be relative to
+   * `//tracing.googleapis.com`. Example:
    * `projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824`
    * 
* - * string trace = 22; + * string trace = 22 [(.google.api.field_behavior) = OPTIONAL]; * * @return The trace. */ @@ -620,13 +582,13 @@ public interface LogEntryOrBuilder * * *
-   * Optional. Resource name of the trace associated with the log entry, if any.
-   * If it contains a relative resource name, the name is assumed to be relative
-   * to `//tracing.googleapis.com`. Example:
+   * Optional. Resource name of the trace associated with the log entry, if any. If it
+   * contains a relative resource name, the name is assumed to be relative to
+   * `//tracing.googleapis.com`. Example:
    * `projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824`
    * 
* - * string trace = 22; + * string trace = 22 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for trace. */ @@ -639,10 +601,10 @@ public interface LogEntryOrBuilder * Optional. The span ID within the trace associated with the log entry. * For Trace spans, this is the same format that the Trace API v2 uses: a * 16-character hexadecimal encoding of an 8-byte array, such as - * <code>"000000000000004a"</code>. + * `000000000000004a`. * * - * string span_id = 27; + * string span_id = 27 [(.google.api.field_behavior) = OPTIONAL]; * * @return The spanId. */ @@ -654,10 +616,10 @@ public interface LogEntryOrBuilder * Optional. The span ID within the trace associated with the log entry. * For Trace spans, this is the same format that the Trace API v2 uses: a * 16-character hexadecimal encoding of an 8-byte array, such as - * <code>"000000000000004a"</code>. + * `000000000000004a`. * * - * string span_id = 27; + * string span_id = 27 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for spanId. */ @@ -675,7 +637,7 @@ public interface LogEntryOrBuilder * request correlation identifier. The default is False. * * - * bool trace_sampled = 30; + * bool trace_sampled = 30 [(.google.api.field_behavior) = OPTIONAL]; * * @return The traceSampled. */ @@ -685,11 +647,12 @@ public interface LogEntryOrBuilder * * *
-   * Optional. Source code location information associated with the log entry,
-   * if any.
+   * Optional. Source code location information associated with the log entry, if any.
    * 
* - * .google.logging.v2.LogEntrySourceLocation source_location = 23; + * + * .google.logging.v2.LogEntrySourceLocation source_location = 23 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return Whether the sourceLocation field is set. */ @@ -698,11 +661,12 @@ public interface LogEntryOrBuilder * * *
-   * Optional. Source code location information associated with the log entry,
-   * if any.
+   * Optional. Source code location information associated with the log entry, if any.
    * 
* - * .google.logging.v2.LogEntrySourceLocation source_location = 23; + * + * .google.logging.v2.LogEntrySourceLocation source_location = 23 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return The sourceLocation. */ @@ -711,11 +675,12 @@ public interface LogEntryOrBuilder * * *
-   * Optional. Source code location information associated with the log entry,
-   * if any.
+   * Optional. Source code location information associated with the log entry, if any.
    * 
* - * .google.logging.v2.LogEntrySourceLocation source_location = 23; + * + * .google.logging.v2.LogEntrySourceLocation source_location = 23 [(.google.api.field_behavior) = OPTIONAL]; + * */ com.google.logging.v2.LogEntrySourceLocationOrBuilder getSourceLocationOrBuilder(); diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntryProto.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntryProto.java index 72738471f..3f0612226 100644 --- a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntryProto.java +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntryProto.java @@ -53,51 +53,54 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { static { java.lang.String[] descriptorData = { "\n!google/logging/v2/log_entry.proto\022\021goo" - + "gle.logging.v2\032#google/api/monitored_res" - + "ource.proto\032\031google/api/resource.proto\032&" - + "google/logging/type/http_request.proto\032&" - + "google/logging/type/log_severity.proto\032\031" - + "google/protobuf/any.proto\032\034google/protob" - + "uf/struct.proto\032\037google/protobuf/timesta" - + "mp.proto\032\027google/rpc/status.proto\032\034googl" - + "e/api/annotations.proto\"\316\007\n\010LogEntry\022\020\n\010" - + "log_name\030\014 \001(\t\022/\n\010resource\030\010 \001(\0132\035.googl" - + "e.api.MonitoredResource\022-\n\rproto_payload" - + "\030\002 \001(\0132\024.google.protobuf.AnyH\000\022\026\n\014text_p" - + "ayload\030\003 \001(\tH\000\022/\n\014json_payload\030\006 \001(\0132\027.g" - + "oogle.protobuf.StructH\000\022-\n\ttimestamp\030\t \001" - + "(\0132\032.google.protobuf.Timestamp\0225\n\021receiv" - + "e_timestamp\030\030 \001(\0132\032.google.protobuf.Time" - + "stamp\0222\n\010severity\030\n \001(\0162 .google.logging" - + ".type.LogSeverity\022\021\n\tinsert_id\030\004 \001(\t\0226\n\014" - + "http_request\030\007 \001(\0132 .google.logging.type" - + ".HttpRequest\0227\n\006labels\030\013 \003(\0132\'.google.lo" - + "gging.v2.LogEntry.LabelsEntry\022;\n\010metadat" - + "a\030\031 \001(\0132%.google.api.MonitoredResourceMe" - + "tadataB\002\030\001\0227\n\toperation\030\017 \001(\0132$.google.l" - + "ogging.v2.LogEntryOperation\022\r\n\005trace\030\026 \001" - + "(\t\022\017\n\007span_id\030\033 \001(\t\022\025\n\rtrace_sampled\030\036 \001" - + "(\010\022B\n\017source_location\030\027 \001(\0132).google.log" - + "ging.v2.LogEntrySourceLocation\032-\n\013Labels" - + "Entry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001:\275\001" - + "\352A\271\001\n\032logging.googleapis.com/Log\022\035projec" - + "ts/{project}/logs/{log}\022\'organizations/{" - + "organization}/logs/{log}\022\033folders/{folde" - + "r}/logs/{log}\022,billingAccounts/{billing_" - + "account}/logs/{log}\032\010log_nameB\t\n\007payload" - + "\"N\n\021LogEntryOperation\022\n\n\002id\030\001 \001(\t\022\020\n\010pro" - + "ducer\030\002 \001(\t\022\r\n\005first\030\003 \001(\010\022\014\n\004last\030\004 \001(\010" - + "\"F\n\026LogEntrySourceLocation\022\014\n\004file\030\001 \001(\t" - + "\022\014\n\004line\030\002 \001(\003\022\020\n\010function\030\003 \001(\tB\231\001\n\025com" - + ".google.logging.v2B\rLogEntryProtoP\001Z8goo" - + "gle.golang.org/genproto/googleapis/loggi" - + "ng/v2;logging\370\001\001\252\002\027Google.Cloud.Logging." - + "V2\312\002\027Google\\Cloud\\Logging\\V2b\006proto3" + + "gle.logging.v2\032\037google/api/field_behavio" + + "r.proto\032#google/api/monitored_resource.p" + + "roto\032\031google/api/resource.proto\032&google/" + + "logging/type/http_request.proto\032&google/" + + "logging/type/log_severity.proto\032\031google/" + + "protobuf/any.proto\032\034google/protobuf/stru" + + "ct.proto\032\037google/protobuf/timestamp.prot" + + "o\032\027google/rpc/status.proto\032\034google/api/a" + + "nnotations.proto\"\322\007\n\010LogEntry\022\025\n\010log_nam" + + "e\030\014 \001(\tB\003\340A\002\0224\n\010resource\030\010 \001(\0132\035.google." + + "api.MonitoredResourceB\003\340A\002\022-\n\rproto_payl" + + "oad\030\002 \001(\0132\024.google.protobuf.AnyH\000\022\026\n\014tex" + + "t_payload\030\003 \001(\tH\000\022/\n\014json_payload\030\006 \001(\0132" + + "\027.google.protobuf.StructH\000\0222\n\ttimestamp\030" + + "\t \001(\0132\032.google.protobuf.TimestampB\003\340A\001\022:" + + "\n\021receive_timestamp\030\030 \001(\0132\032.google.proto" + + "buf.TimestampB\003\340A\003\0227\n\010severity\030\n \001(\0162 .g" + + "oogle.logging.type.LogSeverityB\003\340A\001\022\026\n\ti" + + "nsert_id\030\004 \001(\tB\003\340A\001\022;\n\014http_request\030\007 \001(" + + "\0132 .google.logging.type.HttpRequestB\003\340A\001" + + "\022<\n\006labels\030\013 \003(\0132\'.google.logging.v2.Log" + + "Entry.LabelsEntryB\003\340A\001\022<\n\toperation\030\017 \001(" + + "\0132$.google.logging.v2.LogEntryOperationB" + + "\003\340A\001\022\022\n\005trace\030\026 \001(\tB\003\340A\001\022\024\n\007span_id\030\033 \001(" + + "\tB\003\340A\001\022\032\n\rtrace_sampled\030\036 \001(\010B\003\340A\001\022G\n\017so" + + "urce_location\030\027 \001(\0132).google.logging.v2." + + "LogEntrySourceLocationB\003\340A\001\032-\n\013LabelsEnt" + + "ry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001:\275\001\352A\271" + + "\001\n\032logging.googleapis.com/Log\022\035projects/" + + "{project}/logs/{log}\022\'organizations/{org" + + "anization}/logs/{log}\022\033folders/{folder}/" + + "logs/{log}\022,billingAccounts/{billing_acc" + + "ount}/logs/{log}\032\010log_nameB\t\n\007payload\"b\n" + + "\021LogEntryOperation\022\017\n\002id\030\001 \001(\tB\003\340A\001\022\025\n\010p" + + "roducer\030\002 \001(\tB\003\340A\001\022\022\n\005first\030\003 \001(\010B\003\340A\001\022\021" + + "\n\004last\030\004 \001(\010B\003\340A\001\"U\n\026LogEntrySourceLocat" + + "ion\022\021\n\004file\030\001 \001(\tB\003\340A\001\022\021\n\004line\030\002 \001(\003B\003\340A" + + "\001\022\025\n\010function\030\003 \001(\tB\003\340A\001B\231\001\n\025com.google." + + "logging.v2B\rLogEntryProtoP\001Z8google.gola" + + "ng.org/genproto/googleapis/logging/v2;lo" + + "gging\370\001\001\252\002\027Google.Cloud.Logging.V2\312\002\027Goo" + + "gle\\Cloud\\Logging\\V2b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), com.google.api.MonitoredResourceProto.getDescriptor(), com.google.api.ResourceProto.getDescriptor(), com.google.logging.type.HttpRequestProto.getDescriptor(), @@ -125,7 +128,6 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "InsertId", "HttpRequest", "Labels", - "Metadata", "Operation", "Trace", "SpanId", @@ -159,9 +161,11 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { }); com.google.protobuf.ExtensionRegistry registry = com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); registry.add(com.google.api.ResourceProto.resource); com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); com.google.api.MonitoredResourceProto.getDescriptor(); com.google.api.ResourceProto.getDescriptor(); com.google.logging.type.HttpRequestProto.getDescriptor(); diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntrySourceLocation.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntrySourceLocation.java index c62f17d5b..b1804fa02 100644 --- a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntrySourceLocation.java +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntrySourceLocation.java @@ -135,7 +135,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * might be a simple name or a fully-qualified name. * * - * string file = 1; + * string file = 1 [(.google.api.field_behavior) = OPTIONAL]; * * @return The file. */ @@ -158,7 +158,7 @@ public java.lang.String getFile() { * might be a simple name or a fully-qualified name. * * - * string file = 1; + * string file = 1 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for file. */ @@ -184,7 +184,7 @@ public com.google.protobuf.ByteString getFileBytes() { * available. * * - * int64 line = 2; + * int64 line = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return The line. */ @@ -206,7 +206,7 @@ public long getLine() { * (Python). * * - * string function = 3; + * string function = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return The function. */ @@ -233,7 +233,7 @@ public java.lang.String getFunction() { * (Python). * * - * string function = 3; + * string function = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for function. */ @@ -606,7 +606,7 @@ public Builder mergeFrom( * might be a simple name or a fully-qualified name. * * - * string file = 1; + * string file = 1 [(.google.api.field_behavior) = OPTIONAL]; * * @return The file. */ @@ -629,7 +629,7 @@ public java.lang.String getFile() { * might be a simple name or a fully-qualified name. * * - * string file = 1; + * string file = 1 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for file. */ @@ -652,7 +652,7 @@ public com.google.protobuf.ByteString getFileBytes() { * might be a simple name or a fully-qualified name. * * - * string file = 1; + * string file = 1 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The file to set. * @return This builder for chaining. @@ -674,7 +674,7 @@ public Builder setFile(java.lang.String value) { * might be a simple name or a fully-qualified name. * * - * string file = 1; + * string file = 1 [(.google.api.field_behavior) = OPTIONAL]; * * @return This builder for chaining. */ @@ -692,7 +692,7 @@ public Builder clearFile() { * might be a simple name or a fully-qualified name. * * - * string file = 1; + * string file = 1 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The bytes for file to set. * @return This builder for chaining. @@ -717,7 +717,7 @@ public Builder setFileBytes(com.google.protobuf.ByteString value) { * available. * * - * int64 line = 2; + * int64 line = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return The line. */ @@ -732,7 +732,7 @@ public long getLine() { * available. * * - * int64 line = 2; + * int64 line = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The line to set. * @return This builder for chaining. @@ -751,7 +751,7 @@ public Builder setLine(long value) { * available. * * - * int64 line = 2; + * int64 line = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return This builder for chaining. */ @@ -775,7 +775,7 @@ public Builder clearLine() { * (Python). * * - * string function = 3; + * string function = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return The function. */ @@ -802,7 +802,7 @@ public java.lang.String getFunction() { * (Python). * * - * string function = 3; + * string function = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for function. */ @@ -829,7 +829,7 @@ public com.google.protobuf.ByteString getFunctionBytes() { * (Python). * * - * string function = 3; + * string function = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The function to set. * @return This builder for chaining. @@ -855,7 +855,7 @@ public Builder setFunction(java.lang.String value) { * (Python). * * - * string function = 3; + * string function = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return This builder for chaining. */ @@ -877,7 +877,7 @@ public Builder clearFunction() { * (Python). * * - * string function = 3; + * string function = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The bytes for function to set. * @return This builder for chaining. diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntrySourceLocationOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntrySourceLocationOrBuilder.java index 4d524ac00..e341dc47b 100644 --- a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntrySourceLocationOrBuilder.java +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntrySourceLocationOrBuilder.java @@ -31,7 +31,7 @@ public interface LogEntrySourceLocationOrBuilder * might be a simple name or a fully-qualified name. * * - * string file = 1; + * string file = 1 [(.google.api.field_behavior) = OPTIONAL]; * * @return The file. */ @@ -44,7 +44,7 @@ public interface LogEntrySourceLocationOrBuilder * might be a simple name or a fully-qualified name. * * - * string file = 1; + * string file = 1 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for file. */ @@ -58,7 +58,7 @@ public interface LogEntrySourceLocationOrBuilder * available. * * - * int64 line = 2; + * int64 line = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return The line. */ @@ -76,7 +76,7 @@ public interface LogEntrySourceLocationOrBuilder * (Python). * * - * string function = 3; + * string function = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return The function. */ @@ -93,7 +93,7 @@ public interface LogEntrySourceLocationOrBuilder * (Python). * * - * string function = 3; + * string function = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for function. */ diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogExclusion.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogExclusion.java index c59e7d551..e3d55e963 100644 --- a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogExclusion.java +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogExclusion.java @@ -173,13 +173,13 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * Required. A client-assigned identifier, such as
-   * `"load-balancer-exclusion"`. Identifiers are limited to 100 characters and
-   * can include only letters, digits, underscores, hyphens, and periods.
-   * First character has to be alphanumeric.
+   * Required. A client-assigned identifier, such as `"load-balancer-exclusion"`.
+   * Identifiers are limited to 100 characters and can include only letters,
+   * digits, underscores, hyphens, and periods. First character has to be
+   * alphanumeric.
    * 
* - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The name. */ @@ -198,13 +198,13 @@ public java.lang.String getName() { * * *
-   * Required. A client-assigned identifier, such as
-   * `"load-balancer-exclusion"`. Identifiers are limited to 100 characters and
-   * can include only letters, digits, underscores, hyphens, and periods.
-   * First character has to be alphanumeric.
+   * Required. A client-assigned identifier, such as `"load-balancer-exclusion"`.
+   * Identifiers are limited to 100 characters and can include only letters,
+   * digits, underscores, hyphens, and periods. First character has to be
+   * alphanumeric.
    * 
* - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The bytes for name. */ @@ -229,7 +229,7 @@ public com.google.protobuf.ByteString getNameBytes() { * Optional. A description of this exclusion. * * - * string description = 2; + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return The description. */ @@ -251,7 +251,7 @@ public java.lang.String getDescription() { * Optional. A description of this exclusion. * * - * string description = 2; + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for description. */ @@ -282,7 +282,7 @@ public com.google.protobuf.ByteString getDescriptionBytes() { * `"resource.type=gcs_bucket severity<ERROR sample(insertId, 0.99)"` * * - * string filter = 3; + * string filter = 3 [(.google.api.field_behavior) = REQUIRED]; * * @return The filter. */ @@ -310,7 +310,7 @@ public java.lang.String getFilter() { * `"resource.type=gcs_bucket severity<ERROR sample(insertId, 0.99)"` * * - * string filter = 3; + * string filter = 3 [(.google.api.field_behavior) = REQUIRED]; * * @return The bytes for filter. */ @@ -338,7 +338,7 @@ public com.google.protobuf.ByteString getFilterBytes() { * value of this field. * * - * bool disabled = 4; + * bool disabled = 4 [(.google.api.field_behavior) = OPTIONAL]; * * @return The disabled. */ @@ -356,7 +356,8 @@ public boolean getDisabled() { * This field may not be present for older exclusions. * * - * .google.protobuf.Timestamp create_time = 5; + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return Whether the createTime field is set. */ @@ -371,7 +372,8 @@ public boolean hasCreateTime() { * This field may not be present for older exclusions. * * - * .google.protobuf.Timestamp create_time = 5; + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return The createTime. */ @@ -386,7 +388,8 @@ public com.google.protobuf.Timestamp getCreateTime() { * This field may not be present for older exclusions. * * - * .google.protobuf.Timestamp create_time = 5; + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { return getCreateTime(); @@ -402,7 +405,8 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { * This field may not be present for older exclusions. * * - * .google.protobuf.Timestamp update_time = 6; + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return Whether the updateTime field is set. */ @@ -417,7 +421,8 @@ public boolean hasUpdateTime() { * This field may not be present for older exclusions. * * - * .google.protobuf.Timestamp update_time = 6; + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return The updateTime. */ @@ -432,7 +437,8 @@ public com.google.protobuf.Timestamp getUpdateTime() { * This field may not be present for older exclusions. * * - * .google.protobuf.Timestamp update_time = 6; + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { return getUpdateTime(); @@ -864,13 +870,13 @@ public Builder mergeFrom( * * *
-     * Required. A client-assigned identifier, such as
-     * `"load-balancer-exclusion"`. Identifiers are limited to 100 characters and
-     * can include only letters, digits, underscores, hyphens, and periods.
-     * First character has to be alphanumeric.
+     * Required. A client-assigned identifier, such as `"load-balancer-exclusion"`.
+     * Identifiers are limited to 100 characters and can include only letters,
+     * digits, underscores, hyphens, and periods. First character has to be
+     * alphanumeric.
      * 
* - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The name. */ @@ -889,13 +895,13 @@ public java.lang.String getName() { * * *
-     * Required. A client-assigned identifier, such as
-     * `"load-balancer-exclusion"`. Identifiers are limited to 100 characters and
-     * can include only letters, digits, underscores, hyphens, and periods.
-     * First character has to be alphanumeric.
+     * Required. A client-assigned identifier, such as `"load-balancer-exclusion"`.
+     * Identifiers are limited to 100 characters and can include only letters,
+     * digits, underscores, hyphens, and periods. First character has to be
+     * alphanumeric.
      * 
* - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The bytes for name. */ @@ -914,13 +920,13 @@ public com.google.protobuf.ByteString getNameBytes() { * * *
-     * Required. A client-assigned identifier, such as
-     * `"load-balancer-exclusion"`. Identifiers are limited to 100 characters and
-     * can include only letters, digits, underscores, hyphens, and periods.
-     * First character has to be alphanumeric.
+     * Required. A client-assigned identifier, such as `"load-balancer-exclusion"`.
+     * Identifiers are limited to 100 characters and can include only letters,
+     * digits, underscores, hyphens, and periods. First character has to be
+     * alphanumeric.
      * 
* - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @param value The name to set. * @return This builder for chaining. @@ -938,13 +944,13 @@ public Builder setName(java.lang.String value) { * * *
-     * Required. A client-assigned identifier, such as
-     * `"load-balancer-exclusion"`. Identifiers are limited to 100 characters and
-     * can include only letters, digits, underscores, hyphens, and periods.
-     * First character has to be alphanumeric.
+     * Required. A client-assigned identifier, such as `"load-balancer-exclusion"`.
+     * Identifiers are limited to 100 characters and can include only letters,
+     * digits, underscores, hyphens, and periods. First character has to be
+     * alphanumeric.
      * 
* - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return This builder for chaining. */ @@ -958,13 +964,13 @@ public Builder clearName() { * * *
-     * Required. A client-assigned identifier, such as
-     * `"load-balancer-exclusion"`. Identifiers are limited to 100 characters and
-     * can include only letters, digits, underscores, hyphens, and periods.
-     * First character has to be alphanumeric.
+     * Required. A client-assigned identifier, such as `"load-balancer-exclusion"`.
+     * Identifiers are limited to 100 characters and can include only letters,
+     * digits, underscores, hyphens, and periods. First character has to be
+     * alphanumeric.
      * 
* - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @param value The bytes for name to set. * @return This builder for chaining. @@ -988,7 +994,7 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { * Optional. A description of this exclusion. * * - * string description = 2; + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return The description. */ @@ -1010,7 +1016,7 @@ public java.lang.String getDescription() { * Optional. A description of this exclusion. * * - * string description = 2; + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for description. */ @@ -1032,7 +1038,7 @@ public com.google.protobuf.ByteString getDescriptionBytes() { * Optional. A description of this exclusion. * * - * string description = 2; + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The description to set. * @return This builder for chaining. @@ -1053,7 +1059,7 @@ public Builder setDescription(java.lang.String value) { * Optional. A description of this exclusion. * * - * string description = 2; + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return This builder for chaining. */ @@ -1070,7 +1076,7 @@ public Builder clearDescription() { * Optional. A description of this exclusion. * * - * string description = 2; + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The bytes for description to set. * @return This builder for chaining. @@ -1100,7 +1106,7 @@ public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { * `"resource.type=gcs_bucket severity<ERROR sample(insertId, 0.99)"` * * - * string filter = 3; + * string filter = 3 [(.google.api.field_behavior) = REQUIRED]; * * @return The filter. */ @@ -1128,7 +1134,7 @@ public java.lang.String getFilter() { * `"resource.type=gcs_bucket severity<ERROR sample(insertId, 0.99)"` * * - * string filter = 3; + * string filter = 3 [(.google.api.field_behavior) = REQUIRED]; * * @return The bytes for filter. */ @@ -1156,7 +1162,7 @@ public com.google.protobuf.ByteString getFilterBytes() { * `"resource.type=gcs_bucket severity<ERROR sample(insertId, 0.99)"` * * - * string filter = 3; + * string filter = 3 [(.google.api.field_behavior) = REQUIRED]; * * @param value The filter to set. * @return This builder for chaining. @@ -1183,7 +1189,7 @@ public Builder setFilter(java.lang.String value) { * `"resource.type=gcs_bucket severity<ERROR sample(insertId, 0.99)"` * * - * string filter = 3; + * string filter = 3 [(.google.api.field_behavior) = REQUIRED]; * * @return This builder for chaining. */ @@ -1206,7 +1212,7 @@ public Builder clearFilter() { * `"resource.type=gcs_bucket severity<ERROR sample(insertId, 0.99)"` * * - * string filter = 3; + * string filter = 3 [(.google.api.field_behavior) = REQUIRED]; * * @param value The bytes for filter to set. * @return This builder for chaining. @@ -1233,7 +1239,7 @@ public Builder setFilterBytes(com.google.protobuf.ByteString value) { * value of this field. * * - * bool disabled = 4; + * bool disabled = 4 [(.google.api.field_behavior) = OPTIONAL]; * * @return The disabled. */ @@ -1250,7 +1256,7 @@ public boolean getDisabled() { * value of this field. * * - * bool disabled = 4; + * bool disabled = 4 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The disabled to set. * @return This builder for chaining. @@ -1271,7 +1277,7 @@ public Builder setDisabled(boolean value) { * value of this field. * * - * bool disabled = 4; + * bool disabled = 4 [(.google.api.field_behavior) = OPTIONAL]; * * @return This builder for chaining. */ @@ -1296,7 +1302,9 @@ public Builder clearDisabled() { * This field may not be present for older exclusions. * * - * .google.protobuf.Timestamp create_time = 5; + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return Whether the createTime field is set. */ @@ -1311,7 +1319,9 @@ public boolean hasCreateTime() { * This field may not be present for older exclusions. * * - * .google.protobuf.Timestamp create_time = 5; + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return The createTime. */ @@ -1332,7 +1342,9 @@ public com.google.protobuf.Timestamp getCreateTime() { * This field may not be present for older exclusions. * * - * .google.protobuf.Timestamp create_time = 5; + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ public Builder setCreateTime(com.google.protobuf.Timestamp value) { if (createTimeBuilder_ == null) { @@ -1355,7 +1367,9 @@ public Builder setCreateTime(com.google.protobuf.Timestamp value) { * This field may not be present for older exclusions. * * - * .google.protobuf.Timestamp create_time = 5; + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { if (createTimeBuilder_ == null) { @@ -1375,7 +1389,9 @@ public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForVal * This field may not be present for older exclusions. * * - * .google.protobuf.Timestamp create_time = 5; + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { if (createTimeBuilder_ == null) { @@ -1400,7 +1416,9 @@ public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { * This field may not be present for older exclusions. * * - * .google.protobuf.Timestamp create_time = 5; + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ public Builder clearCreateTime() { if (createTimeBuilder_ == null) { @@ -1421,7 +1439,9 @@ public Builder clearCreateTime() { * This field may not be present for older exclusions. * * - * .google.protobuf.Timestamp create_time = 5; + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { @@ -1436,7 +1456,9 @@ public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { * This field may not be present for older exclusions. * * - * .google.protobuf.Timestamp create_time = 5; + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { if (createTimeBuilder_ != null) { @@ -1455,7 +1477,9 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { * This field may not be present for older exclusions. * * - * .google.protobuf.Timestamp create_time = 5; + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Timestamp, @@ -1488,7 +1512,9 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { * This field may not be present for older exclusions. * * - * .google.protobuf.Timestamp update_time = 6; + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return Whether the updateTime field is set. */ @@ -1503,7 +1529,9 @@ public boolean hasUpdateTime() { * This field may not be present for older exclusions. * * - * .google.protobuf.Timestamp update_time = 6; + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return The updateTime. */ @@ -1524,7 +1552,9 @@ public com.google.protobuf.Timestamp getUpdateTime() { * This field may not be present for older exclusions. * * - * .google.protobuf.Timestamp update_time = 6; + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ public Builder setUpdateTime(com.google.protobuf.Timestamp value) { if (updateTimeBuilder_ == null) { @@ -1547,7 +1577,9 @@ public Builder setUpdateTime(com.google.protobuf.Timestamp value) { * This field may not be present for older exclusions. * * - * .google.protobuf.Timestamp update_time = 6; + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { if (updateTimeBuilder_ == null) { @@ -1567,7 +1599,9 @@ public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForVal * This field may not be present for older exclusions. * * - * .google.protobuf.Timestamp update_time = 6; + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { if (updateTimeBuilder_ == null) { @@ -1592,7 +1626,9 @@ public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { * This field may not be present for older exclusions. * * - * .google.protobuf.Timestamp update_time = 6; + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ public Builder clearUpdateTime() { if (updateTimeBuilder_ == null) { @@ -1613,7 +1649,9 @@ public Builder clearUpdateTime() { * This field may not be present for older exclusions. * * - * .google.protobuf.Timestamp update_time = 6; + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { @@ -1628,7 +1666,9 @@ public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { * This field may not be present for older exclusions. * * - * .google.protobuf.Timestamp update_time = 6; + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { if (updateTimeBuilder_ != null) { @@ -1647,7 +1687,9 @@ public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { * This field may not be present for older exclusions. * * - * .google.protobuf.Timestamp update_time = 6; + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Timestamp, diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogExclusionName.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogExclusionName.java new file mode 100644 index 000000000..25d725c45 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogExclusionName.java @@ -0,0 +1,449 @@ +/* + * Copyright 2020 Google LLC + * + * 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 + * + * https://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.logging.v2; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.pathtemplate.ValidationException; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** AUTO-GENERATED DOCUMENTATION AND CLASS */ +@javax.annotation.Generated("by GAPIC protoc plugin") +public class LogExclusionName implements ResourceName { + + @Deprecated + protected LogExclusionName() {} + + private static final PathTemplate PROJECT_EXCLUSION_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/exclusions/{exclusion}"); + private static final PathTemplate ORGANIZATION_EXCLUSION_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("organizations/{organization}/exclusions/{exclusion}"); + private static final PathTemplate FOLDER_EXCLUSION_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("folders/{folder}/exclusions/{exclusion}"); + private static final PathTemplate BILLING_ACCOUNT_EXCLUSION_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "billingAccounts/{billing_account}/exclusions/{exclusion}"); + + private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; + + private String project; + private String exclusion; + private String organization; + private String folder; + private String billingAccount; + + public String getProject() { + return project; + } + + public String getExclusion() { + return exclusion; + } + + public String getOrganization() { + return organization; + } + + public String getFolder() { + return folder; + } + + public String getBillingAccount() { + return billingAccount; + } + + private LogExclusionName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + exclusion = Preconditions.checkNotNull(builder.getExclusion()); + pathTemplate = PROJECT_EXCLUSION_PATH_TEMPLATE; + } + + private LogExclusionName(OrganizationExclusionBuilder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + exclusion = Preconditions.checkNotNull(builder.getExclusion()); + pathTemplate = ORGANIZATION_EXCLUSION_PATH_TEMPLATE; + } + + private LogExclusionName(FolderExclusionBuilder builder) { + folder = Preconditions.checkNotNull(builder.getFolder()); + exclusion = Preconditions.checkNotNull(builder.getExclusion()); + pathTemplate = FOLDER_EXCLUSION_PATH_TEMPLATE; + } + + private LogExclusionName(BillingAccountExclusionBuilder builder) { + billingAccount = Preconditions.checkNotNull(builder.getBillingAccount()); + exclusion = Preconditions.checkNotNull(builder.getExclusion()); + pathTemplate = BILLING_ACCOUNT_EXCLUSION_PATH_TEMPLATE; + } + + public static Builder newBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static Builder newProjectExclusionBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static OrganizationExclusionBuilder newOrganizationExclusionBuilder() { + return new OrganizationExclusionBuilder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static FolderExclusionBuilder newFolderExclusionBuilder() { + return new FolderExclusionBuilder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static BillingAccountExclusionBuilder newBillingAccountExclusionBuilder() { + return new BillingAccountExclusionBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static LogExclusionName of(String project, String exclusion) { + return newProjectExclusionBuilder().setProject(project).setExclusion(exclusion).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static LogExclusionName ofProjectExclusionName(String project, String exclusion) { + return newProjectExclusionBuilder().setProject(project).setExclusion(exclusion).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static LogExclusionName ofOrganizationExclusionName( + String organization, String exclusion) { + return newOrganizationExclusionBuilder() + .setOrganization(organization) + .setExclusion(exclusion) + .build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static LogExclusionName ofFolderExclusionName(String folder, String exclusion) { + return newFolderExclusionBuilder().setFolder(folder).setExclusion(exclusion).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static LogExclusionName ofBillingAccountExclusionName( + String billingAccount, String exclusion) { + return newBillingAccountExclusionBuilder() + .setBillingAccount(billingAccount) + .setExclusion(exclusion) + .build(); + } + + public static String format(String project, String exclusion) { + return newBuilder().setProject(project).setExclusion(exclusion).build().toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatProjectExclusionName(String project, String exclusion) { + return newBuilder().setProject(project).setExclusion(exclusion).build().toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatOrganizationExclusionName(String organization, String exclusion) { + return newOrganizationExclusionBuilder() + .setOrganization(organization) + .setExclusion(exclusion) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatFolderExclusionName(String folder, String exclusion) { + return newFolderExclusionBuilder().setFolder(folder).setExclusion(exclusion).build().toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatBillingAccountExclusionName(String billingAccount, String exclusion) { + return newBillingAccountExclusionBuilder() + .setBillingAccount(billingAccount) + .setExclusion(exclusion) + .build() + .toString(); + } + + public static LogExclusionName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + if (PROJECT_EXCLUSION_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = PROJECT_EXCLUSION_PATH_TEMPLATE.match(formattedString); + return ofProjectExclusionName(matchMap.get("project"), matchMap.get("exclusion")); + } else if (ORGANIZATION_EXCLUSION_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = ORGANIZATION_EXCLUSION_PATH_TEMPLATE.match(formattedString); + return ofOrganizationExclusionName(matchMap.get("organization"), matchMap.get("exclusion")); + } else if (FOLDER_EXCLUSION_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = FOLDER_EXCLUSION_PATH_TEMPLATE.match(formattedString); + return ofFolderExclusionName(matchMap.get("folder"), matchMap.get("exclusion")); + } else if (BILLING_ACCOUNT_EXCLUSION_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = BILLING_ACCOUNT_EXCLUSION_PATH_TEMPLATE.match(formattedString); + return ofBillingAccountExclusionName( + matchMap.get("billing_account"), matchMap.get("exclusion")); + } + throw new ValidationException("JobName.parse: formattedString not in valid format"); + } + + @BetaApi("The method will be renamed to parseList after subclasses of this class are removed.") + public static List parse(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + @BetaApi("The method will be renamed to toStringList after subclasses of this class are removed.") + public static List toStrings(List values) { + List list = new ArrayList<>(values.size()); + for (LogExclusionName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_EXCLUSION_PATH_TEMPLATE.matches(formattedString) + || ORGANIZATION_EXCLUSION_PATH_TEMPLATE.matches(formattedString) + || FOLDER_EXCLUSION_PATH_TEMPLATE.matches(formattedString) + || BILLING_ACCOUNT_EXCLUSION_PATH_TEMPLATE.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (exclusion != null) { + fieldMapBuilder.put("exclusion", exclusion); + } + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + if (folder != null) { + fieldMapBuilder.put("folder", folder); + } + if (billingAccount != null) { + fieldMapBuilder.put("billing_account", billingAccount); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + } + + /** Builder for projects/{project}/exclusions/{exclusion}. */ + public static class Builder { + + private String project; + private String exclusion; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getExclusion() { + return exclusion; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setExclusion(String exclusion) { + this.exclusion = exclusion; + return this; + } + + private Builder(LogExclusionName logExclusionName) { + Preconditions.checkArgument( + logExclusionName.pathTemplate == PROJECT_EXCLUSION_PATH_TEMPLATE, + "toBuilder is only supported when LogExclusionName has the pattern of " + + "projects/{project}/exclusions/{exclusion}."); + project = logExclusionName.project; + exclusion = logExclusionName.exclusion; + } + + public LogExclusionName build() { + return new LogExclusionName(this); + } + } + + /** Builder for organizations/{organization}/exclusions/{exclusion}. */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class OrganizationExclusionBuilder { + + private String organization; + private String exclusion; + + private OrganizationExclusionBuilder() {} + + public String getOrganization() { + return organization; + } + + public String getExclusion() { + return exclusion; + } + + public OrganizationExclusionBuilder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public OrganizationExclusionBuilder setExclusion(String exclusion) { + this.exclusion = exclusion; + return this; + } + + public LogExclusionName build() { + return new LogExclusionName(this); + } + } + + /** Builder for folders/{folder}/exclusions/{exclusion}. */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class FolderExclusionBuilder { + + private String folder; + private String exclusion; + + private FolderExclusionBuilder() {} + + public String getFolder() { + return folder; + } + + public String getExclusion() { + return exclusion; + } + + public FolderExclusionBuilder setFolder(String folder) { + this.folder = folder; + return this; + } + + public FolderExclusionBuilder setExclusion(String exclusion) { + this.exclusion = exclusion; + return this; + } + + public LogExclusionName build() { + return new LogExclusionName(this); + } + } + + /** Builder for billingAccounts/{billing_account}/exclusions/{exclusion}. */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class BillingAccountExclusionBuilder { + + private String billingAccount; + private String exclusion; + + private BillingAccountExclusionBuilder() {} + + public String getBillingAccount() { + return billingAccount; + } + + public String getExclusion() { + return exclusion; + } + + public BillingAccountExclusionBuilder setBillingAccount(String billingAccount) { + this.billingAccount = billingAccount; + return this; + } + + public BillingAccountExclusionBuilder setExclusion(String exclusion) { + this.exclusion = exclusion; + return this; + } + + public LogExclusionName build() { + return new LogExclusionName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + LogExclusionName that = (LogExclusionName) o; + return (Objects.equals(this.project, that.project)) + && (Objects.equals(this.exclusion, that.exclusion)) + && (Objects.equals(this.organization, that.organization)) + && (Objects.equals(this.folder, that.folder)) + && (Objects.equals(this.billingAccount, that.billingAccount)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(exclusion); + h *= 1000003; + h ^= Objects.hashCode(organization); + h *= 1000003; + h ^= Objects.hashCode(folder); + h *= 1000003; + h ^= Objects.hashCode(billingAccount); + return h; + } +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogExclusionOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogExclusionOrBuilder.java index e43e747f7..84acfc25b 100644 --- a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogExclusionOrBuilder.java +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogExclusionOrBuilder.java @@ -27,13 +27,13 @@ public interface LogExclusionOrBuilder * * *
-   * Required. A client-assigned identifier, such as
-   * `"load-balancer-exclusion"`. Identifiers are limited to 100 characters and
-   * can include only letters, digits, underscores, hyphens, and periods.
-   * First character has to be alphanumeric.
+   * Required. A client-assigned identifier, such as `"load-balancer-exclusion"`.
+   * Identifiers are limited to 100 characters and can include only letters,
+   * digits, underscores, hyphens, and periods. First character has to be
+   * alphanumeric.
    * 
* - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The name. */ @@ -42,13 +42,13 @@ public interface LogExclusionOrBuilder * * *
-   * Required. A client-assigned identifier, such as
-   * `"load-balancer-exclusion"`. Identifiers are limited to 100 characters and
-   * can include only letters, digits, underscores, hyphens, and periods.
-   * First character has to be alphanumeric.
+   * Required. A client-assigned identifier, such as `"load-balancer-exclusion"`.
+   * Identifiers are limited to 100 characters and can include only letters,
+   * digits, underscores, hyphens, and periods. First character has to be
+   * alphanumeric.
    * 
* - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The bytes for name. */ @@ -61,7 +61,7 @@ public interface LogExclusionOrBuilder * Optional. A description of this exclusion. * * - * string description = 2; + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return The description. */ @@ -73,7 +73,7 @@ public interface LogExclusionOrBuilder * Optional. A description of this exclusion. * * - * string description = 2; + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for description. */ @@ -92,7 +92,7 @@ public interface LogExclusionOrBuilder * `"resource.type=gcs_bucket severity<ERROR sample(insertId, 0.99)"` * * - * string filter = 3; + * string filter = 3 [(.google.api.field_behavior) = REQUIRED]; * * @return The filter. */ @@ -110,7 +110,7 @@ public interface LogExclusionOrBuilder * `"resource.type=gcs_bucket severity<ERROR sample(insertId, 0.99)"` * * - * string filter = 3; + * string filter = 3 [(.google.api.field_behavior) = REQUIRED]; * * @return The bytes for filter. */ @@ -126,7 +126,7 @@ public interface LogExclusionOrBuilder * value of this field. * * - * bool disabled = 4; + * bool disabled = 4 [(.google.api.field_behavior) = OPTIONAL]; * * @return The disabled. */ @@ -140,7 +140,8 @@ public interface LogExclusionOrBuilder * This field may not be present for older exclusions. * * - * .google.protobuf.Timestamp create_time = 5; + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return Whether the createTime field is set. */ @@ -153,7 +154,8 @@ public interface LogExclusionOrBuilder * This field may not be present for older exclusions. * * - * .google.protobuf.Timestamp create_time = 5; + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return The createTime. */ @@ -166,7 +168,8 @@ public interface LogExclusionOrBuilder * This field may not be present for older exclusions. * * - * .google.protobuf.Timestamp create_time = 5; + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); @@ -178,7 +181,8 @@ public interface LogExclusionOrBuilder * This field may not be present for older exclusions. * * - * .google.protobuf.Timestamp update_time = 6; + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return Whether the updateTime field is set. */ @@ -191,7 +195,8 @@ public interface LogExclusionOrBuilder * This field may not be present for older exclusions. * * - * .google.protobuf.Timestamp update_time = 6; + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return The updateTime. */ @@ -204,7 +209,8 @@ public interface LogExclusionOrBuilder * This field may not be present for older exclusions. * * - * .google.protobuf.Timestamp update_time = 6; + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); } diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogMetric.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogMetric.java index 1f39d8e4d..ae34c9716 100644 --- a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogMetric.java +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogMetric.java @@ -387,7 +387,7 @@ private ApiVersion(int value) { * URL-encoded. Example: `"projects/my-project/metrics/nginx%2Frequests"`. * * - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The name. */ @@ -419,7 +419,7 @@ public java.lang.String getName() { * URL-encoded. Example: `"projects/my-project/metrics/nginx%2Frequests"`. * * - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The bytes for name. */ @@ -445,7 +445,7 @@ public com.google.protobuf.ByteString getNameBytes() { * The maximum length of the description is 8000 characters. * * - * string description = 2; + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return The description. */ @@ -468,7 +468,7 @@ public java.lang.String getDescription() { * The maximum length of the description is 8000 characters. * * - * string description = 2; + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for description. */ @@ -490,14 +490,14 @@ public com.google.protobuf.ByteString getDescriptionBytes() { * * *
-   * Required. An [advanced logs filter](/logging/docs/view/advanced_filters)
-   * which is used to match log entries.
+   * Required. An [advanced logs filter](/logging/docs/view/advanced_filters) which is
+   * used to match log entries.
    * Example:
    *     "resource.type=gae_app AND severity>=ERROR"
    * The maximum length of the filter is 20000 characters.
    * 
* - * string filter = 3; + * string filter = 3 [(.google.api.field_behavior) = REQUIRED]; * * @return The filter. */ @@ -516,14 +516,14 @@ public java.lang.String getFilter() { * * *
-   * Required. An [advanced logs filter](/logging/docs/view/advanced_filters)
-   * which is used to match log entries.
+   * Required. An [advanced logs filter](/logging/docs/view/advanced_filters) which is
+   * used to match log entries.
    * Example:
    *     "resource.type=gae_app AND severity>=ERROR"
    * The maximum length of the filter is 20000 characters.
    * 
* - * string filter = 3; + * string filter = 3 [(.google.api.field_behavior) = REQUIRED]; * * @return The bytes for filter. */ @@ -564,7 +564,9 @@ public com.google.protobuf.ByteString getFilterBytes() { * their description. * * - * .google.api.MetricDescriptor metric_descriptor = 5; + * + * .google.api.MetricDescriptor metric_descriptor = 5 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return Whether the metricDescriptor field is set. */ @@ -594,7 +596,9 @@ public boolean hasMetricDescriptor() { * their description. * * - * .google.api.MetricDescriptor metric_descriptor = 5; + * + * .google.api.MetricDescriptor metric_descriptor = 5 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return The metricDescriptor. */ @@ -626,7 +630,9 @@ public com.google.api.MetricDescriptor getMetricDescriptor() { * their description. * * - * .google.api.MetricDescriptor metric_descriptor = 5; + * + * .google.api.MetricDescriptor metric_descriptor = 5 [(.google.api.field_behavior) = OPTIONAL]; + * */ public com.google.api.MetricDescriptorOrBuilder getMetricDescriptorOrBuilder() { return getMetricDescriptor(); @@ -657,7 +663,7 @@ public com.google.api.MetricDescriptorOrBuilder getMetricDescriptorOrBuilder() { * Example: `REGEXP_EXTRACT(jsonPayload.request, ".*quantity=(\d+).*")` * * - * string value_extractor = 6; + * string value_extractor = 6 [(.google.api.field_behavior) = OPTIONAL]; * * @return The valueExtractor. */ @@ -695,7 +701,7 @@ public java.lang.String getValueExtractor() { * Example: `REGEXP_EXTRACT(jsonPayload.request, ".*quantity=(\d+).*")` * * - * string value_extractor = 6; + * string value_extractor = 6 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for valueExtractor. */ @@ -756,7 +762,8 @@ public int getLabelExtractorsCount() { * number of active time series that are allowed in a project. * * - * map<string, string> label_extractors = 7; + * map<string, string> label_extractors = 7 [(.google.api.field_behavior) = OPTIONAL]; + * */ public boolean containsLabelExtractors(java.lang.String key) { if (key == null) { @@ -787,7 +794,8 @@ public java.util.Map getLabelExtractors() { * number of active time series that are allowed in a project. * * - * map<string, string> label_extractors = 7; + * map<string, string> label_extractors = 7 [(.google.api.field_behavior) = OPTIONAL]; + * */ public java.util.Map getLabelExtractorsMap() { return internalGetLabelExtractors().getMap(); @@ -810,7 +818,8 @@ public java.util.Map getLabelExtractorsMap() * number of active time series that are allowed in a project. * * - * map<string, string> label_extractors = 7; + * map<string, string> label_extractors = 7 [(.google.api.field_behavior) = OPTIONAL]; + * */ public java.lang.String getLabelExtractorsOrDefault( java.lang.String key, java.lang.String defaultValue) { @@ -838,7 +847,8 @@ public java.lang.String getLabelExtractorsOrDefault( * number of active time series that are allowed in a project. * * - * map<string, string> label_extractors = 7; + * map<string, string> label_extractors = 7 [(.google.api.field_behavior) = OPTIONAL]; + * */ public java.lang.String getLabelExtractorsOrThrow(java.lang.String key) { if (key == null) { @@ -862,7 +872,9 @@ public java.lang.String getLabelExtractorsOrThrow(java.lang.String key) { * used to create a histogram of the extracted values. * * - * .google.api.Distribution.BucketOptions bucket_options = 8; + * + * .google.api.Distribution.BucketOptions bucket_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return Whether the bucketOptions field is set. */ @@ -878,7 +890,9 @@ public boolean hasBucketOptions() { * used to create a histogram of the extracted values. * * - * .google.api.Distribution.BucketOptions bucket_options = 8; + * + * .google.api.Distribution.BucketOptions bucket_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return The bucketOptions. */ @@ -896,7 +910,9 @@ public com.google.api.Distribution.BucketOptions getBucketOptions() { * used to create a histogram of the extracted values. * * - * .google.api.Distribution.BucketOptions bucket_options = 8; + * + * .google.api.Distribution.BucketOptions bucket_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * */ public com.google.api.Distribution.BucketOptionsOrBuilder getBucketOptionsOrBuilder() { return getBucketOptions(); @@ -912,7 +928,8 @@ public com.google.api.Distribution.BucketOptionsOrBuilder getBucketOptionsOrBuil * This field may not be present for older metrics. * * - * .google.protobuf.Timestamp create_time = 9; + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return Whether the createTime field is set. */ @@ -927,7 +944,8 @@ public boolean hasCreateTime() { * This field may not be present for older metrics. * * - * .google.protobuf.Timestamp create_time = 9; + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return The createTime. */ @@ -942,7 +960,8 @@ public com.google.protobuf.Timestamp getCreateTime() { * This field may not be present for older metrics. * * - * .google.protobuf.Timestamp create_time = 9; + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { return getCreateTime(); @@ -958,7 +977,8 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { * This field may not be present for older metrics. * * - * .google.protobuf.Timestamp update_time = 10; + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return Whether the updateTime field is set. */ @@ -973,7 +993,8 @@ public boolean hasUpdateTime() { * This field may not be present for older metrics. * * - * .google.protobuf.Timestamp update_time = 10; + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return The updateTime. */ @@ -988,7 +1009,8 @@ public com.google.protobuf.Timestamp getUpdateTime() { * This field may not be present for older metrics. * * - * .google.protobuf.Timestamp update_time = 10; + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { return getUpdateTime(); @@ -1586,7 +1608,7 @@ public Builder mergeFrom( * URL-encoded. Example: `"projects/my-project/metrics/nginx%2Frequests"`. * * - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The name. */ @@ -1618,7 +1640,7 @@ public java.lang.String getName() { * URL-encoded. Example: `"projects/my-project/metrics/nginx%2Frequests"`. * * - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The bytes for name. */ @@ -1650,7 +1672,7 @@ public com.google.protobuf.ByteString getNameBytes() { * URL-encoded. Example: `"projects/my-project/metrics/nginx%2Frequests"`. * * - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @param value The name to set. * @return This builder for chaining. @@ -1681,7 +1703,7 @@ public Builder setName(java.lang.String value) { * URL-encoded. Example: `"projects/my-project/metrics/nginx%2Frequests"`. * * - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return This builder for chaining. */ @@ -1708,7 +1730,7 @@ public Builder clearName() { * URL-encoded. Example: `"projects/my-project/metrics/nginx%2Frequests"`. * * - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @param value The bytes for name to set. * @return This builder for chaining. @@ -1733,7 +1755,7 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { * The maximum length of the description is 8000 characters. * * - * string description = 2; + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return The description. */ @@ -1756,7 +1778,7 @@ public java.lang.String getDescription() { * The maximum length of the description is 8000 characters. * * - * string description = 2; + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for description. */ @@ -1779,7 +1801,7 @@ public com.google.protobuf.ByteString getDescriptionBytes() { * The maximum length of the description is 8000 characters. * * - * string description = 2; + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The description to set. * @return This builder for chaining. @@ -1801,7 +1823,7 @@ public Builder setDescription(java.lang.String value) { * The maximum length of the description is 8000 characters. * * - * string description = 2; + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return This builder for chaining. */ @@ -1819,7 +1841,7 @@ public Builder clearDescription() { * The maximum length of the description is 8000 characters. * * - * string description = 2; + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The bytes for description to set. * @return This builder for chaining. @@ -1840,14 +1862,14 @@ public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { * * *
-     * Required. An [advanced logs filter](/logging/docs/view/advanced_filters)
-     * which is used to match log entries.
+     * Required. An [advanced logs filter](/logging/docs/view/advanced_filters) which is
+     * used to match log entries.
      * Example:
      *     "resource.type=gae_app AND severity>=ERROR"
      * The maximum length of the filter is 20000 characters.
      * 
* - * string filter = 3; + * string filter = 3 [(.google.api.field_behavior) = REQUIRED]; * * @return The filter. */ @@ -1866,14 +1888,14 @@ public java.lang.String getFilter() { * * *
-     * Required. An [advanced logs filter](/logging/docs/view/advanced_filters)
-     * which is used to match log entries.
+     * Required. An [advanced logs filter](/logging/docs/view/advanced_filters) which is
+     * used to match log entries.
      * Example:
      *     "resource.type=gae_app AND severity>=ERROR"
      * The maximum length of the filter is 20000 characters.
      * 
* - * string filter = 3; + * string filter = 3 [(.google.api.field_behavior) = REQUIRED]; * * @return The bytes for filter. */ @@ -1892,14 +1914,14 @@ public com.google.protobuf.ByteString getFilterBytes() { * * *
-     * Required. An [advanced logs filter](/logging/docs/view/advanced_filters)
-     * which is used to match log entries.
+     * Required. An [advanced logs filter](/logging/docs/view/advanced_filters) which is
+     * used to match log entries.
      * Example:
      *     "resource.type=gae_app AND severity>=ERROR"
      * The maximum length of the filter is 20000 characters.
      * 
* - * string filter = 3; + * string filter = 3 [(.google.api.field_behavior) = REQUIRED]; * * @param value The filter to set. * @return This builder for chaining. @@ -1917,14 +1939,14 @@ public Builder setFilter(java.lang.String value) { * * *
-     * Required. An [advanced logs filter](/logging/docs/view/advanced_filters)
-     * which is used to match log entries.
+     * Required. An [advanced logs filter](/logging/docs/view/advanced_filters) which is
+     * used to match log entries.
      * Example:
      *     "resource.type=gae_app AND severity>=ERROR"
      * The maximum length of the filter is 20000 characters.
      * 
* - * string filter = 3; + * string filter = 3 [(.google.api.field_behavior) = REQUIRED]; * * @return This builder for chaining. */ @@ -1938,14 +1960,14 @@ public Builder clearFilter() { * * *
-     * Required. An [advanced logs filter](/logging/docs/view/advanced_filters)
-     * which is used to match log entries.
+     * Required. An [advanced logs filter](/logging/docs/view/advanced_filters) which is
+     * used to match log entries.
      * Example:
      *     "resource.type=gae_app AND severity>=ERROR"
      * The maximum length of the filter is 20000 characters.
      * 
* - * string filter = 3; + * string filter = 3 [(.google.api.field_behavior) = REQUIRED]; * * @param value The bytes for filter to set. * @return This builder for chaining. @@ -1990,7 +2012,9 @@ public Builder setFilterBytes(com.google.protobuf.ByteString value) { * their description. * * - * .google.api.MetricDescriptor metric_descriptor = 5; + * + * .google.api.MetricDescriptor metric_descriptor = 5 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return Whether the metricDescriptor field is set. */ @@ -2020,7 +2044,9 @@ public boolean hasMetricDescriptor() { * their description. * * - * .google.api.MetricDescriptor metric_descriptor = 5; + * + * .google.api.MetricDescriptor metric_descriptor = 5 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return The metricDescriptor. */ @@ -2056,7 +2082,9 @@ public com.google.api.MetricDescriptor getMetricDescriptor() { * their description. * * - * .google.api.MetricDescriptor metric_descriptor = 5; + * + * .google.api.MetricDescriptor metric_descriptor = 5 [(.google.api.field_behavior) = OPTIONAL]; + * */ public Builder setMetricDescriptor(com.google.api.MetricDescriptor value) { if (metricDescriptorBuilder_ == null) { @@ -2094,7 +2122,9 @@ public Builder setMetricDescriptor(com.google.api.MetricDescriptor value) { * their description. * * - * .google.api.MetricDescriptor metric_descriptor = 5; + * + * .google.api.MetricDescriptor metric_descriptor = 5 [(.google.api.field_behavior) = OPTIONAL]; + * */ public Builder setMetricDescriptor(com.google.api.MetricDescriptor.Builder builderForValue) { if (metricDescriptorBuilder_ == null) { @@ -2129,7 +2159,9 @@ public Builder setMetricDescriptor(com.google.api.MetricDescriptor.Builder build * their description. * * - * .google.api.MetricDescriptor metric_descriptor = 5; + * + * .google.api.MetricDescriptor metric_descriptor = 5 [(.google.api.field_behavior) = OPTIONAL]; + * */ public Builder mergeMetricDescriptor(com.google.api.MetricDescriptor value) { if (metricDescriptorBuilder_ == null) { @@ -2171,7 +2203,9 @@ public Builder mergeMetricDescriptor(com.google.api.MetricDescriptor value) { * their description. * * - * .google.api.MetricDescriptor metric_descriptor = 5; + * + * .google.api.MetricDescriptor metric_descriptor = 5 [(.google.api.field_behavior) = OPTIONAL]; + * */ public Builder clearMetricDescriptor() { if (metricDescriptorBuilder_ == null) { @@ -2207,7 +2241,9 @@ public Builder clearMetricDescriptor() { * their description. * * - * .google.api.MetricDescriptor metric_descriptor = 5; + * + * .google.api.MetricDescriptor metric_descriptor = 5 [(.google.api.field_behavior) = OPTIONAL]; + * */ public com.google.api.MetricDescriptor.Builder getMetricDescriptorBuilder() { @@ -2237,7 +2273,9 @@ public com.google.api.MetricDescriptor.Builder getMetricDescriptorBuilder() { * their description. * * - * .google.api.MetricDescriptor metric_descriptor = 5; + * + * .google.api.MetricDescriptor metric_descriptor = 5 [(.google.api.field_behavior) = OPTIONAL]; + * */ public com.google.api.MetricDescriptorOrBuilder getMetricDescriptorOrBuilder() { if (metricDescriptorBuilder_ != null) { @@ -2271,7 +2309,9 @@ public com.google.api.MetricDescriptorOrBuilder getMetricDescriptorOrBuilder() { * their description. * * - * .google.api.MetricDescriptor metric_descriptor = 5; + * + * .google.api.MetricDescriptor metric_descriptor = 5 [(.google.api.field_behavior) = OPTIONAL]; + * */ private com.google.protobuf.SingleFieldBuilderV3< com.google.api.MetricDescriptor, @@ -2314,7 +2354,7 @@ public com.google.api.MetricDescriptorOrBuilder getMetricDescriptorOrBuilder() { * Example: `REGEXP_EXTRACT(jsonPayload.request, ".*quantity=(\d+).*")` * * - * string value_extractor = 6; + * string value_extractor = 6 [(.google.api.field_behavior) = OPTIONAL]; * * @return The valueExtractor. */ @@ -2352,7 +2392,7 @@ public java.lang.String getValueExtractor() { * Example: `REGEXP_EXTRACT(jsonPayload.request, ".*quantity=(\d+).*")` * * - * string value_extractor = 6; + * string value_extractor = 6 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for valueExtractor. */ @@ -2390,7 +2430,7 @@ public com.google.protobuf.ByteString getValueExtractorBytes() { * Example: `REGEXP_EXTRACT(jsonPayload.request, ".*quantity=(\d+).*")` * * - * string value_extractor = 6; + * string value_extractor = 6 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The valueExtractor to set. * @return This builder for chaining. @@ -2427,7 +2467,7 @@ public Builder setValueExtractor(java.lang.String value) { * Example: `REGEXP_EXTRACT(jsonPayload.request, ".*quantity=(\d+).*")` * * - * string value_extractor = 6; + * string value_extractor = 6 [(.google.api.field_behavior) = OPTIONAL]; * * @return This builder for chaining. */ @@ -2460,7 +2500,7 @@ public Builder clearValueExtractor() { * Example: `REGEXP_EXTRACT(jsonPayload.request, ".*quantity=(\d+).*")` * * - * string value_extractor = 6; + * string value_extractor = 6 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The bytes for valueExtractor to set. * @return This builder for chaining. @@ -2523,7 +2563,9 @@ public int getLabelExtractorsCount() { * number of active time series that are allowed in a project. * * - * map<string, string> label_extractors = 7; + * + * map<string, string> label_extractors = 7 [(.google.api.field_behavior) = OPTIONAL]; + * */ public boolean containsLabelExtractors(java.lang.String key) { if (key == null) { @@ -2554,7 +2596,9 @@ public java.util.Map getLabelExtractors() { * number of active time series that are allowed in a project. * * - * map<string, string> label_extractors = 7; + * + * map<string, string> label_extractors = 7 [(.google.api.field_behavior) = OPTIONAL]; + * */ public java.util.Map getLabelExtractorsMap() { return internalGetLabelExtractors().getMap(); @@ -2577,7 +2621,9 @@ public java.util.Map getLabelExtractorsMap() * number of active time series that are allowed in a project. * * - * map<string, string> label_extractors = 7; + * + * map<string, string> label_extractors = 7 [(.google.api.field_behavior) = OPTIONAL]; + * */ public java.lang.String getLabelExtractorsOrDefault( java.lang.String key, java.lang.String defaultValue) { @@ -2605,7 +2651,9 @@ public java.lang.String getLabelExtractorsOrDefault( * number of active time series that are allowed in a project. * * - * map<string, string> label_extractors = 7; + * + * map<string, string> label_extractors = 7 [(.google.api.field_behavior) = OPTIONAL]; + * */ public java.lang.String getLabelExtractorsOrThrow(java.lang.String key) { if (key == null) { @@ -2640,7 +2688,9 @@ public Builder clearLabelExtractors() { * number of active time series that are allowed in a project. * * - * map<string, string> label_extractors = 7; + * + * map<string, string> label_extractors = 7 [(.google.api.field_behavior) = OPTIONAL]; + * */ public Builder removeLabelExtractors(java.lang.String key) { if (key == null) { @@ -2672,7 +2722,9 @@ public java.util.Map getMutableLabelExtracto * number of active time series that are allowed in a project. * * - * map<string, string> label_extractors = 7; + * + * map<string, string> label_extractors = 7 [(.google.api.field_behavior) = OPTIONAL]; + * */ public Builder putLabelExtractors(java.lang.String key, java.lang.String value) { if (key == null) { @@ -2702,7 +2754,9 @@ public Builder putLabelExtractors(java.lang.String key, java.lang.String value) * number of active time series that are allowed in a project. * * - * map<string, string> label_extractors = 7; + * + * map<string, string> label_extractors = 7 [(.google.api.field_behavior) = OPTIONAL]; + * */ public Builder putAllLabelExtractors(java.util.Map values) { internalGetMutableLabelExtractors().getMutableMap().putAll(values); @@ -2724,7 +2778,9 @@ public Builder putAllLabelExtractors(java.util.Map * - * .google.api.Distribution.BucketOptions bucket_options = 8; + * + * .google.api.Distribution.BucketOptions bucket_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return Whether the bucketOptions field is set. */ @@ -2740,7 +2796,9 @@ public boolean hasBucketOptions() { * used to create a histogram of the extracted values. * * - * .google.api.Distribution.BucketOptions bucket_options = 8; + * + * .google.api.Distribution.BucketOptions bucket_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return The bucketOptions. */ @@ -2762,7 +2820,9 @@ public com.google.api.Distribution.BucketOptions getBucketOptions() { * used to create a histogram of the extracted values. * * - * .google.api.Distribution.BucketOptions bucket_options = 8; + * + * .google.api.Distribution.BucketOptions bucket_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * */ public Builder setBucketOptions(com.google.api.Distribution.BucketOptions value) { if (bucketOptionsBuilder_ == null) { @@ -2786,7 +2846,9 @@ public Builder setBucketOptions(com.google.api.Distribution.BucketOptions value) * used to create a histogram of the extracted values. * * - * .google.api.Distribution.BucketOptions bucket_options = 8; + * + * .google.api.Distribution.BucketOptions bucket_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * */ public Builder setBucketOptions( com.google.api.Distribution.BucketOptions.Builder builderForValue) { @@ -2808,7 +2870,9 @@ public Builder setBucketOptions( * used to create a histogram of the extracted values. * * - * .google.api.Distribution.BucketOptions bucket_options = 8; + * + * .google.api.Distribution.BucketOptions bucket_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * */ public Builder mergeBucketOptions(com.google.api.Distribution.BucketOptions value) { if (bucketOptionsBuilder_ == null) { @@ -2836,7 +2900,9 @@ public Builder mergeBucketOptions(com.google.api.Distribution.BucketOptions valu * used to create a histogram of the extracted values. * * - * .google.api.Distribution.BucketOptions bucket_options = 8; + * + * .google.api.Distribution.BucketOptions bucket_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * */ public Builder clearBucketOptions() { if (bucketOptionsBuilder_ == null) { @@ -2858,7 +2924,9 @@ public Builder clearBucketOptions() { * used to create a histogram of the extracted values. * * - * .google.api.Distribution.BucketOptions bucket_options = 8; + * + * .google.api.Distribution.BucketOptions bucket_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * */ public com.google.api.Distribution.BucketOptions.Builder getBucketOptionsBuilder() { @@ -2874,7 +2942,9 @@ public com.google.api.Distribution.BucketOptions.Builder getBucketOptionsBuilder * used to create a histogram of the extracted values. * * - * .google.api.Distribution.BucketOptions bucket_options = 8; + * + * .google.api.Distribution.BucketOptions bucket_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * */ public com.google.api.Distribution.BucketOptionsOrBuilder getBucketOptionsOrBuilder() { if (bucketOptionsBuilder_ != null) { @@ -2894,7 +2964,9 @@ public com.google.api.Distribution.BucketOptionsOrBuilder getBucketOptionsOrBuil * used to create a histogram of the extracted values. * * - * .google.api.Distribution.BucketOptions bucket_options = 8; + * + * .google.api.Distribution.BucketOptions bucket_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * */ private com.google.protobuf.SingleFieldBuilderV3< com.google.api.Distribution.BucketOptions, @@ -2927,7 +2999,9 @@ public com.google.api.Distribution.BucketOptionsOrBuilder getBucketOptionsOrBuil * This field may not be present for older metrics. * * - * .google.protobuf.Timestamp create_time = 9; + * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return Whether the createTime field is set. */ @@ -2942,7 +3016,9 @@ public boolean hasCreateTime() { * This field may not be present for older metrics. * * - * .google.protobuf.Timestamp create_time = 9; + * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return The createTime. */ @@ -2963,7 +3039,9 @@ public com.google.protobuf.Timestamp getCreateTime() { * This field may not be present for older metrics. * * - * .google.protobuf.Timestamp create_time = 9; + * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ public Builder setCreateTime(com.google.protobuf.Timestamp value) { if (createTimeBuilder_ == null) { @@ -2986,7 +3064,9 @@ public Builder setCreateTime(com.google.protobuf.Timestamp value) { * This field may not be present for older metrics. * * - * .google.protobuf.Timestamp create_time = 9; + * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { if (createTimeBuilder_ == null) { @@ -3006,7 +3086,9 @@ public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForVal * This field may not be present for older metrics. * * - * .google.protobuf.Timestamp create_time = 9; + * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { if (createTimeBuilder_ == null) { @@ -3031,7 +3113,9 @@ public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { * This field may not be present for older metrics. * * - * .google.protobuf.Timestamp create_time = 9; + * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ public Builder clearCreateTime() { if (createTimeBuilder_ == null) { @@ -3052,7 +3136,9 @@ public Builder clearCreateTime() { * This field may not be present for older metrics. * * - * .google.protobuf.Timestamp create_time = 9; + * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { @@ -3067,7 +3153,9 @@ public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { * This field may not be present for older metrics. * * - * .google.protobuf.Timestamp create_time = 9; + * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { if (createTimeBuilder_ != null) { @@ -3086,7 +3174,9 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { * This field may not be present for older metrics. * * - * .google.protobuf.Timestamp create_time = 9; + * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Timestamp, @@ -3119,7 +3209,9 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { * This field may not be present for older metrics. * * - * .google.protobuf.Timestamp update_time = 10; + * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return Whether the updateTime field is set. */ @@ -3134,7 +3226,9 @@ public boolean hasUpdateTime() { * This field may not be present for older metrics. * * - * .google.protobuf.Timestamp update_time = 10; + * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return The updateTime. */ @@ -3155,7 +3249,9 @@ public com.google.protobuf.Timestamp getUpdateTime() { * This field may not be present for older metrics. * * - * .google.protobuf.Timestamp update_time = 10; + * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ public Builder setUpdateTime(com.google.protobuf.Timestamp value) { if (updateTimeBuilder_ == null) { @@ -3178,7 +3274,9 @@ public Builder setUpdateTime(com.google.protobuf.Timestamp value) { * This field may not be present for older metrics. * * - * .google.protobuf.Timestamp update_time = 10; + * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { if (updateTimeBuilder_ == null) { @@ -3198,7 +3296,9 @@ public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForVal * This field may not be present for older metrics. * * - * .google.protobuf.Timestamp update_time = 10; + * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { if (updateTimeBuilder_ == null) { @@ -3223,7 +3323,9 @@ public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { * This field may not be present for older metrics. * * - * .google.protobuf.Timestamp update_time = 10; + * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ public Builder clearUpdateTime() { if (updateTimeBuilder_ == null) { @@ -3244,7 +3346,9 @@ public Builder clearUpdateTime() { * This field may not be present for older metrics. * * - * .google.protobuf.Timestamp update_time = 10; + * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { @@ -3259,7 +3363,9 @@ public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { * This field may not be present for older metrics. * * - * .google.protobuf.Timestamp update_time = 10; + * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { if (updateTimeBuilder_ != null) { @@ -3278,7 +3384,9 @@ public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { * This field may not be present for older metrics. * * - * .google.protobuf.Timestamp update_time = 10; + * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Timestamp, diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogMetricName.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogMetricName.java new file mode 100644 index 000000000..1d0cd4016 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogMetricName.java @@ -0,0 +1,182 @@ +/* + * Copyright 2020 Google LLC + * + * 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 + * + * https://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.logging.v2; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** AUTO-GENERATED DOCUMENTATION AND CLASS */ +@javax.annotation.Generated("by GAPIC protoc plugin") +public class LogMetricName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/metrics/{metric}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String metric; + + public String getProject() { + return project; + } + + public String getMetric() { + return metric; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private LogMetricName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + metric = Preconditions.checkNotNull(builder.getMetric()); + } + + public static LogMetricName of(String project, String metric) { + return newBuilder().setProject(project).setMetric(metric).build(); + } + + public static String format(String project, String metric) { + return newBuilder().setProject(project).setMetric(metric).build().toString(); + } + + public static LogMetricName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "LogMetricName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("metric")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (LogMetricName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("metric", metric); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("project", project, "metric", metric); + } + + /** Builder for LogMetricName. */ + public static class Builder { + + private String project; + private String metric; + + public String getProject() { + return project; + } + + public String getMetric() { + return metric; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setMetric(String metric) { + this.metric = metric; + return this; + } + + private Builder() {} + + private Builder(LogMetricName logMetricName) { + project = logMetricName.project; + metric = logMetricName.metric; + } + + public LogMetricName build() { + return new LogMetricName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof LogMetricName) { + LogMetricName that = (LogMetricName) o; + return (this.project.equals(that.project)) && (this.metric.equals(that.metric)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= metric.hashCode(); + return h; + } +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogMetricOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogMetricOrBuilder.java index df257b722..066b7bee1 100644 --- a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogMetricOrBuilder.java +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogMetricOrBuilder.java @@ -40,7 +40,7 @@ public interface LogMetricOrBuilder * URL-encoded. Example: `"projects/my-project/metrics/nginx%2Frequests"`. * * - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The name. */ @@ -62,7 +62,7 @@ public interface LogMetricOrBuilder * URL-encoded. Example: `"projects/my-project/metrics/nginx%2Frequests"`. * * - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The bytes for name. */ @@ -76,7 +76,7 @@ public interface LogMetricOrBuilder * The maximum length of the description is 8000 characters. * * - * string description = 2; + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return The description. */ @@ -89,7 +89,7 @@ public interface LogMetricOrBuilder * The maximum length of the description is 8000 characters. * * - * string description = 2; + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for description. */ @@ -99,14 +99,14 @@ public interface LogMetricOrBuilder * * *
-   * Required. An [advanced logs filter](/logging/docs/view/advanced_filters)
-   * which is used to match log entries.
+   * Required. An [advanced logs filter](/logging/docs/view/advanced_filters) which is
+   * used to match log entries.
    * Example:
    *     "resource.type=gae_app AND severity>=ERROR"
    * The maximum length of the filter is 20000 characters.
    * 
* - * string filter = 3; + * string filter = 3 [(.google.api.field_behavior) = REQUIRED]; * * @return The filter. */ @@ -115,14 +115,14 @@ public interface LogMetricOrBuilder * * *
-   * Required. An [advanced logs filter](/logging/docs/view/advanced_filters)
-   * which is used to match log entries.
+   * Required. An [advanced logs filter](/logging/docs/view/advanced_filters) which is
+   * used to match log entries.
    * Example:
    *     "resource.type=gae_app AND severity>=ERROR"
    * The maximum length of the filter is 20000 characters.
    * 
* - * string filter = 3; + * string filter = 3 [(.google.api.field_behavior) = REQUIRED]; * * @return The bytes for filter. */ @@ -151,7 +151,9 @@ public interface LogMetricOrBuilder * their description. * * - * .google.api.MetricDescriptor metric_descriptor = 5; + * + * .google.api.MetricDescriptor metric_descriptor = 5 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return Whether the metricDescriptor field is set. */ @@ -179,7 +181,9 @@ public interface LogMetricOrBuilder * their description. * * - * .google.api.MetricDescriptor metric_descriptor = 5; + * + * .google.api.MetricDescriptor metric_descriptor = 5 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return The metricDescriptor. */ @@ -207,7 +211,9 @@ public interface LogMetricOrBuilder * their description. * * - * .google.api.MetricDescriptor metric_descriptor = 5; + * + * .google.api.MetricDescriptor metric_descriptor = 5 [(.google.api.field_behavior) = OPTIONAL]; + * */ com.google.api.MetricDescriptorOrBuilder getMetricDescriptorOrBuilder(); @@ -234,7 +240,7 @@ public interface LogMetricOrBuilder * Example: `REGEXP_EXTRACT(jsonPayload.request, ".*quantity=(\d+).*")` * * - * string value_extractor = 6; + * string value_extractor = 6 [(.google.api.field_behavior) = OPTIONAL]; * * @return The valueExtractor. */ @@ -262,7 +268,7 @@ public interface LogMetricOrBuilder * Example: `REGEXP_EXTRACT(jsonPayload.request, ".*quantity=(\d+).*")` * * - * string value_extractor = 6; + * string value_extractor = 6 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for valueExtractor. */ @@ -286,7 +292,8 @@ public interface LogMetricOrBuilder * number of active time series that are allowed in a project. * * - * map<string, string> label_extractors = 7; + * map<string, string> label_extractors = 7 [(.google.api.field_behavior) = OPTIONAL]; + * */ int getLabelExtractorsCount(); /** @@ -307,7 +314,8 @@ public interface LogMetricOrBuilder * number of active time series that are allowed in a project. * * - * map<string, string> label_extractors = 7; + * map<string, string> label_extractors = 7 [(.google.api.field_behavior) = OPTIONAL]; + * */ boolean containsLabelExtractors(java.lang.String key); /** Use {@link #getLabelExtractorsMap()} instead. */ @@ -331,7 +339,8 @@ public interface LogMetricOrBuilder * number of active time series that are allowed in a project. * * - * map<string, string> label_extractors = 7; + * map<string, string> label_extractors = 7 [(.google.api.field_behavior) = OPTIONAL]; + * */ java.util.Map getLabelExtractorsMap(); /** @@ -352,7 +361,8 @@ public interface LogMetricOrBuilder * number of active time series that are allowed in a project. * * - * map<string, string> label_extractors = 7; + * map<string, string> label_extractors = 7 [(.google.api.field_behavior) = OPTIONAL]; + * */ java.lang.String getLabelExtractorsOrDefault(java.lang.String key, java.lang.String defaultValue); /** @@ -373,7 +383,8 @@ public interface LogMetricOrBuilder * number of active time series that are allowed in a project. * * - * map<string, string> label_extractors = 7; + * map<string, string> label_extractors = 7 [(.google.api.field_behavior) = OPTIONAL]; + * */ java.lang.String getLabelExtractorsOrThrow(java.lang.String key); @@ -386,7 +397,9 @@ public interface LogMetricOrBuilder * used to create a histogram of the extracted values. * * - * .google.api.Distribution.BucketOptions bucket_options = 8; + * + * .google.api.Distribution.BucketOptions bucket_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return Whether the bucketOptions field is set. */ @@ -400,7 +413,9 @@ public interface LogMetricOrBuilder * used to create a histogram of the extracted values. * * - * .google.api.Distribution.BucketOptions bucket_options = 8; + * + * .google.api.Distribution.BucketOptions bucket_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return The bucketOptions. */ @@ -414,7 +429,9 @@ public interface LogMetricOrBuilder * used to create a histogram of the extracted values. * * - * .google.api.Distribution.BucketOptions bucket_options = 8; + * + * .google.api.Distribution.BucketOptions bucket_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * */ com.google.api.Distribution.BucketOptionsOrBuilder getBucketOptionsOrBuilder(); @@ -426,7 +443,8 @@ public interface LogMetricOrBuilder * This field may not be present for older metrics. * * - * .google.protobuf.Timestamp create_time = 9; + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return Whether the createTime field is set. */ @@ -439,7 +457,8 @@ public interface LogMetricOrBuilder * This field may not be present for older metrics. * * - * .google.protobuf.Timestamp create_time = 9; + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return The createTime. */ @@ -452,7 +471,8 @@ public interface LogMetricOrBuilder * This field may not be present for older metrics. * * - * .google.protobuf.Timestamp create_time = 9; + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); @@ -464,7 +484,8 @@ public interface LogMetricOrBuilder * This field may not be present for older metrics. * * - * .google.protobuf.Timestamp update_time = 10; + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return Whether the updateTime field is set. */ @@ -477,7 +498,8 @@ public interface LogMetricOrBuilder * This field may not be present for older metrics. * * - * .google.protobuf.Timestamp update_time = 10; + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return The updateTime. */ @@ -490,7 +512,8 @@ public interface LogMetricOrBuilder * This field may not be present for older metrics. * * - * .google.protobuf.Timestamp update_time = 10; + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogName.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogName.java index 33b1abe74..88cb1ec49 100644 --- a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogName.java +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogName.java @@ -16,10 +16,420 @@ package com.google.logging.v2; +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.pathtemplate.ValidationException; import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; /** AUTO-GENERATED DOCUMENTATION AND CLASS */ @javax.annotation.Generated("by GAPIC protoc plugin") -public abstract class LogName implements ResourceName { +public class LogName implements ResourceName { + + @Deprecated protected LogName() {} + + private static final PathTemplate PROJECT_LOG_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/logs/{log}"); + private static final PathTemplate ORGANIZATION_LOG_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("organizations/{organization}/logs/{log}"); + private static final PathTemplate FOLDER_LOG_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("folders/{folder}/logs/{log}"); + private static final PathTemplate BILLING_ACCOUNT_LOG_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("billingAccounts/{billing_account}/logs/{log}"); + + private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; + + private String project; + private String log; + private String organization; + private String folder; + private String billingAccount; + + public String getProject() { + return project; + } + + public String getLog() { + return log; + } + + public String getOrganization() { + return organization; + } + + public String getFolder() { + return folder; + } + + public String getBillingAccount() { + return billingAccount; + } + + private LogName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + log = Preconditions.checkNotNull(builder.getLog()); + pathTemplate = PROJECT_LOG_PATH_TEMPLATE; + } + + private LogName(OrganizationLogBuilder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + log = Preconditions.checkNotNull(builder.getLog()); + pathTemplate = ORGANIZATION_LOG_PATH_TEMPLATE; + } + + private LogName(FolderLogBuilder builder) { + folder = Preconditions.checkNotNull(builder.getFolder()); + log = Preconditions.checkNotNull(builder.getLog()); + pathTemplate = FOLDER_LOG_PATH_TEMPLATE; + } + + private LogName(BillingAccountLogBuilder builder) { + billingAccount = Preconditions.checkNotNull(builder.getBillingAccount()); + log = Preconditions.checkNotNull(builder.getLog()); + pathTemplate = BILLING_ACCOUNT_LOG_PATH_TEMPLATE; + } + + public static Builder newBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static Builder newProjectLogBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static OrganizationLogBuilder newOrganizationLogBuilder() { + return new OrganizationLogBuilder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static FolderLogBuilder newFolderLogBuilder() { + return new FolderLogBuilder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static BillingAccountLogBuilder newBillingAccountLogBuilder() { + return new BillingAccountLogBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static LogName of(String project, String log) { + return newProjectLogBuilder().setProject(project).setLog(log).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static LogName ofProjectLogName(String project, String log) { + return newProjectLogBuilder().setProject(project).setLog(log).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static LogName ofOrganizationLogName(String organization, String log) { + return newOrganizationLogBuilder().setOrganization(organization).setLog(log).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static LogName ofFolderLogName(String folder, String log) { + return newFolderLogBuilder().setFolder(folder).setLog(log).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static LogName ofBillingAccountLogName(String billingAccount, String log) { + return newBillingAccountLogBuilder().setBillingAccount(billingAccount).setLog(log).build(); + } + + public static String format(String project, String log) { + return newBuilder().setProject(project).setLog(log).build().toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatProjectLogName(String project, String log) { + return newBuilder().setProject(project).setLog(log).build().toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatOrganizationLogName(String organization, String log) { + return newOrganizationLogBuilder().setOrganization(organization).setLog(log).build().toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatFolderLogName(String folder, String log) { + return newFolderLogBuilder().setFolder(folder).setLog(log).build().toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatBillingAccountLogName(String billingAccount, String log) { + return newBillingAccountLogBuilder() + .setBillingAccount(billingAccount) + .setLog(log) + .build() + .toString(); + } + + public static LogName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + if (PROJECT_LOG_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = PROJECT_LOG_PATH_TEMPLATE.match(formattedString); + return ofProjectLogName(matchMap.get("project"), matchMap.get("log")); + } else if (ORGANIZATION_LOG_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = ORGANIZATION_LOG_PATH_TEMPLATE.match(formattedString); + return ofOrganizationLogName(matchMap.get("organization"), matchMap.get("log")); + } else if (FOLDER_LOG_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = FOLDER_LOG_PATH_TEMPLATE.match(formattedString); + return ofFolderLogName(matchMap.get("folder"), matchMap.get("log")); + } else if (BILLING_ACCOUNT_LOG_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = BILLING_ACCOUNT_LOG_PATH_TEMPLATE.match(formattedString); + return ofBillingAccountLogName(matchMap.get("billing_account"), matchMap.get("log")); + } + throw new ValidationException("JobName.parse: formattedString not in valid format"); + } + + @BetaApi("The method will be renamed to parseList after subclasses of this class are removed.") + public static List parse(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + @BetaApi("The method will be renamed to toStringList after subclasses of this class are removed.") + public static List toStrings(List values) { + List list = new ArrayList<>(values.size()); + for (LogName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOG_PATH_TEMPLATE.matches(formattedString) + || ORGANIZATION_LOG_PATH_TEMPLATE.matches(formattedString) + || FOLDER_LOG_PATH_TEMPLATE.matches(formattedString) + || BILLING_ACCOUNT_LOG_PATH_TEMPLATE.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (log != null) { + fieldMapBuilder.put("log", log); + } + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + if (folder != null) { + fieldMapBuilder.put("folder", folder); + } + if (billingAccount != null) { + fieldMapBuilder.put("billing_account", billingAccount); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + } + + /** Builder for projects/{project}/logs/{log}. */ + public static class Builder { + + private String project; + private String log; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLog() { + return log; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLog(String log) { + this.log = log; + return this; + } + + private Builder(LogName logName) { + Preconditions.checkArgument( + logName.pathTemplate == PROJECT_LOG_PATH_TEMPLATE, + "toBuilder is only supported when LogName has the pattern of " + + "projects/{project}/logs/{log}."); + project = logName.project; + log = logName.log; + } + + public LogName build() { + return new LogName(this); + } + } + + /** Builder for organizations/{organization}/logs/{log}. */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class OrganizationLogBuilder { + + private String organization; + private String log; + + private OrganizationLogBuilder() {} + + public String getOrganization() { + return organization; + } + + public String getLog() { + return log; + } + + public OrganizationLogBuilder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public OrganizationLogBuilder setLog(String log) { + this.log = log; + return this; + } + + public LogName build() { + return new LogName(this); + } + } + + /** Builder for folders/{folder}/logs/{log}. */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class FolderLogBuilder { + + private String folder; + private String log; + + private FolderLogBuilder() {} + + public String getFolder() { + return folder; + } + + public String getLog() { + return log; + } + + public FolderLogBuilder setFolder(String folder) { + this.folder = folder; + return this; + } + + public FolderLogBuilder setLog(String log) { + this.log = log; + return this; + } + + public LogName build() { + return new LogName(this); + } + } + + /** Builder for billingAccounts/{billing_account}/logs/{log}. */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class BillingAccountLogBuilder { + + private String billingAccount; + private String log; + + private BillingAccountLogBuilder() {} + + public String getBillingAccount() { + return billingAccount; + } + + public String getLog() { + return log; + } + + public BillingAccountLogBuilder setBillingAccount(String billingAccount) { + this.billingAccount = billingAccount; + return this; + } + + public BillingAccountLogBuilder setLog(String log) { + this.log = log; + return this; + } + + public LogName build() { + return new LogName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + LogName that = (LogName) o; + return (Objects.equals(this.project, that.project)) + && (Objects.equals(this.log, that.log)) + && (Objects.equals(this.organization, that.organization)) + && (Objects.equals(this.folder, that.folder)) + && (Objects.equals(this.billingAccount, that.billingAccount)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(log); + h *= 1000003; + h ^= Objects.hashCode(organization); + h *= 1000003; + h ^= Objects.hashCode(folder); + h *= 1000003; + h ^= Objects.hashCode(billingAccount); + return h; + } } diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogSink.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogSink.java index e36f7b19a..ea04f98e6 100644 --- a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogSink.java +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogSink.java @@ -117,36 +117,6 @@ private LogSink( case 72: { includeChildren_ = input.readBool(); - break; - } - case 82: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (startTime_ != null) { - subBuilder = startTime_.toBuilder(); - } - startTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(startTime_); - startTime_ = subBuilder.buildPartial(); - } - - break; - } - case 90: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (endTime_ != null) { - subBuilder = endTime_.toBuilder(); - } - endTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(endTime_); - endTime_ = subBuilder.buildPartial(); - } - break; } case 98: @@ -445,14 +415,14 @@ public OptionsCase getOptionsCase() { * * *
-   * Required. The client-assigned sink identifier, unique within the
-   * project. Example: `"my-syslog-errors-to-pubsub"`. Sink identifiers are
-   * limited to 100 characters and can include only the following characters:
-   * upper and lower-case alphanumeric characters, underscores, hyphens, and
-   * periods. First character has to be alphanumeric.
+   * Required. The client-assigned sink identifier, unique within the project. Example:
+   * `"my-syslog-errors-to-pubsub"`. Sink identifiers are limited to 100
+   * characters and can include only the following characters: upper and
+   * lower-case alphanumeric characters, underscores, hyphens, and periods.
+   * First character has to be alphanumeric.
    * 
* - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The name. */ @@ -471,14 +441,14 @@ public java.lang.String getName() { * * *
-   * Required. The client-assigned sink identifier, unique within the
-   * project. Example: `"my-syslog-errors-to-pubsub"`. Sink identifiers are
-   * limited to 100 characters and can include only the following characters:
-   * upper and lower-case alphanumeric characters, underscores, hyphens, and
-   * periods. First character has to be alphanumeric.
+   * Required. The client-assigned sink identifier, unique within the project. Example:
+   * `"my-syslog-errors-to-pubsub"`. Sink identifiers are limited to 100
+   * characters and can include only the following characters: upper and
+   * lower-case alphanumeric characters, underscores, hyphens, and periods.
+   * First character has to be alphanumeric.
    * 
* - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The bytes for name. */ @@ -510,7 +480,9 @@ public com.google.protobuf.ByteString getNameBytes() { * [Exporting Logs with Sinks](/logging/docs/api/tasks/exporting-logs). * * - * string destination = 3 [(.google.api.resource_reference) = { ... } + * + * string destination = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The destination. */ @@ -539,7 +511,9 @@ public java.lang.String getDestination() { * [Exporting Logs with Sinks](/logging/docs/api/tasks/exporting-logs). * * - * string destination = 3 [(.google.api.resource_reference) = { ... } + * + * string destination = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The bytes for destination. */ @@ -567,7 +541,7 @@ public com.google.protobuf.ByteString getDestinationBytes() { * logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR * * - * string filter = 5; + * string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; * * @return The filter. */ @@ -592,7 +566,7 @@ public java.lang.String getFilter() { * logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR * * - * string filter = 5; + * string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for filter. */ @@ -618,7 +592,7 @@ public com.google.protobuf.ByteString getFilterBytes() { * The maximum length of the description is 8000 characters. * * - * string description = 18; + * string description = 18 [(.google.api.field_behavior) = OPTIONAL]; * * @return The description. */ @@ -641,7 +615,7 @@ public java.lang.String getDescription() { * The maximum length of the description is 8000 characters. * * - * string description = 18; + * string description = 18 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for description. */ @@ -667,7 +641,7 @@ public com.google.protobuf.ByteString getDescriptionBytes() { * export any log entries. * * - * bool disabled = 19; + * bool disabled = 19 [(.google.api.field_behavior) = OPTIONAL]; * * @return The disabled. */ @@ -721,13 +695,11 @@ public com.google.logging.v2.LogSink.VersionFormat getOutputVersionFormat() { * * *
-   * Output only. An IAM identity&mdash;a service account or group&mdash;under
-   * which Logging writes the exported log entries to the sink's destination.
-   * This field is set by
-   * [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink]
-   * and
-   * [sinks.update][google.logging.v2.ConfigServiceV2.UpdateSink]
-   * based on the value of `unique_writer_identity` in those methods.
+   * Output only. An IAM identity–a service account or group&mdash;under which Logging
+   * writes the exported log entries to the sink's destination. This field is
+   * set by [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] and
+   * [sinks.update][google.logging.v2.ConfigServiceV2.UpdateSink] based on the
+   * value of `unique_writer_identity` in those methods.
    * Until you grant this identity write-access to the destination, log entry
    * exports from this sink will fail. For more information,
    * see [Granting Access for a
@@ -755,13 +727,11 @@ public java.lang.String getWriterIdentity() {
    *
    *
    * 
-   * Output only. An IAM identity&mdash;a service account or group&mdash;under
-   * which Logging writes the exported log entries to the sink's destination.
-   * This field is set by
-   * [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink]
-   * and
-   * [sinks.update][google.logging.v2.ConfigServiceV2.UpdateSink]
-   * based on the value of `unique_writer_identity` in those methods.
+   * Output only. An IAM identity–a service account or group&mdash;under which Logging
+   * writes the exported log entries to the sink's destination. This field is
+   * set by [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] and
+   * [sinks.update][google.logging.v2.ConfigServiceV2.UpdateSink] based on the
+   * value of `unique_writer_identity` in those methods.
    * Until you grant this identity write-access to the destination, log entry
    * exports from this sink will fail. For more information,
    * see [Granting Access for a
@@ -806,7 +776,7 @@ public com.google.protobuf.ByteString getWriterIdentityBytes() {
    *     resource.type=gce_instance
    * 
* - * bool include_children = 9; + * bool include_children = 9 [(.google.api.field_behavior) = OPTIONAL]; * * @return The includeChildren. */ @@ -822,7 +792,9 @@ public boolean getIncludeChildren() { * Optional. Options that affect sinks exporting data to BigQuery. *
* - * .google.logging.v2.BigQueryOptions bigquery_options = 12; + * + * .google.logging.v2.BigQueryOptions bigquery_options = 12 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return Whether the bigqueryOptions field is set. */ @@ -836,7 +808,9 @@ public boolean hasBigqueryOptions() { * Optional. Options that affect sinks exporting data to BigQuery. * * - * .google.logging.v2.BigQueryOptions bigquery_options = 12; + * + * .google.logging.v2.BigQueryOptions bigquery_options = 12 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return The bigqueryOptions. */ @@ -853,7 +827,9 @@ public com.google.logging.v2.BigQueryOptions getBigqueryOptions() { * Optional. Options that affect sinks exporting data to BigQuery. * * - * .google.logging.v2.BigQueryOptions bigquery_options = 12; + * + * .google.logging.v2.BigQueryOptions bigquery_options = 12 [(.google.api.field_behavior) = OPTIONAL]; + * */ public com.google.logging.v2.BigQueryOptionsOrBuilder getBigqueryOptionsOrBuilder() { if (optionsCase_ == 12) { @@ -960,98 +936,6 @@ public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { return getUpdateTime(); } - public static final int START_TIME_FIELD_NUMBER = 10; - private com.google.protobuf.Timestamp startTime_; - /** - * - * - *
-   * Do not use. This field is ignored.
-   * 
- * - * .google.protobuf.Timestamp start_time = 10 [deprecated = true]; - * - * @return Whether the startTime field is set. - */ - @java.lang.Deprecated - public boolean hasStartTime() { - return startTime_ != null; - } - /** - * - * - *
-   * Do not use. This field is ignored.
-   * 
- * - * .google.protobuf.Timestamp start_time = 10 [deprecated = true]; - * - * @return The startTime. - */ - @java.lang.Deprecated - public com.google.protobuf.Timestamp getStartTime() { - return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; - } - /** - * - * - *
-   * Do not use. This field is ignored.
-   * 
- * - * .google.protobuf.Timestamp start_time = 10 [deprecated = true]; - */ - @java.lang.Deprecated - public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { - return getStartTime(); - } - - public static final int END_TIME_FIELD_NUMBER = 11; - private com.google.protobuf.Timestamp endTime_; - /** - * - * - *
-   * Do not use. This field is ignored.
-   * 
- * - * .google.protobuf.Timestamp end_time = 11 [deprecated = true]; - * - * @return Whether the endTime field is set. - */ - @java.lang.Deprecated - public boolean hasEndTime() { - return endTime_ != null; - } - /** - * - * - *
-   * Do not use. This field is ignored.
-   * 
- * - * .google.protobuf.Timestamp end_time = 11 [deprecated = true]; - * - * @return The endTime. - */ - @java.lang.Deprecated - public com.google.protobuf.Timestamp getEndTime() { - return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; - } - /** - * - * - *
-   * Do not use. This field is ignored.
-   * 
- * - * .google.protobuf.Timestamp end_time = 11 [deprecated = true]; - */ - @java.lang.Deprecated - public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { - return getEndTime(); - } - private byte memoizedIsInitialized = -1; @java.lang.Override @@ -1085,12 +969,6 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (includeChildren_ != false) { output.writeBool(9, includeChildren_); } - if (startTime_ != null) { - output.writeMessage(10, getStartTime()); - } - if (endTime_ != null) { - output.writeMessage(11, getEndTime()); - } if (optionsCase_ == 12) { output.writeMessage(12, (com.google.logging.v2.BigQueryOptions) options_); } @@ -1134,12 +1012,6 @@ public int getSerializedSize() { if (includeChildren_ != false) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(9, includeChildren_); } - if (startTime_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getStartTime()); - } - if (endTime_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, getEndTime()); - } if (optionsCase_ == 12) { size += com.google.protobuf.CodedOutputStream.computeMessageSize( @@ -1188,14 +1060,6 @@ public boolean equals(final java.lang.Object obj) { if (hasUpdateTime()) { if (!getUpdateTime().equals(other.getUpdateTime())) return false; } - if (hasStartTime() != other.hasStartTime()) return false; - if (hasStartTime()) { - if (!getStartTime().equals(other.getStartTime())) return false; - } - if (hasEndTime() != other.hasEndTime()) return false; - if (hasEndTime()) { - if (!getEndTime().equals(other.getEndTime())) return false; - } if (!getOptionsCase().equals(other.getOptionsCase())) return false; switch (optionsCase_) { case 12: @@ -1239,14 +1103,6 @@ public int hashCode() { hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; hash = (53 * hash) + getUpdateTime().hashCode(); } - if (hasStartTime()) { - hash = (37 * hash) + START_TIME_FIELD_NUMBER; - hash = (53 * hash) + getStartTime().hashCode(); - } - if (hasEndTime()) { - hash = (37 * hash) + END_TIME_FIELD_NUMBER; - hash = (53 * hash) + getEndTime().hashCode(); - } switch (optionsCase_) { case 12: hash = (37 * hash) + BIGQUERY_OPTIONS_FIELD_NUMBER; @@ -1430,18 +1286,6 @@ public Builder clear() { updateTime_ = null; updateTimeBuilder_ = null; } - if (startTimeBuilder_ == null) { - startTime_ = null; - } else { - startTime_ = null; - startTimeBuilder_ = null; - } - if (endTimeBuilder_ == null) { - endTime_ = null; - } else { - endTime_ = null; - endTimeBuilder_ = null; - } optionsCase_ = 0; options_ = null; return this; @@ -1495,16 +1339,6 @@ public com.google.logging.v2.LogSink buildPartial() { } else { result.updateTime_ = updateTimeBuilder_.build(); } - if (startTimeBuilder_ == null) { - result.startTime_ = startTime_; - } else { - result.startTime_ = startTimeBuilder_.build(); - } - if (endTimeBuilder_ == null) { - result.endTime_ = endTime_; - } else { - result.endTime_ = endTimeBuilder_.build(); - } result.optionsCase_ = optionsCase_; onBuilt(); return result; @@ -1590,12 +1424,6 @@ public Builder mergeFrom(com.google.logging.v2.LogSink other) { if (other.hasUpdateTime()) { mergeUpdateTime(other.getUpdateTime()); } - if (other.hasStartTime()) { - mergeStartTime(other.getStartTime()); - } - if (other.hasEndTime()) { - mergeEndTime(other.getEndTime()); - } switch (other.getOptionsCase()) { case BIGQUERY_OPTIONS: { @@ -1655,14 +1483,14 @@ public Builder clearOptions() { * * *
-     * Required. The client-assigned sink identifier, unique within the
-     * project. Example: `"my-syslog-errors-to-pubsub"`. Sink identifiers are
-     * limited to 100 characters and can include only the following characters:
-     * upper and lower-case alphanumeric characters, underscores, hyphens, and
-     * periods. First character has to be alphanumeric.
+     * Required. The client-assigned sink identifier, unique within the project. Example:
+     * `"my-syslog-errors-to-pubsub"`. Sink identifiers are limited to 100
+     * characters and can include only the following characters: upper and
+     * lower-case alphanumeric characters, underscores, hyphens, and periods.
+     * First character has to be alphanumeric.
      * 
* - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The name. */ @@ -1681,14 +1509,14 @@ public java.lang.String getName() { * * *
-     * Required. The client-assigned sink identifier, unique within the
-     * project. Example: `"my-syslog-errors-to-pubsub"`. Sink identifiers are
-     * limited to 100 characters and can include only the following characters:
-     * upper and lower-case alphanumeric characters, underscores, hyphens, and
-     * periods. First character has to be alphanumeric.
+     * Required. The client-assigned sink identifier, unique within the project. Example:
+     * `"my-syslog-errors-to-pubsub"`. Sink identifiers are limited to 100
+     * characters and can include only the following characters: upper and
+     * lower-case alphanumeric characters, underscores, hyphens, and periods.
+     * First character has to be alphanumeric.
      * 
* - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The bytes for name. */ @@ -1707,14 +1535,14 @@ public com.google.protobuf.ByteString getNameBytes() { * * *
-     * Required. The client-assigned sink identifier, unique within the
-     * project. Example: `"my-syslog-errors-to-pubsub"`. Sink identifiers are
-     * limited to 100 characters and can include only the following characters:
-     * upper and lower-case alphanumeric characters, underscores, hyphens, and
-     * periods. First character has to be alphanumeric.
+     * Required. The client-assigned sink identifier, unique within the project. Example:
+     * `"my-syslog-errors-to-pubsub"`. Sink identifiers are limited to 100
+     * characters and can include only the following characters: upper and
+     * lower-case alphanumeric characters, underscores, hyphens, and periods.
+     * First character has to be alphanumeric.
      * 
* - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @param value The name to set. * @return This builder for chaining. @@ -1732,14 +1560,14 @@ public Builder setName(java.lang.String value) { * * *
-     * Required. The client-assigned sink identifier, unique within the
-     * project. Example: `"my-syslog-errors-to-pubsub"`. Sink identifiers are
-     * limited to 100 characters and can include only the following characters:
-     * upper and lower-case alphanumeric characters, underscores, hyphens, and
-     * periods. First character has to be alphanumeric.
+     * Required. The client-assigned sink identifier, unique within the project. Example:
+     * `"my-syslog-errors-to-pubsub"`. Sink identifiers are limited to 100
+     * characters and can include only the following characters: upper and
+     * lower-case alphanumeric characters, underscores, hyphens, and periods.
+     * First character has to be alphanumeric.
      * 
* - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return This builder for chaining. */ @@ -1753,14 +1581,14 @@ public Builder clearName() { * * *
-     * Required. The client-assigned sink identifier, unique within the
-     * project. Example: `"my-syslog-errors-to-pubsub"`. Sink identifiers are
-     * limited to 100 characters and can include only the following characters:
-     * upper and lower-case alphanumeric characters, underscores, hyphens, and
-     * periods. First character has to be alphanumeric.
+     * Required. The client-assigned sink identifier, unique within the project. Example:
+     * `"my-syslog-errors-to-pubsub"`. Sink identifiers are limited to 100
+     * characters and can include only the following characters: upper and
+     * lower-case alphanumeric characters, underscores, hyphens, and periods.
+     * First character has to be alphanumeric.
      * 
* - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @param value The bytes for name to set. * @return This builder for chaining. @@ -1791,7 +1619,9 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { * [Exporting Logs with Sinks](/logging/docs/api/tasks/exporting-logs). * * - * string destination = 3 [(.google.api.resource_reference) = { ... } + * + * string destination = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The destination. */ @@ -1820,7 +1650,9 @@ public java.lang.String getDestination() { * [Exporting Logs with Sinks](/logging/docs/api/tasks/exporting-logs). * * - * string destination = 3 [(.google.api.resource_reference) = { ... } + * + * string destination = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The bytes for destination. */ @@ -1849,7 +1681,9 @@ public com.google.protobuf.ByteString getDestinationBytes() { * [Exporting Logs with Sinks](/logging/docs/api/tasks/exporting-logs). * * - * string destination = 3 [(.google.api.resource_reference) = { ... } + * + * string destination = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @param value The destination to set. * @return This builder for chaining. @@ -1877,7 +1711,9 @@ public Builder setDestination(java.lang.String value) { * [Exporting Logs with Sinks](/logging/docs/api/tasks/exporting-logs). * * - * string destination = 3 [(.google.api.resource_reference) = { ... } + * + * string destination = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return This builder for chaining. */ @@ -1901,7 +1737,9 @@ public Builder clearDestination() { * [Exporting Logs with Sinks](/logging/docs/api/tasks/exporting-logs). * * - * string destination = 3 [(.google.api.resource_reference) = { ... } + * + * string destination = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @param value The bytes for destination to set. * @return This builder for chaining. @@ -1928,7 +1766,7 @@ public Builder setDestinationBytes(com.google.protobuf.ByteString value) { * logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR * * - * string filter = 5; + * string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; * * @return The filter. */ @@ -1953,7 +1791,7 @@ public java.lang.String getFilter() { * logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR * * - * string filter = 5; + * string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for filter. */ @@ -1978,7 +1816,7 @@ public com.google.protobuf.ByteString getFilterBytes() { * logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR * * - * string filter = 5; + * string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The filter to set. * @return This builder for chaining. @@ -2002,7 +1840,7 @@ public Builder setFilter(java.lang.String value) { * logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR * * - * string filter = 5; + * string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; * * @return This builder for chaining. */ @@ -2022,7 +1860,7 @@ public Builder clearFilter() { * logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR * * - * string filter = 5; + * string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The bytes for filter to set. * @return This builder for chaining. @@ -2047,7 +1885,7 @@ public Builder setFilterBytes(com.google.protobuf.ByteString value) { * The maximum length of the description is 8000 characters. * * - * string description = 18; + * string description = 18 [(.google.api.field_behavior) = OPTIONAL]; * * @return The description. */ @@ -2070,7 +1908,7 @@ public java.lang.String getDescription() { * The maximum length of the description is 8000 characters. * * - * string description = 18; + * string description = 18 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for description. */ @@ -2093,7 +1931,7 @@ public com.google.protobuf.ByteString getDescriptionBytes() { * The maximum length of the description is 8000 characters. * * - * string description = 18; + * string description = 18 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The description to set. * @return This builder for chaining. @@ -2115,7 +1953,7 @@ public Builder setDescription(java.lang.String value) { * The maximum length of the description is 8000 characters. * * - * string description = 18; + * string description = 18 [(.google.api.field_behavior) = OPTIONAL]; * * @return This builder for chaining. */ @@ -2133,7 +1971,7 @@ public Builder clearDescription() { * The maximum length of the description is 8000 characters. * * - * string description = 18; + * string description = 18 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The bytes for description to set. * @return This builder for chaining. @@ -2158,7 +1996,7 @@ public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { * export any log entries. * * - * bool disabled = 19; + * bool disabled = 19 [(.google.api.field_behavior) = OPTIONAL]; * * @return The disabled. */ @@ -2173,7 +2011,7 @@ public boolean getDisabled() { * export any log entries. * * - * bool disabled = 19; + * bool disabled = 19 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The disabled to set. * @return This builder for chaining. @@ -2192,7 +2030,7 @@ public Builder setDisabled(boolean value) { * export any log entries. * * - * bool disabled = 19; + * bool disabled = 19 [(.google.api.field_behavior) = OPTIONAL]; * * @return This builder for chaining. */ @@ -2311,13 +2149,11 @@ public Builder clearOutputVersionFormat() { * * *
-     * Output only. An IAM identity&mdash;a service account or group&mdash;under
-     * which Logging writes the exported log entries to the sink's destination.
-     * This field is set by
-     * [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink]
-     * and
-     * [sinks.update][google.logging.v2.ConfigServiceV2.UpdateSink]
-     * based on the value of `unique_writer_identity` in those methods.
+     * Output only. An IAM identity–a service account or group&mdash;under which Logging
+     * writes the exported log entries to the sink's destination. This field is
+     * set by [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] and
+     * [sinks.update][google.logging.v2.ConfigServiceV2.UpdateSink] based on the
+     * value of `unique_writer_identity` in those methods.
      * Until you grant this identity write-access to the destination, log entry
      * exports from this sink will fail. For more information,
      * see [Granting Access for a
@@ -2345,13 +2181,11 @@ public java.lang.String getWriterIdentity() {
      *
      *
      * 
-     * Output only. An IAM identity&mdash;a service account or group&mdash;under
-     * which Logging writes the exported log entries to the sink's destination.
-     * This field is set by
-     * [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink]
-     * and
-     * [sinks.update][google.logging.v2.ConfigServiceV2.UpdateSink]
-     * based on the value of `unique_writer_identity` in those methods.
+     * Output only. An IAM identity–a service account or group&mdash;under which Logging
+     * writes the exported log entries to the sink's destination. This field is
+     * set by [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] and
+     * [sinks.update][google.logging.v2.ConfigServiceV2.UpdateSink] based on the
+     * value of `unique_writer_identity` in those methods.
      * Until you grant this identity write-access to the destination, log entry
      * exports from this sink will fail. For more information,
      * see [Granting Access for a
@@ -2379,13 +2213,11 @@ public com.google.protobuf.ByteString getWriterIdentityBytes() {
      *
      *
      * 
-     * Output only. An IAM identity&mdash;a service account or group&mdash;under
-     * which Logging writes the exported log entries to the sink's destination.
-     * This field is set by
-     * [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink]
-     * and
-     * [sinks.update][google.logging.v2.ConfigServiceV2.UpdateSink]
-     * based on the value of `unique_writer_identity` in those methods.
+     * Output only. An IAM identity–a service account or group&mdash;under which Logging
+     * writes the exported log entries to the sink's destination. This field is
+     * set by [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] and
+     * [sinks.update][google.logging.v2.ConfigServiceV2.UpdateSink] based on the
+     * value of `unique_writer_identity` in those methods.
      * Until you grant this identity write-access to the destination, log entry
      * exports from this sink will fail. For more information,
      * see [Granting Access for a
@@ -2412,13 +2244,11 @@ public Builder setWriterIdentity(java.lang.String value) {
      *
      *
      * 
-     * Output only. An IAM identity&mdash;a service account or group&mdash;under
-     * which Logging writes the exported log entries to the sink's destination.
-     * This field is set by
-     * [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink]
-     * and
-     * [sinks.update][google.logging.v2.ConfigServiceV2.UpdateSink]
-     * based on the value of `unique_writer_identity` in those methods.
+     * Output only. An IAM identity–a service account or group&mdash;under which Logging
+     * writes the exported log entries to the sink's destination. This field is
+     * set by [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] and
+     * [sinks.update][google.logging.v2.ConfigServiceV2.UpdateSink] based on the
+     * value of `unique_writer_identity` in those methods.
      * Until you grant this identity write-access to the destination, log entry
      * exports from this sink will fail. For more information,
      * see [Granting Access for a
@@ -2441,13 +2271,11 @@ public Builder clearWriterIdentity() {
      *
      *
      * 
-     * Output only. An IAM identity&mdash;a service account or group&mdash;under
-     * which Logging writes the exported log entries to the sink's destination.
-     * This field is set by
-     * [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink]
-     * and
-     * [sinks.update][google.logging.v2.ConfigServiceV2.UpdateSink]
-     * based on the value of `unique_writer_identity` in those methods.
+     * Output only. An IAM identity–a service account or group&mdash;under which Logging
+     * writes the exported log entries to the sink's destination. This field is
+     * set by [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] and
+     * [sinks.update][google.logging.v2.ConfigServiceV2.UpdateSink] based on the
+     * value of `unique_writer_identity` in those methods.
      * Until you grant this identity write-access to the destination, log entry
      * exports from this sink will fail. For more information,
      * see [Granting Access for a
@@ -2491,7 +2319,7 @@ public Builder setWriterIdentityBytes(com.google.protobuf.ByteString value) {
      *     resource.type=gce_instance
      * 
* - * bool include_children = 9; + * bool include_children = 9 [(.google.api.field_behavior) = OPTIONAL]; * * @return The includeChildren. */ @@ -2516,7 +2344,7 @@ public boolean getIncludeChildren() { * resource.type=gce_instance *
* - * bool include_children = 9; + * bool include_children = 9 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The includeChildren to set. * @return This builder for chaining. @@ -2545,7 +2373,7 @@ public Builder setIncludeChildren(boolean value) { * resource.type=gce_instance *
* - * bool include_children = 9; + * bool include_children = 9 [(.google.api.field_behavior) = OPTIONAL]; * * @return This builder for chaining. */ @@ -2568,7 +2396,9 @@ public Builder clearIncludeChildren() { * Optional. Options that affect sinks exporting data to BigQuery. *
* - * .google.logging.v2.BigQueryOptions bigquery_options = 12; + * + * .google.logging.v2.BigQueryOptions bigquery_options = 12 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return Whether the bigqueryOptions field is set. */ @@ -2582,7 +2412,9 @@ public boolean hasBigqueryOptions() { * Optional. Options that affect sinks exporting data to BigQuery. *
* - * .google.logging.v2.BigQueryOptions bigquery_options = 12; + * + * .google.logging.v2.BigQueryOptions bigquery_options = 12 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return The bigqueryOptions. */ @@ -2606,7 +2438,9 @@ public com.google.logging.v2.BigQueryOptions getBigqueryOptions() { * Optional. Options that affect sinks exporting data to BigQuery. * * - * .google.logging.v2.BigQueryOptions bigquery_options = 12; + * + * .google.logging.v2.BigQueryOptions bigquery_options = 12 [(.google.api.field_behavior) = OPTIONAL]; + * */ public Builder setBigqueryOptions(com.google.logging.v2.BigQueryOptions value) { if (bigqueryOptionsBuilder_ == null) { @@ -2628,7 +2462,9 @@ public Builder setBigqueryOptions(com.google.logging.v2.BigQueryOptions value) { * Optional. Options that affect sinks exporting data to BigQuery. * * - * .google.logging.v2.BigQueryOptions bigquery_options = 12; + * + * .google.logging.v2.BigQueryOptions bigquery_options = 12 [(.google.api.field_behavior) = OPTIONAL]; + * */ public Builder setBigqueryOptions( com.google.logging.v2.BigQueryOptions.Builder builderForValue) { @@ -2648,7 +2484,9 @@ public Builder setBigqueryOptions( * Optional. Options that affect sinks exporting data to BigQuery. * * - * .google.logging.v2.BigQueryOptions bigquery_options = 12; + * + * .google.logging.v2.BigQueryOptions bigquery_options = 12 [(.google.api.field_behavior) = OPTIONAL]; + * */ public Builder mergeBigqueryOptions(com.google.logging.v2.BigQueryOptions value) { if (bigqueryOptionsBuilder_ == null) { @@ -2679,7 +2517,9 @@ public Builder mergeBigqueryOptions(com.google.logging.v2.BigQueryOptions value) * Optional. Options that affect sinks exporting data to BigQuery. * * - * .google.logging.v2.BigQueryOptions bigquery_options = 12; + * + * .google.logging.v2.BigQueryOptions bigquery_options = 12 [(.google.api.field_behavior) = OPTIONAL]; + * */ public Builder clearBigqueryOptions() { if (bigqueryOptionsBuilder_ == null) { @@ -2704,7 +2544,9 @@ public Builder clearBigqueryOptions() { * Optional. Options that affect sinks exporting data to BigQuery. * * - * .google.logging.v2.BigQueryOptions bigquery_options = 12; + * + * .google.logging.v2.BigQueryOptions bigquery_options = 12 [(.google.api.field_behavior) = OPTIONAL]; + * */ public com.google.logging.v2.BigQueryOptions.Builder getBigqueryOptionsBuilder() { return getBigqueryOptionsFieldBuilder().getBuilder(); @@ -2716,7 +2558,9 @@ public com.google.logging.v2.BigQueryOptions.Builder getBigqueryOptionsBuilder() * Optional. Options that affect sinks exporting data to BigQuery. * * - * .google.logging.v2.BigQueryOptions bigquery_options = 12; + * + * .google.logging.v2.BigQueryOptions bigquery_options = 12 [(.google.api.field_behavior) = OPTIONAL]; + * */ public com.google.logging.v2.BigQueryOptionsOrBuilder getBigqueryOptionsOrBuilder() { if ((optionsCase_ == 12) && (bigqueryOptionsBuilder_ != null)) { @@ -2735,7 +2579,9 @@ public com.google.logging.v2.BigQueryOptionsOrBuilder getBigqueryOptionsOrBuilde * Optional. Options that affect sinks exporting data to BigQuery. * * - * .google.logging.v2.BigQueryOptions bigquery_options = 12; + * + * .google.logging.v2.BigQueryOptions bigquery_options = 12 [(.google.api.field_behavior) = OPTIONAL]; + * */ private com.google.protobuf.SingleFieldBuilderV3< com.google.logging.v2.BigQueryOptions, @@ -3182,380 +3028,6 @@ public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { return updateTimeBuilder_; } - private com.google.protobuf.Timestamp startTime_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - startTimeBuilder_; - /** - * - * - *
-     * Do not use. This field is ignored.
-     * 
- * - * .google.protobuf.Timestamp start_time = 10 [deprecated = true]; - * - * @return Whether the startTime field is set. - */ - @java.lang.Deprecated - public boolean hasStartTime() { - return startTimeBuilder_ != null || startTime_ != null; - } - /** - * - * - *
-     * Do not use. This field is ignored.
-     * 
- * - * .google.protobuf.Timestamp start_time = 10 [deprecated = true]; - * - * @return The startTime. - */ - @java.lang.Deprecated - public com.google.protobuf.Timestamp getStartTime() { - if (startTimeBuilder_ == null) { - return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; - } else { - return startTimeBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Do not use. This field is ignored.
-     * 
- * - * .google.protobuf.Timestamp start_time = 10 [deprecated = true]; - */ - @java.lang.Deprecated - public Builder setStartTime(com.google.protobuf.Timestamp value) { - if (startTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - startTime_ = value; - onChanged(); - } else { - startTimeBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Do not use. This field is ignored.
-     * 
- * - * .google.protobuf.Timestamp start_time = 10 [deprecated = true]; - */ - @java.lang.Deprecated - public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { - if (startTimeBuilder_ == null) { - startTime_ = builderForValue.build(); - onChanged(); - } else { - startTimeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Do not use. This field is ignored.
-     * 
- * - * .google.protobuf.Timestamp start_time = 10 [deprecated = true]; - */ - @java.lang.Deprecated - public Builder mergeStartTime(com.google.protobuf.Timestamp value) { - if (startTimeBuilder_ == null) { - if (startTime_ != null) { - startTime_ = - com.google.protobuf.Timestamp.newBuilder(startTime_).mergeFrom(value).buildPartial(); - } else { - startTime_ = value; - } - onChanged(); - } else { - startTimeBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Do not use. This field is ignored.
-     * 
- * - * .google.protobuf.Timestamp start_time = 10 [deprecated = true]; - */ - @java.lang.Deprecated - public Builder clearStartTime() { - if (startTimeBuilder_ == null) { - startTime_ = null; - onChanged(); - } else { - startTime_ = null; - startTimeBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Do not use. This field is ignored.
-     * 
- * - * .google.protobuf.Timestamp start_time = 10 [deprecated = true]; - */ - @java.lang.Deprecated - public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { - - onChanged(); - return getStartTimeFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Do not use. This field is ignored.
-     * 
- * - * .google.protobuf.Timestamp start_time = 10 [deprecated = true]; - */ - @java.lang.Deprecated - public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { - if (startTimeBuilder_ != null) { - return startTimeBuilder_.getMessageOrBuilder(); - } else { - return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; - } - } - /** - * - * - *
-     * Do not use. This field is ignored.
-     * 
- * - * .google.protobuf.Timestamp start_time = 10 [deprecated = true]; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - getStartTimeFieldBuilder() { - if (startTimeBuilder_ == null) { - startTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder>( - getStartTime(), getParentForChildren(), isClean()); - startTime_ = null; - } - return startTimeBuilder_; - } - - private com.google.protobuf.Timestamp endTime_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - endTimeBuilder_; - /** - * - * - *
-     * Do not use. This field is ignored.
-     * 
- * - * .google.protobuf.Timestamp end_time = 11 [deprecated = true]; - * - * @return Whether the endTime field is set. - */ - @java.lang.Deprecated - public boolean hasEndTime() { - return endTimeBuilder_ != null || endTime_ != null; - } - /** - * - * - *
-     * Do not use. This field is ignored.
-     * 
- * - * .google.protobuf.Timestamp end_time = 11 [deprecated = true]; - * - * @return The endTime. - */ - @java.lang.Deprecated - public com.google.protobuf.Timestamp getEndTime() { - if (endTimeBuilder_ == null) { - return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; - } else { - return endTimeBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Do not use. This field is ignored.
-     * 
- * - * .google.protobuf.Timestamp end_time = 11 [deprecated = true]; - */ - @java.lang.Deprecated - public Builder setEndTime(com.google.protobuf.Timestamp value) { - if (endTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - endTime_ = value; - onChanged(); - } else { - endTimeBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-     * Do not use. This field is ignored.
-     * 
- * - * .google.protobuf.Timestamp end_time = 11 [deprecated = true]; - */ - @java.lang.Deprecated - public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { - if (endTimeBuilder_ == null) { - endTime_ = builderForValue.build(); - onChanged(); - } else { - endTimeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-     * Do not use. This field is ignored.
-     * 
- * - * .google.protobuf.Timestamp end_time = 11 [deprecated = true]; - */ - @java.lang.Deprecated - public Builder mergeEndTime(com.google.protobuf.Timestamp value) { - if (endTimeBuilder_ == null) { - if (endTime_ != null) { - endTime_ = - com.google.protobuf.Timestamp.newBuilder(endTime_).mergeFrom(value).buildPartial(); - } else { - endTime_ = value; - } - onChanged(); - } else { - endTimeBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-     * Do not use. This field is ignored.
-     * 
- * - * .google.protobuf.Timestamp end_time = 11 [deprecated = true]; - */ - @java.lang.Deprecated - public Builder clearEndTime() { - if (endTimeBuilder_ == null) { - endTime_ = null; - onChanged(); - } else { - endTime_ = null; - endTimeBuilder_ = null; - } - - return this; - } - /** - * - * - *
-     * Do not use. This field is ignored.
-     * 
- * - * .google.protobuf.Timestamp end_time = 11 [deprecated = true]; - */ - @java.lang.Deprecated - public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { - - onChanged(); - return getEndTimeFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Do not use. This field is ignored.
-     * 
- * - * .google.protobuf.Timestamp end_time = 11 [deprecated = true]; - */ - @java.lang.Deprecated - public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { - if (endTimeBuilder_ != null) { - return endTimeBuilder_.getMessageOrBuilder(); - } else { - return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; - } - } - /** - * - * - *
-     * Do not use. This field is ignored.
-     * 
- * - * .google.protobuf.Timestamp end_time = 11 [deprecated = true]; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - getEndTimeFieldBuilder() { - if (endTimeBuilder_ == null) { - endTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder>( - getEndTime(), getParentForChildren(), isClean()); - endTime_ = null; - } - return endTimeBuilder_; - } - @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogSinkName.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogSinkName.java new file mode 100644 index 000000000..ead5343de --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogSinkName.java @@ -0,0 +1,439 @@ +/* + * Copyright 2020 Google LLC + * + * 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 + * + * https://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.logging.v2; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.pathtemplate.ValidationException; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** AUTO-GENERATED DOCUMENTATION AND CLASS */ +@javax.annotation.Generated("by GAPIC protoc plugin") +public class LogSinkName implements ResourceName { + + @Deprecated + protected LogSinkName() {} + + private static final PathTemplate PROJECT_SINK_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/sinks/{sink}"); + private static final PathTemplate ORGANIZATION_SINK_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("organizations/{organization}/sinks/{sink}"); + private static final PathTemplate FOLDER_SINK_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("folders/{folder}/sinks/{sink}"); + private static final PathTemplate BILLING_ACCOUNT_SINK_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("billingAccounts/{billing_account}/sinks/{sink}"); + + private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; + + private String project; + private String sink; + private String organization; + private String folder; + private String billingAccount; + + public String getProject() { + return project; + } + + public String getSink() { + return sink; + } + + public String getOrganization() { + return organization; + } + + public String getFolder() { + return folder; + } + + public String getBillingAccount() { + return billingAccount; + } + + private LogSinkName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + sink = Preconditions.checkNotNull(builder.getSink()); + pathTemplate = PROJECT_SINK_PATH_TEMPLATE; + } + + private LogSinkName(OrganizationSinkBuilder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + sink = Preconditions.checkNotNull(builder.getSink()); + pathTemplate = ORGANIZATION_SINK_PATH_TEMPLATE; + } + + private LogSinkName(FolderSinkBuilder builder) { + folder = Preconditions.checkNotNull(builder.getFolder()); + sink = Preconditions.checkNotNull(builder.getSink()); + pathTemplate = FOLDER_SINK_PATH_TEMPLATE; + } + + private LogSinkName(BillingAccountSinkBuilder builder) { + billingAccount = Preconditions.checkNotNull(builder.getBillingAccount()); + sink = Preconditions.checkNotNull(builder.getSink()); + pathTemplate = BILLING_ACCOUNT_SINK_PATH_TEMPLATE; + } + + public static Builder newBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static Builder newProjectSinkBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static OrganizationSinkBuilder newOrganizationSinkBuilder() { + return new OrganizationSinkBuilder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static FolderSinkBuilder newFolderSinkBuilder() { + return new FolderSinkBuilder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static BillingAccountSinkBuilder newBillingAccountSinkBuilder() { + return new BillingAccountSinkBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static LogSinkName of(String project, String sink) { + return newProjectSinkBuilder().setProject(project).setSink(sink).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static LogSinkName ofProjectSinkName(String project, String sink) { + return newProjectSinkBuilder().setProject(project).setSink(sink).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static LogSinkName ofOrganizationSinkName(String organization, String sink) { + return newOrganizationSinkBuilder().setOrganization(organization).setSink(sink).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static LogSinkName ofFolderSinkName(String folder, String sink) { + return newFolderSinkBuilder().setFolder(folder).setSink(sink).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static LogSinkName ofBillingAccountSinkName(String billingAccount, String sink) { + return newBillingAccountSinkBuilder().setBillingAccount(billingAccount).setSink(sink).build(); + } + + public static String format(String project, String sink) { + return newBuilder().setProject(project).setSink(sink).build().toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatProjectSinkName(String project, String sink) { + return newBuilder().setProject(project).setSink(sink).build().toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatOrganizationSinkName(String organization, String sink) { + return newOrganizationSinkBuilder() + .setOrganization(organization) + .setSink(sink) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatFolderSinkName(String folder, String sink) { + return newFolderSinkBuilder().setFolder(folder).setSink(sink).build().toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatBillingAccountSinkName(String billingAccount, String sink) { + return newBillingAccountSinkBuilder() + .setBillingAccount(billingAccount) + .setSink(sink) + .build() + .toString(); + } + + public static LogSinkName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + if (PROJECT_SINK_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = PROJECT_SINK_PATH_TEMPLATE.match(formattedString); + return ofProjectSinkName(matchMap.get("project"), matchMap.get("sink")); + } else if (ORGANIZATION_SINK_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = ORGANIZATION_SINK_PATH_TEMPLATE.match(formattedString); + return ofOrganizationSinkName(matchMap.get("organization"), matchMap.get("sink")); + } else if (FOLDER_SINK_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = FOLDER_SINK_PATH_TEMPLATE.match(formattedString); + return ofFolderSinkName(matchMap.get("folder"), matchMap.get("sink")); + } else if (BILLING_ACCOUNT_SINK_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = BILLING_ACCOUNT_SINK_PATH_TEMPLATE.match(formattedString); + return ofBillingAccountSinkName(matchMap.get("billing_account"), matchMap.get("sink")); + } + throw new ValidationException("JobName.parse: formattedString not in valid format"); + } + + @BetaApi("The method will be renamed to parseList after subclasses of this class are removed.") + public static List parse(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + @BetaApi("The method will be renamed to toStringList after subclasses of this class are removed.") + public static List toStrings(List values) { + List list = new ArrayList<>(values.size()); + for (LogSinkName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_SINK_PATH_TEMPLATE.matches(formattedString) + || ORGANIZATION_SINK_PATH_TEMPLATE.matches(formattedString) + || FOLDER_SINK_PATH_TEMPLATE.matches(formattedString) + || BILLING_ACCOUNT_SINK_PATH_TEMPLATE.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (sink != null) { + fieldMapBuilder.put("sink", sink); + } + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + if (folder != null) { + fieldMapBuilder.put("folder", folder); + } + if (billingAccount != null) { + fieldMapBuilder.put("billing_account", billingAccount); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + } + + /** Builder for projects/{project}/sinks/{sink}. */ + public static class Builder { + + private String project; + private String sink; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getSink() { + return sink; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setSink(String sink) { + this.sink = sink; + return this; + } + + private Builder(LogSinkName logSinkName) { + Preconditions.checkArgument( + logSinkName.pathTemplate == PROJECT_SINK_PATH_TEMPLATE, + "toBuilder is only supported when LogSinkName has the pattern of " + + "projects/{project}/sinks/{sink}."); + project = logSinkName.project; + sink = logSinkName.sink; + } + + public LogSinkName build() { + return new LogSinkName(this); + } + } + + /** Builder for organizations/{organization}/sinks/{sink}. */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class OrganizationSinkBuilder { + + private String organization; + private String sink; + + private OrganizationSinkBuilder() {} + + public String getOrganization() { + return organization; + } + + public String getSink() { + return sink; + } + + public OrganizationSinkBuilder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public OrganizationSinkBuilder setSink(String sink) { + this.sink = sink; + return this; + } + + public LogSinkName build() { + return new LogSinkName(this); + } + } + + /** Builder for folders/{folder}/sinks/{sink}. */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class FolderSinkBuilder { + + private String folder; + private String sink; + + private FolderSinkBuilder() {} + + public String getFolder() { + return folder; + } + + public String getSink() { + return sink; + } + + public FolderSinkBuilder setFolder(String folder) { + this.folder = folder; + return this; + } + + public FolderSinkBuilder setSink(String sink) { + this.sink = sink; + return this; + } + + public LogSinkName build() { + return new LogSinkName(this); + } + } + + /** Builder for billingAccounts/{billing_account}/sinks/{sink}. */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class BillingAccountSinkBuilder { + + private String billingAccount; + private String sink; + + private BillingAccountSinkBuilder() {} + + public String getBillingAccount() { + return billingAccount; + } + + public String getSink() { + return sink; + } + + public BillingAccountSinkBuilder setBillingAccount(String billingAccount) { + this.billingAccount = billingAccount; + return this; + } + + public BillingAccountSinkBuilder setSink(String sink) { + this.sink = sink; + return this; + } + + public LogSinkName build() { + return new LogSinkName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + LogSinkName that = (LogSinkName) o; + return (Objects.equals(this.project, that.project)) + && (Objects.equals(this.sink, that.sink)) + && (Objects.equals(this.organization, that.organization)) + && (Objects.equals(this.folder, that.folder)) + && (Objects.equals(this.billingAccount, that.billingAccount)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(sink); + h *= 1000003; + h ^= Objects.hashCode(organization); + h *= 1000003; + h ^= Objects.hashCode(folder); + h *= 1000003; + h ^= Objects.hashCode(billingAccount); + return h; + } +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogSinkOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogSinkOrBuilder.java index 775d3cba8..d0a3b387d 100644 --- a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogSinkOrBuilder.java +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogSinkOrBuilder.java @@ -27,14 +27,14 @@ public interface LogSinkOrBuilder * * *
-   * Required. The client-assigned sink identifier, unique within the
-   * project. Example: `"my-syslog-errors-to-pubsub"`. Sink identifiers are
-   * limited to 100 characters and can include only the following characters:
-   * upper and lower-case alphanumeric characters, underscores, hyphens, and
-   * periods. First character has to be alphanumeric.
+   * Required. The client-assigned sink identifier, unique within the project. Example:
+   * `"my-syslog-errors-to-pubsub"`. Sink identifiers are limited to 100
+   * characters and can include only the following characters: upper and
+   * lower-case alphanumeric characters, underscores, hyphens, and periods.
+   * First character has to be alphanumeric.
    * 
* - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The name. */ @@ -43,14 +43,14 @@ public interface LogSinkOrBuilder * * *
-   * Required. The client-assigned sink identifier, unique within the
-   * project. Example: `"my-syslog-errors-to-pubsub"`. Sink identifiers are
-   * limited to 100 characters and can include only the following characters:
-   * upper and lower-case alphanumeric characters, underscores, hyphens, and
-   * periods. First character has to be alphanumeric.
+   * Required. The client-assigned sink identifier, unique within the project. Example:
+   * `"my-syslog-errors-to-pubsub"`. Sink identifiers are limited to 100
+   * characters and can include only the following characters: upper and
+   * lower-case alphanumeric characters, underscores, hyphens, and periods.
+   * First character has to be alphanumeric.
    * 
* - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The bytes for name. */ @@ -70,7 +70,9 @@ public interface LogSinkOrBuilder * [Exporting Logs with Sinks](/logging/docs/api/tasks/exporting-logs). * * - * string destination = 3 [(.google.api.resource_reference) = { ... } + * + * string destination = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The destination. */ @@ -89,7 +91,9 @@ public interface LogSinkOrBuilder * [Exporting Logs with Sinks](/logging/docs/api/tasks/exporting-logs). * * - * string destination = 3 [(.google.api.resource_reference) = { ... } + * + * string destination = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * * * @return The bytes for destination. */ @@ -105,7 +109,7 @@ public interface LogSinkOrBuilder * logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR * * - * string filter = 5; + * string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; * * @return The filter. */ @@ -120,7 +124,7 @@ public interface LogSinkOrBuilder * logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR * * - * string filter = 5; + * string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for filter. */ @@ -134,7 +138,7 @@ public interface LogSinkOrBuilder * The maximum length of the description is 8000 characters. * * - * string description = 18; + * string description = 18 [(.google.api.field_behavior) = OPTIONAL]; * * @return The description. */ @@ -147,7 +151,7 @@ public interface LogSinkOrBuilder * The maximum length of the description is 8000 characters. * * - * string description = 18; + * string description = 18 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for description. */ @@ -161,7 +165,7 @@ public interface LogSinkOrBuilder * export any log entries. * * - * bool disabled = 19; + * bool disabled = 19 [(.google.api.field_behavior) = OPTIONAL]; * * @return The disabled. */ @@ -202,13 +206,11 @@ public interface LogSinkOrBuilder * * *
-   * Output only. An IAM identity&mdash;a service account or group&mdash;under
-   * which Logging writes the exported log entries to the sink's destination.
-   * This field is set by
-   * [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink]
-   * and
-   * [sinks.update][google.logging.v2.ConfigServiceV2.UpdateSink]
-   * based on the value of `unique_writer_identity` in those methods.
+   * Output only. An IAM identity–a service account or group&mdash;under which Logging
+   * writes the exported log entries to the sink's destination. This field is
+   * set by [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] and
+   * [sinks.update][google.logging.v2.ConfigServiceV2.UpdateSink] based on the
+   * value of `unique_writer_identity` in those methods.
    * Until you grant this identity write-access to the destination, log entry
    * exports from this sink will fail. For more information,
    * see [Granting Access for a
@@ -226,13 +228,11 @@ public interface LogSinkOrBuilder
    *
    *
    * 
-   * Output only. An IAM identity&mdash;a service account or group&mdash;under
-   * which Logging writes the exported log entries to the sink's destination.
-   * This field is set by
-   * [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink]
-   * and
-   * [sinks.update][google.logging.v2.ConfigServiceV2.UpdateSink]
-   * based on the value of `unique_writer_identity` in those methods.
+   * Output only. An IAM identity–a service account or group&mdash;under which Logging
+   * writes the exported log entries to the sink's destination. This field is
+   * set by [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] and
+   * [sinks.update][google.logging.v2.ConfigServiceV2.UpdateSink] based on the
+   * value of `unique_writer_identity` in those methods.
    * Until you grant this identity write-access to the destination, log entry
    * exports from this sink will fail. For more information,
    * see [Granting Access for a
@@ -265,7 +265,7 @@ public interface LogSinkOrBuilder
    *     resource.type=gce_instance
    * 
* - * bool include_children = 9; + * bool include_children = 9 [(.google.api.field_behavior) = OPTIONAL]; * * @return The includeChildren. */ @@ -278,7 +278,9 @@ public interface LogSinkOrBuilder * Optional. Options that affect sinks exporting data to BigQuery. *
* - * .google.logging.v2.BigQueryOptions bigquery_options = 12; + * + * .google.logging.v2.BigQueryOptions bigquery_options = 12 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return Whether the bigqueryOptions field is set. */ @@ -290,7 +292,9 @@ public interface LogSinkOrBuilder * Optional. Options that affect sinks exporting data to BigQuery. * * - * .google.logging.v2.BigQueryOptions bigquery_options = 12; + * + * .google.logging.v2.BigQueryOptions bigquery_options = 12 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return The bigqueryOptions. */ @@ -302,7 +306,9 @@ public interface LogSinkOrBuilder * Optional. Options that affect sinks exporting data to BigQuery. * * - * .google.logging.v2.BigQueryOptions bigquery_options = 12; + * + * .google.logging.v2.BigQueryOptions bigquery_options = 12 [(.google.api.field_behavior) = OPTIONAL]; + * */ com.google.logging.v2.BigQueryOptionsOrBuilder getBigqueryOptionsOrBuilder(); @@ -388,81 +394,5 @@ public interface LogSinkOrBuilder */ com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); - /** - * - * - *
-   * Do not use. This field is ignored.
-   * 
- * - * .google.protobuf.Timestamp start_time = 10 [deprecated = true]; - * - * @return Whether the startTime field is set. - */ - @java.lang.Deprecated - boolean hasStartTime(); - /** - * - * - *
-   * Do not use. This field is ignored.
-   * 
- * - * .google.protobuf.Timestamp start_time = 10 [deprecated = true]; - * - * @return The startTime. - */ - @java.lang.Deprecated - com.google.protobuf.Timestamp getStartTime(); - /** - * - * - *
-   * Do not use. This field is ignored.
-   * 
- * - * .google.protobuf.Timestamp start_time = 10 [deprecated = true]; - */ - @java.lang.Deprecated - com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); - - /** - * - * - *
-   * Do not use. This field is ignored.
-   * 
- * - * .google.protobuf.Timestamp end_time = 11 [deprecated = true]; - * - * @return Whether the endTime field is set. - */ - @java.lang.Deprecated - boolean hasEndTime(); - /** - * - * - *
-   * Do not use. This field is ignored.
-   * 
- * - * .google.protobuf.Timestamp end_time = 11 [deprecated = true]; - * - * @return The endTime. - */ - @java.lang.Deprecated - com.google.protobuf.Timestamp getEndTime(); - /** - * - * - *
-   * Do not use. This field is ignored.
-   * 
- * - * .google.protobuf.Timestamp end_time = 11 [deprecated = true]; - */ - @java.lang.Deprecated - com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); - public com.google.logging.v2.LogSink.OptionsCase getOptionsCase(); } diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LoggingConfigProto.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LoggingConfigProto.java index c6770e573..76452bd54 100644 --- a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LoggingConfigProto.java +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LoggingConfigProto.java @@ -27,6 +27,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_LogBucket_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_LogBucket_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_logging_v2_LogSink_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -35,6 +39,22 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_logging_v2_BigQueryOptions_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_logging_v2_BigQueryOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_ListBucketsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_ListBucketsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_ListBucketsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_ListBucketsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_UpdateBucketRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_UpdateBucketRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_GetBucketRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_GetBucketRequest_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_logging_v2_ListSinksRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -115,186 +135,248 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "f/duration.proto\032\033google/protobuf/empty." + "proto\032 google/protobuf/field_mask.proto\032" + "\037google/protobuf/timestamp.proto\032\034google" - + "/api/annotations.proto\"\215\006\n\007LogSink\022\014\n\004na" - + "me\030\001 \001(\t\022\033\n\013destination\030\003 \001(\tB\006\372A\003\n\001*\022\016\n" - + "\006filter\030\005 \001(\t\022\023\n\013description\030\022 \001(\t\022\020\n\010di" - + "sabled\030\023 \001(\010\022K\n\025output_version_format\030\006 " - + "\001(\0162(.google.logging.v2.LogSink.VersionF" - + "ormatB\002\030\001\022\034\n\017writer_identity\030\010 \001(\tB\003\340A\003\022" - + "\030\n\020include_children\030\t \001(\010\022>\n\020bigquery_op" - + "tions\030\014 \001(\0132\".google.logging.v2.BigQuery" - + "OptionsH\000\0224\n\013create_time\030\r \001(\0132\032.google." - + "protobuf.TimestampB\003\340A\003\0224\n\013update_time\030\016" - + " \001(\0132\032.google.protobuf.TimestampB\003\340A\003\0222\n" - + "\nstart_time\030\n \001(\0132\032.google.protobuf.Time" - + "stampB\002\030\001\0220\n\010end_time\030\013 \001(\0132\032.google.pro" - + "tobuf.TimestampB\002\030\001\"?\n\rVersionFormat\022\036\n\032" - + "VERSION_FORMAT_UNSPECIFIED\020\000\022\006\n\002V2\020\001\022\006\n\002" - + "V1\020\002:\274\001\352A\270\001\n\033logging.googleapis.com/Sink" - + "\022\037projects/{project}/sinks/{sink}\022)organ" - + "izations/{organization}/sinks/{sink}\022\035fo" - + "lders/{folder}/sinks/{sink}\022.billingAcco" - + "unts/{billing_account}/sinks/{sink}B\t\n\007o" - + "ptions\"b\n\017BigQueryOptions\022\036\n\026use_partiti" - + "oned_tables\030\001 \001(\010\022/\n\"uses_timestamp_colu" - + "mn_partitioning\030\003 \001(\010B\003\340A\003\"n\n\020ListSinksR" - + "equest\0223\n\006parent\030\001 \001(\tB#\340A\002\372A\035\022\033logging." - + "googleapis.com/Sink\022\022\n\npage_token\030\002 \001(\t\022" - + "\021\n\tpage_size\030\003 \001(\005\"W\n\021ListSinksResponse\022" - + ")\n\005sinks\030\001 \003(\0132\032.google.logging.v2.LogSi" - + "nk\022\027\n\017next_page_token\030\002 \001(\t\"H\n\016GetSinkRe" - + "quest\0226\n\tsink_name\030\001 \001(\tB#\340A\002\372A\035\n\033loggin" - + "g.googleapis.com/Sink\"\227\001\n\021CreateSinkRequ" - + "est\0223\n\006parent\030\001 \001(\tB#\340A\002\372A\035\022\033logging.goo" - + "gleapis.com/Sink\022-\n\004sink\030\002 \001(\0132\032.google." - + "logging.v2.LogSinkB\003\340A\002\022\036\n\026unique_writer" - + "_identity\030\003 \001(\010\"\313\001\n\021UpdateSinkRequest\0226\n" - + "\tsink_name\030\001 \001(\tB#\340A\002\372A\035\n\033logging.google" - + "apis.com/Sink\022-\n\004sink\030\002 \001(\0132\032.google.log" - + "ging.v2.LogSinkB\003\340A\002\022\036\n\026unique_writer_id" - + "entity\030\003 \001(\010\022/\n\013update_mask\030\004 \001(\0132\032.goog" - + "le.protobuf.FieldMask\"K\n\021DeleteSinkReque" - + "st\0226\n\tsink_name\030\001 \001(\tB#\340A\002\372A\035\n\033logging.g" - + "oogleapis.com/Sink\"\241\003\n\014LogExclusion\022\014\n\004n" - + "ame\030\001 \001(\t\022\023\n\013description\030\002 \001(\t\022\016\n\006filter" - + "\030\003 \001(\t\022\020\n\010disabled\030\004 \001(\010\022/\n\013create_time\030" - + "\005 \001(\0132\032.google.protobuf.Timestamp\022/\n\013upd" - + "ate_time\030\006 \001(\0132\032.google.protobuf.Timesta" - + "mp:\351\001\352A\345\001\n logging.googleapis.com/Exclus" - + "ion\022)projects/{project}/exclusions/{excl" - + "usion}\0223organizations/{organization}/exc" - + "lusions/{exclusion}\022\'folders/{folder}/ex" - + "clusions/{exclusion}\0228billingAccounts/{b" - + "illing_account}/exclusions/{exclusion}\"x" - + "\n\025ListExclusionsRequest\0228\n\006parent\030\001 \001(\tB" - + "(\340A\002\372A\"\022 logging.googleapis.com/Exclusio" - + "n\022\022\n\npage_token\030\002 \001(\t\022\021\n\tpage_size\030\003 \001(\005" - + "\"f\n\026ListExclusionsResponse\0223\n\nexclusions" - + "\030\001 \003(\0132\037.google.logging.v2.LogExclusion\022" - + "\027\n\017next_page_token\030\002 \001(\t\"M\n\023GetExclusion" - + "Request\0226\n\004name\030\001 \001(\tB(\340A\002\372A\"\n logging.g" - + "oogleapis.com/Exclusion\"\206\001\n\026CreateExclus" - + "ionRequest\0228\n\006parent\030\001 \001(\tB(\340A\002\372A\"\022 logg" - + "ing.googleapis.com/Exclusion\0222\n\texclusio" - + "n\030\002 \001(\0132\037.google.logging.v2.LogExclusion" - + "\"\277\001\n\026UpdateExclusionRequest\0226\n\004name\030\001 \001(" - + "\tB(\340A\002\372A\"\n logging.googleapis.com/Exclus" - + "ion\0227\n\texclusion\030\002 \001(\0132\037.google.logging." - + "v2.LogExclusionB\003\340A\002\0224\n\013update_mask\030\003 \001(" - + "\0132\032.google.protobuf.FieldMaskB\003\340A\002\"P\n\026De" - + "leteExclusionRequest\0226\n\004name\030\001 \001(\tB(\340A\002\372" - + "A\"\n logging.googleapis.com/Exclusion\"&\n\026" - + "GetCmekSettingsRequest\022\014\n\004name\030\001 \001(\t\"\222\001\n" - + "\031UpdateCmekSettingsRequest\022\014\n\004name\030\001 \001(\t" - + "\0226\n\rcmek_settings\030\002 \001(\0132\037.google.logging" - + ".v2.CmekSettings\022/\n\013update_mask\030\003 \001(\0132\032." - + "google.protobuf.FieldMask\"N\n\014CmekSetting" - + "s\022\014\n\004name\030\001 \001(\t\022\024\n\014kms_key_name\030\002 \001(\t\022\032\n" - + "\022service_account_id\030\003 \001(\t2\236\037\n\017ConfigServ" - + "iceV2\022\220\002\n\tListSinks\022#.google.logging.v2." - + "ListSinksRequest\032$.google.logging.v2.Lis" - + "tSinksResponse\"\267\001\202\323\344\223\002\247\001\022\026/v2/{parent=*/" - + "*}/sinksZ\037\022\035/v2/{parent=projects/*}/sink" - + "sZ$\022\"/v2/{parent=organizations/*}/sinksZ" - + "\036\022\034/v2/{parent=folders/*}/sinksZ&\022$/v2/{" - + "parent=billingAccounts/*}/sinks\332A\006parent" - + "\022\236\002\n\007GetSink\022!.google.logging.v2.GetSink" - + "Request\032\032.google.logging.v2.LogSink\"\323\001\202\323" - + "\344\223\002\300\001\022\033/v2/{sink_name=*/*/sinks/*}Z$\022\"/v" - + "2/{sink_name=projects/*/sinks/*}Z)\022\'/v2/" - + "{sink_name=organizations/*/sinks/*}Z#\022!/" - + "v2/{sink_name=folders/*/sinks/*}Z+\022)/v2/" - + "{sink_name=billingAccounts/*/sinks/*}\332A\t" - + "sink_name\022\253\002\n\nCreateSink\022$.google.loggin" - + "g.v2.CreateSinkRequest\032\032.google.logging." - + "v2.LogSink\"\332\001\202\323\344\223\002\305\001\"\026/v2/{parent=*/*}/s" - + "inks:\004sinkZ%\"\035/v2/{parent=projects/*}/si" - + "nks:\004sinkZ*\"\"/v2/{parent=organizations/*" - + "}/sinks:\004sinkZ$\"\034/v2/{parent=folders/*}/" - + "sinks:\004sinkZ,\"$/v2/{parent=billingAccoun" - + "ts/*}/sinks:\004sink\332A\013parent,sink\022\237\004\n\nUpda" - + "teSink\022$.google.logging.v2.UpdateSinkReq" - + "uest\032\032.google.logging.v2.LogSink\"\316\003\202\323\344\223\002" - + "\231\003\032\033/v2/{sink_name=*/*/sinks/*}:\004sinkZ*\032" - + "\"/v2/{sink_name=projects/*/sinks/*}:\004sin" - + "kZ/\032\'/v2/{sink_name=organizations/*/sink" - + "s/*}:\004sinkZ)\032!/v2/{sink_name=folders/*/s" - + "inks/*}:\004sinkZ1\032)/v2/{sink_name=billingA" - + "ccounts/*/sinks/*}:\004sinkZ*2\"/v2/{sink_na" - + "me=projects/*/sinks/*}:\004sinkZ/2\'/v2/{sin" - + "k_name=organizations/*/sinks/*}:\004sinkZ)2" - + "!/v2/{sink_name=folders/*/sinks/*}:\004sink" - + "Z12)/v2/{sink_name=billingAccounts/*/sin" - + "ks/*}:\004sink\332A\032sink_name,sink,update_mask" - + "\332A\016sink_name,sink\022\240\002\n\nDeleteSink\022$.googl" - + "e.logging.v2.DeleteSinkRequest\032\026.google." - + "protobuf.Empty\"\323\001\202\323\344\223\002\300\001*\033/v2/{sink_name" - + "=*/*/sinks/*}Z$*\"/v2/{sink_name=projects" - + "/*/sinks/*}Z)*\'/v2/{sink_name=organizati" - + "ons/*/sinks/*}Z#*!/v2/{sink_name=folders" - + "/*/sinks/*}Z+*)/v2/{sink_name=billingAcc" - + "ounts/*/sinks/*}\332A\tsink_name\022\270\002\n\016ListExc" - + "lusions\022(.google.logging.v2.ListExclusio" - + "nsRequest\032).google.logging.v2.ListExclus" - + "ionsResponse\"\320\001\202\323\344\223\002\300\001\022\033/v2/{parent=*/*}" - + "/exclusionsZ$\022\"/v2/{parent=projects/*}/e" - + "xclusionsZ)\022\'/v2/{parent=organizations/*" - + "}/exclusionsZ#\022!/v2/{parent=folders/*}/e" - + "xclusionsZ+\022)/v2/{parent=billingAccounts" - + "/*}/exclusions\332A\006parent\022\250\002\n\014GetExclusion" - + "\022&.google.logging.v2.GetExclusionRequest" - + "\032\037.google.logging.v2.LogExclusion\"\316\001\202\323\344\223" - + "\002\300\001\022\033/v2/{name=*/*/exclusions/*}Z$\022\"/v2/" - + "{name=projects/*/exclusions/*}Z)\022\'/v2/{n" - + "ame=organizations/*/exclusions/*}Z#\022!/v2" - + "/{name=folders/*/exclusions/*}Z+\022)/v2/{n" - + "ame=billingAccounts/*/exclusions/*}\332A\004na" - + "me\022\361\002\n\017CreateExclusion\022).google.logging." - + "v2.CreateExclusionRequest\032\037.google.loggi" - + "ng.v2.LogExclusion\"\221\002\202\323\344\223\002\367\001\"\033/v2/{paren" - + "t=*/*}/exclusions:\texclusionZ/\"\"/v2/{par" - + "ent=projects/*}/exclusions:\texclusionZ4\"" - + "\'/v2/{parent=organizations/*}/exclusions" - + ":\texclusionZ.\"!/v2/{parent=folders/*}/ex" - + "clusions:\texclusionZ6\")/v2/{parent=billi" - + "ngAccounts/*}/exclusions:\texclusion\332A\020pa" - + "rent,exclusion\022\373\002\n\017UpdateExclusion\022).goo" - + "gle.logging.v2.UpdateExclusionRequest\032\037." - + "google.logging.v2.LogExclusion\"\233\002\202\323\344\223\002\367\001" - + "2\033/v2/{name=*/*/exclusions/*}:\texclusion" - + "Z/2\"/v2/{name=projects/*/exclusions/*}:\t" - + "exclusionZ42\'/v2/{name=organizations/*/e" - + "xclusions/*}:\texclusionZ.2!/v2/{name=fol" - + "ders/*/exclusions/*}:\texclusionZ62)/v2/{" - + "name=billingAccounts/*/exclusions/*}:\tex" - + "clusion\332A\032name,exclusion,update_mask\022\245\002\n" - + "\017DeleteExclusion\022).google.logging.v2.Del" - + "eteExclusionRequest\032\026.google.protobuf.Em" - + "pty\"\316\001\202\323\344\223\002\300\001*\033/v2/{name=*/*/exclusions/" - + "*}Z$*\"/v2/{name=projects/*/exclusions/*}" - + "Z)*\'/v2/{name=organizations/*/exclusions" - + "/*}Z#*!/v2/{name=folders/*/exclusions/*}" - + "Z+*)/v2/{name=billingAccounts/*/exclusio" - + "ns/*}\332A\004name\022\255\001\n\017GetCmekSettings\022).googl" - + "e.logging.v2.GetCmekSettingsRequest\032\037.go" - + "ogle.logging.v2.CmekSettings\"N\202\323\344\223\002H\022\033/v" - + "2/{name=*/*}/cmekSettingsZ)\022\'/v2/{name=o" - + "rganizations/*}/cmekSettings\022\321\001\n\022UpdateC" - + "mekSettings\022,.google.logging.v2.UpdateCm" - + "ekSettingsRequest\032\037.google.logging.v2.Cm" - + "ekSettings\"l\202\323\344\223\002f2\033/v2/{name=*/*}/cmekS" - + "ettings:\rcmek_settingsZ82\'/v2/{name=orga" - + "nizations/*}/cmekSettings:\rcmek_settings" - + "\032\337\001\312A\026logging.googleapis.com\322A\302\001https://" - + "www.googleapis.com/auth/cloud-platform,h" - + "ttps://www.googleapis.com/auth/cloud-pla" - + "tform.read-only,https://www.googleapis.c" - + "om/auth/logging.admin,https://www.google" - + "apis.com/auth/logging.readB\236\001\n\025com.googl" - + "e.logging.v2B\022LoggingConfigProtoP\001Z8goog" - + "le.golang.org/genproto/googleapis/loggin" - + "g/v2;logging\370\001\001\252\002\027Google.Cloud.Logging.V" - + "2\312\002\027Google\\Cloud\\Logging\\V2b\006proto3" + + "/api/annotations.proto\"\233\004\n\tLogBucket\022\014\n\004" + + "name\030\001 \001(\t\022\023\n\013description\030\003 \001(\t\0224\n\013creat" + + "e_time\030\004 \001(\0132\032.google.protobuf.Timestamp" + + "B\003\340A\003\0224\n\013update_time\030\005 \001(\0132\032.google.prot" + + "obuf.TimestampB\003\340A\003\022\026\n\016retention_days\030\013 " + + "\001(\005\022?\n\017lifecycle_state\030\014 \001(\0162!.google.lo" + + "gging.v2.LifecycleStateB\003\340A\003:\245\002\352A\241\002\n log" + + "ging.googleapis.com/LogBucket\0228projects/" + + "{project}/locations/{location}/buckets/{" + + "bucket}\022Borganizations/{organization}/lo" + + "cations/{location}/buckets/{bucket}\0226fol" + + "ders/{folder}/locations/{location}/bucke" + + "ts/{bucket}\022GbillingAccounts/{billing_ac" + + "count}/locations/{location}/buckets/{buc" + + "ket}\"\313\005\n\007LogSink\022\021\n\004name\030\001 \001(\tB\003\340A\002\022\036\n\013d" + + "estination\030\003 \001(\tB\t\340A\002\372A\003\n\001*\022\023\n\006filter\030\005 " + + "\001(\tB\003\340A\001\022\030\n\013description\030\022 \001(\tB\003\340A\001\022\025\n\010di" + + "sabled\030\023 \001(\010B\003\340A\001\022K\n\025output_version_form" + + "at\030\006 \001(\0162(.google.logging.v2.LogSink.Ver" + + "sionFormatB\002\030\001\022\034\n\017writer_identity\030\010 \001(\tB" + + "\003\340A\003\022\035\n\020include_children\030\t \001(\010B\003\340A\001\022C\n\020b" + + "igquery_options\030\014 \001(\0132\".google.logging.v" + + "2.BigQueryOptionsB\003\340A\001H\000\0224\n\013create_time\030" + + "\r \001(\0132\032.google.protobuf.TimestampB\003\340A\003\0224" + + "\n\013update_time\030\016 \001(\0132\032.google.protobuf.Ti" + + "mestampB\003\340A\003\"?\n\rVersionFormat\022\036\n\032VERSION" + + "_FORMAT_UNSPECIFIED\020\000\022\006\n\002V2\020\001\022\006\n\002V1\020\002:\277\001" + + "\352A\273\001\n\036logging.googleapis.com/LogSink\022\037pr" + + "ojects/{project}/sinks/{sink}\022)organizat" + + "ions/{organization}/sinks/{sink}\022\035folder" + + "s/{folder}/sinks/{sink}\022.billingAccounts" + + "/{billing_account}/sinks/{sink}B\t\n\007optio" + + "ns\"g\n\017BigQueryOptions\022#\n\026use_partitioned" + + "_tables\030\001 \001(\010B\003\340A\001\022/\n\"uses_timestamp_col" + + "umn_partitioning\030\003 \001(\010B\003\340A\003\"\177\n\022ListBucke" + + "tsRequest\0228\n\006parent\030\001 \001(\tB(\340A\002\372A\"\022 loggi" + + "ng.googleapis.com/LogBucket\022\027\n\npage_toke" + + "n\030\002 \001(\tB\003\340A\001\022\026\n\tpage_size\030\003 \001(\005B\003\340A\001\"]\n\023" + + "ListBucketsResponse\022-\n\007buckets\030\001 \003(\0132\034.g" + + "oogle.logging.v2.LogBucket\022\027\n\017next_page_" + + "token\030\002 \001(\t\"\266\001\n\023UpdateBucketRequest\0226\n\004n" + + "ame\030\001 \001(\tB(\340A\002\372A\"\n logging.googleapis.co" + + "m/LogBucket\0221\n\006bucket\030\002 \001(\0132\034.google.log" + + "ging.v2.LogBucketB\003\340A\002\0224\n\013update_mask\030\004 " + + "\001(\0132\032.google.protobuf.FieldMaskB\003\340A\002\"J\n\020" + + "GetBucketRequest\0226\n\004name\030\001 \001(\tB(\340A\002\372A\"\n " + + "logging.googleapis.com/LogBucket\"{\n\020List" + + "SinksRequest\0226\n\006parent\030\001 \001(\tB&\340A\002\372A \022\036lo" + + "gging.googleapis.com/LogSink\022\027\n\npage_tok" + + "en\030\002 \001(\tB\003\340A\001\022\026\n\tpage_size\030\003 \001(\005B\003\340A\001\"W\n" + + "\021ListSinksResponse\022)\n\005sinks\030\001 \003(\0132\032.goog" + + "le.logging.v2.LogSink\022\027\n\017next_page_token" + + "\030\002 \001(\t\"K\n\016GetSinkRequest\0229\n\tsink_name\030\001 " + + "\001(\tB&\340A\002\372A \n\036logging.googleapis.com/LogS" + + "ink\"\237\001\n\021CreateSinkRequest\0226\n\006parent\030\001 \001(" + + "\tB&\340A\002\372A \022\036logging.googleapis.com/LogSin" + + "k\022-\n\004sink\030\002 \001(\0132\032.google.logging.v2.LogS" + + "inkB\003\340A\002\022#\n\026unique_writer_identity\030\003 \001(\010" + + "B\003\340A\001\"\330\001\n\021UpdateSinkRequest\0229\n\tsink_name" + + "\030\001 \001(\tB&\340A\002\372A \n\036logging.googleapis.com/L" + + "ogSink\022-\n\004sink\030\002 \001(\0132\032.google.logging.v2" + + ".LogSinkB\003\340A\002\022#\n\026unique_writer_identity\030" + + "\003 \001(\010B\003\340A\001\0224\n\013update_mask\030\004 \001(\0132\032.google" + + ".protobuf.FieldMaskB\003\340A\001\"N\n\021DeleteSinkRe" + + "quest\0229\n\tsink_name\030\001 \001(\tB&\340A\002\372A \n\036loggin" + + "g.googleapis.com/LogSink\"\302\003\n\014LogExclusio" + + "n\022\021\n\004name\030\001 \001(\tB\003\340A\002\022\030\n\013description\030\002 \001(" + + "\tB\003\340A\001\022\023\n\006filter\030\003 \001(\tB\003\340A\002\022\025\n\010disabled\030" + + "\004 \001(\010B\003\340A\001\0224\n\013create_time\030\005 \001(\0132\032.google" + + ".protobuf.TimestampB\003\340A\003\0224\n\013update_time\030" + + "\006 \001(\0132\032.google.protobuf.TimestampB\003\340A\003:\354" + + "\001\352A\350\001\n#logging.googleapis.com/LogExclusi" + + "on\022)projects/{project}/exclusions/{exclu" + + "sion}\0223organizations/{organization}/excl" + + "usions/{exclusion}\022\'folders/{folder}/exc" + + "lusions/{exclusion}\0228billingAccounts/{bi" + + "lling_account}/exclusions/{exclusion}\"\205\001" + + "\n\025ListExclusionsRequest\022;\n\006parent\030\001 \001(\tB" + + "+\340A\002\372A%\022#logging.googleapis.com/LogExclu" + + "sion\022\027\n\npage_token\030\002 \001(\tB\003\340A\001\022\026\n\tpage_si" + + "ze\030\003 \001(\005B\003\340A\001\"f\n\026ListExclusionsResponse\022" + + "3\n\nexclusions\030\001 \003(\0132\037.google.logging.v2." + + "LogExclusion\022\027\n\017next_page_token\030\002 \001(\t\"P\n" + + "\023GetExclusionRequest\0229\n\004name\030\001 \001(\tB+\340A\002\372" + + "A%\n#logging.googleapis.com/LogExclusion\"" + + "\216\001\n\026CreateExclusionRequest\022;\n\006parent\030\001 \001" + + "(\tB+\340A\002\372A%\022#logging.googleapis.com/LogEx" + + "clusion\0227\n\texclusion\030\002 \001(\0132\037.google.logg" + + "ing.v2.LogExclusionB\003\340A\002\"\302\001\n\026UpdateExclu" + + "sionRequest\0229\n\004name\030\001 \001(\tB+\340A\002\372A%\n#loggi" + + "ng.googleapis.com/LogExclusion\0227\n\texclus" + + "ion\030\002 \001(\0132\037.google.logging.v2.LogExclusi" + + "onB\003\340A\002\0224\n\013update_mask\030\003 \001(\0132\032.google.pr" + + "otobuf.FieldMaskB\003\340A\002\"S\n\026DeleteExclusion" + + "Request\0229\n\004name\030\001 \001(\tB+\340A\002\372A%\n#logging.g" + + "oogleapis.com/LogExclusion\"S\n\026GetCmekSet" + + "tingsRequest\0229\n\004name\030\001 \001(\tB+\340A\002\372A%\n#logg" + + "ing.googleapis.com/CmekSettings\"\241\001\n\031Upda" + + "teCmekSettingsRequest\022\021\n\004name\030\001 \001(\tB\003\340A\002" + + "\022;\n\rcmek_settings\030\002 \001(\0132\037.google.logging" + + ".v2.CmekSettingsB\003\340A\002\0224\n\013update_mask\030\003 \001" + + "(\0132\032.google.protobuf.FieldMaskB\003\340A\001\"\237\002\n\014" + + "CmekSettings\022\021\n\004name\030\001 \001(\tB\003\340A\003\022\024\n\014kms_k" + + "ey_name\030\002 \001(\t\022\037\n\022service_account_id\030\003 \001(" + + "\tB\003\340A\003:\304\001\352A\300\001\n#logging.googleapis.com/Cm" + + "ekSettings\022\037projects/{project}/cmekSetti" + + "ngs\022)organizations/{organization}/cmekSe" + + "ttings\022\035folders/{folder}/cmekSettings\022.b" + + "illingAccounts/{billing_account}/cmekSet" + + "tings*S\n\016LifecycleState\022\037\n\033LIFECYCLE_STA" + + "TE_UNSPECIFIED\020\000\022\n\n\006ACTIVE\020\001\022\024\n\020DELETE_R" + + "EQUESTED\020\0022\257\'\n\017ConfigServiceV2\022\334\002\n\013ListB" + + "uckets\022%.google.logging.v2.ListBucketsRe" + + "quest\032&.google.logging.v2.ListBucketsRes" + + "ponse\"\375\001\202\323\344\223\002\355\001\022$/v2/{parent=*/*/locatio" + + "ns/*}/bucketsZ-\022+/v2/{parent=projects/*/" + + "locations/*}/bucketsZ2\0220/v2/{parent=orga" + + "nizations/*/locations/*}/bucketsZ,\022*/v2/" + + "{parent=folders/*/locations/*}/bucketsZ4" + + "\0222/v2/{parent=billingAccounts/*/location" + + "s/*}/buckets\332A\006parent\022\271\002\n\tGetBucket\022#.go" + + "ogle.logging.v2.GetBucketRequest\032\034.googl" + + "e.logging.v2.LogBucket\"\350\001\202\323\344\223\002\341\001\022$/v2/{n" + + "ame=*/*/locations/*/buckets/*}Z-\022+/v2/{n" + + "ame=projects/*/locations/*/buckets/*}Z2\022" + + "0/v2/{name=organizations/*/locations/*/b" + + "uckets/*}Z,\022*/v2/{name=folders/*/locatio" + + "ns/*/buckets/*}Z(\022&/v2/{name=billingAcco" + + "unts/*/buckets/*}\022\363\002\n\014UpdateBucket\022&.goo" + + "gle.logging.v2.UpdateBucketRequest\032\034.goo" + + "gle.logging.v2.LogBucket\"\234\002\202\323\344\223\002\225\0022$/v2/" + + "{name=*/*/locations/*/buckets/*}:\006bucket" + + "Z52+/v2/{name=projects/*/locations/*/buc" + + "kets/*}:\006bucketZ:20/v2/{name=organizatio" + + "ns/*/locations/*/buckets/*}:\006bucketZ42*/" + + "v2/{name=folders/*/locations/*/buckets/*" + + "}:\006bucketZ<22/v2/{name=billingAccounts/*" + + "/locations/*/buckets/*}:\006bucket\022\220\002\n\tList" + + "Sinks\022#.google.logging.v2.ListSinksReque" + + "st\032$.google.logging.v2.ListSinksResponse" + + "\"\267\001\202\323\344\223\002\247\001\022\026/v2/{parent=*/*}/sinksZ\037\022\035/v" + + "2/{parent=projects/*}/sinksZ$\022\"/v2/{pare" + + "nt=organizations/*}/sinksZ\036\022\034/v2/{parent" + + "=folders/*}/sinksZ&\022$/v2/{parent=billing" + + "Accounts/*}/sinks\332A\006parent\022\236\002\n\007GetSink\022!" + + ".google.logging.v2.GetSinkRequest\032\032.goog" + + "le.logging.v2.LogSink\"\323\001\202\323\344\223\002\300\001\022\033/v2/{si" + + "nk_name=*/*/sinks/*}Z$\022\"/v2/{sink_name=p" + + "rojects/*/sinks/*}Z)\022\'/v2/{sink_name=org" + + "anizations/*/sinks/*}Z#\022!/v2/{sink_name=" + + "folders/*/sinks/*}Z+\022)/v2/{sink_name=bil" + + "lingAccounts/*/sinks/*}\332A\tsink_name\022\253\002\n\n" + + "CreateSink\022$.google.logging.v2.CreateSin" + + "kRequest\032\032.google.logging.v2.LogSink\"\332\001\202" + + "\323\344\223\002\305\001\"\026/v2/{parent=*/*}/sinks:\004sinkZ%\"\035" + + "/v2/{parent=projects/*}/sinks:\004sinkZ*\"\"/" + + "v2/{parent=organizations/*}/sinks:\004sinkZ" + + "$\"\034/v2/{parent=folders/*}/sinks:\004sinkZ,\"" + + "$/v2/{parent=billingAccounts/*}/sinks:\004s" + + "ink\332A\013parent,sink\022\237\004\n\nUpdateSink\022$.googl" + + "e.logging.v2.UpdateSinkRequest\032\032.google." + + "logging.v2.LogSink\"\316\003\202\323\344\223\002\231\003\032\033/v2/{sink_" + + "name=*/*/sinks/*}:\004sinkZ*\032\"/v2/{sink_nam" + + "e=projects/*/sinks/*}:\004sinkZ/\032\'/v2/{sink" + + "_name=organizations/*/sinks/*}:\004sinkZ)\032!" + + "/v2/{sink_name=folders/*/sinks/*}:\004sinkZ" + + "1\032)/v2/{sink_name=billingAccounts/*/sink" + + "s/*}:\004sinkZ*2\"/v2/{sink_name=projects/*/" + + "sinks/*}:\004sinkZ/2\'/v2/{sink_name=organiz" + + "ations/*/sinks/*}:\004sinkZ)2!/v2/{sink_nam" + + "e=folders/*/sinks/*}:\004sinkZ12)/v2/{sink_" + + "name=billingAccounts/*/sinks/*}:\004sink\332A\032" + + "sink_name,sink,update_mask\332A\016sink_name,s" + + "ink\022\240\002\n\nDeleteSink\022$.google.logging.v2.D" + + "eleteSinkRequest\032\026.google.protobuf.Empty" + + "\"\323\001\202\323\344\223\002\300\001*\033/v2/{sink_name=*/*/sinks/*}Z" + + "$*\"/v2/{sink_name=projects/*/sinks/*}Z)*" + + "\'/v2/{sink_name=organizations/*/sinks/*}" + + "Z#*!/v2/{sink_name=folders/*/sinks/*}Z+*" + + ")/v2/{sink_name=billingAccounts/*/sinks/" + + "*}\332A\tsink_name\022\270\002\n\016ListExclusions\022(.goog" + + "le.logging.v2.ListExclusionsRequest\032).go" + + "ogle.logging.v2.ListExclusionsResponse\"\320" + + "\001\202\323\344\223\002\300\001\022\033/v2/{parent=*/*}/exclusionsZ$\022" + + "\"/v2/{parent=projects/*}/exclusionsZ)\022\'/" + + "v2/{parent=organizations/*}/exclusionsZ#" + + "\022!/v2/{parent=folders/*}/exclusionsZ+\022)/" + + "v2/{parent=billingAccounts/*}/exclusions" + + "\332A\006parent\022\250\002\n\014GetExclusion\022&.google.logg" + + "ing.v2.GetExclusionRequest\032\037.google.logg" + + "ing.v2.LogExclusion\"\316\001\202\323\344\223\002\300\001\022\033/v2/{name" + + "=*/*/exclusions/*}Z$\022\"/v2/{name=projects" + + "/*/exclusions/*}Z)\022\'/v2/{name=organizati" + + "ons/*/exclusions/*}Z#\022!/v2/{name=folders" + + "/*/exclusions/*}Z+\022)/v2/{name=billingAcc" + + "ounts/*/exclusions/*}\332A\004name\022\361\002\n\017CreateE" + + "xclusion\022).google.logging.v2.CreateExclu" + + "sionRequest\032\037.google.logging.v2.LogExclu" + + "sion\"\221\002\202\323\344\223\002\367\001\"\033/v2/{parent=*/*}/exclusi" + + "ons:\texclusionZ/\"\"/v2/{parent=projects/*" + + "}/exclusions:\texclusionZ4\"\'/v2/{parent=o" + + "rganizations/*}/exclusions:\texclusionZ.\"" + + "!/v2/{parent=folders/*}/exclusions:\texcl" + + "usionZ6\")/v2/{parent=billingAccounts/*}/" + + "exclusions:\texclusion\332A\020parent,exclusion" + + "\022\373\002\n\017UpdateExclusion\022).google.logging.v2" + + ".UpdateExclusionRequest\032\037.google.logging" + + ".v2.LogExclusion\"\233\002\202\323\344\223\002\367\0012\033/v2/{name=*/" + + "*/exclusions/*}:\texclusionZ/2\"/v2/{name=" + + "projects/*/exclusions/*}:\texclusionZ42\'/" + + "v2/{name=organizations/*/exclusions/*}:\t" + + "exclusionZ.2!/v2/{name=folders/*/exclusi" + + "ons/*}:\texclusionZ62)/v2/{name=billingAc" + + "counts/*/exclusions/*}:\texclusion\332A\032name" + + ",exclusion,update_mask\022\245\002\n\017DeleteExclusi" + + "on\022).google.logging.v2.DeleteExclusionRe" + + "quest\032\026.google.protobuf.Empty\"\316\001\202\323\344\223\002\300\001*" + + "\033/v2/{name=*/*/exclusions/*}Z$*\"/v2/{nam" + + "e=projects/*/exclusions/*}Z)*\'/v2/{name=" + + "organizations/*/exclusions/*}Z#*!/v2/{na" + + "me=folders/*/exclusions/*}Z+*)/v2/{name=" + + "billingAccounts/*/exclusions/*}\332A\004name\022\255" + + "\001\n\017GetCmekSettings\022).google.logging.v2.G" + + "etCmekSettingsRequest\032\037.google.logging.v" + + "2.CmekSettings\"N\202\323\344\223\002H\022\033/v2/{name=*/*}/c" + + "mekSettingsZ)\022\'/v2/{name=organizations/*" + + "}/cmekSettings\022\321\001\n\022UpdateCmekSettings\022,." + + "google.logging.v2.UpdateCmekSettingsRequ" + + "est\032\037.google.logging.v2.CmekSettings\"l\202\323" + + "\344\223\002f2\033/v2/{name=*/*}/cmekSettings:\rcmek_" + + "settingsZ82\'/v2/{name=organizations/*}/c" + + "mekSettings:\rcmek_settings\032\337\001\312A\026logging." + + "googleapis.com\322A\302\001https://www.googleapis" + + ".com/auth/cloud-platform,https://www.goo" + + "gleapis.com/auth/cloud-platform.read-onl" + + "y,https://www.googleapis.com/auth/loggin" + + "g.admin,https://www.googleapis.com/auth/" + + "logging.readB\236\001\n\025com.google.logging.v2B\022" + + "LoggingConfigProtoP\001Z8google.golang.org/" + + "genproto/googleapis/logging/v2;logging\370\001" + + "\001\252\002\027Google.Cloud.Logging.V2\312\002\027Google\\Clo" + + "ud\\Logging\\V2b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -309,7 +391,15 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.protobuf.TimestampProto.getDescriptor(), com.google.api.AnnotationsProto.getDescriptor(), }); - internal_static_google_logging_v2_LogSink_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_google_logging_v2_LogBucket_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_logging_v2_LogBucket_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_LogBucket_descriptor, + new java.lang.String[] { + "Name", "Description", "CreateTime", "UpdateTime", "RetentionDays", "LifecycleState", + }); + internal_static_google_logging_v2_LogSink_descriptor = getDescriptor().getMessageTypes().get(1); internal_static_google_logging_v2_LogSink_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_logging_v2_LogSink_descriptor, @@ -325,20 +415,50 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "BigqueryOptions", "CreateTime", "UpdateTime", - "StartTime", - "EndTime", "Options", }); internal_static_google_logging_v2_BigQueryOptions_descriptor = - getDescriptor().getMessageTypes().get(1); + getDescriptor().getMessageTypes().get(2); internal_static_google_logging_v2_BigQueryOptions_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_logging_v2_BigQueryOptions_descriptor, new java.lang.String[] { "UsePartitionedTables", "UsesTimestampColumnPartitioning", }); + internal_static_google_logging_v2_ListBucketsRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_logging_v2_ListBucketsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_ListBucketsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageToken", "PageSize", + }); + internal_static_google_logging_v2_ListBucketsResponse_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_logging_v2_ListBucketsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_ListBucketsResponse_descriptor, + new java.lang.String[] { + "Buckets", "NextPageToken", + }); + internal_static_google_logging_v2_UpdateBucketRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_logging_v2_UpdateBucketRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_UpdateBucketRequest_descriptor, + new java.lang.String[] { + "Name", "Bucket", "UpdateMask", + }); + internal_static_google_logging_v2_GetBucketRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_logging_v2_GetBucketRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_GetBucketRequest_descriptor, + new java.lang.String[] { + "Name", + }); internal_static_google_logging_v2_ListSinksRequest_descriptor = - getDescriptor().getMessageTypes().get(2); + getDescriptor().getMessageTypes().get(7); internal_static_google_logging_v2_ListSinksRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_logging_v2_ListSinksRequest_descriptor, @@ -346,7 +466,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Parent", "PageToken", "PageSize", }); internal_static_google_logging_v2_ListSinksResponse_descriptor = - getDescriptor().getMessageTypes().get(3); + getDescriptor().getMessageTypes().get(8); internal_static_google_logging_v2_ListSinksResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_logging_v2_ListSinksResponse_descriptor, @@ -354,7 +474,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Sinks", "NextPageToken", }); internal_static_google_logging_v2_GetSinkRequest_descriptor = - getDescriptor().getMessageTypes().get(4); + getDescriptor().getMessageTypes().get(9); internal_static_google_logging_v2_GetSinkRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_logging_v2_GetSinkRequest_descriptor, @@ -362,7 +482,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "SinkName", }); internal_static_google_logging_v2_CreateSinkRequest_descriptor = - getDescriptor().getMessageTypes().get(5); + getDescriptor().getMessageTypes().get(10); internal_static_google_logging_v2_CreateSinkRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_logging_v2_CreateSinkRequest_descriptor, @@ -370,7 +490,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Parent", "Sink", "UniqueWriterIdentity", }); internal_static_google_logging_v2_UpdateSinkRequest_descriptor = - getDescriptor().getMessageTypes().get(6); + getDescriptor().getMessageTypes().get(11); internal_static_google_logging_v2_UpdateSinkRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_logging_v2_UpdateSinkRequest_descriptor, @@ -378,7 +498,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "SinkName", "Sink", "UniqueWriterIdentity", "UpdateMask", }); internal_static_google_logging_v2_DeleteSinkRequest_descriptor = - getDescriptor().getMessageTypes().get(7); + getDescriptor().getMessageTypes().get(12); internal_static_google_logging_v2_DeleteSinkRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_logging_v2_DeleteSinkRequest_descriptor, @@ -386,7 +506,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "SinkName", }); internal_static_google_logging_v2_LogExclusion_descriptor = - getDescriptor().getMessageTypes().get(8); + getDescriptor().getMessageTypes().get(13); internal_static_google_logging_v2_LogExclusion_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_logging_v2_LogExclusion_descriptor, @@ -394,7 +514,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", "Description", "Filter", "Disabled", "CreateTime", "UpdateTime", }); internal_static_google_logging_v2_ListExclusionsRequest_descriptor = - getDescriptor().getMessageTypes().get(9); + getDescriptor().getMessageTypes().get(14); internal_static_google_logging_v2_ListExclusionsRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_logging_v2_ListExclusionsRequest_descriptor, @@ -402,7 +522,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Parent", "PageToken", "PageSize", }); internal_static_google_logging_v2_ListExclusionsResponse_descriptor = - getDescriptor().getMessageTypes().get(10); + getDescriptor().getMessageTypes().get(15); internal_static_google_logging_v2_ListExclusionsResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_logging_v2_ListExclusionsResponse_descriptor, @@ -410,7 +530,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Exclusions", "NextPageToken", }); internal_static_google_logging_v2_GetExclusionRequest_descriptor = - getDescriptor().getMessageTypes().get(11); + getDescriptor().getMessageTypes().get(16); internal_static_google_logging_v2_GetExclusionRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_logging_v2_GetExclusionRequest_descriptor, @@ -418,7 +538,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", }); internal_static_google_logging_v2_CreateExclusionRequest_descriptor = - getDescriptor().getMessageTypes().get(12); + getDescriptor().getMessageTypes().get(17); internal_static_google_logging_v2_CreateExclusionRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_logging_v2_CreateExclusionRequest_descriptor, @@ -426,7 +546,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Parent", "Exclusion", }); internal_static_google_logging_v2_UpdateExclusionRequest_descriptor = - getDescriptor().getMessageTypes().get(13); + getDescriptor().getMessageTypes().get(18); internal_static_google_logging_v2_UpdateExclusionRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_logging_v2_UpdateExclusionRequest_descriptor, @@ -434,7 +554,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", "Exclusion", "UpdateMask", }); internal_static_google_logging_v2_DeleteExclusionRequest_descriptor = - getDescriptor().getMessageTypes().get(14); + getDescriptor().getMessageTypes().get(19); internal_static_google_logging_v2_DeleteExclusionRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_logging_v2_DeleteExclusionRequest_descriptor, @@ -442,7 +562,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", }); internal_static_google_logging_v2_GetCmekSettingsRequest_descriptor = - getDescriptor().getMessageTypes().get(15); + getDescriptor().getMessageTypes().get(20); internal_static_google_logging_v2_GetCmekSettingsRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_logging_v2_GetCmekSettingsRequest_descriptor, @@ -450,7 +570,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", }); internal_static_google_logging_v2_UpdateCmekSettingsRequest_descriptor = - getDescriptor().getMessageTypes().get(16); + getDescriptor().getMessageTypes().get(21); internal_static_google_logging_v2_UpdateCmekSettingsRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_logging_v2_UpdateCmekSettingsRequest_descriptor, @@ -458,7 +578,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", "CmekSettings", "UpdateMask", }); internal_static_google_logging_v2_CmekSettings_descriptor = - getDescriptor().getMessageTypes().get(17); + getDescriptor().getMessageTypes().get(22); internal_static_google_logging_v2_CmekSettings_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_logging_v2_CmekSettings_descriptor, diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LoggingMetricsProto.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LoggingMetricsProto.java index 75211a542..816264c08 100644 --- a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LoggingMetricsProto.java +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LoggingMetricsProto.java @@ -77,70 +77,71 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "e/protobuf/empty.proto\032 google/protobuf/" + "field_mask.proto\032\037google/protobuf/timest" + "amp.proto\032\034google/api/annotations.proto\"" - + "\334\004\n\tLogMetric\022\014\n\004name\030\001 \001(\t\022\023\n\013descripti" - + "on\030\002 \001(\t\022\016\n\006filter\030\003 \001(\t\0227\n\021metric_descr" - + "iptor\030\005 \001(\0132\034.google.api.MetricDescripto" - + "r\022\027\n\017value_extractor\030\006 \001(\t\022K\n\020label_extr" - + "actors\030\007 \003(\01321.google.logging.v2.LogMetr" - + "ic.LabelExtractorsEntry\022>\n\016bucket_option" - + "s\030\010 \001(\0132&.google.api.Distribution.Bucket" - + "Options\022/\n\013create_time\030\t \001(\0132\032.google.pr" - + "otobuf.Timestamp\022/\n\013update_time\030\n \001(\0132\032." - + "google.protobuf.Timestamp\022<\n\007version\030\004 \001" - + "(\0162\'.google.logging.v2.LogMetric.ApiVers" - + "ionB\002\030\001\0326\n\024LabelExtractorsEntry\022\013\n\003key\030\001" - + " \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\034\n\nApiVersion\022\006\n" - + "\002V2\020\000\022\006\n\002V1\020\001:G\352AD\n\035logging.googleapis.c" - + "om/Metric\022#projects/{project}/metrics/{m" - + "etric}\"\203\001\n\025ListLogMetricsRequest\022C\n\006pare" - + "nt\030\001 \001(\tB3\340A\002\372A-\n+cloudresourcemanager.g" - + "oogleapis.com/Project\022\022\n\npage_token\030\002 \001(" - + "\t\022\021\n\tpage_size\030\003 \001(\005\"`\n\026ListLogMetricsRe" - + "sponse\022-\n\007metrics\030\001 \003(\0132\034.google.logging" - + ".v2.LogMetric\022\027\n\017next_page_token\030\002 \001(\t\"Q" - + "\n\023GetLogMetricRequest\022:\n\013metric_name\030\001 \001" - + "(\tB%\340A\002\372A\037\n\035logging.googleapis.com/Metri" - + "c\"\202\001\n\026CreateLogMetricRequest\0225\n\006parent\030\001" - + " \001(\tB%\340A\002\372A\037\n\035logging.googleapis.com/Met" - + "ric\0221\n\006metric\030\002 \001(\0132\034.google.logging.v2." - + "LogMetricB\003\340A\002\"\207\001\n\026UpdateLogMetricReques" - + "t\022:\n\013metric_name\030\001 \001(\tB%\340A\002\372A\037\n\035logging." - + "googleapis.com/Metric\0221\n\006metric\030\002 \001(\0132\034." - + "google.logging.v2.LogMetricB\003\340A\002\"T\n\026Dele" - + "teLogMetricRequest\022:\n\013metric_name\030\001 \001(\tB" - + "%\340A\002\372A\037\n\035logging.googleapis.com/Metric2\256" - + "\010\n\020MetricsServiceV2\022\227\001\n\016ListLogMetrics\022(" - + ".google.logging.v2.ListLogMetricsRequest" - + "\032).google.logging.v2.ListLogMetricsRespo" - + "nse\"0\202\323\344\223\002!\022\037/v2/{parent=projects/*}/met" - + "rics\332A\006parent\022\222\001\n\014GetLogMetric\022&.google." - + "logging.v2.GetLogMetricRequest\032\034.google." - + "logging.v2.LogMetric\"<\202\323\344\223\002(\022&/v2/{metri" - + "c_name=projects/*/metrics/*}\332A\013metric_na" - + "me\022\233\001\n\017CreateLogMetric\022).google.logging." - + "v2.CreateLogMetricRequest\032\034.google.loggi" - + "ng.v2.LogMetric\"?\202\323\344\223\002)\"\037/v2/{parent=pro" - + "jects/*}/metrics:\006metric\332A\rparent,metric" - + "\022\247\001\n\017UpdateLogMetric\022).google.logging.v2" - + ".UpdateLogMetricRequest\032\034.google.logging" - + ".v2.LogMetric\"K\202\323\344\223\0020\032&/v2/{metric_name=" - + "projects/*/metrics/*}:\006metric\332A\022metric_n" - + "ame,metric\022\222\001\n\017DeleteLogMetric\022).google." - + "logging.v2.DeleteLogMetricRequest\032\026.goog" - + "le.protobuf.Empty\"<\202\323\344\223\002(*&/v2/{metric_n" - + "ame=projects/*/metrics/*}\332A\013metric_name\032" - + "\215\002\312A\026logging.googleapis.com\322A\360\001https://w" - + "ww.googleapis.com/auth/cloud-platform,ht" - + "tps://www.googleapis.com/auth/cloud-plat" - + "form.read-only,https://www.googleapis.co" - + "m/auth/logging.admin,https://www.googlea" - + "pis.com/auth/logging.read,https://www.go" - + "ogleapis.com/auth/logging.writeB\237\001\n\025com." - + "google.logging.v2B\023LoggingMetricsProtoP\001" - + "Z8google.golang.org/genproto/googleapis/" - + "logging/v2;logging\370\001\001\252\002\027Google.Cloud.Log" - + "ging.V2\312\002\027Google\\Cloud\\Logging\\V2b\006proto" - + "3" + + "\214\005\n\tLogMetric\022\021\n\004name\030\001 \001(\tB\003\340A\002\022\030\n\013desc" + + "ription\030\002 \001(\tB\003\340A\001\022\023\n\006filter\030\003 \001(\tB\003\340A\002\022" + + "<\n\021metric_descriptor\030\005 \001(\0132\034.google.api." + + "MetricDescriptorB\003\340A\001\022\034\n\017value_extractor" + + "\030\006 \001(\tB\003\340A\001\022P\n\020label_extractors\030\007 \003(\01321." + + "google.logging.v2.LogMetric.LabelExtract" + + "orsEntryB\003\340A\001\022C\n\016bucket_options\030\010 \001(\0132&." + + "google.api.Distribution.BucketOptionsB\003\340" + + "A\001\0224\n\013create_time\030\t \001(\0132\032.google.protobu" + + "f.TimestampB\003\340A\003\0224\n\013update_time\030\n \001(\0132\032." + + "google.protobuf.TimestampB\003\340A\003\022<\n\007versio" + + "n\030\004 \001(\0162\'.google.logging.v2.LogMetric.Ap" + + "iVersionB\002\030\001\0326\n\024LabelExtractorsEntry\022\013\n\003" + + "key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\034\n\nApiVersi" + + "on\022\006\n\002V2\020\000\022\006\n\002V1\020\001:J\352AG\n logging.googlea" + + "pis.com/LogMetric\022#projects/{project}/me" + + "trics/{metric}\"\215\001\n\025ListLogMetricsRequest" + + "\022C\n\006parent\030\001 \001(\tB3\340A\002\372A-\n+cloudresourcem" + + "anager.googleapis.com/Project\022\027\n\npage_to" + + "ken\030\002 \001(\tB\003\340A\001\022\026\n\tpage_size\030\003 \001(\005B\003\340A\001\"`" + + "\n\026ListLogMetricsResponse\022-\n\007metrics\030\001 \003(" + + "\0132\034.google.logging.v2.LogMetric\022\027\n\017next_" + + "page_token\030\002 \001(\t\"T\n\023GetLogMetricRequest\022" + + "=\n\013metric_name\030\001 \001(\tB(\340A\002\372A\"\n logging.go" + + "ogleapis.com/LogMetric\"\205\001\n\026CreateLogMetr" + + "icRequest\0228\n\006parent\030\001 \001(\tB(\340A\002\372A\"\022 loggi" + + "ng.googleapis.com/LogMetric\0221\n\006metric\030\002 " + + "\001(\0132\034.google.logging.v2.LogMetricB\003\340A\002\"\212" + + "\001\n\026UpdateLogMetricRequest\022=\n\013metric_name" + + "\030\001 \001(\tB(\340A\002\372A\"\n logging.googleapis.com/L" + + "ogMetric\0221\n\006metric\030\002 \001(\0132\034.google.loggin" + + "g.v2.LogMetricB\003\340A\002\"W\n\026DeleteLogMetricRe" + + "quest\022=\n\013metric_name\030\001 \001(\tB(\340A\002\372A\"\n logg" + + "ing.googleapis.com/LogMetric2\256\010\n\020Metrics" + + "ServiceV2\022\227\001\n\016ListLogMetrics\022(.google.lo" + + "gging.v2.ListLogMetricsRequest\032).google." + + "logging.v2.ListLogMetricsResponse\"0\202\323\344\223\002" + + "!\022\037/v2/{parent=projects/*}/metrics\332A\006par" + + "ent\022\222\001\n\014GetLogMetric\022&.google.logging.v2" + + ".GetLogMetricRequest\032\034.google.logging.v2" + + ".LogMetric\"<\202\323\344\223\002(\022&/v2/{metric_name=pro" + + "jects/*/metrics/*}\332A\013metric_name\022\233\001\n\017Cre" + + "ateLogMetric\022).google.logging.v2.CreateL" + + "ogMetricRequest\032\034.google.logging.v2.LogM" + + "etric\"?\202\323\344\223\002)\"\037/v2/{parent=projects/*}/m" + + "etrics:\006metric\332A\rparent,metric\022\247\001\n\017Updat" + + "eLogMetric\022).google.logging.v2.UpdateLog" + + "MetricRequest\032\034.google.logging.v2.LogMet" + + "ric\"K\202\323\344\223\0020\032&/v2/{metric_name=projects/*" + + "/metrics/*}:\006metric\332A\022metric_name,metric" + + "\022\222\001\n\017DeleteLogMetric\022).google.logging.v2" + + ".DeleteLogMetricRequest\032\026.google.protobu" + + "f.Empty\"<\202\323\344\223\002(*&/v2/{metric_name=projec" + + "ts/*/metrics/*}\332A\013metric_name\032\215\002\312A\026loggi" + + "ng.googleapis.com\322A\360\001https://www.googlea" + + "pis.com/auth/cloud-platform,https://www." + + "googleapis.com/auth/cloud-platform.read-" + + "only,https://www.googleapis.com/auth/log" + + "ging.admin,https://www.googleapis.com/au" + + "th/logging.read,https://www.googleapis.c" + + "om/auth/logging.writeB\237\001\n\025com.google.log" + + "ging.v2B\023LoggingMetricsProtoP\001Z8google.g" + + "olang.org/genproto/googleapis/logging/v2" + + ";logging\370\001\001\252\002\027Google.Cloud.Logging.V2\312\002\027" + + "Google\\Cloud\\Logging\\V2b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LoggingProto.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LoggingProto.java index 79dc71528..2d5dc770d 100644 --- a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LoggingProto.java +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LoggingProto.java @@ -85,93 +85,93 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { static { java.lang.String[] descriptorData = { "\n\037google/logging/v2/logging.proto\022\021googl" - + "e.logging.v2\032\034google/api/annotations.pro" - + "to\032\027google/api/client.proto\032\037google/api/" - + "field_behavior.proto\032#google/api/monitor" - + "ed_resource.proto\032\031google/api/resource.p" - + "roto\032!google/logging/v2/log_entry.proto\032" - + "&google/logging/v2/logging_config.proto\032" - + "\036google/protobuf/duration.proto\032\033google/" - + "protobuf/empty.proto\032\037google/protobuf/ti" - + "mestamp.proto\032\027google/rpc/status.proto\"H" + + "e.logging.v2\032\027google/api/client.proto\032\037g" + + "oogle/api/field_behavior.proto\032#google/a" + + "pi/monitored_resource.proto\032\031google/api/" + + "resource.proto\032!google/logging/v2/log_en" + + "try.proto\032&google/logging/v2/logging_con" + + "fig.proto\032\036google/protobuf/duration.prot" + + "o\032\033google/protobuf/empty.proto\032\037google/p" + + "rotobuf/timestamp.proto\032\027google/rpc/stat" + + "us.proto\032\034google/api/annotations.proto\"H" + "\n\020DeleteLogRequest\0224\n\010log_name\030\001 \001(\tB\"\340A" - + "\002\372A\034\022\032logging.googleapis.com/Log\"\317\002\n\026Wri" - + "teLogEntriesRequest\0221\n\010log_name\030\001 \001(\tB\037\372" - + "A\034\n\032logging.googleapis.com/Log\022/\n\010resour" - + "ce\030\002 \001(\0132\035.google.api.MonitoredResource\022" - + "E\n\006labels\030\003 \003(\01325.google.logging.v2.Writ" - + "eLogEntriesRequest.LabelsEntry\0221\n\007entrie" - + "s\030\004 \003(\0132\033.google.logging.v2.LogEntryB\003\340A" - + "\002\022\027\n\017partial_success\030\005 \001(\010\022\017\n\007dry_run\030\006 " - + "\001(\010\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value" - + "\030\002 \001(\t:\0028\001\"\031\n\027WriteLogEntriesResponse\"\310\001" - + "\n\034WriteLogEntriesPartialErrors\022]\n\020log_en" - + "try_errors\030\001 \003(\0132C.google.logging.v2.Wri" - + "teLogEntriesPartialErrors.LogEntryErrors" - + "Entry\032I\n\023LogEntryErrorsEntry\022\013\n\003key\030\001 \001(" - + "\005\022!\n\005value\030\002 \001(\0132\022.google.rpc.Status:\0028\001" - + "\"\265\001\n\025ListLogEntriesRequest\022\027\n\013project_id" - + "s\030\001 \003(\tB\002\030\001\022:\n\016resource_names\030\010 \003(\tB\"\340A\002" - + "\372A\034\022\032logging.googleapis.com/Log\022\016\n\006filte" - + "r\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\026ListLogEntri" - + "esResponse\022,\n\007entries\030\001 \003(\0132\033.google.log" - + "ging.v2.LogEntry\022\027\n\017next_page_token\030\002 \001(" - + "\t\"P\n\'ListMonitoredResourceDescriptorsReq" - + "uest\022\021\n\tpage_size\030\001 \001(\005\022\022\n\npage_token\030\002 " - + "\001(\t\"\212\001\n(ListMonitoredResourceDescriptors" - + "Response\022E\n\024resource_descriptors\030\001 \003(\0132\'" - + ".google.api.MonitoredResourceDescriptor\022" - + "\027\n\017next_page_token\030\002 \001(\t\"i\n\017ListLogsRequ" - + "est\022/\n\006parent\030\001 \001(\tB\037\372A\034\022\032logging.google" - + "apis.com/Log\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_" - + "token\030\003 \001(\t\">\n\020ListLogsResponse\022\021\n\tlog_n" - + "ames\030\003 \003(\t\022\027\n\017next_page_token\030\002 \001(\t2\335\n\n\020" - + "LoggingServiceV2\022\223\002\n\tDeleteLog\022#.google." - + "logging.v2.DeleteLogRequest\032\026.google.pro" - + "tobuf.Empty\"\310\001\202\323\344\223\002\266\001* /v2/{log_name=pro" - + "jects/*/logs/*}Z\033*\031/v2/{log_name=*/*/log" - + "s/*}Z\'*%/v2/{log_name=organizations/*/lo" - + "gs/*}Z!*\037/v2/{log_name=folders/*/logs/*}" - + "Z)*\'/v2/{log_name=billingAccounts/*/logs" - + "/*}\332A\010log_name\022\251\001\n\017WriteLogEntries\022).goo" - + "gle.logging.v2.WriteLogEntriesRequest\032*." - + "google.logging.v2.WriteLogEntriesRespons" - + "e\"?\202\323\344\223\002\026\"\021/v2/entries:write:\001*\332A log_na" - + "me,resource,labels,entries\022\243\001\n\016ListLogEn" - + "tries\022(.google.logging.v2.ListLogEntries" - + "Request\032).google.logging.v2.ListLogEntri" - + "esResponse\"<\202\323\344\223\002\025\"\020/v2/entries:list:\001*\332" - + "A\036resource_names,filter,order_by\022\305\001\n Lis" - + "tMonitoredResourceDescriptors\022:.google.l" - + "ogging.v2.ListMonitoredResourceDescripto" - + "rsRequest\032;.google.logging.v2.ListMonito" - + "redResourceDescriptorsResponse\"(\202\323\344\223\002\"\022 " - + "/v2/monitoredResourceDescriptors\022\210\002\n\010Lis" - + "tLogs\022\".google.logging.v2.ListLogsReques" - + "t\032#.google.logging.v2.ListLogsResponse\"\262" - + "\001\202\323\344\223\002\242\001\022\025/v2/{parent=*/*}/logsZ\036\022\034/v2/{" - + "parent=projects/*}/logsZ#\022!/v2/{parent=o" - + "rganizations/*}/logsZ\035\022\033/v2/{parent=fold" - + "ers/*}/logsZ%\022#/v2/{parent=billingAccoun" - + "ts/*}/logs\332A\006parent\032\215\002\312A\026logging.googlea" - + "pis.com\322A\360\001https://www.googleapis.com/au" - + "th/cloud-platform,https://www.googleapis" - + ".com/auth/cloud-platform.read-only,https" - + "://www.googleapis.com/auth/logging.admin" - + ",https://www.googleapis.com/auth/logging" - + ".read,https://www.googleapis.com/auth/lo" - + "gging.writeB\230\001\n\025com.google.logging.v2B\014L" - + "oggingProtoP\001Z8google.golang.org/genprot" - + "o/googleapis/logging/v2;logging\370\001\001\252\002\027Goo" - + "gle.Cloud.Logging.V2\312\002\027Google\\Cloud\\Logg" - + "ing\\V2b\006proto3" + + "\002\372A\034\n\032logging.googleapis.com/Log\"\346\002\n\026Wri" + + "teLogEntriesRequest\0224\n\010log_name\030\001 \001(\tB\"\340" + + "A\001\372A\034\n\032logging.googleapis.com/Log\0224\n\010res" + + "ource\030\002 \001(\0132\035.google.api.MonitoredResour" + + "ceB\003\340A\001\022J\n\006labels\030\003 \003(\01325.google.logging" + + ".v2.WriteLogEntriesRequest.LabelsEntryB\003" + + "\340A\001\0221\n\007entries\030\004 \003(\0132\033.google.logging.v2" + + ".LogEntryB\003\340A\002\022\034\n\017partial_success\030\005 \001(\010B" + + "\003\340A\001\022\024\n\007dry_run\030\006 \001(\010B\003\340A\001\032-\n\013LabelsEntr" + + "y\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\031\n\027Wri" + + "teLogEntriesResponse\"\310\001\n\034WriteLogEntries" + + "PartialErrors\022]\n\020log_entry_errors\030\001 \003(\0132" + + "C.google.logging.v2.WriteLogEntriesParti" + + "alErrors.LogEntryErrorsEntry\032I\n\023LogEntry" + + "ErrorsEntry\022\013\n\003key\030\001 \001(\005\022!\n\005value\030\002 \001(\0132" + + "\022.google.rpc.Status:\0028\001\"\260\001\n\025ListLogEntri" + + "esRequest\022:\n\016resource_names\030\010 \003(\tB\"\340A\002\372A" + + "\034\022\032logging.googleapis.com/Log\022\023\n\006filter\030" + + "\002 \001(\tB\003\340A\001\022\025\n\010order_by\030\003 \001(\tB\003\340A\001\022\026\n\tpag" + + "e_size\030\004 \001(\005B\003\340A\001\022\027\n\npage_token\030\005 \001(\tB\003\340" + + "A\001\"_\n\026ListLogEntriesResponse\022,\n\007entries\030" + + "\001 \003(\0132\033.google.logging.v2.LogEntry\022\027\n\017ne" + + "xt_page_token\030\002 \001(\t\"Z\n\'ListMonitoredReso" + + "urceDescriptorsRequest\022\026\n\tpage_size\030\001 \001(" + + "\005B\003\340A\001\022\027\n\npage_token\030\002 \001(\tB\003\340A\001\"\212\001\n(List" + + "MonitoredResourceDescriptorsResponse\022E\n\024" + + "resource_descriptors\030\001 \003(\0132\'.google.api." + + "MonitoredResourceDescriptor\022\027\n\017next_page" + + "_token\030\002 \001(\t\"v\n\017ListLogsRequest\0222\n\006paren" + + "t\030\001 \001(\tB\"\340A\002\372A\034\022\032logging.googleapis.com/" + + "Log\022\026\n\tpage_size\030\002 \001(\005B\003\340A\001\022\027\n\npage_toke" + + "n\030\003 \001(\tB\003\340A\001\">\n\020ListLogsResponse\022\021\n\tlog_" + + "names\030\003 \003(\t\022\027\n\017next_page_token\030\002 \001(\t2\335\n\n" + + "\020LoggingServiceV2\022\223\002\n\tDeleteLog\022#.google" + + ".logging.v2.DeleteLogRequest\032\026.google.pr" + + "otobuf.Empty\"\310\001\202\323\344\223\002\266\001* /v2/{log_name=pr" + + "ojects/*/logs/*}Z\033*\031/v2/{log_name=*/*/lo" + + "gs/*}Z\'*%/v2/{log_name=organizations/*/l" + + "ogs/*}Z!*\037/v2/{log_name=folders/*/logs/*" + + "}Z)*\'/v2/{log_name=billingAccounts/*/log" + + "s/*}\332A\010log_name\022\251\001\n\017WriteLogEntries\022).go" + + "ogle.logging.v2.WriteLogEntriesRequest\032*" + + ".google.logging.v2.WriteLogEntriesRespon" + + "se\"?\202\323\344\223\002\026\"\021/v2/entries:write:\001*\332A log_n" + + "ame,resource,labels,entries\022\243\001\n\016ListLogE" + + "ntries\022(.google.logging.v2.ListLogEntrie" + + "sRequest\032).google.logging.v2.ListLogEntr" + + "iesResponse\"<\202\323\344\223\002\025\"\020/v2/entries:list:\001*" + + "\332A\036resource_names,filter,order_by\022\305\001\n Li" + + "stMonitoredResourceDescriptors\022:.google." + + "logging.v2.ListMonitoredResourceDescript" + + "orsRequest\032;.google.logging.v2.ListMonit" + + "oredResourceDescriptorsResponse\"(\202\323\344\223\002\"\022" + + " /v2/monitoredResourceDescriptors\022\210\002\n\010Li" + + "stLogs\022\".google.logging.v2.ListLogsReque" + + "st\032#.google.logging.v2.ListLogsResponse\"" + + "\262\001\202\323\344\223\002\242\001\022\025/v2/{parent=*/*}/logsZ\036\022\034/v2/" + + "{parent=projects/*}/logsZ#\022!/v2/{parent=" + + "organizations/*}/logsZ\035\022\033/v2/{parent=fol" + + "ders/*}/logsZ%\022#/v2/{parent=billingAccou" + + "nts/*}/logs\332A\006parent\032\215\002\312A\026logging.google" + + "apis.com\322A\360\001https://www.googleapis.com/a" + + "uth/cloud-platform,https://www.googleapi" + + "s.com/auth/cloud-platform.read-only,http" + + "s://www.googleapis.com/auth/logging.admi" + + "n,https://www.googleapis.com/auth/loggin" + + "g.read,https://www.googleapis.com/auth/l" + + "ogging.writeB\230\001\n\025com.google.logging.v2B\014" + + "LoggingProtoP\001Z8google.golang.org/genpro" + + "to/googleapis/logging/v2;logging\370\001\001\252\002\027Go" + + "ogle.Cloud.Logging.V2\312\002\027Google\\Cloud\\Log" + + "ging\\V2b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { - com.google.api.AnnotationsProto.getDescriptor(), com.google.api.ClientProto.getDescriptor(), com.google.api.FieldBehaviorProto.getDescriptor(), com.google.api.MonitoredResourceProto.getDescriptor(), @@ -182,6 +182,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.protobuf.EmptyProto.getDescriptor(), com.google.protobuf.TimestampProto.getDescriptor(), com.google.rpc.StatusProto.getDescriptor(), + com.google.api.AnnotationsProto.getDescriptor(), }); internal_static_google_logging_v2_DeleteLogRequest_descriptor = getDescriptor().getMessageTypes().get(0); @@ -237,7 +238,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_logging_v2_ListLogEntriesRequest_descriptor, new java.lang.String[] { - "ProjectIds", "ResourceNames", "Filter", "OrderBy", "PageSize", "PageToken", + "ResourceNames", "Filter", "OrderBy", "PageSize", "PageToken", }); internal_static_google_logging_v2_ListLogEntriesResponse_descriptor = getDescriptor().getMessageTypes().get(5); @@ -289,7 +290,6 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { registry.add(com.google.api.ResourceProto.resourceReference); com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( descriptor, registry); - com.google.api.AnnotationsProto.getDescriptor(); com.google.api.ClientProto.getDescriptor(); com.google.api.FieldBehaviorProto.getDescriptor(); com.google.api.MonitoredResourceProto.getDescriptor(); @@ -300,6 +300,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.protobuf.EmptyProto.getDescriptor(); com.google.protobuf.TimestampProto.getDescriptor(); com.google.rpc.StatusProto.getDescriptor(); + com.google.api.AnnotationsProto.getDescriptor(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/OrganizationName.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/OrganizationName.java index ef9c7f3dc..224340f75 100644 --- a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/OrganizationName.java +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/OrganizationName.java @@ -17,6 +17,7 @@ package com.google.logging.v2; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; import java.util.ArrayList; @@ -25,7 +26,7 @@ /** AUTO-GENERATED DOCUMENTATION AND CLASS */ @javax.annotation.Generated("by GAPIC protoc plugin") -public class OrganizationName extends ParentName { +public class OrganizationName implements ResourceName { private static final PathTemplate PATH_TEMPLATE = PathTemplate.createWithoutUrlEncoding("organizations/{organization}"); diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ProjectName.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ProjectName.java index 101cb3b1d..b3bc846fb 100644 --- a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ProjectName.java +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ProjectName.java @@ -17,6 +17,7 @@ package com.google.logging.v2; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; import java.util.ArrayList; @@ -25,7 +26,7 @@ /** AUTO-GENERATED DOCUMENTATION AND CLASS */ @javax.annotation.Generated("by GAPIC protoc plugin") -public class ProjectName extends ParentName { +public class ProjectName implements ResourceName { private static final PathTemplate PATH_TEMPLATE = PathTemplate.createWithoutUrlEncoding("projects/{project}"); diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateBucketRequest.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateBucketRequest.java new file mode 100644 index 000000000..2ab453af8 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateBucketRequest.java @@ -0,0 +1,1317 @@ +/* + * Copyright 2020 Google LLC + * + * 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 + * + * https://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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging_config.proto + +package com.google.logging.v2; + +/** + * + * + *
+ * The parameters to `UpdateBucket` (Beta).
+ * 
+ * + * Protobuf type {@code google.logging.v2.UpdateBucketRequest} + */ +public final class UpdateBucketRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.UpdateBucketRequest) + UpdateBucketRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateBucketRequest.newBuilder() to construct. + private UpdateBucketRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateBucketRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateBucketRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateBucketRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + com.google.logging.v2.LogBucket.Builder subBuilder = null; + if (bucket_ != null) { + subBuilder = bucket_.toBuilder(); + } + bucket_ = + input.readMessage(com.google.logging.v2.LogBucket.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(bucket_); + bucket_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_UpdateBucketRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_UpdateBucketRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.UpdateBucketRequest.class, + com.google.logging.v2.UpdateBucketRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The full resource name of the bucket to update.
+   *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   * Example:
+   * `"projects/my-project-id/locations/my-location/buckets/my-bucket-id"`. Also
+   * requires permission "resourcemanager.projects.updateLiens" to set the
+   * locked property
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return 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; + } + } + /** + * + * + *
+   * Required. The full resource name of the bucket to update.
+   *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   * Example:
+   * `"projects/my-project-id/locations/my-location/buckets/my-bucket-id"`. Also
+   * requires permission "resourcemanager.projects.updateLiens" to set the
+   * locked property
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for 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 BUCKET_FIELD_NUMBER = 2; + private com.google.logging.v2.LogBucket bucket_; + /** + * + * + *
+   * Required. The updated bucket.
+   * 
+ * + * .google.logging.v2.LogBucket bucket = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the bucket field is set. + */ + public boolean hasBucket() { + return bucket_ != null; + } + /** + * + * + *
+   * Required. The updated bucket.
+   * 
+ * + * .google.logging.v2.LogBucket bucket = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bucket. + */ + public com.google.logging.v2.LogBucket getBucket() { + return bucket_ == null ? com.google.logging.v2.LogBucket.getDefaultInstance() : bucket_; + } + /** + * + * + *
+   * Required. The updated bucket.
+   * 
+ * + * .google.logging.v2.LogBucket bucket = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.logging.v2.LogBucketOrBuilder getBucketOrBuilder() { + return getBucket(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 4; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Required. Field mask that specifies the fields in `bucket` that need an update. A
+   * bucket field will be overwritten if, and only if, it is in the update
+   * mask. `name` and output only fields cannot be updated.
+   * For a detailed `FieldMask` definition, see
+   * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
+   * Example: `updateMask=retention_days`.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Required. Field mask that specifies the fields in `bucket` that need an update. A
+   * bucket field will be overwritten if, and only if, it is in the update
+   * mask. `name` and output only fields cannot be updated.
+   * For a detailed `FieldMask` definition, see
+   * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
+   * Example: `updateMask=retention_days`.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Required. Field mask that specifies the fields in `bucket` that need an update. A
+   * bucket field will be overwritten if, and only if, it is in the update
+   * mask. `name` and output only fields cannot be updated.
+   * For a detailed `FieldMask` definition, see
+   * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
+   * Example: `updateMask=retention_days`.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (bucket_ != null) { + output.writeMessage(2, getBucket()); + } + if (updateMask_ != null) { + output.writeMessage(4, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (bucket_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getBucket()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getUpdateMask()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.logging.v2.UpdateBucketRequest)) { + return super.equals(obj); + } + com.google.logging.v2.UpdateBucketRequest other = + (com.google.logging.v2.UpdateBucketRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (hasBucket() != other.hasBucket()) return false; + if (hasBucket()) { + if (!getBucket().equals(other.getBucket())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasBucket()) { + hash = (37 * hash) + BUCKET_FIELD_NUMBER; + hash = (53 * hash) + getBucket().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.UpdateBucketRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.UpdateBucketRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.UpdateBucketRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.UpdateBucketRequest 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.UpdateBucketRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.UpdateBucketRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.UpdateBucketRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.UpdateBucketRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.logging.v2.UpdateBucketRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.UpdateBucketRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.logging.v2.UpdateBucketRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.UpdateBucketRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.logging.v2.UpdateBucketRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The parameters to `UpdateBucket` (Beta).
+   * 
+ * + * Protobuf type {@code google.logging.v2.UpdateBucketRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.UpdateBucketRequest) + com.google.logging.v2.UpdateBucketRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_UpdateBucketRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_UpdateBucketRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.UpdateBucketRequest.class, + com.google.logging.v2.UpdateBucketRequest.Builder.class); + } + + // Construct using com.google.logging.v2.UpdateBucketRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (bucketBuilder_ == null) { + bucket_ = null; + } else { + bucket_ = null; + bucketBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_UpdateBucketRequest_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.UpdateBucketRequest getDefaultInstanceForType() { + return com.google.logging.v2.UpdateBucketRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.UpdateBucketRequest build() { + com.google.logging.v2.UpdateBucketRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.UpdateBucketRequest buildPartial() { + com.google.logging.v2.UpdateBucketRequest result = + new com.google.logging.v2.UpdateBucketRequest(this); + result.name_ = name_; + if (bucketBuilder_ == null) { + result.bucket_ = bucket_; + } else { + result.bucket_ = bucketBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.logging.v2.UpdateBucketRequest) { + return mergeFrom((com.google.logging.v2.UpdateBucketRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.UpdateBucketRequest other) { + if (other == com.google.logging.v2.UpdateBucketRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasBucket()) { + mergeBucket(other.getBucket()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.logging.v2.UpdateBucketRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.logging.v2.UpdateBucketRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The full resource name of the bucket to update.
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     * Example:
+     * `"projects/my-project-id/locations/my-location/buckets/my-bucket-id"`. Also
+     * requires permission "resourcemanager.projects.updateLiens" to set the
+     * locked property
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return 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; + } + } + /** + * + * + *
+     * Required. The full resource name of the bucket to update.
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     * Example:
+     * `"projects/my-project-id/locations/my-location/buckets/my-bucket-id"`. Also
+     * requires permission "resourcemanager.projects.updateLiens" to set the
+     * locked property
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for 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; + } + } + /** + * + * + *
+     * Required. The full resource name of the bucket to update.
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     * Example:
+     * `"projects/my-project-id/locations/my-location/buckets/my-bucket-id"`. Also
+     * requires permission "resourcemanager.projects.updateLiens" to set the
+     * locked property
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The full resource name of the bucket to update.
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     * Example:
+     * `"projects/my-project-id/locations/my-location/buckets/my-bucket-id"`. Also
+     * requires permission "resourcemanager.projects.updateLiens" to set the
+     * locked property
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The full resource name of the bucket to update.
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     * Example:
+     * `"projects/my-project-id/locations/my-location/buckets/my-bucket-id"`. Also
+     * requires permission "resourcemanager.projects.updateLiens" to set the
+     * locked property
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.logging.v2.LogBucket bucket_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogBucket, + com.google.logging.v2.LogBucket.Builder, + com.google.logging.v2.LogBucketOrBuilder> + bucketBuilder_; + /** + * + * + *
+     * Required. The updated bucket.
+     * 
+ * + * .google.logging.v2.LogBucket bucket = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the bucket field is set. + */ + public boolean hasBucket() { + return bucketBuilder_ != null || bucket_ != null; + } + /** + * + * + *
+     * Required. The updated bucket.
+     * 
+ * + * .google.logging.v2.LogBucket bucket = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The bucket. + */ + public com.google.logging.v2.LogBucket getBucket() { + if (bucketBuilder_ == null) { + return bucket_ == null ? com.google.logging.v2.LogBucket.getDefaultInstance() : bucket_; + } else { + return bucketBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The updated bucket.
+     * 
+ * + * .google.logging.v2.LogBucket bucket = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBucket(com.google.logging.v2.LogBucket value) { + if (bucketBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + bucket_ = value; + onChanged(); + } else { + bucketBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The updated bucket.
+     * 
+ * + * .google.logging.v2.LogBucket bucket = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBucket(com.google.logging.v2.LogBucket.Builder builderForValue) { + if (bucketBuilder_ == null) { + bucket_ = builderForValue.build(); + onChanged(); + } else { + bucketBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The updated bucket.
+     * 
+ * + * .google.logging.v2.LogBucket bucket = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeBucket(com.google.logging.v2.LogBucket value) { + if (bucketBuilder_ == null) { + if (bucket_ != null) { + bucket_ = + com.google.logging.v2.LogBucket.newBuilder(bucket_).mergeFrom(value).buildPartial(); + } else { + bucket_ = value; + } + onChanged(); + } else { + bucketBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The updated bucket.
+     * 
+ * + * .google.logging.v2.LogBucket bucket = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearBucket() { + if (bucketBuilder_ == null) { + bucket_ = null; + onChanged(); + } else { + bucket_ = null; + bucketBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The updated bucket.
+     * 
+ * + * .google.logging.v2.LogBucket bucket = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.logging.v2.LogBucket.Builder getBucketBuilder() { + + onChanged(); + return getBucketFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The updated bucket.
+     * 
+ * + * .google.logging.v2.LogBucket bucket = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.logging.v2.LogBucketOrBuilder getBucketOrBuilder() { + if (bucketBuilder_ != null) { + return bucketBuilder_.getMessageOrBuilder(); + } else { + return bucket_ == null ? com.google.logging.v2.LogBucket.getDefaultInstance() : bucket_; + } + } + /** + * + * + *
+     * Required. The updated bucket.
+     * 
+ * + * .google.logging.v2.LogBucket bucket = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogBucket, + com.google.logging.v2.LogBucket.Builder, + com.google.logging.v2.LogBucketOrBuilder> + getBucketFieldBuilder() { + if (bucketBuilder_ == null) { + bucketBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogBucket, + com.google.logging.v2.LogBucket.Builder, + com.google.logging.v2.LogBucketOrBuilder>( + getBucket(), getParentForChildren(), isClean()); + bucket_ = null; + } + return bucketBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * Required. Field mask that specifies the fields in `bucket` that need an update. A
+     * bucket field will be overwritten if, and only if, it is in the update
+     * mask. `name` and output only fields cannot be updated.
+     * For a detailed `FieldMask` definition, see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
+     * Example: `updateMask=retention_days`.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * Required. Field mask that specifies the fields in `bucket` that need an update. A
+     * bucket field will be overwritten if, and only if, it is in the update
+     * mask. `name` and output only fields cannot be updated.
+     * For a detailed `FieldMask` definition, see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
+     * Example: `updateMask=retention_days`.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Field mask that specifies the fields in `bucket` that need an update. A
+     * bucket field will be overwritten if, and only if, it is in the update
+     * mask. `name` and output only fields cannot be updated.
+     * For a detailed `FieldMask` definition, see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
+     * Example: `updateMask=retention_days`.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. Field mask that specifies the fields in `bucket` that need an update. A
+     * bucket field will be overwritten if, and only if, it is in the update
+     * mask. `name` and output only fields cannot be updated.
+     * For a detailed `FieldMask` definition, see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
+     * Example: `updateMask=retention_days`.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. Field mask that specifies the fields in `bucket` that need an update. A
+     * bucket field will be overwritten if, and only if, it is in the update
+     * mask. `name` and output only fields cannot be updated.
+     * For a detailed `FieldMask` definition, see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
+     * Example: `updateMask=retention_days`.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. Field mask that specifies the fields in `bucket` that need an update. A
+     * bucket field will be overwritten if, and only if, it is in the update
+     * mask. `name` and output only fields cannot be updated.
+     * For a detailed `FieldMask` definition, see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
+     * Example: `updateMask=retention_days`.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. Field mask that specifies the fields in `bucket` that need an update. A
+     * bucket field will be overwritten if, and only if, it is in the update
+     * mask. `name` and output only fields cannot be updated.
+     * For a detailed `FieldMask` definition, see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
+     * Example: `updateMask=retention_days`.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Field mask that specifies the fields in `bucket` that need an update. A
+     * bucket field will be overwritten if, and only if, it is in the update
+     * mask. `name` and output only fields cannot be updated.
+     * For a detailed `FieldMask` definition, see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
+     * Example: `updateMask=retention_days`.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Required. Field mask that specifies the fields in `bucket` that need an update. A
+     * bucket field will be overwritten if, and only if, it is in the update
+     * mask. `name` and output only fields cannot be updated.
+     * For a detailed `FieldMask` definition, see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
+     * Example: `updateMask=retention_days`.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.logging.v2.UpdateBucketRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.UpdateBucketRequest) + private static final com.google.logging.v2.UpdateBucketRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.UpdateBucketRequest(); + } + + public static com.google.logging.v2.UpdateBucketRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateBucketRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateBucketRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.logging.v2.UpdateBucketRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateBucketRequestOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateBucketRequestOrBuilder.java new file mode 100644 index 000000000..93d5e2344 --- /dev/null +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateBucketRequestOrBuilder.java @@ -0,0 +1,158 @@ +/* + * Copyright 2020 Google LLC + * + * 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 + * + * https://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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/logging/v2/logging_config.proto + +package com.google.logging.v2; + +public interface UpdateBucketRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.UpdateBucketRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The full resource name of the bucket to update.
+   *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   * Example:
+   * `"projects/my-project-id/locations/my-location/buckets/my-bucket-id"`. Also
+   * requires permission "resourcemanager.projects.updateLiens" to set the
+   * locked property
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The full resource name of the bucket to update.
+   *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   * Example:
+   * `"projects/my-project-id/locations/my-location/buckets/my-bucket-id"`. Also
+   * requires permission "resourcemanager.projects.updateLiens" to set the
+   * locked property
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. The updated bucket.
+   * 
+ * + * .google.logging.v2.LogBucket bucket = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the bucket field is set. + */ + boolean hasBucket(); + /** + * + * + *
+   * Required. The updated bucket.
+   * 
+ * + * .google.logging.v2.LogBucket bucket = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bucket. + */ + com.google.logging.v2.LogBucket getBucket(); + /** + * + * + *
+   * Required. The updated bucket.
+   * 
+ * + * .google.logging.v2.LogBucket bucket = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + com.google.logging.v2.LogBucketOrBuilder getBucketOrBuilder(); + + /** + * + * + *
+   * Required. Field mask that specifies the fields in `bucket` that need an update. A
+   * bucket field will be overwritten if, and only if, it is in the update
+   * mask. `name` and output only fields cannot be updated.
+   * For a detailed `FieldMask` definition, see
+   * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
+   * Example: `updateMask=retention_days`.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Required. Field mask that specifies the fields in `bucket` that need an update. A
+   * bucket field will be overwritten if, and only if, it is in the update
+   * mask. `name` and output only fields cannot be updated.
+   * For a detailed `FieldMask` definition, see
+   * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
+   * Example: `updateMask=retention_days`.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Required. Field mask that specifies the fields in `bucket` that need an update. A
+   * bucket field will be overwritten if, and only if, it is in the update
+   * mask. `name` and output only fields cannot be updated.
+   * For a detailed `FieldMask` definition, see
+   * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
+   * Example: `updateMask=retention_days`.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateCmekSettingsRequest.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateCmekSettingsRequest.java index 16dc3014d..b306d326a 100644 --- a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateCmekSettingsRequest.java +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateCmekSettingsRequest.java @@ -161,7 +161,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * the GCP organization. * * - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The name. */ @@ -191,7 +191,7 @@ public java.lang.String getName() { * the GCP organization. * * - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The bytes for name. */ @@ -218,7 +218,9 @@ public com.google.protobuf.ByteString getNameBytes() { * Router](/logging/docs/routing/managed-encryption) for more information. * * - * .google.logging.v2.CmekSettings cmek_settings = 2; + * + * .google.logging.v2.CmekSettings cmek_settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * * * @return Whether the cmekSettings field is set. */ @@ -234,7 +236,9 @@ public boolean hasCmekSettings() { * Router](/logging/docs/routing/managed-encryption) for more information. * * - * .google.logging.v2.CmekSettings cmek_settings = 2; + * + * .google.logging.v2.CmekSettings cmek_settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * * * @return The cmekSettings. */ @@ -252,7 +256,9 @@ public com.google.logging.v2.CmekSettings getCmekSettings() { * Router](/logging/docs/routing/managed-encryption) for more information. * * - * .google.logging.v2.CmekSettings cmek_settings = 2; + * + * .google.logging.v2.CmekSettings cmek_settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * */ public com.google.logging.v2.CmekSettingsOrBuilder getCmekSettingsOrBuilder() { return getCmekSettings(); @@ -271,7 +277,8 @@ public com.google.logging.v2.CmekSettingsOrBuilder getCmekSettingsOrBuilder() { * Example: `"updateMask=kmsKeyName"` * * - * .google.protobuf.FieldMask update_mask = 3; + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return Whether the updateMask field is set. */ @@ -289,7 +296,8 @@ public boolean hasUpdateMask() { * Example: `"updateMask=kmsKeyName"` * * - * .google.protobuf.FieldMask update_mask = 3; + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return The updateMask. */ @@ -307,7 +315,8 @@ public com.google.protobuf.FieldMask getUpdateMask() { * Example: `"updateMask=kmsKeyName"` * * - * .google.protobuf.FieldMask update_mask = 3; + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * */ public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { return getUpdateMask(); @@ -705,7 +714,7 @@ public Builder mergeFrom( * the GCP organization. * * - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The name. */ @@ -735,7 +744,7 @@ public java.lang.String getName() { * the GCP organization. * * - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The bytes for name. */ @@ -765,7 +774,7 @@ public com.google.protobuf.ByteString getNameBytes() { * the GCP organization. * * - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @param value The name to set. * @return This builder for chaining. @@ -794,7 +803,7 @@ public Builder setName(java.lang.String value) { * the GCP organization. * * - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return This builder for chaining. */ @@ -819,7 +828,7 @@ public Builder clearName() { * the GCP organization. * * - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @param value The bytes for name to set. * @return This builder for chaining. @@ -850,7 +859,9 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { * Router](/logging/docs/routing/managed-encryption) for more information. * * - * .google.logging.v2.CmekSettings cmek_settings = 2; + * + * .google.logging.v2.CmekSettings cmek_settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * * * @return Whether the cmekSettings field is set. */ @@ -866,7 +877,9 @@ public boolean hasCmekSettings() { * Router](/logging/docs/routing/managed-encryption) for more information. * * - * .google.logging.v2.CmekSettings cmek_settings = 2; + * + * .google.logging.v2.CmekSettings cmek_settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * * * @return The cmekSettings. */ @@ -888,7 +901,9 @@ public com.google.logging.v2.CmekSettings getCmekSettings() { * Router](/logging/docs/routing/managed-encryption) for more information. * * - * .google.logging.v2.CmekSettings cmek_settings = 2; + * + * .google.logging.v2.CmekSettings cmek_settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * */ public Builder setCmekSettings(com.google.logging.v2.CmekSettings value) { if (cmekSettingsBuilder_ == null) { @@ -912,7 +927,9 @@ public Builder setCmekSettings(com.google.logging.v2.CmekSettings value) { * Router](/logging/docs/routing/managed-encryption) for more information. * * - * .google.logging.v2.CmekSettings cmek_settings = 2; + * + * .google.logging.v2.CmekSettings cmek_settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * */ public Builder setCmekSettings(com.google.logging.v2.CmekSettings.Builder builderForValue) { if (cmekSettingsBuilder_ == null) { @@ -933,7 +950,9 @@ public Builder setCmekSettings(com.google.logging.v2.CmekSettings.Builder builde * Router](/logging/docs/routing/managed-encryption) for more information. * * - * .google.logging.v2.CmekSettings cmek_settings = 2; + * + * .google.logging.v2.CmekSettings cmek_settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * */ public Builder mergeCmekSettings(com.google.logging.v2.CmekSettings value) { if (cmekSettingsBuilder_ == null) { @@ -961,7 +980,9 @@ public Builder mergeCmekSettings(com.google.logging.v2.CmekSettings value) { * Router](/logging/docs/routing/managed-encryption) for more information. * * - * .google.logging.v2.CmekSettings cmek_settings = 2; + * + * .google.logging.v2.CmekSettings cmek_settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * */ public Builder clearCmekSettings() { if (cmekSettingsBuilder_ == null) { @@ -983,7 +1004,9 @@ public Builder clearCmekSettings() { * Router](/logging/docs/routing/managed-encryption) for more information. * * - * .google.logging.v2.CmekSettings cmek_settings = 2; + * + * .google.logging.v2.CmekSettings cmek_settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * */ public com.google.logging.v2.CmekSettings.Builder getCmekSettingsBuilder() { @@ -999,7 +1022,9 @@ public com.google.logging.v2.CmekSettings.Builder getCmekSettingsBuilder() { * Router](/logging/docs/routing/managed-encryption) for more information. * * - * .google.logging.v2.CmekSettings cmek_settings = 2; + * + * .google.logging.v2.CmekSettings cmek_settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * */ public com.google.logging.v2.CmekSettingsOrBuilder getCmekSettingsOrBuilder() { if (cmekSettingsBuilder_ != null) { @@ -1019,7 +1044,9 @@ public com.google.logging.v2.CmekSettingsOrBuilder getCmekSettingsOrBuilder() { * Router](/logging/docs/routing/managed-encryption) for more information. * * - * .google.logging.v2.CmekSettings cmek_settings = 2; + * + * .google.logging.v2.CmekSettings cmek_settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * */ private com.google.protobuf.SingleFieldBuilderV3< com.google.logging.v2.CmekSettings, @@ -1055,7 +1082,8 @@ public com.google.logging.v2.CmekSettingsOrBuilder getCmekSettingsOrBuilder() { * Example: `"updateMask=kmsKeyName"` * * - * .google.protobuf.FieldMask update_mask = 3; + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return Whether the updateMask field is set. */ @@ -1073,7 +1101,8 @@ public boolean hasUpdateMask() { * Example: `"updateMask=kmsKeyName"` * * - * .google.protobuf.FieldMask update_mask = 3; + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return The updateMask. */ @@ -1097,7 +1126,8 @@ public com.google.protobuf.FieldMask getUpdateMask() { * Example: `"updateMask=kmsKeyName"` * * - * .google.protobuf.FieldMask update_mask = 3; + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * */ public Builder setUpdateMask(com.google.protobuf.FieldMask value) { if (updateMaskBuilder_ == null) { @@ -1123,7 +1153,8 @@ public Builder setUpdateMask(com.google.protobuf.FieldMask value) { * Example: `"updateMask=kmsKeyName"` * * - * .google.protobuf.FieldMask update_mask = 3; + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * */ public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { if (updateMaskBuilder_ == null) { @@ -1146,7 +1177,8 @@ public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForVal * Example: `"updateMask=kmsKeyName"` * * - * .google.protobuf.FieldMask update_mask = 3; + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * */ public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { if (updateMaskBuilder_ == null) { @@ -1174,7 +1206,8 @@ public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { * Example: `"updateMask=kmsKeyName"` * * - * .google.protobuf.FieldMask update_mask = 3; + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * */ public Builder clearUpdateMask() { if (updateMaskBuilder_ == null) { @@ -1198,7 +1231,8 @@ public Builder clearUpdateMask() { * Example: `"updateMask=kmsKeyName"` * * - * .google.protobuf.FieldMask update_mask = 3; + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * */ public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { @@ -1216,7 +1250,8 @@ public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { * Example: `"updateMask=kmsKeyName"` * * - * .google.protobuf.FieldMask update_mask = 3; + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * */ public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { if (updateMaskBuilder_ != null) { @@ -1238,7 +1273,8 @@ public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { * Example: `"updateMask=kmsKeyName"` * * - * .google.protobuf.FieldMask update_mask = 3; + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * */ private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.FieldMask, diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateCmekSettingsRequestOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateCmekSettingsRequestOrBuilder.java index e591e670b..57f6df4e7 100644 --- a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateCmekSettingsRequestOrBuilder.java +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateCmekSettingsRequestOrBuilder.java @@ -38,7 +38,7 @@ public interface UpdateCmekSettingsRequestOrBuilder * the GCP organization. * * - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The name. */ @@ -58,7 +58,7 @@ public interface UpdateCmekSettingsRequestOrBuilder * the GCP organization. * * - * string name = 1; + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The bytes for name. */ @@ -73,7 +73,9 @@ public interface UpdateCmekSettingsRequestOrBuilder * Router](/logging/docs/routing/managed-encryption) for more information. * * - * .google.logging.v2.CmekSettings cmek_settings = 2; + * + * .google.logging.v2.CmekSettings cmek_settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * * * @return Whether the cmekSettings field is set. */ @@ -87,7 +89,9 @@ public interface UpdateCmekSettingsRequestOrBuilder * Router](/logging/docs/routing/managed-encryption) for more information. * * - * .google.logging.v2.CmekSettings cmek_settings = 2; + * + * .google.logging.v2.CmekSettings cmek_settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * * * @return The cmekSettings. */ @@ -101,7 +105,9 @@ public interface UpdateCmekSettingsRequestOrBuilder * Router](/logging/docs/routing/managed-encryption) for more information. * * - * .google.logging.v2.CmekSettings cmek_settings = 2; + * + * .google.logging.v2.CmekSettings cmek_settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * */ com.google.logging.v2.CmekSettingsOrBuilder getCmekSettingsOrBuilder(); @@ -116,7 +122,8 @@ public interface UpdateCmekSettingsRequestOrBuilder * Example: `"updateMask=kmsKeyName"` * * - * .google.protobuf.FieldMask update_mask = 3; + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return Whether the updateMask field is set. */ @@ -132,7 +139,8 @@ public interface UpdateCmekSettingsRequestOrBuilder * Example: `"updateMask=kmsKeyName"` * * - * .google.protobuf.FieldMask update_mask = 3; + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return The updateMask. */ @@ -148,7 +156,8 @@ public interface UpdateCmekSettingsRequestOrBuilder * Example: `"updateMask=kmsKeyName"` * * - * .google.protobuf.FieldMask update_mask = 3; + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * */ com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); } diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateExclusionRequest.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateExclusionRequest.java index e128c84b6..8e365a4db 100644 --- a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateExclusionRequest.java +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateExclusionRequest.java @@ -208,8 +208,8 @@ public com.google.protobuf.ByteString getNameBytes() { * * *
-   * Required. New values for the existing exclusion. Only the fields specified
-   * in `update_mask` are relevant.
+   * Required. New values for the existing exclusion. Only the fields specified in
+   * `update_mask` are relevant.
    * 
* * .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -224,8 +224,8 @@ public boolean hasExclusion() { * * *
-   * Required. New values for the existing exclusion. Only the fields specified
-   * in `update_mask` are relevant.
+   * Required. New values for the existing exclusion. Only the fields specified in
+   * `update_mask` are relevant.
    * 
* * .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -242,8 +242,8 @@ public com.google.logging.v2.LogExclusion getExclusion() { * * *
-   * Required. New values for the existing exclusion. Only the fields specified
-   * in `update_mask` are relevant.
+   * Required. New values for the existing exclusion. Only the fields specified in
+   * `update_mask` are relevant.
    * 
* * .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -259,8 +259,8 @@ public com.google.logging.v2.LogExclusionOrBuilder getExclusionOrBuilder() { * * *
-   * Required. A non-empty list of fields to change in the existing exclusion.
-   * New values for the fields are taken from the corresponding fields in the
+   * Required. A non-empty list of fields to change in the existing exclusion. New values
+   * for the fields are taken from the corresponding fields in the
    * [LogExclusion][google.logging.v2.LogExclusion] included in this request. Fields not mentioned in
    * `update_mask` are not changed and are ignored in the request.
    * For example, to change the filter and description of an exclusion,
@@ -279,8 +279,8 @@ public boolean hasUpdateMask() {
    *
    *
    * 
-   * Required. A non-empty list of fields to change in the existing exclusion.
-   * New values for the fields are taken from the corresponding fields in the
+   * Required. A non-empty list of fields to change in the existing exclusion. New values
+   * for the fields are taken from the corresponding fields in the
    * [LogExclusion][google.logging.v2.LogExclusion] included in this request. Fields not mentioned in
    * `update_mask` are not changed and are ignored in the request.
    * For example, to change the filter and description of an exclusion,
@@ -299,8 +299,8 @@ public com.google.protobuf.FieldMask getUpdateMask() {
    *
    *
    * 
-   * Required. A non-empty list of fields to change in the existing exclusion.
-   * New values for the fields are taken from the corresponding fields in the
+   * Required. A non-empty list of fields to change in the existing exclusion. New values
+   * for the fields are taken from the corresponding fields in the
    * [LogExclusion][google.logging.v2.LogExclusion] included in this request. Fields not mentioned in
    * `update_mask` are not changed and are ignored in the request.
    * For example, to change the filter and description of an exclusion,
@@ -837,8 +837,8 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) {
      *
      *
      * 
-     * Required. New values for the existing exclusion. Only the fields specified
-     * in `update_mask` are relevant.
+     * Required. New values for the existing exclusion. Only the fields specified in
+     * `update_mask` are relevant.
      * 
* * @@ -854,8 +854,8 @@ public boolean hasExclusion() { * * *
-     * Required. New values for the existing exclusion. Only the fields specified
-     * in `update_mask` are relevant.
+     * Required. New values for the existing exclusion. Only the fields specified in
+     * `update_mask` are relevant.
      * 
* * @@ -877,8 +877,8 @@ public com.google.logging.v2.LogExclusion getExclusion() { * * *
-     * Required. New values for the existing exclusion. Only the fields specified
-     * in `update_mask` are relevant.
+     * Required. New values for the existing exclusion. Only the fields specified in
+     * `update_mask` are relevant.
      * 
* * @@ -902,8 +902,8 @@ public Builder setExclusion(com.google.logging.v2.LogExclusion value) { * * *
-     * Required. New values for the existing exclusion. Only the fields specified
-     * in `update_mask` are relevant.
+     * Required. New values for the existing exclusion. Only the fields specified in
+     * `update_mask` are relevant.
      * 
* * @@ -924,8 +924,8 @@ public Builder setExclusion(com.google.logging.v2.LogExclusion.Builder builderFo * * *
-     * Required. New values for the existing exclusion. Only the fields specified
-     * in `update_mask` are relevant.
+     * Required. New values for the existing exclusion. Only the fields specified in
+     * `update_mask` are relevant.
      * 
* * @@ -953,8 +953,8 @@ public Builder mergeExclusion(com.google.logging.v2.LogExclusion value) { * * *
-     * Required. New values for the existing exclusion. Only the fields specified
-     * in `update_mask` are relevant.
+     * Required. New values for the existing exclusion. Only the fields specified in
+     * `update_mask` are relevant.
      * 
* * @@ -976,8 +976,8 @@ public Builder clearExclusion() { * * *
-     * Required. New values for the existing exclusion. Only the fields specified
-     * in `update_mask` are relevant.
+     * Required. New values for the existing exclusion. Only the fields specified in
+     * `update_mask` are relevant.
      * 
* * @@ -993,8 +993,8 @@ public com.google.logging.v2.LogExclusion.Builder getExclusionBuilder() { * * *
-     * Required. New values for the existing exclusion. Only the fields specified
-     * in `update_mask` are relevant.
+     * Required. New values for the existing exclusion. Only the fields specified in
+     * `update_mask` are relevant.
      * 
* * @@ -1014,8 +1014,8 @@ public com.google.logging.v2.LogExclusionOrBuilder getExclusionOrBuilder() { * * *
-     * Required. New values for the existing exclusion. Only the fields specified
-     * in `update_mask` are relevant.
+     * Required. New values for the existing exclusion. Only the fields specified in
+     * `update_mask` are relevant.
      * 
* * @@ -1049,8 +1049,8 @@ public com.google.logging.v2.LogExclusionOrBuilder getExclusionOrBuilder() { * * *
-     * Required. A non-empty list of fields to change in the existing exclusion.
-     * New values for the fields are taken from the corresponding fields in the
+     * Required. A non-empty list of fields to change in the existing exclusion. New values
+     * for the fields are taken from the corresponding fields in the
      * [LogExclusion][google.logging.v2.LogExclusion] included in this request. Fields not mentioned in
      * `update_mask` are not changed and are ignored in the request.
      * For example, to change the filter and description of an exclusion,
@@ -1069,8 +1069,8 @@ public boolean hasUpdateMask() {
      *
      *
      * 
-     * Required. A non-empty list of fields to change in the existing exclusion.
-     * New values for the fields are taken from the corresponding fields in the
+     * Required. A non-empty list of fields to change in the existing exclusion. New values
+     * for the fields are taken from the corresponding fields in the
      * [LogExclusion][google.logging.v2.LogExclusion] included in this request. Fields not mentioned in
      * `update_mask` are not changed and are ignored in the request.
      * For example, to change the filter and description of an exclusion,
@@ -1095,8 +1095,8 @@ public com.google.protobuf.FieldMask getUpdateMask() {
      *
      *
      * 
-     * Required. A non-empty list of fields to change in the existing exclusion.
-     * New values for the fields are taken from the corresponding fields in the
+     * Required. A non-empty list of fields to change in the existing exclusion. New values
+     * for the fields are taken from the corresponding fields in the
      * [LogExclusion][google.logging.v2.LogExclusion] included in this request. Fields not mentioned in
      * `update_mask` are not changed and are ignored in the request.
      * For example, to change the filter and description of an exclusion,
@@ -1123,8 +1123,8 @@ public Builder setUpdateMask(com.google.protobuf.FieldMask value) {
      *
      *
      * 
-     * Required. A non-empty list of fields to change in the existing exclusion.
-     * New values for the fields are taken from the corresponding fields in the
+     * Required. A non-empty list of fields to change in the existing exclusion. New values
+     * for the fields are taken from the corresponding fields in the
      * [LogExclusion][google.logging.v2.LogExclusion] included in this request. Fields not mentioned in
      * `update_mask` are not changed and are ignored in the request.
      * For example, to change the filter and description of an exclusion,
@@ -1148,8 +1148,8 @@ public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForVal
      *
      *
      * 
-     * Required. A non-empty list of fields to change in the existing exclusion.
-     * New values for the fields are taken from the corresponding fields in the
+     * Required. A non-empty list of fields to change in the existing exclusion. New values
+     * for the fields are taken from the corresponding fields in the
      * [LogExclusion][google.logging.v2.LogExclusion] included in this request. Fields not mentioned in
      * `update_mask` are not changed and are ignored in the request.
      * For example, to change the filter and description of an exclusion,
@@ -1178,8 +1178,8 @@ public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) {
      *
      *
      * 
-     * Required. A non-empty list of fields to change in the existing exclusion.
-     * New values for the fields are taken from the corresponding fields in the
+     * Required. A non-empty list of fields to change in the existing exclusion. New values
+     * for the fields are taken from the corresponding fields in the
      * [LogExclusion][google.logging.v2.LogExclusion] included in this request. Fields not mentioned in
      * `update_mask` are not changed and are ignored in the request.
      * For example, to change the filter and description of an exclusion,
@@ -1204,8 +1204,8 @@ public Builder clearUpdateMask() {
      *
      *
      * 
-     * Required. A non-empty list of fields to change in the existing exclusion.
-     * New values for the fields are taken from the corresponding fields in the
+     * Required. A non-empty list of fields to change in the existing exclusion. New values
+     * for the fields are taken from the corresponding fields in the
      * [LogExclusion][google.logging.v2.LogExclusion] included in this request. Fields not mentioned in
      * `update_mask` are not changed and are ignored in the request.
      * For example, to change the filter and description of an exclusion,
@@ -1224,8 +1224,8 @@ public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() {
      *
      *
      * 
-     * Required. A non-empty list of fields to change in the existing exclusion.
-     * New values for the fields are taken from the corresponding fields in the
+     * Required. A non-empty list of fields to change in the existing exclusion. New values
+     * for the fields are taken from the corresponding fields in the
      * [LogExclusion][google.logging.v2.LogExclusion] included in this request. Fields not mentioned in
      * `update_mask` are not changed and are ignored in the request.
      * For example, to change the filter and description of an exclusion,
@@ -1248,8 +1248,8 @@ public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() {
      *
      *
      * 
-     * Required. A non-empty list of fields to change in the existing exclusion.
-     * New values for the fields are taken from the corresponding fields in the
+     * Required. A non-empty list of fields to change in the existing exclusion. New values
+     * for the fields are taken from the corresponding fields in the
      * [LogExclusion][google.logging.v2.LogExclusion] included in this request. Fields not mentioned in
      * `update_mask` are not changed and are ignored in the request.
      * For example, to change the filter and description of an exclusion,
diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateExclusionRequestOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateExclusionRequestOrBuilder.java
index b2e175355..01bc7fd79 100644
--- a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateExclusionRequestOrBuilder.java
+++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateExclusionRequestOrBuilder.java
@@ -66,8 +66,8 @@ public interface UpdateExclusionRequestOrBuilder
    *
    *
    * 
-   * Required. New values for the existing exclusion. Only the fields specified
-   * in `update_mask` are relevant.
+   * Required. New values for the existing exclusion. Only the fields specified in
+   * `update_mask` are relevant.
    * 
* * .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -80,8 +80,8 @@ public interface UpdateExclusionRequestOrBuilder * * *
-   * Required. New values for the existing exclusion. Only the fields specified
-   * in `update_mask` are relevant.
+   * Required. New values for the existing exclusion. Only the fields specified in
+   * `update_mask` are relevant.
    * 
* * .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -94,8 +94,8 @@ public interface UpdateExclusionRequestOrBuilder * * *
-   * Required. New values for the existing exclusion. Only the fields specified
-   * in `update_mask` are relevant.
+   * Required. New values for the existing exclusion. Only the fields specified in
+   * `update_mask` are relevant.
    * 
* * .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -107,8 +107,8 @@ public interface UpdateExclusionRequestOrBuilder * * *
-   * Required. A non-empty list of fields to change in the existing exclusion.
-   * New values for the fields are taken from the corresponding fields in the
+   * Required. A non-empty list of fields to change in the existing exclusion. New values
+   * for the fields are taken from the corresponding fields in the
    * [LogExclusion][google.logging.v2.LogExclusion] included in this request. Fields not mentioned in
    * `update_mask` are not changed and are ignored in the request.
    * For example, to change the filter and description of an exclusion,
@@ -125,8 +125,8 @@ public interface UpdateExclusionRequestOrBuilder
    *
    *
    * 
-   * Required. A non-empty list of fields to change in the existing exclusion.
-   * New values for the fields are taken from the corresponding fields in the
+   * Required. A non-empty list of fields to change in the existing exclusion. New values
+   * for the fields are taken from the corresponding fields in the
    * [LogExclusion][google.logging.v2.LogExclusion] included in this request. Fields not mentioned in
    * `update_mask` are not changed and are ignored in the request.
    * For example, to change the filter and description of an exclusion,
@@ -143,8 +143,8 @@ public interface UpdateExclusionRequestOrBuilder
    *
    *
    * 
-   * Required. A non-empty list of fields to change in the existing exclusion.
-   * New values for the fields are taken from the corresponding fields in the
+   * Required. A non-empty list of fields to change in the existing exclusion. New values
+   * for the fields are taken from the corresponding fields in the
    * [LogExclusion][google.logging.v2.LogExclusion] included in this request. Fields not mentioned in
    * `update_mask` are not changed and are ignored in the request.
    * For example, to change the filter and description of an exclusion,
diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateSinkRequest.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateSinkRequest.java
index 07c0de1dd..3b08ca5fe 100644
--- a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateSinkRequest.java
+++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateSinkRequest.java
@@ -151,8 +151,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    *
    *
    * 
-   * Required. The full resource name of the sink to update, including the
-   * parent resource and the sink identifier:
+   * Required. The full resource name of the sink to update, including the parent
+   * resource and the sink identifier:
    *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
    *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
    *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
@@ -181,8 +181,8 @@ public java.lang.String getSinkName() {
    *
    *
    * 
-   * Required. The full resource name of the sink to update, including the
-   * parent resource and the sink identifier:
+   * Required. The full resource name of the sink to update, including the parent
+   * resource and the sink identifier:
    *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
    *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
    *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
@@ -214,8 +214,8 @@ public com.google.protobuf.ByteString getSinkNameBytes() {
    *
    *
    * 
-   * Required. The updated sink, whose name is the same identifier that appears
-   * as part of `sink_name`.
+   * Required. The updated sink, whose name is the same identifier that appears as part
+   * of `sink_name`.
    * 
* * .google.logging.v2.LogSink sink = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -229,8 +229,8 @@ public boolean hasSink() { * * *
-   * Required. The updated sink, whose name is the same identifier that appears
-   * as part of `sink_name`.
+   * Required. The updated sink, whose name is the same identifier that appears as part
+   * of `sink_name`.
    * 
* * .google.logging.v2.LogSink sink = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -244,8 +244,8 @@ public com.google.logging.v2.LogSink getSink() { * * *
-   * Required. The updated sink, whose name is the same identifier that appears
-   * as part of `sink_name`.
+   * Required. The updated sink, whose name is the same identifier that appears as part
+   * of `sink_name`.
    * 
* * .google.logging.v2.LogSink sink = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -272,7 +272,7 @@ public com.google.logging.v2.LogSinkOrBuilder getSinkOrBuilder() { * set to false or defaulted to false. *
* - * bool unique_writer_identity = 3; + * bool unique_writer_identity = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return The uniqueWriterIdentity. */ @@ -299,7 +299,8 @@ public boolean getUniqueWriterIdentity() { * Example: `updateMask=filter`. *
* - * .google.protobuf.FieldMask update_mask = 4; + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return Whether the updateMask field is set. */ @@ -323,7 +324,8 @@ public boolean hasUpdateMask() { * Example: `updateMask=filter`. *
* - * .google.protobuf.FieldMask update_mask = 4; + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return The updateMask. */ @@ -347,7 +349,8 @@ public com.google.protobuf.FieldMask getUpdateMask() { * Example: `updateMask=filter`. *
* - * .google.protobuf.FieldMask update_mask = 4; + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + * */ public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { return getUpdateMask(); @@ -744,8 +747,8 @@ public Builder mergeFrom( * * *
-     * Required. The full resource name of the sink to update, including the
-     * parent resource and the sink identifier:
+     * Required. The full resource name of the sink to update, including the parent
+     * resource and the sink identifier:
      *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
      *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
      *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
@@ -774,8 +777,8 @@ public java.lang.String getSinkName() {
      *
      *
      * 
-     * Required. The full resource name of the sink to update, including the
-     * parent resource and the sink identifier:
+     * Required. The full resource name of the sink to update, including the parent
+     * resource and the sink identifier:
      *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
      *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
      *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
@@ -804,8 +807,8 @@ public com.google.protobuf.ByteString getSinkNameBytes() {
      *
      *
      * 
-     * Required. The full resource name of the sink to update, including the
-     * parent resource and the sink identifier:
+     * Required. The full resource name of the sink to update, including the parent
+     * resource and the sink identifier:
      *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
      *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
      *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
@@ -833,8 +836,8 @@ public Builder setSinkName(java.lang.String value) {
      *
      *
      * 
-     * Required. The full resource name of the sink to update, including the
-     * parent resource and the sink identifier:
+     * Required. The full resource name of the sink to update, including the parent
+     * resource and the sink identifier:
      *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
      *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
      *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
@@ -858,8 +861,8 @@ public Builder clearSinkName() {
      *
      *
      * 
-     * Required. The full resource name of the sink to update, including the
-     * parent resource and the sink identifier:
+     * Required. The full resource name of the sink to update, including the parent
+     * resource and the sink identifier:
      *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
      *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
      *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
@@ -895,8 +898,8 @@ public Builder setSinkNameBytes(com.google.protobuf.ByteString value) {
      *
      *
      * 
-     * Required. The updated sink, whose name is the same identifier that appears
-     * as part of `sink_name`.
+     * Required. The updated sink, whose name is the same identifier that appears as part
+     * of `sink_name`.
      * 
* * .google.logging.v2.LogSink sink = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -910,8 +913,8 @@ public boolean hasSink() { * * *
-     * Required. The updated sink, whose name is the same identifier that appears
-     * as part of `sink_name`.
+     * Required. The updated sink, whose name is the same identifier that appears as part
+     * of `sink_name`.
      * 
* * .google.logging.v2.LogSink sink = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -929,8 +932,8 @@ public com.google.logging.v2.LogSink getSink() { * * *
-     * Required. The updated sink, whose name is the same identifier that appears
-     * as part of `sink_name`.
+     * Required. The updated sink, whose name is the same identifier that appears as part
+     * of `sink_name`.
      * 
* * .google.logging.v2.LogSink sink = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -952,8 +955,8 @@ public Builder setSink(com.google.logging.v2.LogSink value) { * * *
-     * Required. The updated sink, whose name is the same identifier that appears
-     * as part of `sink_name`.
+     * Required. The updated sink, whose name is the same identifier that appears as part
+     * of `sink_name`.
      * 
* * .google.logging.v2.LogSink sink = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -972,8 +975,8 @@ public Builder setSink(com.google.logging.v2.LogSink.Builder builderForValue) { * * *
-     * Required. The updated sink, whose name is the same identifier that appears
-     * as part of `sink_name`.
+     * Required. The updated sink, whose name is the same identifier that appears as part
+     * of `sink_name`.
      * 
* * .google.logging.v2.LogSink sink = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -996,8 +999,8 @@ public Builder mergeSink(com.google.logging.v2.LogSink value) { * * *
-     * Required. The updated sink, whose name is the same identifier that appears
-     * as part of `sink_name`.
+     * Required. The updated sink, whose name is the same identifier that appears as part
+     * of `sink_name`.
      * 
* * .google.logging.v2.LogSink sink = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -1017,8 +1020,8 @@ public Builder clearSink() { * * *
-     * Required. The updated sink, whose name is the same identifier that appears
-     * as part of `sink_name`.
+     * Required. The updated sink, whose name is the same identifier that appears as part
+     * of `sink_name`.
      * 
* * .google.logging.v2.LogSink sink = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -1032,8 +1035,8 @@ public com.google.logging.v2.LogSink.Builder getSinkBuilder() { * * *
-     * Required. The updated sink, whose name is the same identifier that appears
-     * as part of `sink_name`.
+     * Required. The updated sink, whose name is the same identifier that appears as part
+     * of `sink_name`.
      * 
* * .google.logging.v2.LogSink sink = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -1049,8 +1052,8 @@ public com.google.logging.v2.LogSinkOrBuilder getSinkOrBuilder() { * * *
-     * Required. The updated sink, whose name is the same identifier that appears
-     * as part of `sink_name`.
+     * Required. The updated sink, whose name is the same identifier that appears as part
+     * of `sink_name`.
      * 
* * .google.logging.v2.LogSink sink = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -1089,7 +1092,7 @@ public com.google.logging.v2.LogSinkOrBuilder getSinkOrBuilder() { * set to false or defaulted to false. *
* - * bool unique_writer_identity = 3; + * bool unique_writer_identity = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return The uniqueWriterIdentity. */ @@ -1112,7 +1115,7 @@ public boolean getUniqueWriterIdentity() { * set to false or defaulted to false. *
* - * bool unique_writer_identity = 3; + * bool unique_writer_identity = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The uniqueWriterIdentity to set. * @return This builder for chaining. @@ -1139,7 +1142,7 @@ public Builder setUniqueWriterIdentity(boolean value) { * set to false or defaulted to false. *
* - * bool unique_writer_identity = 3; + * bool unique_writer_identity = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return This builder for chaining. */ @@ -1173,7 +1176,8 @@ public Builder clearUniqueWriterIdentity() { * Example: `updateMask=filter`. *
* - * .google.protobuf.FieldMask update_mask = 4; + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return Whether the updateMask field is set. */ @@ -1197,7 +1201,8 @@ public boolean hasUpdateMask() { * Example: `updateMask=filter`. *
* - * .google.protobuf.FieldMask update_mask = 4; + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return The updateMask. */ @@ -1227,7 +1232,8 @@ public com.google.protobuf.FieldMask getUpdateMask() { * Example: `updateMask=filter`. *
* - * .google.protobuf.FieldMask update_mask = 4; + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + * */ public Builder setUpdateMask(com.google.protobuf.FieldMask value) { if (updateMaskBuilder_ == null) { @@ -1259,7 +1265,8 @@ public Builder setUpdateMask(com.google.protobuf.FieldMask value) { * Example: `updateMask=filter`. *
* - * .google.protobuf.FieldMask update_mask = 4; + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + * */ public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { if (updateMaskBuilder_ == null) { @@ -1288,7 +1295,8 @@ public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForVal * Example: `updateMask=filter`. *
* - * .google.protobuf.FieldMask update_mask = 4; + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + * */ public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { if (updateMaskBuilder_ == null) { @@ -1322,7 +1330,8 @@ public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { * Example: `updateMask=filter`. *
* - * .google.protobuf.FieldMask update_mask = 4; + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + * */ public Builder clearUpdateMask() { if (updateMaskBuilder_ == null) { @@ -1352,7 +1361,8 @@ public Builder clearUpdateMask() { * Example: `updateMask=filter`. *
* - * .google.protobuf.FieldMask update_mask = 4; + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + * */ public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { @@ -1376,7 +1386,8 @@ public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { * Example: `updateMask=filter`. *
* - * .google.protobuf.FieldMask update_mask = 4; + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + * */ public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { if (updateMaskBuilder_ != null) { @@ -1404,7 +1415,8 @@ public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { * Example: `updateMask=filter`. *
* - * .google.protobuf.FieldMask update_mask = 4; + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + * */ private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.FieldMask, diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateSinkRequestOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateSinkRequestOrBuilder.java index 62475f8dc..dce77c709 100644 --- a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateSinkRequestOrBuilder.java +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateSinkRequestOrBuilder.java @@ -27,8 +27,8 @@ public interface UpdateSinkRequestOrBuilder * * *
-   * Required. The full resource name of the sink to update, including the
-   * parent resource and the sink identifier:
+   * Required. The full resource name of the sink to update, including the parent
+   * resource and the sink identifier:
    *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
    *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
    *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
@@ -47,8 +47,8 @@ public interface UpdateSinkRequestOrBuilder
    *
    *
    * 
-   * Required. The full resource name of the sink to update, including the
-   * parent resource and the sink identifier:
+   * Required. The full resource name of the sink to update, including the parent
+   * resource and the sink identifier:
    *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
    *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
    *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
@@ -68,8 +68,8 @@ public interface UpdateSinkRequestOrBuilder
    *
    *
    * 
-   * Required. The updated sink, whose name is the same identifier that appears
-   * as part of `sink_name`.
+   * Required. The updated sink, whose name is the same identifier that appears as part
+   * of `sink_name`.
    * 
* * .google.logging.v2.LogSink sink = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -81,8 +81,8 @@ public interface UpdateSinkRequestOrBuilder * * *
-   * Required. The updated sink, whose name is the same identifier that appears
-   * as part of `sink_name`.
+   * Required. The updated sink, whose name is the same identifier that appears as part
+   * of `sink_name`.
    * 
* * .google.logging.v2.LogSink sink = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -94,8 +94,8 @@ public interface UpdateSinkRequestOrBuilder * * *
-   * Required. The updated sink, whose name is the same identifier that appears
-   * as part of `sink_name`.
+   * Required. The updated sink, whose name is the same identifier that appears as part
+   * of `sink_name`.
    * 
* * .google.logging.v2.LogSink sink = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -118,7 +118,7 @@ public interface UpdateSinkRequestOrBuilder * set to false or defaulted to false. *
* - * bool unique_writer_identity = 3; + * bool unique_writer_identity = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return The uniqueWriterIdentity. */ @@ -141,7 +141,8 @@ public interface UpdateSinkRequestOrBuilder * Example: `updateMask=filter`. *
* - * .google.protobuf.FieldMask update_mask = 4; + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return Whether the updateMask field is set. */ @@ -163,7 +164,8 @@ public interface UpdateSinkRequestOrBuilder * Example: `updateMask=filter`. *
* - * .google.protobuf.FieldMask update_mask = 4; + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return The updateMask. */ @@ -185,7 +187,8 @@ public interface UpdateSinkRequestOrBuilder * Example: `updateMask=filter`. *
* - * .google.protobuf.FieldMask update_mask = 4; + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + * */ com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); } diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/WriteLogEntriesRequest.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/WriteLogEntriesRequest.java index 3466a8465..e3bc0351d 100644 --- a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/WriteLogEntriesRequest.java +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/WriteLogEntriesRequest.java @@ -190,13 +190,15 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { * `[LOG_ID]` must be URL-encoded. For example: * "projects/my-project-id/logs/syslog" * "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity" - * The permission <code>logging.logEntries.create</code> is needed on each - * project, organization, billing account, or folder that is receiving - * new log entries, whether the resource is specified in - * <code>logName</code> or in an individual log entry. + * The permission `logging.logEntries.create` is needed on each project, + * organization, billing account, or folder that is receiving new log + * entries, whether the resource is specified in `logName` or in an + * individual log entry. *
* - * string log_name = 1 [(.google.api.resource_reference) = { ... } + * + * string log_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * * * @return The logName. */ @@ -224,13 +226,15 @@ public java.lang.String getLogName() { * `[LOG_ID]` must be URL-encoded. For example: * "projects/my-project-id/logs/syslog" * "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity" - * The permission <code>logging.logEntries.create</code> is needed on each - * project, organization, billing account, or folder that is receiving - * new log entries, whether the resource is specified in - * <code>logName</code> or in an individual log entry. + * The permission `logging.logEntries.create` is needed on each project, + * organization, billing account, or folder that is receiving new log + * entries, whether the resource is specified in `logName` or in an + * individual log entry. *
* - * string log_name = 1 [(.google.api.resource_reference) = { ... } + * + * string log_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * * * @return The bytes for logName. */ @@ -260,7 +264,8 @@ public com.google.protobuf.ByteString getLogNameBytes() { * See [LogEntry][google.logging.v2.LogEntry]. *
* - * .google.api.MonitoredResource resource = 2; + * .google.api.MonitoredResource resource = 2 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return Whether the resource field is set. */ @@ -279,7 +284,8 @@ public boolean hasResource() { * See [LogEntry][google.logging.v2.LogEntry]. *
* - * .google.api.MonitoredResource resource = 2; + * .google.api.MonitoredResource resource = 2 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return The resource. */ @@ -298,7 +304,8 @@ public com.google.api.MonitoredResource getResource() { * See [LogEntry][google.logging.v2.LogEntry]. * * - * .google.api.MonitoredResource resource = 2; + * .google.api.MonitoredResource resource = 2 [(.google.api.field_behavior) = OPTIONAL]; + * */ public com.google.api.MonitoredResourceOrBuilder getResourceOrBuilder() { return getResource(); @@ -339,7 +346,7 @@ public int getLabelsCount() { * See [LogEntry][google.logging.v2.LogEntry]. * * - * map<string, string> labels = 3; + * map<string, string> labels = 3 [(.google.api.field_behavior) = OPTIONAL]; */ public boolean containsLabels(java.lang.String key) { if (key == null) { @@ -362,7 +369,7 @@ public java.util.Map getLabels() { * See [LogEntry][google.logging.v2.LogEntry]. * * - * map<string, string> labels = 3; + * map<string, string> labels = 3 [(.google.api.field_behavior) = OPTIONAL]; */ public java.util.Map getLabelsMap() { return internalGetLabels().getMap(); @@ -377,7 +384,7 @@ public java.util.Map getLabelsMap() { * See [LogEntry][google.logging.v2.LogEntry]. * * - * map<string, string> labels = 3; + * map<string, string> labels = 3 [(.google.api.field_behavior) = OPTIONAL]; */ public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { if (key == null) { @@ -396,7 +403,7 @@ public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.Strin * See [LogEntry][google.logging.v2.LogEntry]. * * - * map<string, string> labels = 3; + * map<string, string> labels = 3 [(.google.api.field_behavior) = OPTIONAL]; */ public java.lang.String getLabelsOrThrow(java.lang.String key) { if (key == null) { @@ -591,7 +598,7 @@ public com.google.logging.v2.LogEntryOrBuilder getEntriesOrBuilder(int index) { * keyed by the entries' zero-based index in the `entries.write` method. * * - * bool partial_success = 5; + * bool partial_success = 5 [(.google.api.field_behavior) = OPTIONAL]; * * @return The partialSuccess. */ @@ -610,7 +617,7 @@ public boolean getPartialSuccess() { * logging API endpoints are working properly before sending valuable data. * * - * bool dry_run = 6; + * bool dry_run = 6 [(.google.api.field_behavior) = OPTIONAL]; * * @return The dryRun. */ @@ -1105,13 +1112,15 @@ public Builder mergeFrom( * `[LOG_ID]` must be URL-encoded. For example: * "projects/my-project-id/logs/syslog" * "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity" - * The permission <code>logging.logEntries.create</code> is needed on each - * project, organization, billing account, or folder that is receiving - * new log entries, whether the resource is specified in - * <code>logName</code> or in an individual log entry. + * The permission `logging.logEntries.create` is needed on each project, + * organization, billing account, or folder that is receiving new log + * entries, whether the resource is specified in `logName` or in an + * individual log entry. * * - * string log_name = 1 [(.google.api.resource_reference) = { ... } + * + * string log_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * * * @return The logName. */ @@ -1139,13 +1148,15 @@ public java.lang.String getLogName() { * `[LOG_ID]` must be URL-encoded. For example: * "projects/my-project-id/logs/syslog" * "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity" - * The permission <code>logging.logEntries.create</code> is needed on each - * project, organization, billing account, or folder that is receiving - * new log entries, whether the resource is specified in - * <code>logName</code> or in an individual log entry. + * The permission `logging.logEntries.create` is needed on each project, + * organization, billing account, or folder that is receiving new log + * entries, whether the resource is specified in `logName` or in an + * individual log entry. * * - * string log_name = 1 [(.google.api.resource_reference) = { ... } + * + * string log_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * * * @return The bytes for logName. */ @@ -1173,13 +1184,15 @@ public com.google.protobuf.ByteString getLogNameBytes() { * `[LOG_ID]` must be URL-encoded. For example: * "projects/my-project-id/logs/syslog" * "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity" - * The permission <code>logging.logEntries.create</code> is needed on each - * project, organization, billing account, or folder that is receiving - * new log entries, whether the resource is specified in - * <code>logName</code> or in an individual log entry. + * The permission `logging.logEntries.create` is needed on each project, + * organization, billing account, or folder that is receiving new log + * entries, whether the resource is specified in `logName` or in an + * individual log entry. * * - * string log_name = 1 [(.google.api.resource_reference) = { ... } + * + * string log_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * * * @param value The logName to set. * @return This builder for chaining. @@ -1206,13 +1219,15 @@ public Builder setLogName(java.lang.String value) { * `[LOG_ID]` must be URL-encoded. For example: * "projects/my-project-id/logs/syslog" * "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity" - * The permission <code>logging.logEntries.create</code> is needed on each - * project, organization, billing account, or folder that is receiving - * new log entries, whether the resource is specified in - * <code>logName</code> or in an individual log entry. + * The permission `logging.logEntries.create` is needed on each project, + * organization, billing account, or folder that is receiving new log + * entries, whether the resource is specified in `logName` or in an + * individual log entry. * * - * string log_name = 1 [(.google.api.resource_reference) = { ... } + * + * string log_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * * * @return This builder for chaining. */ @@ -1235,13 +1250,15 @@ public Builder clearLogName() { * `[LOG_ID]` must be URL-encoded. For example: * "projects/my-project-id/logs/syslog" * "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity" - * The permission <code>logging.logEntries.create</code> is needed on each - * project, organization, billing account, or folder that is receiving - * new log entries, whether the resource is specified in - * <code>logName</code> or in an individual log entry. + * The permission `logging.logEntries.create` is needed on each project, + * organization, billing account, or folder that is receiving new log + * entries, whether the resource is specified in `logName` or in an + * individual log entry. * * - * string log_name = 1 [(.google.api.resource_reference) = { ... } + * + * string log_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * * * @param value The bytes for logName to set. * @return This builder for chaining. @@ -1275,7 +1292,8 @@ public Builder setLogNameBytes(com.google.protobuf.ByteString value) { * See [LogEntry][google.logging.v2.LogEntry]. * * - * .google.api.MonitoredResource resource = 2; + * .google.api.MonitoredResource resource = 2 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return Whether the resource field is set. */ @@ -1294,7 +1312,8 @@ public boolean hasResource() { * See [LogEntry][google.logging.v2.LogEntry]. * * - * .google.api.MonitoredResource resource = 2; + * .google.api.MonitoredResource resource = 2 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return The resource. */ @@ -1319,7 +1338,8 @@ public com.google.api.MonitoredResource getResource() { * See [LogEntry][google.logging.v2.LogEntry]. * * - * .google.api.MonitoredResource resource = 2; + * .google.api.MonitoredResource resource = 2 [(.google.api.field_behavior) = OPTIONAL]; + * */ public Builder setResource(com.google.api.MonitoredResource value) { if (resourceBuilder_ == null) { @@ -1346,7 +1366,8 @@ public Builder setResource(com.google.api.MonitoredResource value) { * See [LogEntry][google.logging.v2.LogEntry]. * * - * .google.api.MonitoredResource resource = 2; + * .google.api.MonitoredResource resource = 2 [(.google.api.field_behavior) = OPTIONAL]; + * */ public Builder setResource(com.google.api.MonitoredResource.Builder builderForValue) { if (resourceBuilder_ == null) { @@ -1370,7 +1391,8 @@ public Builder setResource(com.google.api.MonitoredResource.Builder builderForVa * See [LogEntry][google.logging.v2.LogEntry]. * * - * .google.api.MonitoredResource resource = 2; + * .google.api.MonitoredResource resource = 2 [(.google.api.field_behavior) = OPTIONAL]; + * */ public Builder mergeResource(com.google.api.MonitoredResource value) { if (resourceBuilder_ == null) { @@ -1401,7 +1423,8 @@ public Builder mergeResource(com.google.api.MonitoredResource value) { * See [LogEntry][google.logging.v2.LogEntry]. * * - * .google.api.MonitoredResource resource = 2; + * .google.api.MonitoredResource resource = 2 [(.google.api.field_behavior) = OPTIONAL]; + * */ public Builder clearResource() { if (resourceBuilder_ == null) { @@ -1426,7 +1449,8 @@ public Builder clearResource() { * See [LogEntry][google.logging.v2.LogEntry]. * * - * .google.api.MonitoredResource resource = 2; + * .google.api.MonitoredResource resource = 2 [(.google.api.field_behavior) = OPTIONAL]; + * */ public com.google.api.MonitoredResource.Builder getResourceBuilder() { @@ -1445,7 +1469,8 @@ public com.google.api.MonitoredResource.Builder getResourceBuilder() { * See [LogEntry][google.logging.v2.LogEntry]. * * - * .google.api.MonitoredResource resource = 2; + * .google.api.MonitoredResource resource = 2 [(.google.api.field_behavior) = OPTIONAL]; + * */ public com.google.api.MonitoredResourceOrBuilder getResourceOrBuilder() { if (resourceBuilder_ != null) { @@ -1468,7 +1493,8 @@ public com.google.api.MonitoredResourceOrBuilder getResourceOrBuilder() { * See [LogEntry][google.logging.v2.LogEntry]. * * - * .google.api.MonitoredResource resource = 2; + * .google.api.MonitoredResource resource = 2 [(.google.api.field_behavior) = OPTIONAL]; + * */ private com.google.protobuf.SingleFieldBuilderV3< com.google.api.MonitoredResource, @@ -1522,7 +1548,7 @@ public int getLabelsCount() { * See [LogEntry][google.logging.v2.LogEntry]. * * - * map<string, string> labels = 3; + * map<string, string> labels = 3 [(.google.api.field_behavior) = OPTIONAL]; */ public boolean containsLabels(java.lang.String key) { if (key == null) { @@ -1545,7 +1571,7 @@ public java.util.Map getLabels() { * See [LogEntry][google.logging.v2.LogEntry]. * * - * map<string, string> labels = 3; + * map<string, string> labels = 3 [(.google.api.field_behavior) = OPTIONAL]; */ public java.util.Map getLabelsMap() { return internalGetLabels().getMap(); @@ -1560,7 +1586,7 @@ public java.util.Map getLabelsMap() { * See [LogEntry][google.logging.v2.LogEntry]. * * - * map<string, string> labels = 3; + * map<string, string> labels = 3 [(.google.api.field_behavior) = OPTIONAL]; */ public java.lang.String getLabelsOrDefault( java.lang.String key, java.lang.String defaultValue) { @@ -1580,7 +1606,7 @@ public java.lang.String getLabelsOrDefault( * See [LogEntry][google.logging.v2.LogEntry]. * * - * map<string, string> labels = 3; + * map<string, string> labels = 3 [(.google.api.field_behavior) = OPTIONAL]; */ public java.lang.String getLabelsOrThrow(java.lang.String key) { if (key == null) { @@ -1607,7 +1633,7 @@ public Builder clearLabels() { * See [LogEntry][google.logging.v2.LogEntry]. * * - * map<string, string> labels = 3; + * map<string, string> labels = 3 [(.google.api.field_behavior) = OPTIONAL]; */ public Builder removeLabels(java.lang.String key) { if (key == null) { @@ -1631,7 +1657,7 @@ public java.util.Map getMutableLabels() { * See [LogEntry][google.logging.v2.LogEntry]. * * - * map<string, string> labels = 3; + * map<string, string> labels = 3 [(.google.api.field_behavior) = OPTIONAL]; */ public Builder putLabels(java.lang.String key, java.lang.String value) { if (key == null) { @@ -1653,7 +1679,7 @@ public Builder putLabels(java.lang.String key, java.lang.String value) { * See [LogEntry][google.logging.v2.LogEntry]. * * - * map<string, string> labels = 3; + * map<string, string> labels = 3 [(.google.api.field_behavior) = OPTIONAL]; */ public Builder putAllLabels(java.util.Map values) { internalGetMutableLabels().getMutableMap().putAll(values); @@ -2396,7 +2422,7 @@ public java.util.List getEntriesBuilderL * keyed by the entries' zero-based index in the `entries.write` method. * * - * bool partial_success = 5; + * bool partial_success = 5 [(.google.api.field_behavior) = OPTIONAL]; * * @return The partialSuccess. */ @@ -2414,7 +2440,7 @@ public boolean getPartialSuccess() { * keyed by the entries' zero-based index in the `entries.write` method. * * - * bool partial_success = 5; + * bool partial_success = 5 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The partialSuccess to set. * @return This builder for chaining. @@ -2436,7 +2462,7 @@ public Builder setPartialSuccess(boolean value) { * keyed by the entries' zero-based index in the `entries.write` method. * * - * bool partial_success = 5; + * bool partial_success = 5 [(.google.api.field_behavior) = OPTIONAL]; * * @return This builder for chaining. */ @@ -2457,7 +2483,7 @@ public Builder clearPartialSuccess() { * logging API endpoints are working properly before sending valuable data. * * - * bool dry_run = 6; + * bool dry_run = 6 [(.google.api.field_behavior) = OPTIONAL]; * * @return The dryRun. */ @@ -2473,7 +2499,7 @@ public boolean getDryRun() { * logging API endpoints are working properly before sending valuable data. * * - * bool dry_run = 6; + * bool dry_run = 6 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The dryRun to set. * @return This builder for chaining. @@ -2493,7 +2519,7 @@ public Builder setDryRun(boolean value) { * logging API endpoints are working properly before sending valuable data. * * - * bool dry_run = 6; + * bool dry_run = 6 [(.google.api.field_behavior) = OPTIONAL]; * * @return This builder for chaining. */ diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/WriteLogEntriesRequestOrBuilder.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/WriteLogEntriesRequestOrBuilder.java index c704aaecc..44f9cfa9a 100644 --- a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/WriteLogEntriesRequestOrBuilder.java +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/WriteLogEntriesRequestOrBuilder.java @@ -36,13 +36,15 @@ public interface WriteLogEntriesRequestOrBuilder * `[LOG_ID]` must be URL-encoded. For example: * "projects/my-project-id/logs/syslog" * "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity" - * The permission <code>logging.logEntries.create</code> is needed on each - * project, organization, billing account, or folder that is receiving - * new log entries, whether the resource is specified in - * <code>logName</code> or in an individual log entry. + * The permission `logging.logEntries.create` is needed on each project, + * organization, billing account, or folder that is receiving new log + * entries, whether the resource is specified in `logName` or in an + * individual log entry. * * - * string log_name = 1 [(.google.api.resource_reference) = { ... } + * + * string log_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * * * @return The logName. */ @@ -60,13 +62,15 @@ public interface WriteLogEntriesRequestOrBuilder * `[LOG_ID]` must be URL-encoded. For example: * "projects/my-project-id/logs/syslog" * "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity" - * The permission <code>logging.logEntries.create</code> is needed on each - * project, organization, billing account, or folder that is receiving - * new log entries, whether the resource is specified in - * <code>logName</code> or in an individual log entry. + * The permission `logging.logEntries.create` is needed on each project, + * organization, billing account, or folder that is receiving new log + * entries, whether the resource is specified in `logName` or in an + * individual log entry. * * - * string log_name = 1 [(.google.api.resource_reference) = { ... } + * + * string log_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * * * @return The bytes for logName. */ @@ -84,7 +88,8 @@ public interface WriteLogEntriesRequestOrBuilder * See [LogEntry][google.logging.v2.LogEntry]. * * - * .google.api.MonitoredResource resource = 2; + * .google.api.MonitoredResource resource = 2 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return Whether the resource field is set. */ @@ -101,7 +106,8 @@ public interface WriteLogEntriesRequestOrBuilder * See [LogEntry][google.logging.v2.LogEntry]. * * - * .google.api.MonitoredResource resource = 2; + * .google.api.MonitoredResource resource = 2 [(.google.api.field_behavior) = OPTIONAL]; + * * * @return The resource. */ @@ -118,7 +124,8 @@ public interface WriteLogEntriesRequestOrBuilder * See [LogEntry][google.logging.v2.LogEntry]. * * - * .google.api.MonitoredResource resource = 2; + * .google.api.MonitoredResource resource = 2 [(.google.api.field_behavior) = OPTIONAL]; + * */ com.google.api.MonitoredResourceOrBuilder getResourceOrBuilder(); @@ -132,7 +139,7 @@ public interface WriteLogEntriesRequestOrBuilder * See [LogEntry][google.logging.v2.LogEntry]. * * - * map<string, string> labels = 3; + * map<string, string> labels = 3 [(.google.api.field_behavior) = OPTIONAL]; */ int getLabelsCount(); /** @@ -145,7 +152,7 @@ public interface WriteLogEntriesRequestOrBuilder * See [LogEntry][google.logging.v2.LogEntry]. * * - * map<string, string> labels = 3; + * map<string, string> labels = 3 [(.google.api.field_behavior) = OPTIONAL]; */ boolean containsLabels(java.lang.String key); /** Use {@link #getLabelsMap()} instead. */ @@ -161,7 +168,7 @@ public interface WriteLogEntriesRequestOrBuilder * See [LogEntry][google.logging.v2.LogEntry]. * * - * map<string, string> labels = 3; + * map<string, string> labels = 3 [(.google.api.field_behavior) = OPTIONAL]; */ java.util.Map getLabelsMap(); /** @@ -174,7 +181,7 @@ public interface WriteLogEntriesRequestOrBuilder * See [LogEntry][google.logging.v2.LogEntry]. * * - * map<string, string> labels = 3; + * map<string, string> labels = 3 [(.google.api.field_behavior) = OPTIONAL]; */ java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue); /** @@ -187,7 +194,7 @@ public interface WriteLogEntriesRequestOrBuilder * See [LogEntry][google.logging.v2.LogEntry]. * * - * map<string, string> labels = 3; + * map<string, string> labels = 3 [(.google.api.field_behavior) = OPTIONAL]; */ java.lang.String getLabelsOrThrow(java.lang.String key); @@ -358,7 +365,7 @@ public interface WriteLogEntriesRequestOrBuilder * keyed by the entries' zero-based index in the `entries.write` method. * * - * bool partial_success = 5; + * bool partial_success = 5 [(.google.api.field_behavior) = OPTIONAL]; * * @return The partialSuccess. */ @@ -373,7 +380,7 @@ public interface WriteLogEntriesRequestOrBuilder * logging API endpoints are working properly before sending valuable data. * * - * bool dry_run = 6; + * bool dry_run = 6 [(.google.api.field_behavior) = OPTIONAL]; * * @return The dryRun. */ diff --git a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/WriteLogEntriesResponse.java b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/WriteLogEntriesResponse.java index d613aef44..fa53a3b88 100644 --- a/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/WriteLogEntriesResponse.java +++ b/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/WriteLogEntriesResponse.java @@ -23,7 +23,6 @@ * *
  * Result returned from WriteLogEntries.
- * empty
  * 
* * Protobuf type {@code google.logging.v2.WriteLogEntriesResponse} @@ -258,7 +257,6 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * *
    * Result returned from WriteLogEntries.
-   * empty
    * 
* * Protobuf type {@code google.logging.v2.WriteLogEntriesResponse} diff --git a/proto-google-cloud-logging-v2/src/main/proto/google/logging/v2/log_entry.proto b/proto-google-cloud-logging-v2/src/main/proto/google/logging/v2/log_entry.proto index 3f9c3d51d..ba8a08ff2 100644 --- a/proto-google-cloud-logging-v2/src/main/proto/google/logging/v2/log_entry.proto +++ b/proto-google-cloud-logging-v2/src/main/proto/google/logging/v2/log_entry.proto @@ -17,6 +17,7 @@ syntax = "proto3"; package google.logging.v2; +import "google/api/field_behavior.proto"; import "google/api/monitored_resource.proto"; import "google/api/resource.proto"; import "google/logging/type/http_request.proto"; @@ -55,9 +56,9 @@ message LogEntry { // "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" // "folders/[FOLDER_ID]/logs/[LOG_ID]" // - // A project number may optionally be used in place of PROJECT_ID. The project - // number is translated to its corresponding PROJECT_ID internally and the - // `log_name` field will contain PROJECT_ID in queries and exports. + // A project number may be used in place of PROJECT_ID. The project number is + // translated to its corresponding PROJECT_ID internally and the `log_name` + // field will contain PROJECT_ID in queries and exports. // // `[LOG_ID]` must be URL-encoded within `log_name`. Example: // `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`. @@ -70,16 +71,16 @@ message LogEntry { // forward-slash is removed. Listing the log entry will not show the leading // slash and filtering for a log name with a leading slash will never return // any results. - string log_name = 12; + string log_name = 12 [(google.api.field_behavior) = REQUIRED]; // Required. The monitored resource that produced 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. - google.api.MonitoredResource resource = 8; + google.api.MonitoredResource resource = 8 [(google.api.field_behavior) = REQUIRED]; - // Optional. The log entry payload, which can be one of multiple types. + // The log entry payload, which can be one of multiple types. oneof payload { // The log entry payload, represented as a protocol buffer. Some Google // Cloud Platform services use this field for their log entry payloads. @@ -99,29 +100,27 @@ message LogEntry { google.protobuf.Struct json_payload = 6; } - // Optional. The time the event described by the log entry occurred. This - // time is used to compute the log entry's age and to enforce the logs - // retention period. If this field is omitted in a new log entry, then Logging - // assigns it the current time. Timestamps have nanosecond accuracy, but - // trailing zeros in the fractional seconds might be omitted when the - // timestamp is displayed. + // Optional. The time the event described by the log entry occurred. This time is used + // to compute the log entry's age and to enforce the logs retention period. + // If this field is omitted in a new log entry, then Logging assigns it the + // current time. Timestamps have nanosecond accuracy, but trailing zeros in + // the fractional seconds might be omitted when the timestamp is displayed. // // Incoming log entries should have timestamps that are no more than the [logs // retention period](/logging/quotas) in the past, and no more than 24 hours // in the future. Log entries outside those time boundaries will not be // available when calling `entries.list`, but those log entries can still be // [exported with LogSinks](/logging/docs/api/tasks/exporting-logs). - google.protobuf.Timestamp timestamp = 9; + google.protobuf.Timestamp timestamp = 9 [(google.api.field_behavior) = OPTIONAL]; // Output only. The time the log entry was received by Logging. - google.protobuf.Timestamp receive_timestamp = 24; + google.protobuf.Timestamp receive_timestamp = 24 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Optional. The severity of the log entry. The default value is - // `LogSeverity.DEFAULT`. - google.logging.type.LogSeverity severity = 10; + // Optional. The severity of the log entry. The default value is `LogSeverity.DEFAULT`. + google.logging.type.LogSeverity severity = 10 [(google.api.field_behavior) = OPTIONAL]; - // Optional. A unique identifier for the log entry. If you provide a value, - // then Logging considers other log entries in the same project, with the same + // Optional. A unique identifier for the log entry. If you provide a value, then + // Logging considers other log entries in the same project, with the same // `timestamp`, and with the same `insert_id` to be duplicates which are // removed in a single query result. However, there are no guarantees of // de-duplication in the export of logs. @@ -131,43 +130,32 @@ message LogEntry { // // In queries, the `insert_id` is also used to order log entries that have // the same `log_name` and `timestamp` values. - string insert_id = 4; + string insert_id = 4 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Information about the HTTP request associated with this log - // entry, if applicable. - google.logging.type.HttpRequest http_request = 7; + // Optional. Information about the HTTP request associated with this log entry, if + // applicable. + google.logging.type.HttpRequest http_request = 7 [(google.api.field_behavior) = OPTIONAL]; // Optional. A set of user-defined (key, value) data that provides additional // information about the log entry. - map labels = 11; - - // Deprecated. Output only. Additional metadata about the monitored resource. - // - // Only `k8s_container`, `k8s_pod`, and `k8s_node` MonitoredResources have - // this field populated for GKE versions older than 1.12.6. For GKE versions - // 1.12.6 and above, the `metadata` field has been deprecated. The Kubernetes - // pod labels that used to be in `metadata.userLabels` will now be present in - // the `labels` field with a key prefix of `k8s-pod/`. The Stackdriver system - // labels that were present in the `metadata.systemLabels` field will no - // longer be available in the LogEntry. - google.api.MonitoredResourceMetadata metadata = 25 [deprecated = true]; + map labels = 11 [(google.api.field_behavior) = OPTIONAL]; // Optional. Information about an operation associated with the log entry, if // applicable. - LogEntryOperation operation = 15; + LogEntryOperation operation = 15 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Resource name of the trace associated with the log entry, if any. - // If it contains a relative resource name, the name is assumed to be relative - // to `//tracing.googleapis.com`. Example: + // Optional. Resource name of the trace associated with the log entry, if any. If it + // contains a relative resource name, the name is assumed to be relative to + // `//tracing.googleapis.com`. Example: // `projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824` - string trace = 22; + string trace = 22 [(google.api.field_behavior) = OPTIONAL]; // Optional. The span ID within the trace associated with the log entry. // // For Trace spans, this is the same format that the Trace API v2 uses: a // 16-character hexadecimal encoding of an 8-byte array, such as - // "000000000000004a". - string span_id = 27; + // `000000000000004a`. + string span_id = 27 [(google.api.field_behavior) = OPTIONAL]; // Optional. The sampling decision of the trace associated with the log entry. // @@ -176,11 +164,10 @@ message LogEntry { // for storage when this log entry was written, or the sampling decision was // unknown at the time. A non-sampled `trace` value is still useful as a // request correlation identifier. The default is False. - bool trace_sampled = 30; + bool trace_sampled = 30 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Source code location information associated with the log entry, - // if any. - LogEntrySourceLocation source_location = 23; + // Optional. Source code location information associated with the log entry, if any. + LogEntrySourceLocation source_location = 23 [(google.api.field_behavior) = OPTIONAL]; } // Additional information about a potentially long-running operation with which @@ -188,18 +175,18 @@ message LogEntry { message LogEntryOperation { // Optional. An arbitrary operation identifier. Log entries with the same // identifier are assumed to be part of the same operation. - string id = 1; + string id = 1 [(google.api.field_behavior) = OPTIONAL]; // Optional. An arbitrary producer identifier. The combination of `id` and // `producer` must be globally unique. Examples for `producer`: // `"MyDivision.MyBigCompany.com"`, `"github.com/MyProject/MyApplication"`. - string producer = 2; + string producer = 2 [(google.api.field_behavior) = OPTIONAL]; // Optional. Set this to True if this is the first log entry in the operation. - bool first = 3; + bool first = 3 [(google.api.field_behavior) = OPTIONAL]; // Optional. Set this to True if this is the last log entry in the operation. - bool last = 4; + bool last = 4 [(google.api.field_behavior) = OPTIONAL]; } // Additional information about the source code location that produced the log @@ -207,11 +194,11 @@ message LogEntryOperation { message LogEntrySourceLocation { // Optional. Source file name. Depending on the runtime environment, this // might be a simple name or a fully-qualified name. - string file = 1; + string file = 1 [(google.api.field_behavior) = OPTIONAL]; // Optional. Line within the source file. 1-based; 0 indicates no line number // available. - int64 line = 2; + int64 line = 2 [(google.api.field_behavior) = OPTIONAL]; // Optional. Human-readable name of the function or method being invoked, with // optional context such as the class or package name. This information may be @@ -219,5 +206,5 @@ message LogEntrySourceLocation { // less meaningful. The format can vary by language. For example: // `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function` // (Python). - string function = 3; + string function = 3 [(google.api.field_behavior) = OPTIONAL]; } diff --git a/proto-google-cloud-logging-v2/src/main/proto/google/logging/v2/logging.proto b/proto-google-cloud-logging-v2/src/main/proto/google/logging/v2/logging.proto index c3a524633..00af178c3 100644 --- a/proto-google-cloud-logging-v2/src/main/proto/google/logging/v2/logging.proto +++ b/proto-google-cloud-logging-v2/src/main/proto/google/logging/v2/logging.proto @@ -17,7 +17,6 @@ syntax = "proto3"; package google.logging.v2; -import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/api/monitored_resource.proto"; @@ -28,6 +27,7 @@ import "google/protobuf/duration.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/timestamp.proto"; import "google/rpc/status.proto"; +import "google/api/annotations.proto"; option cc_enable_arenas = true; option csharp_namespace = "Google.Cloud.Logging.V2"; @@ -142,7 +142,7 @@ message DeleteLogRequest { string log_name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - child_type: "logging.googleapis.com/Log" + type: "logging.googleapis.com/Log" } ]; } @@ -162,13 +162,16 @@ message WriteLogEntriesRequest { // "projects/my-project-id/logs/syslog" // "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity" // - // The permission logging.logEntries.create is needed on each - // project, organization, billing account, or folder that is receiving - // new log entries, whether the resource is specified in - // logName or in an individual log entry. - string log_name = 1 [(google.api.resource_reference) = { - type: "logging.googleapis.com/Log" - }]; + // The permission `logging.logEntries.create` is needed on each project, + // organization, billing account, or folder that is receiving new log + // entries, whether the resource is specified in `logName` or in an + // individual log entry. + string log_name = 1 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "logging.googleapis.com/Log" + } + ]; // Optional. A default monitored resource object that is assigned to all log // entries in `entries` that do not specify a value for `resource`. Example: @@ -178,13 +181,13 @@ message WriteLogEntriesRequest { // "zone": "us-central1-a", "instance_id": "00000000000000000000" }} // // See [LogEntry][google.logging.v2.LogEntry]. - google.api.MonitoredResource resource = 2; + google.api.MonitoredResource resource = 2 [(google.api.field_behavior) = OPTIONAL]; // Optional. Default labels that are added to the `labels` field of all log // entries in `entries`. If a log entry already has a label with the same key // as a label in this parameter, then the log entry's label is not changed. // See [LogEntry][google.logging.v2.LogEntry]. - map labels = 3; + map labels = 3 [(google.api.field_behavior) = OPTIONAL]; // Required. The log entries to send to Logging. The order of log // entries in this list does not matter. Values supplied in this method's @@ -216,19 +219,16 @@ message WriteLogEntriesRequest { // entry is not written, then the response status is the error associated // with one of the failed entries and the response includes error details // keyed by the entries' zero-based index in the `entries.write` method. - bool partial_success = 5; + bool partial_success = 5 [(google.api.field_behavior) = OPTIONAL]; // Optional. If true, the request should expect normal response, but the // entries won't be persisted nor exported. Useful for checking whether the // logging API endpoints are working properly before sending valuable data. - bool dry_run = 6; + bool dry_run = 6 [(google.api.field_behavior) = OPTIONAL]; } // Result returned from WriteLogEntries. -// empty -message WriteLogEntriesResponse { - -} +message WriteLogEntriesResponse {} // Error details for WriteLogEntries with partial success. message WriteLogEntriesPartialErrors { @@ -243,11 +243,6 @@ message WriteLogEntriesPartialErrors { // The parameters to `ListLogEntries`. message ListLogEntriesRequest { - // Deprecated. Use `resource_names` instead. One or more project identifiers - // or project numbers from which to retrieve log entries. Example: - // `"my-project-1A"`. - repeated string project_ids = 1 [deprecated = true]; - // Required. Names of one or more parent resources from which to // retrieve log entries: // @@ -272,7 +267,7 @@ message ListLogEntriesRequest { // that is not listed in `resource_names` will cause the filter to return no // results. // The maximum length of the filter is 20000 characters. - string filter = 2; + string filter = 2 [(google.api.field_behavior) = OPTIONAL]; // Optional. How the results should be sorted. Presently, the only permitted // values are `"timestamp asc"` (default) and `"timestamp desc"`. The first @@ -280,18 +275,18 @@ message ListLogEntriesRequest { // `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 their `insert_id` values. - string order_by = 3; + string order_by = 3 [(google.api.field_behavior) = OPTIONAL]; // Optional. The maximum number of results to return from this request. // Non-positive values are ignored. The presence of `next_page_token` in the // response indicates that more results might be available. - int32 page_size = 4; + int32 page_size = 4 [(google.api.field_behavior) = OPTIONAL]; // Optional. If present, then retrieve the next batch of results from the // preceding call to this method. `page_token` must be the value of // `next_page_token` from the previous response. The values of other method // parameters should be identical to those in the previous call. - string page_token = 5; + string page_token = 5 [(google.api.field_behavior) = OPTIONAL]; } // Result returned from `ListLogEntries`. @@ -319,13 +314,13 @@ message ListMonitoredResourceDescriptorsRequest { // Optional. The maximum number of results to return from this request. // Non-positive values are ignored. The presence of `nextPageToken` in the // response indicates that more results might be available. - int32 page_size = 1; + int32 page_size = 1 [(google.api.field_behavior) = OPTIONAL]; // Optional. If present, then retrieve the next batch of results from the // preceding call to this method. `pageToken` must be the value of // `nextPageToken` from the previous response. The values of other method // parameters should be identical to those in the previous call. - string page_token = 2; + string page_token = 2 [(google.api.field_behavior) = OPTIONAL]; } // Result returned from ListMonitoredResourceDescriptors. @@ -347,20 +342,23 @@ message ListLogsRequest { // "organizations/[ORGANIZATION_ID]" // "billingAccounts/[BILLING_ACCOUNT_ID]" // "folders/[FOLDER_ID]" - string parent = 1 [(google.api.resource_reference) = { - child_type: "logging.googleapis.com/Log" - }]; + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "logging.googleapis.com/Log" + } + ]; // Optional. The maximum number of results to return from this request. // Non-positive values are ignored. The presence of `nextPageToken` in the // response indicates that more results might be available. - int32 page_size = 2; + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; // Optional. If present, then retrieve the next batch of results from the // preceding call to this method. `pageToken` must be the value of // `nextPageToken` from the previous response. The values of other method // parameters should be identical to those in the previous call. - string page_token = 3; + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; } // Result returned from ListLogs. diff --git a/proto-google-cloud-logging-v2/src/main/proto/google/logging/v2/logging_config.proto b/proto-google-cloud-logging-v2/src/main/proto/google/logging/v2/logging_config.proto index 7fb830ded..1062a6521 100644 --- a/proto-google-cloud-logging-v2/src/main/proto/google/logging/v2/logging_config.proto +++ b/proto-google-cloud-logging-v2/src/main/proto/google/logging/v2/logging_config.proto @@ -43,6 +43,79 @@ service ConfigServiceV2 { "https://www.googleapis.com/auth/logging.admin," "https://www.googleapis.com/auth/logging.read"; + // Lists buckets (Beta). + rpc ListBuckets(ListBucketsRequest) returns (ListBucketsResponse) { + option (google.api.http) = { + get: "/v2/{parent=*/*/locations/*}/buckets" + additional_bindings { + get: "/v2/{parent=projects/*/locations/*}/buckets" + } + additional_bindings { + get: "/v2/{parent=organizations/*/locations/*}/buckets" + } + additional_bindings { + get: "/v2/{parent=folders/*/locations/*}/buckets" + } + additional_bindings { + get: "/v2/{parent=billingAccounts/*/locations/*}/buckets" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Gets a bucket (Beta). + rpc GetBucket(GetBucketRequest) returns (LogBucket) { + option (google.api.http) = { + get: "/v2/{name=*/*/locations/*/buckets/*}" + additional_bindings { + get: "/v2/{name=projects/*/locations/*/buckets/*}" + } + additional_bindings { + get: "/v2/{name=organizations/*/locations/*/buckets/*}" + } + additional_bindings { + get: "/v2/{name=folders/*/locations/*/buckets/*}" + } + additional_bindings { + get: "/v2/{name=billingAccounts/*/buckets/*}" + } + }; + } + + // Updates a bucket. This method replaces the following fields in the + // existing bucket with values from the new bucket: `retention_period` + // + // If the retention period is decreased and the bucket is locked, + // FAILED_PRECONDITION will be returned. + // + // If the bucket has a LifecycleState of DELETE_REQUESTED, FAILED_PRECONDITION + // will be returned. + // + // A buckets region may not be modified after it is created. + // This method is in Beta. + rpc UpdateBucket(UpdateBucketRequest) returns (LogBucket) { + option (google.api.http) = { + patch: "/v2/{name=*/*/locations/*/buckets/*}" + body: "bucket" + additional_bindings { + patch: "/v2/{name=projects/*/locations/*/buckets/*}" + body: "bucket" + } + additional_bindings { + patch: "/v2/{name=organizations/*/locations/*/buckets/*}" + body: "bucket" + } + additional_bindings { + patch: "/v2/{name=folders/*/locations/*/buckets/*}" + body: "bucket" + } + additional_bindings { + patch: "/v2/{name=billingAccounts/*/locations/*/buckets/*}" + body: "bucket" + } + }; + } + // Lists sinks. rpc ListSinks(ListSinksRequest) returns (ListSinksResponse) { option (google.api.http) = { @@ -333,6 +406,48 @@ service ConfigServiceV2 { } } +// Describes a repository of logs (Beta). +message LogBucket { + option (google.api.resource) = { + type: "logging.googleapis.com/LogBucket" + pattern: "projects/{project}/locations/{location}/buckets/{bucket}" + pattern: "organizations/{organization}/locations/{location}/buckets/{bucket}" + pattern: "folders/{folder}/locations/{location}/buckets/{bucket}" + pattern: "billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}" + }; + + // The resource name of the bucket. + // For example: + // "projects/my-project-id/locations/my-location/buckets/my-bucket-id The + // supported locations are: + // "global" + // "us-central1" + // + // For the location of `global` it is unspecified where logs are actually + // stored. + // Once a bucket has been created, the location can not be changed. + string name = 1; + + // Describes this bucket. + string description = 3; + + // Output only. The creation timestamp of the bucket. This is not set for any of the + // default buckets. + google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last update timestamp of the bucket. + google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Logs will be retained by default for this amount of time, after which they + // will automatically be deleted. The minimum retention period is 1 day. + // If this value is set to zero at bucket creation time, the default time of + // 30 days will be used. + int32 retention_days = 11; + + // Output only. The bucket lifecycle state. + LifecycleState lifecycle_state = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + // Describes a sink used to export log entries to one of the following // destinations in any project: a Cloud Storage bucket, a BigQuery dataset, or a // Cloud Pub/Sub topic. A logs filter controls which log entries are exported. @@ -340,7 +455,7 @@ service ConfigServiceV2 { // folder. message LogSink { option (google.api.resource) = { - type: "logging.googleapis.com/Sink" + type: "logging.googleapis.com/LogSink" pattern: "projects/{project}/sinks/{sink}" pattern: "organizations/{organization}/sinks/{sink}" pattern: "folders/{folder}/sinks/{sink}" @@ -361,12 +476,12 @@ message LogSink { V1 = 2; } - // Required. The client-assigned sink identifier, unique within the - // project. Example: `"my-syslog-errors-to-pubsub"`. Sink identifiers are - // limited to 100 characters and can include only the following characters: - // upper and lower-case alphanumeric characters, underscores, hyphens, and - // periods. First character has to be alphanumeric. - string name = 1; + // Required. The client-assigned sink identifier, unique within the project. Example: + // `"my-syslog-errors-to-pubsub"`. Sink identifiers are limited to 100 + // characters and can include only the following characters: upper and + // lower-case alphanumeric characters, underscores, hyphens, and periods. + // First character has to be alphanumeric. + string name = 1 [(google.api.field_behavior) = REQUIRED]; // Required. The export destination: // @@ -378,36 +493,37 @@ message LogSink { // have permission to write to the destination or else the log // entries are not exported. For more information, see // [Exporting Logs with Sinks](/logging/docs/api/tasks/exporting-logs). - string destination = 3 [(google.api.resource_reference) = { - type: "*" - }]; + string destination = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "*" + } + ]; // Optional. An [advanced logs filter](/logging/docs/view/advanced-queries). The only // exported log entries are those that are in the resource owning the sink and // that match the filter. For example: // // logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR - string filter = 5; + string filter = 5 [(google.api.field_behavior) = OPTIONAL]; // Optional. A description of this sink. // The maximum length of the description is 8000 characters. - string description = 18; + string description = 18 [(google.api.field_behavior) = OPTIONAL]; // Optional. If set to True, then this sink is disabled and it does not // export any log entries. - bool disabled = 19; + bool disabled = 19 [(google.api.field_behavior) = OPTIONAL]; // Deprecated. The log entry format to use for this sink's exported log // entries. The v2 format is used by default and cannot be changed. VersionFormat output_version_format = 6 [deprecated = true]; - // Output only. An IAM identity—a service account or group—under - // which Logging writes the exported log entries to the sink's destination. - // This field is set by - // [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] - // and - // [sinks.update][google.logging.v2.ConfigServiceV2.UpdateSink] - // based on the value of `unique_writer_identity` in those methods. + // Output only. An IAM identity–a service account or group—under which Logging + // writes the exported log entries to the sink's destination. This field is + // set by [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] and + // [sinks.update][google.logging.v2.ConfigServiceV2.UpdateSink] based on the + // value of `unique_writer_identity` in those methods. // // Until you grant this identity write-access to the destination, log entry // exports from this sink will fail. For more information, @@ -430,12 +546,12 @@ message LogSink { // // logName:("projects/test-project1/" OR "projects/test-project2/") AND // resource.type=gce_instance - bool include_children = 9; + bool include_children = 9 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Destination dependent options. + // Destination dependent options. oneof options { // Optional. Options that affect sinks exporting data to BigQuery. - BigQueryOptions bigquery_options = 12; + BigQueryOptions bigquery_options = 12 [(google.api.field_behavior) = OPTIONAL]; } // Output only. The creation timestamp of the sink. @@ -447,12 +563,6 @@ message LogSink { // // This field may not be present for older sinks. google.protobuf.Timestamp update_time = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Do not use. This field is ignored. - google.protobuf.Timestamp start_time = 10 [deprecated = true]; - - // Do not use. This field is ignored. - google.protobuf.Timestamp end_time = 11 [deprecated = true]; } // Options that change functionality of a sink exporting data to BigQuery. @@ -464,7 +574,7 @@ message BigQueryOptions { // present and [special query // syntax](/bigquery/docs/querying-partitioned-tables) has to be used instead. // In both cases, tables are sharded based on UTC timezone. - bool use_partitioned_tables = 1; + bool use_partitioned_tables = 1 [(google.api.field_behavior) = OPTIONAL]; // Output only. True if new timestamp column based partitioning is in use, // false if legacy ingestion-time partitioning is in use. @@ -475,6 +585,113 @@ message BigQueryOptions { bool uses_timestamp_column_partitioning = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; } +// LogBucket lifecycle states (Beta). +enum LifecycleState { + // Unspecified state. This is only used/useful for distinguishing + // unset values. + LIFECYCLE_STATE_UNSPECIFIED = 0; + + // The normal and active state. + ACTIVE = 1; + + // The bucket has been marked for deletion by the user. + DELETE_REQUESTED = 2; +} + +// The parameters to `ListBuckets` (Beta). +message ListBucketsRequest { + // Required. The parent resource whose buckets are to be listed: + // + // "projects/[PROJECT_ID]/locations/[LOCATION_ID]" + // "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" + // "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" + // "folders/[FOLDER_ID]/locations/[LOCATION_ID]" + // + // Note: The locations portion of the resource must be specified, but + // supplying the character `-` in place of [LOCATION_ID] will return all + // buckets. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "logging.googleapis.com/LogBucket" + }]; + + // Optional. If present, then retrieve the next batch of results from the + // preceding call to this method. `pageToken` must be the value of + // `nextPageToken` from the previous response. The values of other method + // parameters should be identical to those in the previous call. + string page_token = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of results to return from this request. + // Non-positive values are ignored. The presence of `nextPageToken` in the + // response indicates that more results might be available. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response from ListBuckets (Beta). +message ListBucketsResponse { + // A list of buckets. + repeated LogBucket buckets = 1; + + // If there might be more results than appear in this response, then + // `nextPageToken` is included. To get the next set of results, call the same + // method again using the value of `nextPageToken` as `pageToken`. + string next_page_token = 2; +} + +// The parameters to `UpdateBucket` (Beta). +message UpdateBucketRequest { + // Required. The full resource name of the bucket to update. + // + // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + // "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + // "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + // "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + // + // Example: + // `"projects/my-project-id/locations/my-location/buckets/my-bucket-id"`. Also + // requires permission "resourcemanager.projects.updateLiens" to set the + // locked property + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "logging.googleapis.com/LogBucket" + } + ]; + + // Required. The updated bucket. + LogBucket bucket = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Field mask that specifies the fields in `bucket` that need an update. A + // bucket field will be overwritten if, and only if, it is in the update + // mask. `name` and output only fields cannot be updated. + // + // For a detailed `FieldMask` definition, see + // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask + // + // Example: `updateMask=retention_days`. + google.protobuf.FieldMask update_mask = 4 [(google.api.field_behavior) = REQUIRED]; +} + +// The parameters to `GetBucket` (Beta). +message GetBucketRequest { + // Required. The resource name of the bucket: + // + // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + // "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + // "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + // "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + // + // Example: + // `"projects/my-project-id/locations/my-location/buckets/my-bucket-id"`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "logging.googleapis.com/LogBucket" + } + ]; +} + // The parameters to `ListSinks`. message ListSinksRequest { // Required. The parent resource whose sinks are to be listed: @@ -486,7 +703,7 @@ message ListSinksRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - child_type: "logging.googleapis.com/Sink" + child_type: "logging.googleapis.com/LogSink" } ]; @@ -494,12 +711,12 @@ message ListSinksRequest { // preceding call to this method. `pageToken` must be the value of // `nextPageToken` from the previous response. The values of other method // parameters should be identical to those in the previous call. - string page_token = 2; + string page_token = 2 [(google.api.field_behavior) = OPTIONAL]; // Optional. The maximum number of results to return from this request. // Non-positive values are ignored. The presence of `nextPageToken` in the // response indicates that more results might be available. - int32 page_size = 3; + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; } // Result returned from `ListSinks`. @@ -526,7 +743,7 @@ message GetSinkRequest { string sink_name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "logging.googleapis.com/Sink" + type: "logging.googleapis.com/LogSink" } ]; } @@ -544,7 +761,7 @@ message CreateSinkRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - child_type: "logging.googleapis.com/Sink" + child_type: "logging.googleapis.com/LogSink" } ]; @@ -563,13 +780,13 @@ message CreateSinkRequest { // resource such as an organization, then the value of `writer_identity` will // be a unique service account used only for exports from the new sink. For // more information, see `writer_identity` in [LogSink][google.logging.v2.LogSink]. - bool unique_writer_identity = 3; + bool unique_writer_identity = 3 [(google.api.field_behavior) = OPTIONAL]; } // The parameters to `UpdateSink`. message UpdateSinkRequest { - // Required. The full resource name of the sink to update, including the - // parent resource and the sink identifier: + // Required. The full resource name of the sink to update, including the parent + // resource and the sink identifier: // // "projects/[PROJECT_ID]/sinks/[SINK_ID]" // "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" @@ -580,12 +797,12 @@ message UpdateSinkRequest { string sink_name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "logging.googleapis.com/Sink" + type: "logging.googleapis.com/LogSink" } ]; - // Required. The updated sink, whose name is the same identifier that appears - // as part of `sink_name`. + // Required. The updated sink, whose name is the same identifier that appears as part + // of `sink_name`. LogSink sink = 2 [(google.api.field_behavior) = REQUIRED]; // Optional. See [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] @@ -599,7 +816,7 @@ message UpdateSinkRequest { // `writer_identity` is changed to a unique service account. // + It is an error if the old value is true and the new value is // set to false or defaulted to false. - bool unique_writer_identity = 3; + bool unique_writer_identity = 3 [(google.api.field_behavior) = OPTIONAL]; // Optional. Field mask that specifies the fields in `sink` that need // an update. A sink field will be overwritten if, and only if, it is @@ -615,13 +832,13 @@ message UpdateSinkRequest { // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask // // Example: `updateMask=filter`. - google.protobuf.FieldMask update_mask = 4; + google.protobuf.FieldMask update_mask = 4 [(google.api.field_behavior) = OPTIONAL]; } // The parameters to `DeleteSink`. message DeleteSinkRequest { - // Required. The full resource name of the sink to delete, including the - // parent resource and the sink identifier: + // Required. The full resource name of the sink to delete, including the parent + // resource and the sink identifier: // // "projects/[PROJECT_ID]/sinks/[SINK_ID]" // "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" @@ -632,7 +849,7 @@ message DeleteSinkRequest { string sink_name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "logging.googleapis.com/Sink" + type: "logging.googleapis.com/LogSink" } ]; } @@ -645,21 +862,21 @@ message DeleteSinkRequest { // apply to child resources, and that you can't exclude audit log entries. message LogExclusion { option (google.api.resource) = { - type: "logging.googleapis.com/Exclusion" + type: "logging.googleapis.com/LogExclusion" pattern: "projects/{project}/exclusions/{exclusion}" pattern: "organizations/{organization}/exclusions/{exclusion}" pattern: "folders/{folder}/exclusions/{exclusion}" pattern: "billingAccounts/{billing_account}/exclusions/{exclusion}" }; - // Required. A client-assigned identifier, such as - // `"load-balancer-exclusion"`. Identifiers are limited to 100 characters and - // can include only letters, digits, underscores, hyphens, and periods. - // First character has to be alphanumeric. - string name = 1; + // Required. A client-assigned identifier, such as `"load-balancer-exclusion"`. + // Identifiers are limited to 100 characters and can include only letters, + // digits, underscores, hyphens, and periods. First character has to be + // alphanumeric. + string name = 1 [(google.api.field_behavior) = REQUIRED]; // Optional. A description of this exclusion. - string description = 2; + string description = 2 [(google.api.field_behavior) = OPTIONAL]; // Required. An [advanced logs filter](/logging/docs/view/advanced-queries) // that matches the log entries to be excluded. By using the @@ -669,23 +886,23 @@ message LogExclusion { // entries from Google Cloud Storage buckets: // // `"resource.type=gcs_bucket severity=ERROR" // // The maximum length of the filter is 20000 characters. - string filter = 3; + string filter = 3 [(google.api.field_behavior) = REQUIRED]; // Optional. The metric descriptor associated with the logs-based metric. // If unspecified, it uses a default metric descriptor with a DELTA metric @@ -160,7 +160,7 @@ message LogMetric { // be updated once initially configured. New labels can be added in the // `metric_descriptor`, but existing labels cannot be modified except for // their description. - google.api.MetricDescriptor metric_descriptor = 5; + google.api.MetricDescriptor metric_descriptor = 5 [(google.api.field_behavior) = OPTIONAL]; // Optional. A `value_extractor` is required when using a distribution // logs-based metric to extract the values to record from a log entry. @@ -181,7 +181,7 @@ message LogMetric { // distribution. // // Example: `REGEXP_EXTRACT(jsonPayload.request, ".*quantity=(\d+).*")` - string value_extractor = 6; + string value_extractor = 6 [(google.api.field_behavior) = OPTIONAL]; // Optional. A map from a label key string to an extractor expression which is // used to extract data from a log entry field and assign as the label value. @@ -197,22 +197,22 @@ message LogMetric { // // Note that there are upper bounds on the maximum number of labels and the // number of active time series that are allowed in a project. - map label_extractors = 7; + map label_extractors = 7 [(google.api.field_behavior) = OPTIONAL]; // Optional. The `bucket_options` are required when the logs-based metric is // using a DISTRIBUTION value type and it describes the bucket boundaries // used to create a histogram of the extracted values. - google.api.Distribution.BucketOptions bucket_options = 8; + google.api.Distribution.BucketOptions bucket_options = 8 [(google.api.field_behavior) = OPTIONAL]; // Output only. The creation timestamp of the metric. // // This field may not be present for older metrics. - google.protobuf.Timestamp create_time = 9; + google.protobuf.Timestamp create_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The last update timestamp of the metric. // // This field may not be present for older metrics. - google.protobuf.Timestamp update_time = 10; + google.protobuf.Timestamp update_time = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; // Deprecated. The API version that created or updated this metric. // The v2 format is used by default and cannot be changed. @@ -235,12 +235,12 @@ message ListLogMetricsRequest { // preceding call to this method. `pageToken` must be the value of // `nextPageToken` from the previous response. The values of other method // parameters should be identical to those in the previous call. - string page_token = 2; + string page_token = 2 [(google.api.field_behavior) = OPTIONAL]; // Optional. The maximum number of results to return from this request. // Non-positive values are ignored. The presence of `nextPageToken` in the // response indicates that more results might be available. - int32 page_size = 3; + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; } // Result returned from ListLogMetrics. @@ -262,7 +262,7 @@ message GetLogMetricRequest { string metric_name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "logging.googleapis.com/Metric" + type: "logging.googleapis.com/LogMetric" } ]; } @@ -277,7 +277,7 @@ message CreateLogMetricRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "logging.googleapis.com/Metric" + child_type: "logging.googleapis.com/LogMetric" } ]; @@ -298,7 +298,7 @@ message UpdateLogMetricRequest { string metric_name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "logging.googleapis.com/Metric" + type: "logging.googleapis.com/LogMetric" } ]; @@ -314,7 +314,7 @@ message DeleteLogMetricRequest { string metric_name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "logging.googleapis.com/Metric" + type: "logging.googleapis.com/LogMetric" } ]; } diff --git a/synth.metadata b/synth.metadata index 5259a83c5..c0b1ca1a2 100644 --- a/synth.metadata +++ b/synth.metadata @@ -1,20 +1,20 @@ { - "updateTime": "2020-02-29T09:42:45.087168Z", + "updateTime": "2020-03-06T17:28:48.052070Z", "sources": [ { "generator": { "name": "artman", - "version": "0.47.0", - "dockerImage": "googleapis/artman@sha256:b3e50d6b8de03920b9f065bbc3d210e2ca93a043446f1fa16cdf567393c09678" + "version": "1.0.0", + "dockerImage": "googleapis/artman@sha256:f37f2464788cb551299209b4fcab4eb323533154488c2ef9ec0c75d7c2b4b482" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "83c6f84035ee0f80eaa44d8b688a010461cc4080", - "internalRef": "297918498", - "log": "83c6f84035ee0f80eaa44d8b688a010461cc4080\nUpdate google/api/auth.proto to make AuthProvider to have JwtLocation\n\nPiperOrigin-RevId: 297918498\n\ne9e90a787703ec5d388902e2cb796aaed3a385b4\nDialogflow weekly v2/v2beta1 library update:\n - adding get validation result\n - adding field mask override control for output audio config\nImportant updates are also posted at:\nhttps://cloud.google.com/dialogflow/docs/release-notes\n\nPiperOrigin-RevId: 297671458\n\n1a2b05cc3541a5f7714529c665aecc3ea042c646\nAdding .yaml and .json config files.\n\nPiperOrigin-RevId: 297570622\n\ndfe1cf7be44dee31d78f78e485d8c95430981d6e\nPublish `QueryOptions` proto.\n\nIntroduced a `query_options` input in `ExecuteSqlRequest`.\n\nPiperOrigin-RevId: 297497710\n\ndafc905f71e5d46f500b41ed715aad585be062c3\npubsub: revert pull init_rpc_timeout & max_rpc_timeout back to 25 seconds and reset multiplier to 1.0\n\nPiperOrigin-RevId: 297486523\n\n" + "sha": "8f488efd7bda33885cb674ddd023b3678c40bd82", + "internalRef": "299370279", + "log": "8f488efd7bda33885cb674ddd023b3678c40bd82\nfeat: Migrate logging to GAPIC v2; release new features.\n\nIMPORTANT: This is a breaking change for client libraries\nin all languages.\n\nCommitter: @lukesneeringer, @jskeet\nPiperOrigin-RevId: 299370279\n\n007605bf9ad3a1fd775014ebefbf7f1e6b31ee71\nUpdate API for bigqueryreservation v1beta1.\n- Adds flex capacity commitment plan to CapacityCommitment.\n- Adds methods for getting and updating BiReservations.\n- Adds methods for updating/splitting/merging CapacityCommitments.\n\nPiperOrigin-RevId: 299368059\n\nf0b581b5bdf803e45201ecdb3688b60e381628a8\nfix: recommendationengine/v1beta1 update some comments\n\nPiperOrigin-RevId: 299181282\n\n10e9a0a833dc85ff8f05b2c67ebe5ac785fe04ff\nbuild: add generated BUILD file for Routes Preferred API\n\nPiperOrigin-RevId: 299164808\n\n86738c956a8238d7c77f729be78b0ed887a6c913\npublish v1p1beta1: update with absolute address in comments\n\nPiperOrigin-RevId: 299152383\n\n73d9f2ad4591de45c2e1f352bc99d70cbd2a6d95\npublish v1: update with absolute address in comments\n\nPiperOrigin-RevId: 299147194\n\nd2158f24cb77b0b0ccfe68af784c6a628705e3c6\npublish v1beta2: update with absolute address in comments\n\nPiperOrigin-RevId: 299147086\n\n7fca61292c11b4cd5b352cee1a50bf88819dd63b\npublish v1p2beta1: update with absolute address in comments\n\nPiperOrigin-RevId: 299146903\n\n583b7321624736e2c490e328f4b1957335779295\npublish v1p3beta1: update with absolute address in comments\n\nPiperOrigin-RevId: 299146674\n\n638253bf86d1ce1c314108a089b7351440c2f0bf\nfix: add java_multiple_files option for automl text_sentiment.proto\n\nPiperOrigin-RevId: 298971070\n\n373d655703bf914fb8b0b1cc4071d772bac0e0d1\nUpdate Recs AI Beta public bazel file\n\nPiperOrigin-RevId: 298961623\n\ndcc5d00fc8a8d8b56f16194d7c682027b2c66a3b\nfix: add java_multiple_files option for automl classification.proto\n\nPiperOrigin-RevId: 298953301\n\na3f791827266f3496a6a5201d58adc4bb265c2a3\nchore: automl/v1 publish annotations and retry config\n\nPiperOrigin-RevId: 298942178\n\n01c681586d8d6dbd60155289b587aee678530bd9\nMark return_immediately in PullRequest deprecated.\n\nPiperOrigin-RevId: 298893281\n\nc9f5e9c4bfed54bbd09227e990e7bded5f90f31c\nRemove out of date documentation for predicate support on the Storage API\n\nPiperOrigin-RevId: 298883309\n\nfd5b3b8238d783b04692a113ffe07c0363f5de0f\ngenerate webrisk v1 proto\n\nPiperOrigin-RevId: 298847934\n\n541b1ded4abadcc38e8178680b0677f65594ea6f\nUpdate cloud asset api v1p4beta1.\n\nPiperOrigin-RevId: 298686266\n\nc0d171acecb4f5b0bfd2c4ca34fc54716574e300\n Updated to include the Notification v1 API.\n\nPiperOrigin-RevId: 298652775\n\n2346a9186c0bff2c9cc439f2459d558068637e05\nAdd Service Directory v1beta1 protos and configs\n\nPiperOrigin-RevId: 298625638\n\na78ed801b82a5c6d9c5368e24b1412212e541bb7\nPublishing v3 protos and configs.\n\nPiperOrigin-RevId: 298607357\n\n4a180bfff8a21645b3a935c2756e8d6ab18a74e0\nautoml/v1beta1 publish proto updates\n\nPiperOrigin-RevId: 298484782\n\n6de6e938b7df1cd62396563a067334abeedb9676\nchore: use the latest gapic-generator and protoc-java-resource-name-plugin in Bazel workspace.\n\nPiperOrigin-RevId: 298474513\n\n244ab2b83a82076a1fa7be63b7e0671af73f5c02\nAdds service config definition for bigqueryreservation v1\n\nPiperOrigin-RevId: 298455048\n\n" } }, {