diff --git a/grpc-google-cloud-logging-v2/src/main/java/com/google/logging/v2/MetricsServiceV2Grpc.java b/grpc-google-cloud-logging-v2/src/main/java/com/google/logging/v2/MetricsServiceV2Grpc.java deleted file mode 100644 index 0d3a0a2a0..000000000 --- a/grpc-google-cloud-logging-v2/src/main/java/com/google/logging/v2/MetricsServiceV2Grpc.java +++ /dev/null @@ -1,816 +0,0 @@ -/* - * Copyright 2024 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 static io.grpc.MethodDescriptor.generateFullMethodName; - -/** - * - * - *
- * Service for configuring logs-based metrics. - *- */ -@javax.annotation.Generated( - value = "by gRPC proto compiler", - comments = "Source: google/logging/v2/logging_metrics.proto") -@io.grpc.stub.annotations.GrpcGenerated -public final class MetricsServiceV2Grpc { - - private MetricsServiceV2Grpc() {} - - public static final java.lang.String SERVICE_NAME = "google.logging.v2.MetricsServiceV2"; - - // Static method descriptors that strictly reflect the proto. - private static volatile io.grpc.MethodDescriptor< - com.google.logging.v2.ListLogMetricsRequest, com.google.logging.v2.ListLogMetricsResponse> - getListLogMetricsMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "ListLogMetrics", - requestType = com.google.logging.v2.ListLogMetricsRequest.class, - responseType = com.google.logging.v2.ListLogMetricsResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.logging.v2.ListLogMetricsRequest, com.google.logging.v2.ListLogMetricsResponse> - getListLogMetricsMethod() { - io.grpc.MethodDescriptor< - com.google.logging.v2.ListLogMetricsRequest, - com.google.logging.v2.ListLogMetricsResponse> - getListLogMetricsMethod; - if ((getListLogMetricsMethod = MetricsServiceV2Grpc.getListLogMetricsMethod) == null) { - synchronized (MetricsServiceV2Grpc.class) { - if ((getListLogMetricsMethod = MetricsServiceV2Grpc.getListLogMetricsMethod) == null) { - MetricsServiceV2Grpc.getListLogMetricsMethod = - getListLogMetricsMethod = - io.grpc.MethodDescriptor - .
- * Service for configuring logs-based metrics. - *- */ - public interface AsyncService { - - /** - * - * - *
- * Lists logs-based metrics. - *- */ - default void listLogMetrics( - com.google.logging.v2.ListLogMetricsRequest request, - io.grpc.stub.StreamObserver
- * Gets a logs-based metric. - *- */ - default void getLogMetric( - com.google.logging.v2.GetLogMetricRequest request, - io.grpc.stub.StreamObserver
- * Creates a logs-based metric. - *- */ - default void createLogMetric( - com.google.logging.v2.CreateLogMetricRequest request, - io.grpc.stub.StreamObserver
- * Creates or updates a logs-based metric. - *- */ - default void updateLogMetric( - com.google.logging.v2.UpdateLogMetricRequest request, - io.grpc.stub.StreamObserver
- * Deletes a logs-based metric. - *- */ - default void deleteLogMetric( - com.google.logging.v2.DeleteLogMetricRequest request, - io.grpc.stub.StreamObserver
- * Service for configuring logs-based metrics. - *- */ - public abstract static class MetricsServiceV2ImplBase - implements io.grpc.BindableService, AsyncService { - - @java.lang.Override - public final io.grpc.ServerServiceDefinition bindService() { - return MetricsServiceV2Grpc.bindService(this); - } - } - - /** - * A stub to allow clients to do asynchronous rpc calls to service MetricsServiceV2. - * - *
- * Service for configuring logs-based metrics. - *- */ - public static final class MetricsServiceV2Stub - extends io.grpc.stub.AbstractAsyncStub
- * Lists logs-based metrics. - *- */ - public void listLogMetrics( - com.google.logging.v2.ListLogMetricsRequest request, - io.grpc.stub.StreamObserver
- * Gets a logs-based metric. - *- */ - public void getLogMetric( - com.google.logging.v2.GetLogMetricRequest request, - io.grpc.stub.StreamObserver
- * Creates a logs-based metric. - *- */ - public void createLogMetric( - com.google.logging.v2.CreateLogMetricRequest request, - io.grpc.stub.StreamObserver
- * Creates or updates a logs-based metric. - *- */ - public void updateLogMetric( - com.google.logging.v2.UpdateLogMetricRequest request, - io.grpc.stub.StreamObserver
- * Deletes a logs-based metric. - *- */ - public void deleteLogMetric( - com.google.logging.v2.DeleteLogMetricRequest request, - io.grpc.stub.StreamObserver
- * Service for configuring logs-based metrics. - *- */ - public static final class MetricsServiceV2BlockingStub - extends io.grpc.stub.AbstractBlockingStub
- * Lists logs-based metrics. - *- */ - public com.google.logging.v2.ListLogMetricsResponse listLogMetrics( - com.google.logging.v2.ListLogMetricsRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getListLogMetricsMethod(), getCallOptions(), request); - } - - /** - * - * - *
- * Gets a logs-based metric. - *- */ - public com.google.logging.v2.LogMetric getLogMetric( - com.google.logging.v2.GetLogMetricRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getGetLogMetricMethod(), getCallOptions(), request); - } - - /** - * - * - *
- * Creates a logs-based metric. - *- */ - public com.google.logging.v2.LogMetric createLogMetric( - com.google.logging.v2.CreateLogMetricRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getCreateLogMetricMethod(), getCallOptions(), request); - } - - /** - * - * - *
- * Creates or updates a logs-based metric. - *- */ - public com.google.logging.v2.LogMetric updateLogMetric( - com.google.logging.v2.UpdateLogMetricRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getUpdateLogMetricMethod(), getCallOptions(), request); - } - - /** - * - * - *
- * Deletes a logs-based metric. - *- */ - public com.google.protobuf.Empty deleteLogMetric( - com.google.logging.v2.DeleteLogMetricRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getDeleteLogMetricMethod(), getCallOptions(), request); - } - } - - /** - * A stub to allow clients to do ListenableFuture-style rpc calls to service MetricsServiceV2. - * - *
- * Service for configuring logs-based metrics. - *- */ - public static final class MetricsServiceV2FutureStub - extends io.grpc.stub.AbstractFutureStub
- * Lists logs-based metrics. - *- */ - public com.google.common.util.concurrent.ListenableFuture< - com.google.logging.v2.ListLogMetricsResponse> - listLogMetrics(com.google.logging.v2.ListLogMetricsRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getListLogMetricsMethod(), getCallOptions()), request); - } - - /** - * - * - *
- * Gets a logs-based metric. - *- */ - public com.google.common.util.concurrent.ListenableFuture
- * Creates a logs-based metric. - *- */ - public com.google.common.util.concurrent.ListenableFuture
- * Creates or updates a logs-based metric. - *- */ - public com.google.common.util.concurrent.ListenableFuture
- * Deletes a logs-based metric. - *- */ - public com.google.common.util.concurrent.ListenableFuture
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: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * GetBucketRequest request = + * GetBucketRequest.newBuilder() + * .setName( + * LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]") + * .toString()) + * .build(); + * LogBucket response = configClient.getBucket(request); + * } + * }+ * + *
Note: close() needs to be called on the ConfigClient object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). + * + *
Method | + *Description | + *Method Variants | + *
---|---|---|
ListBuckets |
+ * Lists log buckets. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
GetBucket |
+ * Gets a log bucket. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
CreateBucketAsync |
+ * Creates a log bucket asynchronously that can be used to store log entries. + * After a bucket has been created, the bucket's location cannot be changed. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
UpdateBucketAsync |
+ * Updates a log bucket asynchronously. + * If the bucket has a `lifecycle_state` of `DELETE_REQUESTED`, then `FAILED_PRECONDITION` will be returned. + * After a bucket has been created, the bucket's location cannot be changed. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
CreateBucket |
+ * Creates a log bucket that can be used to store log entries. After a bucket has been created, the bucket's location cannot be changed. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
UpdateBucket |
+ * Updates a log bucket. + * If the bucket has a `lifecycle_state` of `DELETE_REQUESTED`, then `FAILED_PRECONDITION` will be returned. + * After a bucket has been created, the bucket's location cannot be changed. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
DeleteBucket |
+ * Deletes a log bucket. + * Changes the bucket's `lifecycle_state` to the `DELETE_REQUESTED` state. After 7 days, the bucket will be purged and all log entries in the bucket will be permanently deleted. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
UndeleteBucket |
+ * Undeletes a log bucket. A bucket that has been deleted can be undeleted within the grace period of 7 days. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
ListViews |
+ * Lists views on a log bucket. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
GetView |
+ * Gets a view on a log bucket.. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
CreateView |
+ * Creates a view over log entries in a log bucket. A bucket may contain a maximum of 30 views. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
UpdateView |
+ * Updates a view on a log bucket. This method replaces the following fields in the existing view with values from the new view: `filter`. If an `UNAVAILABLE` error is returned, this indicates that system is not in a state where it can update the view. If this occurs, please try again in a few minutes. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
DeleteView |
+ * Deletes a view on a log bucket. If an `UNAVAILABLE` error is returned, this indicates that system is not in a state where it can delete the view. If this occurs, please try again in a few minutes. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
ListSinks |
+ * Lists sinks. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
GetSink |
+ * Gets a sink. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
CreateSink |
+ * 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. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
UpdateSink |
+ * 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. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
DeleteSink |
+ * Deletes a sink. If the sink has a unique `writer_identity`, then that service account is also deleted. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
CreateLink |
+ * Asynchronously creates a linked dataset in BigQuery which makes it possible to use BigQuery to read the logs stored in the log bucket. A log bucket may currently only contain one link. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
DeleteLink |
+ * Deletes a link. This will also delete the corresponding BigQuery linked dataset. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
ListLinks |
+ * Lists links. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
GetLink |
+ * Gets a link. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
ListExclusions |
+ * Lists all the exclusions on the _Default sink in a parent resource. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
GetExclusion |
+ * Gets the description of an exclusion in the _Default sink. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
CreateExclusion |
+ * Creates a new exclusion in the _Default sink 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. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
UpdateExclusion |
+ * Changes one or more properties of an existing exclusion in the _Default sink. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
DeleteExclusion |
+ * Deletes an exclusion in the _Default sink. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
GetCmekSettings |
+ * Gets the Logging CMEK settings for the given resource. + * Note: CMEK for the Log Router can be configured for Google Cloud projects, folders, organizations and billing accounts. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization. + * See [Enabling CMEK for Log Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
UpdateCmekSettings |
+ * Updates the Log Router CMEK settings for the given resource. + * Note: CMEK for the Log Router can currently only be configured for Google Cloud organizations. Once configured, it applies to all projects and folders in the Google Cloud 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 Log Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
GetSettings |
+ * Gets the Log Router settings for the given resource. + * Note: Settings for the Log Router can be get for Google Cloud projects, folders, organizations and billing accounts. Currently it can only be configured for organizations. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization. + * See [Enabling CMEK for Log Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
UpdateSettings |
+ * Updates the Log Router settings for the given resource. + * Note: Settings for the Log Router can currently only be configured for Google Cloud organizations. Once configured, it applies to all projects and folders in the Google Cloud organization. + * [UpdateSettings][google.logging.v2.ConfigServiceV2.UpdateSettings] 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. 4) `location_id` is not supported by Logging. 5) `location_id` violate OrgPolicy. + * See [Enabling CMEK for Log Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
CopyLogEntries |
+ * Copies a set of log entries from a log bucket to a Cloud Storage bucket. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Callable method variants take no parameters and return 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 ConfigSettings to create(). + * For example: + * + *
To customize credentials: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * ConfigSettings configSettings = + * ConfigSettings.newBuilder() + * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + * .build(); + * ConfigClient configClient = ConfigClient.create(configSettings); + * }+ * + *
To customize the endpoint: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * ConfigSettings configSettings = ConfigSettings.newBuilder().setEndpoint(myEndpoint).build(); + * ConfigClient configClient = ConfigClient.create(configSettings); + * }+ * + *
Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class ConfigClient implements BackgroundResource { + private final ConfigSettings settings; + private final ConfigServiceV2Stub stub; + private final OperationsClient operationsClient; + + /** Constructs an instance of ConfigClient with default settings. */ + public static final ConfigClient create() throws IOException { + return create(ConfigSettings.newBuilder().build()); + } + + /** + * Constructs an instance of ConfigClient, 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 ConfigClient create(ConfigSettings settings) throws IOException { + return new ConfigClient(settings); + } + + /** + * Constructs an instance of ConfigClient, using the given stub for making calls. This is for + * advanced usage - prefer using create(ConfigSettings). + */ + public static final ConfigClient create(ConfigServiceV2Stub stub) { + return new ConfigClient(stub); + } + + /** + * Constructs an instance of ConfigClient, 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 ConfigClient(ConfigSettings settings) throws IOException { + this.settings = settings; + this.stub = ((ConfigServiceV2StubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + protected ConfigClient(ConfigServiceV2Stub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final ConfigSettings getSettings() { + return settings; + } + + public ConfigServiceV2Stub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + public final OperationsClient getOperationsClient() { + return operationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists log buckets. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * BillingAccountLocationName parent = + * BillingAccountLocationName.of("[BILLING_ACCOUNT]", "[LOCATION]"); + * for (LogBucket element : configClient.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(BillingAccountLocationName parent) { + ListBucketsRequest request = + ListBucketsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listBuckets(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists log buckets. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * FolderLocationName parent = FolderLocationName.of("[FOLDER]", "[LOCATION]"); + * for (LogBucket element : configClient.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(FolderLocationName parent) { + ListBucketsRequest request = + ListBucketsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listBuckets(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists log buckets. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * for (LogBucket element : configClient.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(LocationName parent) { + ListBucketsRequest request = + ListBucketsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listBuckets(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists log buckets. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]"); + * for (LogBucket element : configClient.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(OrganizationLocationName parent) { + ListBucketsRequest request = + ListBucketsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listBuckets(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists log buckets. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + * for (LogBucket element : configClient.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 log buckets. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * ListBucketsRequest request = + * ListBucketsRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setPageToken("pageToken873572522") + * .setPageSize(883849137) + * .build(); + * for (LogBucket element : configClient.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 log buckets. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * ListBucketsRequest request = + * ListBucketsRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setPageToken("pageToken873572522") + * .setPageSize(883849137) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = configClient.listBucketsPagedCallable().futureCall(request); + * // Do something. + * for (LogBucket element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * ListBucketsRequest request = + * ListBucketsRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setPageToken("pageToken873572522") + * .setPageSize(883849137) + * .build(); + * while (true) { + * ListBucketsResponse response = configClient.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
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * GetBucketRequest request = + * GetBucketRequest.newBuilder() + * .setName( + * LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]") + * .toString()) + * .build(); + * LogBucket response = configClient.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 log bucket. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * GetBucketRequest request = + * GetBucketRequest.newBuilder() + * .setName( + * LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]") + * .toString()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = configClient.getBucketCallable().futureCall(request); + * // Do something. + * LogBucket response = future.get(); + * } + * }
After a bucket has been created, the bucket's location cannot be changed. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * CreateBucketRequest request = + * CreateBucketRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setBucketId("bucketId-1603305307") + * .setBucket(LogBucket.newBuilder().build()) + * .build(); + * LogBucket response = configClient.createBucketAsyncAsync(request).get(); + * } + * }+ * + * @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 OperationFuture
After a bucket has been created, the bucket's location cannot be changed. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * CreateBucketRequest request = + * CreateBucketRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setBucketId("bucketId-1603305307") + * .setBucket(LogBucket.newBuilder().build()) + * .build(); + * OperationFuture+ */ + public final OperationCallablefuture = + * configClient.createBucketAsyncOperationCallable().futureCall(request); + * // Do something. + * LogBucket response = future.get(); + * } + * }
After a bucket has been created, the bucket's location cannot be changed. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * CreateBucketRequest request = + * CreateBucketRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setBucketId("bucketId-1603305307") + * .setBucket(LogBucket.newBuilder().build()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = configClient.createBucketAsyncCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
If the bucket has a `lifecycle_state` of `DELETE_REQUESTED`, then `FAILED_PRECONDITION` will + * be returned. + * + *
After a bucket has been created, the bucket's location cannot be changed. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * UpdateBucketRequest request = + * UpdateBucketRequest.newBuilder() + * .setName( + * LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]") + * .toString()) + * .setBucket(LogBucket.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * LogBucket response = configClient.updateBucketAsyncAsync(request).get(); + * } + * }+ * + * @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 OperationFuture
If the bucket has a `lifecycle_state` of `DELETE_REQUESTED`, then `FAILED_PRECONDITION` will + * be returned. + * + *
After a bucket has been created, the bucket's location cannot be changed. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * UpdateBucketRequest request = + * UpdateBucketRequest.newBuilder() + * .setName( + * LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]") + * .toString()) + * .setBucket(LogBucket.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * OperationFuture+ */ + public final OperationCallablefuture = + * configClient.updateBucketAsyncOperationCallable().futureCall(request); + * // Do something. + * LogBucket response = future.get(); + * } + * }
If the bucket has a `lifecycle_state` of `DELETE_REQUESTED`, then `FAILED_PRECONDITION` will + * be returned. + * + *
After a bucket has been created, the bucket's location cannot be changed. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * UpdateBucketRequest request = + * UpdateBucketRequest.newBuilder() + * .setName( + * LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]") + * .toString()) + * .setBucket(LogBucket.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = configClient.updateBucketAsyncCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * CreateBucketRequest request = + * CreateBucketRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setBucketId("bucketId-1603305307") + * .setBucket(LogBucket.newBuilder().build()) + * .build(); + * LogBucket response = configClient.createBucket(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 createBucket(CreateBucketRequest request) { + return createBucketCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a log bucket that can be used to store log entries. After a bucket has been created, + * the bucket's location cannot be changed. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * CreateBucketRequest request = + * CreateBucketRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setBucketId("bucketId-1603305307") + * .setBucket(LogBucket.newBuilder().build()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = configClient.createBucketCallable().futureCall(request); + * // Do something. + * LogBucket response = future.get(); + * } + * }
If the bucket has a `lifecycle_state` of `DELETE_REQUESTED`, then `FAILED_PRECONDITION` will + * be returned. + * + *
After a bucket has been created, the bucket's location cannot be changed. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * UpdateBucketRequest request = + * UpdateBucketRequest.newBuilder() + * .setName( + * LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]") + * .toString()) + * .setBucket(LogBucket.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * LogBucket response = configClient.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 log bucket. + * + *
If the bucket has a `lifecycle_state` of `DELETE_REQUESTED`, then `FAILED_PRECONDITION` will + * be returned. + * + *
After a bucket has been created, the bucket's location cannot be changed. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * UpdateBucketRequest request = + * UpdateBucketRequest.newBuilder() + * .setName( + * LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]") + * .toString()) + * .setBucket(LogBucket.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = configClient.updateBucketCallable().futureCall(request); + * // Do something. + * LogBucket response = future.get(); + * } + * }
Changes the bucket's `lifecycle_state` to the `DELETE_REQUESTED` state. After 7 days, the + * bucket will be purged and all log entries in the bucket will be permanently deleted. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * DeleteBucketRequest request = + * DeleteBucketRequest.newBuilder() + * .setName( + * LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]") + * .toString()) + * .build(); + * configClient.deleteBucket(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 deleteBucket(DeleteBucketRequest request) { + deleteBucketCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a log bucket. + * + *
Changes the bucket's `lifecycle_state` to the `DELETE_REQUESTED` state. After 7 days, the + * bucket will be purged and all log entries in the bucket will be permanently deleted. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * DeleteBucketRequest request = + * DeleteBucketRequest.newBuilder() + * .setName( + * LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]") + * .toString()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = configClient.deleteBucketCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * UndeleteBucketRequest request = + * UndeleteBucketRequest.newBuilder() + * .setName( + * LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]") + * .toString()) + * .build(); + * configClient.undeleteBucket(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 undeleteBucket(UndeleteBucketRequest request) { + undeleteBucketCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Undeletes a log bucket. A bucket that has been deleted can be undeleted within the grace period + * of 7 days. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * UndeleteBucketRequest request = + * UndeleteBucketRequest.newBuilder() + * .setName( + * LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]") + * .toString()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = configClient.undeleteBucketCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * String parent = "parent-995424086"; + * for (LogView element : configClient.listViews(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. The bucket whose views are to be listed: + *
"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListViewsPagedResponse listViews(String parent) { + ListViewsRequest request = ListViewsRequest.newBuilder().setParent(parent).build(); + return listViews(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists views on a log bucket. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * ListViewsRequest request = + * ListViewsRequest.newBuilder() + * .setParent("parent-995424086") + * .setPageToken("pageToken873572522") + * .setPageSize(883849137) + * .build(); + * for (LogView element : configClient.listViews(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 ListViewsPagedResponse listViews(ListViewsRequest request) { + return listViewsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists views on a log bucket. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * ListViewsRequest request = + * ListViewsRequest.newBuilder() + * .setParent("parent-995424086") + * .setPageToken("pageToken873572522") + * .setPageSize(883849137) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = configClient.listViewsPagedCallable().futureCall(request); + * // Do something. + * for (LogView element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * ListViewsRequest request = + * ListViewsRequest.newBuilder() + * .setParent("parent-995424086") + * .setPageToken("pageToken873572522") + * .setPageSize(883849137) + * .build(); + * while (true) { + * ListViewsResponse response = configClient.listViewsCallable().call(request); + * for (LogView element : response.getViewsList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }+ */ + public final UnaryCallable
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * GetViewRequest request = + * GetViewRequest.newBuilder() + * .setName( + * LogViewName.ofProjectLocationBucketViewName( + * "[PROJECT]", "[LOCATION]", "[BUCKET]", "[VIEW]") + * .toString()) + * .build(); + * LogView response = configClient.getView(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 LogView getView(GetViewRequest request) { + return getViewCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a view on a log bucket.. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * GetViewRequest request = + * GetViewRequest.newBuilder() + * .setName( + * LogViewName.ofProjectLocationBucketViewName( + * "[PROJECT]", "[LOCATION]", "[BUCKET]", "[VIEW]") + * .toString()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = configClient.getViewCallable().futureCall(request); + * // Do something. + * LogView response = future.get(); + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * CreateViewRequest request = + * CreateViewRequest.newBuilder() + * .setParent("parent-995424086") + * .setViewId("viewId-816632160") + * .setView(LogView.newBuilder().build()) + * .build(); + * LogView response = configClient.createView(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 LogView createView(CreateViewRequest request) { + return createViewCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a view over log entries in a log bucket. A bucket may contain a maximum of 30 views. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * CreateViewRequest request = + * CreateViewRequest.newBuilder() + * .setParent("parent-995424086") + * .setViewId("viewId-816632160") + * .setView(LogView.newBuilder().build()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = configClient.createViewCallable().futureCall(request); + * // Do something. + * LogView response = future.get(); + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * UpdateViewRequest request = + * UpdateViewRequest.newBuilder() + * .setName("name3373707") + * .setView(LogView.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * LogView response = configClient.updateView(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 LogView updateView(UpdateViewRequest request) { + return updateViewCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a view on a log bucket. This method replaces the following fields in the existing view + * with values from the new view: `filter`. If an `UNAVAILABLE` error is returned, this indicates + * that system is not in a state where it can update the view. If this occurs, please try again in + * a few minutes. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * UpdateViewRequest request = + * UpdateViewRequest.newBuilder() + * .setName("name3373707") + * .setView(LogView.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = configClient.updateViewCallable().futureCall(request); + * // Do something. + * LogView response = future.get(); + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * DeleteViewRequest request = + * DeleteViewRequest.newBuilder() + * .setName( + * LogViewName.ofProjectLocationBucketViewName( + * "[PROJECT]", "[LOCATION]", "[BUCKET]", "[VIEW]") + * .toString()) + * .build(); + * configClient.deleteView(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 deleteView(DeleteViewRequest request) { + deleteViewCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a view on a log bucket. If an `UNAVAILABLE` error is returned, this indicates that + * system is not in a state where it can delete the view. If this occurs, please try again in a + * few minutes. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * DeleteViewRequest request = + * DeleteViewRequest.newBuilder() + * .setName( + * LogViewName.ofProjectLocationBucketViewName( + * "[PROJECT]", "[LOCATION]", "[BUCKET]", "[VIEW]") + * .toString()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = configClient.deleteViewCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]"); + * for (LogSink element : configClient.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: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * FolderName parent = FolderName.of("[FOLDER]"); + * for (LogSink element : configClient.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: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + * for (LogSink element : configClient.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: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * ProjectName parent = ProjectName.of("[PROJECT]"); + * for (LogSink element : configClient.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: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * String parent = ProjectName.of("[PROJECT]").toString(); + * for (LogSink element : configClient.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(String parent) { + ListSinksRequest request = ListSinksRequest.newBuilder().setParent(parent).build(); + return listSinks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists sinks. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * ListSinksRequest request = + * ListSinksRequest.newBuilder() + * .setParent(ProjectName.of("[PROJECT]").toString()) + * .setPageToken("pageToken873572522") + * .setPageSize(883849137) + * .build(); + * for (LogSink element : configClient.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: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * ListSinksRequest request = + * ListSinksRequest.newBuilder() + * .setParent(ProjectName.of("[PROJECT]").toString()) + * .setPageToken("pageToken873572522") + * .setPageSize(883849137) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = configClient.listSinksPagedCallable().futureCall(request); + * // Do something. + * for (LogSink element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * ListSinksRequest request = + * ListSinksRequest.newBuilder() + * .setParent(ProjectName.of("[PROJECT]").toString()) + * .setPageToken("pageToken873572522") + * .setPageSize(883849137) + * .build(); + * while (true) { + * ListSinksResponse response = configClient.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
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]"); + * LogSink response = configClient.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]" + *
For example: + *
`"projects/my-project/sinks/my-sink"` + * @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: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * String sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString(); + * LogSink response = configClient.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]" + *
For example: + *
`"projects/my-project/sinks/my-sink"` + * @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: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * GetSinkRequest request = + * GetSinkRequest.newBuilder() + * .setSinkName(LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString()) + * .build(); + * LogSink response = configClient.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: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * GetSinkRequest request = + * GetSinkRequest.newBuilder() + * .setSinkName(LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = configClient.getSinkCallable().futureCall(request); + * // Do something. + * LogSink response = future.get(); + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]"); + * LogSink sink = LogSink.newBuilder().build(); + * LogSink response = configClient.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]" + *
For examples: + *
`"projects/my-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: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * FolderName parent = FolderName.of("[FOLDER]"); + * LogSink sink = LogSink.newBuilder().build(); + * LogSink response = configClient.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]" + *
For examples: + *
`"projects/my-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: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + * LogSink sink = LogSink.newBuilder().build(); + * LogSink response = configClient.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]" + *
For examples: + *
`"projects/my-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: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * ProjectName parent = ProjectName.of("[PROJECT]"); + * LogSink sink = LogSink.newBuilder().build(); + * LogSink response = configClient.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]" + *
For examples: + *
`"projects/my-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: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * String parent = ProjectName.of("[PROJECT]").toString(); + * LogSink sink = LogSink.newBuilder().build(); + * LogSink response = configClient.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]" + *
For examples: + *
`"projects/my-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: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * CreateSinkRequest request = + * CreateSinkRequest.newBuilder() + * .setParent(ProjectName.of("[PROJECT]").toString()) + * .setSink(LogSink.newBuilder().build()) + * .setUniqueWriterIdentity(true) + * .build(); + * LogSink response = configClient.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: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * CreateSinkRequest request = + * CreateSinkRequest.newBuilder() + * .setParent(ProjectName.of("[PROJECT]").toString()) + * .setSink(LogSink.newBuilder().build()) + * .setUniqueWriterIdentity(true) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = configClient.createSinkCallable().futureCall(request); + * // Do something. + * LogSink response = future.get(); + * } + * }
The updated sink might also have a new `writer_identity`; see the `unique_writer_identity` + * field. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]"); + * LogSink sink = LogSink.newBuilder().build(); + * LogSink response = configClient.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]" + *
For example: + *
`"projects/my-project/sinks/my-sink"` + * @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: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * String sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString(); + * LogSink sink = LogSink.newBuilder().build(); + * LogSink response = configClient.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]" + *
For example: + *
`"projects/my-project/sinks/my-sink"` + * @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: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]"); + * LogSink sink = LogSink.newBuilder().build(); + * FieldMask updateMask = FieldMask.newBuilder().build(); + * LogSink response = configClient.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]" + *
For example: + *
`"projects/my-project/sinks/my-sink"` + * @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 + *
For 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: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * String sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString(); + * LogSink sink = LogSink.newBuilder().build(); + * FieldMask updateMask = FieldMask.newBuilder().build(); + * LogSink response = configClient.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]" + *
For example: + *
`"projects/my-project/sinks/my-sink"` + * @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 + *
For 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: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * UpdateSinkRequest request = + * UpdateSinkRequest.newBuilder() + * .setSinkName(LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString()) + * .setSink(LogSink.newBuilder().build()) + * .setUniqueWriterIdentity(true) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * LogSink response = configClient.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: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * UpdateSinkRequest request = + * UpdateSinkRequest.newBuilder() + * .setSinkName(LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString()) + * .setSink(LogSink.newBuilder().build()) + * .setUniqueWriterIdentity(true) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = configClient.updateSinkCallable().futureCall(request); + * // Do something. + * LogSink response = future.get(); + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]"); + * configClient.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]" + *
For example: + *
`"projects/my-project/sinks/my-sink"` + * @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: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * String sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString(); + * configClient.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]" + *
For example: + *
`"projects/my-project/sinks/my-sink"` + * @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: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * DeleteSinkRequest request = + * DeleteSinkRequest.newBuilder() + * .setSinkName(LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString()) + * .build(); + * configClient.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: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * DeleteSinkRequest request = + * DeleteSinkRequest.newBuilder() + * .setSinkName(LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = configClient.deleteSinkCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * LogBucketName parent = + * LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]"); + * Link link = Link.newBuilder().build(); + * String linkId = "linkId-1102667083"; + * Link response = configClient.createLinkAsync(parent, link, linkId).get(); + * } + * }+ * + * @param parent Required. The full resource name of the bucket to create a link for. + *
"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]" + * @param link Required. The new link. + * @param linkId Required. The ID to use for the link. The link_id can have up to 100 characters. + * A valid link_id must only have alphanumeric characters and underscores within it. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createLinkAsync( + LogBucketName parent, Link link, String linkId) { + CreateLinkRequest request = + CreateLinkRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setLink(link) + .setLinkId(linkId) + .build(); + return createLinkAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Asynchronously creates a linked dataset in BigQuery which makes it possible to use BigQuery to + * read the logs stored in the log bucket. A log bucket may currently only contain one link. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * String parent = + * LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]") + * .toString(); + * Link link = Link.newBuilder().build(); + * String linkId = "linkId-1102667083"; + * Link response = configClient.createLinkAsync(parent, link, linkId).get(); + * } + * }+ * + * @param parent Required. The full resource name of the bucket to create a link for. + *
"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]" + * @param link Required. The new link. + * @param linkId Required. The ID to use for the link. The link_id can have up to 100 characters. + * A valid link_id must only have alphanumeric characters and underscores within it. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createLinkAsync( + String parent, Link link, String linkId) { + CreateLinkRequest request = + CreateLinkRequest.newBuilder().setParent(parent).setLink(link).setLinkId(linkId).build(); + return createLinkAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Asynchronously creates a linked dataset in BigQuery which makes it possible to use BigQuery to + * read the logs stored in the log bucket. A log bucket may currently only contain one link. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * CreateLinkRequest request = + * CreateLinkRequest.newBuilder() + * .setParent( + * LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]") + * .toString()) + * .setLink(Link.newBuilder().build()) + * .setLinkId("linkId-1102667083") + * .build(); + * Link response = configClient.createLinkAsync(request).get(); + * } + * }+ * + * @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 OperationFuture createLinkAsync(CreateLinkRequest request) { + return createLinkOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Asynchronously creates a linked dataset in BigQuery which makes it possible to use BigQuery to + * read the logs stored in the log bucket. A log bucket may currently only contain one link. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * CreateLinkRequest request = + * CreateLinkRequest.newBuilder() + * .setParent( + * LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]") + * .toString()) + * .setLink(Link.newBuilder().build()) + * .setLinkId("linkId-1102667083") + * .build(); + * OperationFuture future = + * configClient.createLinkOperationCallable().futureCall(request); + * // Do something. + * Link response = future.get(); + * } + * }+ */ + public final OperationCallable
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * CreateLinkRequest request = + * CreateLinkRequest.newBuilder() + * .setParent( + * LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]") + * .toString()) + * .setLink(Link.newBuilder().build()) + * .setLinkId("linkId-1102667083") + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = configClient.createLinkCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ConfigClient configClient = ConfigClient.create()) { + * LinkName name = + * LinkName.ofProjectLocationBucketLinkName("[PROJECT]", "[LOCATION]", "[BUCKET]", "[LINK]"); + * configClient.deleteLinkAsync(name).get(); + * } + * }+ * + * @param name Required. The full resource name of the link to delete. + *
"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+ * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+ * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+ * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture Sample code:
+ *
+ * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+ * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+ * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+ * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/"
+ * "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]/
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListLinksPagedResponse listLinks(LogBucketName parent) {
+ ListLinksRequest request =
+ ListLinksRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build();
+ return listLinks(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists links.
+ *
+ * Sample code:
+ *
+ * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/"
+ * "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]/
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListLinksPagedResponse listLinks(String parent) {
+ ListLinksRequest request = ListLinksRequest.newBuilder().setParent(parent).build();
+ return listLinks(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists links.
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+ * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+ * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+ * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Link getLink(LinkName name) {
+ GetLinkRequest request =
+ GetLinkRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return getLink(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets a link.
+ *
+ * Sample code:
+ *
+ * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+ * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+ * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+ * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Link getLink(String name) {
+ GetLinkRequest request = GetLinkRequest.newBuilder().setName(name).build();
+ return getLink(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets a link.
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * "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 on the _Default sink in a parent resource.
+ *
+ * Sample code:
+ *
+ * "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 on the _Default sink in a parent resource.
+ *
+ * Sample code:
+ *
+ * "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 on the _Default sink in a parent resource.
+ *
+ * Sample code:
+ *
+ * "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 on the _Default sink in a parent resource.
+ *
+ * Sample code:
+ *
+ * "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 on the _Default sink in a parent resource.
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * "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]"
+ * For example:
+ * `"projects/my-project/exclusions/my-exclusion"`
+ * @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 in the _Default sink.
+ *
+ * Sample code:
+ *
+ * "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]"
+ * For example:
+ * `"projects/my-project/exclusions/my-exclusion"`
+ * @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 in the _Default sink.
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
+ * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
+ * For 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 the _Default sink 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:
+ *
+ * "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
+ * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
+ * For 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 the _Default sink 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:
+ *
+ * "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
+ * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
+ * For 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 the _Default sink 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:
+ *
+ * "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
+ * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
+ * For 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 the _Default sink 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:
+ *
+ * "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
+ * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
+ * For 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 the _Default sink 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:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * "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]"
+ * For example:
+ * `"projects/my-project/exclusions/my-exclusion"`
+ * @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 in the _Default sink.
+ *
+ * Sample code:
+ *
+ * "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]"
+ * For example:
+ * `"projects/my-project/exclusions/my-exclusion"`
+ * @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 in the _Default sink.
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * "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]"
+ * For example:
+ * `"projects/my-project/exclusions/my-exclusion"`
+ * @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 in the _Default sink.
+ *
+ * Sample code:
+ *
+ * "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]"
+ * For example:
+ * `"projects/my-project/exclusions/my-exclusion"`
+ * @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 in the _Default sink.
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Note: CMEK for the Log Router can be configured for Google Cloud projects, folders,
+ * organizations and billing accounts. Once configured for an organization, it applies to all
+ * projects and folders in the Google Cloud organization.
+ *
+ * See [Enabling CMEK for Log
+ * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.
+ *
+ * Sample code:
+ *
+ * Note: CMEK for the Log Router can be configured for Google Cloud projects, folders,
+ * organizations and billing accounts. Once configured for an organization, it applies to all
+ * projects and folders in the Google Cloud organization.
+ *
+ * See [Enabling CMEK for Log
+ * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.
+ *
+ * Sample code:
+ *
+ * Note: CMEK for the Log Router can currently only be configured for Google Cloud
+ * organizations. Once configured, it applies to all projects and folders in the Google Cloud
+ * 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 Log
+ * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.
+ *
+ * Sample code:
+ *
+ * Note: CMEK for the Log Router can currently only be configured for Google Cloud
+ * organizations. Once configured, it applies to all projects and folders in the Google Cloud
+ * 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 Log
+ * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.
+ *
+ * Sample code:
+ *
+ * Note: Settings for the Log Router can be get for Google Cloud projects, folders,
+ * organizations and billing accounts. Currently it can only be configured for organizations. Once
+ * configured for an organization, it applies to all projects and folders in the Google Cloud
+ * organization.
+ *
+ * See [Enabling CMEK for Log
+ * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.
+ *
+ * Sample code:
+ *
+ * "projects/[PROJECT_ID]/settings" "organizations/[ORGANIZATION_ID]/settings"
+ * "billingAccounts/[BILLING_ACCOUNT_ID]/settings" "folders/[FOLDER_ID]/settings"
+ * For example:
+ * `"organizations/12345/settings"`
+ * Note: Settings for the Log Router can be get for Google Cloud projects, folders,
+ * organizations and billing accounts. Currently it can only be configured for organizations.
+ * Once configured for an organization, it applies to all projects and folders in the Google
+ * Cloud organization.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Settings getSettings(SettingsName name) {
+ GetSettingsRequest request =
+ GetSettingsRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return getSettings(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets the Log Router settings for the given resource.
+ *
+ * Note: Settings for the Log Router can be get for Google Cloud projects, folders,
+ * organizations and billing accounts. Currently it can only be configured for organizations. Once
+ * configured for an organization, it applies to all projects and folders in the Google Cloud
+ * organization.
+ *
+ * See [Enabling CMEK for Log
+ * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.
+ *
+ * Sample code:
+ *
+ * "projects/[PROJECT_ID]/settings" "organizations/[ORGANIZATION_ID]/settings"
+ * "billingAccounts/[BILLING_ACCOUNT_ID]/settings" "folders/[FOLDER_ID]/settings"
+ * For example:
+ * `"organizations/12345/settings"`
+ * Note: Settings for the Log Router can be get for Google Cloud projects, folders,
+ * organizations and billing accounts. Currently it can only be configured for organizations.
+ * Once configured for an organization, it applies to all projects and folders in the Google
+ * Cloud organization.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Settings getSettings(String name) {
+ GetSettingsRequest request = GetSettingsRequest.newBuilder().setName(name).build();
+ return getSettings(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets the Log Router settings for the given resource.
+ *
+ * Note: Settings for the Log Router can be get for Google Cloud projects, folders,
+ * organizations and billing accounts. Currently it can only be configured for organizations. Once
+ * configured for an organization, it applies to all projects and folders in the Google Cloud
+ * organization.
+ *
+ * See [Enabling CMEK for Log
+ * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.
+ *
+ * Sample code:
+ *
+ * Note: Settings for the Log Router can be get for Google Cloud projects, folders,
+ * organizations and billing accounts. Currently it can only be configured for organizations. Once
+ * configured for an organization, it applies to all projects and folders in the Google Cloud
+ * organization.
+ *
+ * See [Enabling CMEK for Log
+ * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.
+ *
+ * Sample code:
+ *
+ * Note: Settings for the Log Router can currently only be configured for Google Cloud
+ * organizations. Once configured, it applies to all projects and folders in the Google Cloud
+ * organization.
+ *
+ * [UpdateSettings][google.logging.v2.ConfigServiceV2.UpdateSettings] 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. 4) `location_id` is not supported by Logging. 5) `location_id` violate OrgPolicy.
+ *
+ * See [Enabling CMEK for Log
+ * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.
+ *
+ * Sample code:
+ *
+ * See [Enabling CMEK for Log
+ * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more
+ * information.
+ * @param updateMask Optional. Field mask identifying which fields from `settings` should be
+ * updated. A field will be overwritten if and only if it is in the update mask. Output only
+ * fields cannot be updated.
+ * See [FieldMask][google.protobuf.FieldMask] for more information.
+ * For example: `"updateMask=kmsKeyName"`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Settings updateSettings(Settings settings, FieldMask updateMask) {
+ UpdateSettingsRequest request =
+ UpdateSettingsRequest.newBuilder().setSettings(settings).setUpdateMask(updateMask).build();
+ return updateSettings(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates the Log Router settings for the given resource.
+ *
+ * Note: Settings for the Log Router can currently only be configured for Google Cloud
+ * organizations. Once configured, it applies to all projects and folders in the Google Cloud
+ * organization.
+ *
+ * [UpdateSettings][google.logging.v2.ConfigServiceV2.UpdateSettings] 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. 4) `location_id` is not supported by Logging. 5) `location_id` violate OrgPolicy.
+ *
+ * See [Enabling CMEK for Log
+ * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.
+ *
+ * Sample code:
+ *
+ * Note: Settings for the Log Router can currently only be configured for Google Cloud
+ * organizations. Once configured, it applies to all projects and folders in the Google Cloud
+ * organization.
+ *
+ * [UpdateSettings][google.logging.v2.ConfigServiceV2.UpdateSettings] 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. 4) `location_id` is not supported by Logging. 5) `location_id` violate OrgPolicy.
+ *
+ * See [Enabling CMEK for Log
+ * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * The default instance has everything set to sensible defaults:
+ *
+ * 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 getBucket to 30 seconds:
+ *
+ * Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction 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:
+ *
+ * Note: close() needs to be called on the LoggingClient object to clean up resources such as
+ * threads. In the example above, try-with-resources is used, which automatically calls close().
+ *
+ * DeleteLog Deletes all the log entries in a log for the _Default Log Bucket. 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. Request object method variants only take one parameter, a request object, which must be constructed before the call. deleteLog(DeleteLogRequest request)
+ * "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. deleteLog(LogName logName)
+ * deleteLog(String logName)
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. deleteLogCallable()
+ * WriteLogEntries 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) Request object method variants only take one parameter, a request object, which must be constructed before the call. writeLogEntries(WriteLogEntriesRequest request)
+ * "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. writeLogEntries(LogName logName, MonitoredResource resource, Map<String, String> labels, List<LogEntry> entries)
+ * writeLogEntries(String logName, MonitoredResource resource, Map<String, String> labels, List<LogEntry> entries)
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. writeLogEntriesCallable()
+ * ListLogEntries 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](https://cloud.google.com/logging/docs/export). Request object method variants only take one parameter, a request object, which must be constructed before the call. listLogEntries(ListLogEntriesRequest request)
+ * "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. listLogEntries(List<String> resourceNames, String filter, String orderBy)
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. listLogEntriesPagedCallable()
+ * listLogEntriesCallable()
+ * ListMonitoredResourceDescriptors Lists the descriptors for monitored resource types used by Logging. Request object method variants only take one parameter, a request object, which must be constructed before the call. listMonitoredResourceDescriptors(ListMonitoredResourceDescriptorsRequest request)
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. listMonitoredResourceDescriptorsPagedCallable()
+ * listMonitoredResourceDescriptorsCallable()
+ * ListLogs Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed. Request object method variants only take one parameter, a request object, which must be constructed before the call. listLogs(ListLogsRequest request)
+ * "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. listLogs(BillingAccountName parent)
+ * listLogs(FolderName parent)
+ * listLogs(OrganizationName parent)
+ * listLogs(ProjectName parent)
+ * listLogs(String parent)
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. listLogsPagedCallable()
+ * listLogsCallable()
+ * TailLogEntries Streaming read of log entries as they are ingested. Until the stream is terminated, it will continue reading logs. Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. tailLogEntriesCallable()
+ * 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 LoggingSettings to create().
+ * For example:
+ *
+ * To customize credentials:
+ *
+ * To customize the endpoint:
+ *
+ * Please refer to the GitHub repository's samples for more quickstart code snippets.
+ */
+@Generated("by gapic-generator-java")
+public class LoggingClient implements BackgroundResource {
+ private final LoggingSettings settings;
+ private final LoggingServiceV2Stub stub;
+
+ /** Constructs an instance of LoggingClient with default settings. */
+ public static final LoggingClient create() throws IOException {
+ return create(LoggingSettings.newBuilder().build());
+ }
+
+ /**
+ * Constructs an instance of LoggingClient, 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 LoggingClient create(LoggingSettings settings) throws IOException {
+ return new LoggingClient(settings);
+ }
+
+ /**
+ * Constructs an instance of LoggingClient, using the given stub for making calls. This is for
+ * advanced usage - prefer using create(LoggingSettings).
+ */
+ public static final LoggingClient create(LoggingServiceV2Stub stub) {
+ return new LoggingClient(stub);
+ }
+
+ /**
+ * Constructs an instance of LoggingClient, 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 LoggingClient(LoggingSettings settings) throws IOException {
+ this.settings = settings;
+ this.stub = ((LoggingServiceV2StubSettings) settings.getStubSettings()).createStub();
+ }
+
+ protected LoggingClient(LoggingServiceV2Stub stub) {
+ this.settings = null;
+ this.stub = stub;
+ }
+
+ public final LoggingSettings getSettings() {
+ return settings;
+ }
+
+ public LoggingServiceV2Stub getStub() {
+ return stub;
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes all the log entries in a log for the _Default Log Bucket. 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:
+ *
+ * `[LOG_ID]` must be URL-encoded. For example, `"projects/my-project-id/logs/syslog"`,
+ * `"organizations/123/logs/cloudaudit.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 for the _Default Log Bucket. 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:
+ *
+ * `[LOG_ID]` must be URL-encoded. For example, `"projects/my-project-id/logs/syslog"`,
+ * `"organizations/123/logs/cloudaudit.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 for the _Default Log Bucket. 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:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * `[LOG_ID]` must be URL-encoded. For example:
+ * "projects/my-project-id/logs/syslog"
+ * "organizations/123/logs/cloudaudit.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](https://cloud.google.com/logging/quotas) 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](https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
+ * To improve throughput and to avoid exceeding the [quota
+ * limit](https://cloud.google.com/logging/quotas) 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 Sample code:
+ *
+ * `[LOG_ID]` must be URL-encoded. For example:
+ * "projects/my-project-id/logs/syslog"
+ * "organizations/123/logs/cloudaudit.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](https://cloud.google.com/logging/quotas) 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](https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
+ * To improve throughput and to avoid exceeding the [quota
+ * limit](https://cloud.google.com/logging/quotas) 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 Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * May alternatively be one or more views:
+ * *
+ * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` *
+ * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+ * *
+ * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+ * * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+ * Projects listed in the `project_ids` field are added to this list. A maximum of 100
+ * resources may be specified in a single request.
+ * @param filter Optional. 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 a filter is 20,000 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 Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * String name =
+ * LinkName.ofProjectLocationBucketLinkName("[PROJECT]", "[LOCATION]", "[BUCKET]", "[LINK]")
+ * .toString();
+ * configClient.deleteLinkAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. The full resource name of the link to delete.
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * DeleteLinkRequest request =
+ * DeleteLinkRequest.newBuilder()
+ * .setName(
+ * LinkName.ofProjectLocationBucketLinkName(
+ * "[PROJECT]", "[LOCATION]", "[BUCKET]", "[LINK]")
+ * .toString())
+ * .build();
+ * configClient.deleteLinkAsync(request).get();
+ * }
+ * }
+ *
+ * @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 OperationFuture{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * DeleteLinkRequest request =
+ * DeleteLinkRequest.newBuilder()
+ * .setName(
+ * LinkName.ofProjectLocationBucketLinkName(
+ * "[PROJECT]", "[LOCATION]", "[BUCKET]", "[LINK]")
+ * .toString())
+ * .build();
+ * OperationFuture
+ */
+ public final OperationCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * DeleteLinkRequest request =
+ * DeleteLinkRequest.newBuilder()
+ * .setName(
+ * LinkName.ofProjectLocationBucketLinkName(
+ * "[PROJECT]", "[LOCATION]", "[BUCKET]", "[LINK]")
+ * .toString())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * LogBucketName parent =
+ * LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]");
+ * for (Link element : configClient.listLinks(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The parent resource whose links are to be listed:
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * String parent =
+ * LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]")
+ * .toString();
+ * for (Link element : configClient.listLinks(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The parent resource whose links are to be listed:
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * ListLinksRequest request =
+ * ListLinksRequest.newBuilder()
+ * .setParent(
+ * LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]")
+ * .toString())
+ * .setPageToken("pageToken873572522")
+ * .setPageSize(883849137)
+ * .build();
+ * for (Link element : configClient.listLinks(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 ListLinksPagedResponse listLinks(ListLinksRequest request) {
+ return listLinksPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists links.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * ListLinksRequest request =
+ * ListLinksRequest.newBuilder()
+ * .setParent(
+ * LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]")
+ * .toString())
+ * .setPageToken("pageToken873572522")
+ * .setPageSize(883849137)
+ * .build();
+ * ApiFuture future = configClient.listLinksPagedCallable().futureCall(request);
+ * // Do something.
+ * for (Link element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * ListLinksRequest request =
+ * ListLinksRequest.newBuilder()
+ * .setParent(
+ * LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]")
+ * .toString())
+ * .setPageToken("pageToken873572522")
+ * .setPageSize(883849137)
+ * .build();
+ * while (true) {
+ * ListLinksResponse response = configClient.listLinksCallable().call(request);
+ * for (Link element : response.getLinksList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * LinkName name =
+ * LinkName.ofProjectLocationBucketLinkName("[PROJECT]", "[LOCATION]", "[BUCKET]", "[LINK]");
+ * Link response = configClient.getLink(name);
+ * }
+ * }
+ *
+ * @param name Required. The resource name of the link:
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * String name =
+ * LinkName.ofProjectLocationBucketLinkName("[PROJECT]", "[LOCATION]", "[BUCKET]", "[LINK]")
+ * .toString();
+ * Link response = configClient.getLink(name);
+ * }
+ * }
+ *
+ * @param name Required. The resource name of the link:
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * GetLinkRequest request =
+ * GetLinkRequest.newBuilder()
+ * .setName(
+ * LinkName.ofProjectLocationBucketLinkName(
+ * "[PROJECT]", "[LOCATION]", "[BUCKET]", "[LINK]")
+ * .toString())
+ * .build();
+ * Link response = configClient.getLink(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 Link getLink(GetLinkRequest request) {
+ return getLinkCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets a link.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * GetLinkRequest request =
+ * GetLinkRequest.newBuilder()
+ * .setName(
+ * LinkName.ofProjectLocationBucketLinkName(
+ * "[PROJECT]", "[LOCATION]", "[BUCKET]", "[LINK]")
+ * .toString())
+ * .build();
+ * ApiFuture future = configClient.getLinkCallable().futureCall(request);
+ * // Do something.
+ * Link response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]");
+ * for (LogExclusion element : configClient.listExclusions(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The parent resource whose exclusions are to be listed.
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * FolderName parent = FolderName.of("[FOLDER]");
+ * for (LogExclusion element : configClient.listExclusions(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The parent resource whose exclusions are to be listed.
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+ * for (LogExclusion element : configClient.listExclusions(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The parent resource whose exclusions are to be listed.
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * ProjectName parent = ProjectName.of("[PROJECT]");
+ * for (LogExclusion element : configClient.listExclusions(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The parent resource whose exclusions are to be listed.
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * String parent = ProjectName.of("[PROJECT]").toString();
+ * for (LogExclusion element : configClient.listExclusions(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The parent resource whose exclusions are to be listed.
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * ListExclusionsRequest request =
+ * ListExclusionsRequest.newBuilder()
+ * .setParent(ProjectName.of("[PROJECT]").toString())
+ * .setPageToken("pageToken873572522")
+ * .setPageSize(883849137)
+ * .build();
+ * for (LogExclusion element : configClient.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 on the _Default sink in a parent resource.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * ListExclusionsRequest request =
+ * ListExclusionsRequest.newBuilder()
+ * .setParent(ProjectName.of("[PROJECT]").toString())
+ * .setPageToken("pageToken873572522")
+ * .setPageSize(883849137)
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * ListExclusionsRequest request =
+ * ListExclusionsRequest.newBuilder()
+ * .setParent(ProjectName.of("[PROJECT]").toString())
+ * .setPageToken("pageToken873572522")
+ * .setPageSize(883849137)
+ * .build();
+ * while (true) {
+ * ListExclusionsResponse response = configClient.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{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * LogExclusionName name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]");
+ * LogExclusion response = configClient.getExclusion(name);
+ * }
+ * }
+ *
+ * @param name Required. The resource name of an existing exclusion:
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * String name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString();
+ * LogExclusion response = configClient.getExclusion(name);
+ * }
+ * }
+ *
+ * @param name Required. The resource name of an existing exclusion:
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * GetExclusionRequest request =
+ * GetExclusionRequest.newBuilder()
+ * .setName(
+ * LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString())
+ * .build();
+ * LogExclusion response = configClient.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 in the _Default sink.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * GetExclusionRequest request =
+ * GetExclusionRequest.newBuilder()
+ * .setName(
+ * LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]");
+ * LogExclusion exclusion = LogExclusion.newBuilder().build();
+ * LogExclusion response = configClient.createExclusion(parent, exclusion);
+ * }
+ * }
+ *
+ * @param parent Required. The parent resource in which to create the exclusion:
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * FolderName parent = FolderName.of("[FOLDER]");
+ * LogExclusion exclusion = LogExclusion.newBuilder().build();
+ * LogExclusion response = configClient.createExclusion(parent, exclusion);
+ * }
+ * }
+ *
+ * @param parent Required. The parent resource in which to create the exclusion:
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+ * LogExclusion exclusion = LogExclusion.newBuilder().build();
+ * LogExclusion response = configClient.createExclusion(parent, exclusion);
+ * }
+ * }
+ *
+ * @param parent Required. The parent resource in which to create the exclusion:
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * ProjectName parent = ProjectName.of("[PROJECT]");
+ * LogExclusion exclusion = LogExclusion.newBuilder().build();
+ * LogExclusion response = configClient.createExclusion(parent, exclusion);
+ * }
+ * }
+ *
+ * @param parent Required. The parent resource in which to create the exclusion:
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * String parent = ProjectName.of("[PROJECT]").toString();
+ * LogExclusion exclusion = LogExclusion.newBuilder().build();
+ * LogExclusion response = configClient.createExclusion(parent, exclusion);
+ * }
+ * }
+ *
+ * @param parent Required. The parent resource in which to create the exclusion:
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * CreateExclusionRequest request =
+ * CreateExclusionRequest.newBuilder()
+ * .setParent(ProjectName.of("[PROJECT]").toString())
+ * .setExclusion(LogExclusion.newBuilder().build())
+ * .build();
+ * LogExclusion response = configClient.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 the _Default sink 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.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * CreateExclusionRequest request =
+ * CreateExclusionRequest.newBuilder()
+ * .setParent(ProjectName.of("[PROJECT]").toString())
+ * .setExclusion(LogExclusion.newBuilder().build())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * LogExclusionName name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]");
+ * LogExclusion exclusion = LogExclusion.newBuilder().build();
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * LogExclusion response = configClient.updateExclusion(name, exclusion, updateMask);
+ * }
+ * }
+ *
+ * @param name Required. The resource name of the exclusion to update:
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * String name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString();
+ * LogExclusion exclusion = LogExclusion.newBuilder().build();
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * LogExclusion response = configClient.updateExclusion(name, exclusion, updateMask);
+ * }
+ * }
+ *
+ * @param name Required. The resource name of the exclusion to update:
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * UpdateExclusionRequest request =
+ * UpdateExclusionRequest.newBuilder()
+ * .setName(
+ * LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString())
+ * .setExclusion(LogExclusion.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * LogExclusion response = configClient.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 in the _Default sink.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * UpdateExclusionRequest request =
+ * UpdateExclusionRequest.newBuilder()
+ * .setName(
+ * LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString())
+ * .setExclusion(LogExclusion.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * LogExclusionName name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]");
+ * configClient.deleteExclusion(name);
+ * }
+ * }
+ *
+ * @param name Required. The resource name of an existing exclusion to delete:
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * String name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString();
+ * configClient.deleteExclusion(name);
+ * }
+ * }
+ *
+ * @param name Required. The resource name of an existing exclusion to delete:
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * DeleteExclusionRequest request =
+ * DeleteExclusionRequest.newBuilder()
+ * .setName(
+ * LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString())
+ * .build();
+ * configClient.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 in the _Default sink.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * DeleteExclusionRequest request =
+ * DeleteExclusionRequest.newBuilder()
+ * .setName(
+ * LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * GetCmekSettingsRequest request =
+ * GetCmekSettingsRequest.newBuilder()
+ * .setName(CmekSettingsName.ofProjectName("[PROJECT]").toString())
+ * .build();
+ * CmekSettings response = configClient.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 Logging CMEK settings for the given resource.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * GetCmekSettingsRequest request =
+ * GetCmekSettingsRequest.newBuilder()
+ * .setName(CmekSettingsName.ofProjectName("[PROJECT]").toString())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * UpdateCmekSettingsRequest request =
+ * UpdateCmekSettingsRequest.newBuilder()
+ * .setName("name3373707")
+ * .setCmekSettings(CmekSettings.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * CmekSettings response = configClient.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 Log Router CMEK settings for the given resource.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * UpdateCmekSettingsRequest request =
+ * UpdateCmekSettingsRequest.newBuilder()
+ * .setName("name3373707")
+ * .setCmekSettings(CmekSettings.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * SettingsName name = SettingsName.ofProjectName("[PROJECT]");
+ * Settings response = configClient.getSettings(name);
+ * }
+ * }
+ *
+ * @param name Required. The resource for which to retrieve settings.
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * String name = SettingsName.ofProjectName("[PROJECT]").toString();
+ * Settings response = configClient.getSettings(name);
+ * }
+ * }
+ *
+ * @param name Required. The resource for which to retrieve settings.
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * GetSettingsRequest request =
+ * GetSettingsRequest.newBuilder()
+ * .setName(SettingsName.ofProjectName("[PROJECT]").toString())
+ * .build();
+ * Settings response = configClient.getSettings(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 Settings getSettings(GetSettingsRequest request) {
+ return getSettingsCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets the Log Router settings for the given resource.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * GetSettingsRequest request =
+ * GetSettingsRequest.newBuilder()
+ * .setName(SettingsName.ofProjectName("[PROJECT]").toString())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * Settings settings = Settings.newBuilder().build();
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * Settings response = configClient.updateSettings(settings, updateMask);
+ * }
+ * }
+ *
+ * @param settings Required. The settings to update.
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * UpdateSettingsRequest request =
+ * UpdateSettingsRequest.newBuilder()
+ * .setName("name3373707")
+ * .setSettings(Settings.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * Settings response = configClient.updateSettings(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 Settings updateSettings(UpdateSettingsRequest request) {
+ return updateSettingsCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates the Log Router settings for the given resource.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * UpdateSettingsRequest request =
+ * UpdateSettingsRequest.newBuilder()
+ * .setName("name3373707")
+ * .setSettings(Settings.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * CopyLogEntriesRequest request =
+ * CopyLogEntriesRequest.newBuilder()
+ * .setName("name3373707")
+ * .setFilter("filter-1274492040")
+ * .setDestination("destination-1429847026")
+ * .build();
+ * CopyLogEntriesResponse response = configClient.copyLogEntriesAsync(request).get();
+ * }
+ * }
+ *
+ * @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 OperationFuture{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * CopyLogEntriesRequest request =
+ * CopyLogEntriesRequest.newBuilder()
+ * .setName("name3373707")
+ * .setFilter("filter-1274492040")
+ * .setDestination("destination-1429847026")
+ * .build();
+ * OperationFuture
+ */
+ public final OperationCallable<
+ CopyLogEntriesRequest, CopyLogEntriesResponse, CopyLogEntriesMetadata>
+ copyLogEntriesOperationCallable() {
+ return stub.copyLogEntriesOperationCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Copies a set of log entries from a log bucket to a Cloud Storage bucket.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * CopyLogEntriesRequest request =
+ * CopyLogEntriesRequest.newBuilder()
+ * .setName("name3373707")
+ * .setFilter("filter-1274492040")
+ * .setDestination("destination-1429847026")
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable
+ *
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * ConfigSettings.Builder configSettingsBuilder = ConfigSettings.newBuilder();
+ * configSettingsBuilder
+ * .getBucketSettings()
+ * .setRetrySettings(
+ * configSettingsBuilder
+ * .getBucketSettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30))
+ * .build());
+ * ConfigSettings configSettings = configSettingsBuilder.build();
+ * }
+ */
+@Generated("by gapic-generator-java")
+public class ConfigSettings extends ClientSettings{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (LoggingClient loggingClient = LoggingClient.create()) {
+ * LogName logName = LogName.ofProjectLogName("[PROJECT]", "[LOG]");
+ * loggingClient.deleteLog(logName);
+ * }
+ * }
+ *
+ *
+ *
+ *
+ *
+ *
+ * Method
+ * Description
+ * Method Variants
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * LoggingSettings loggingSettings =
+ * LoggingSettings.newBuilder()
+ * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ * .build();
+ * LoggingClient loggingClient = LoggingClient.create(loggingSettings);
+ * }
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * LoggingSettings loggingSettings = LoggingSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * LoggingClient loggingClient = LoggingClient.create(loggingSettings);
+ * }
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (LoggingClient loggingClient = LoggingClient.create()) {
+ * LogName logName = LogName.ofProjectLogName("[PROJECT]", "[LOG]");
+ * loggingClient.deleteLog(logName);
+ * }
+ * }
+ *
+ * @param logName Required. The resource name of the log to delete:
+ *
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (LoggingClient loggingClient = LoggingClient.create()) {
+ * String logName = LogName.ofProjectLogName("[PROJECT]", "[LOG]").toString();
+ * loggingClient.deleteLog(logName);
+ * }
+ * }
+ *
+ * @param logName Required. The resource name of the log to delete:
+ *
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (LoggingClient loggingClient = LoggingClient.create()) {
+ * DeleteLogRequest request =
+ * DeleteLogRequest.newBuilder()
+ * .setLogName(LogName.ofProjectLogName("[PROJECT]", "[LOG]").toString())
+ * .build();
+ * loggingClient.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 for the _Default Log Bucket. 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.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (LoggingClient loggingClient = LoggingClient.create()) {
+ * DeleteLogRequest request =
+ * DeleteLogRequest.newBuilder()
+ * .setLogName(LogName.ofProjectLogName("[PROJECT]", "[LOG]").toString())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (LoggingClient loggingClient = LoggingClient.create()) {
+ * LogName logName = LogName.ofProjectLogName("[PROJECT]", "[LOG]");
+ * MonitoredResource resource = MonitoredResource.newBuilder().build();
+ * Map
+ *
+ * @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`:
+ *
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (LoggingClient loggingClient = LoggingClient.create()) {
+ * String logName = LogName.ofProjectLogName("[PROJECT]", "[LOG]").toString();
+ * MonitoredResource resource = MonitoredResource.newBuilder().build();
+ * Map
+ *
+ * @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`:
+ *
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (LoggingClient loggingClient = LoggingClient.create()) {
+ * WriteLogEntriesRequest request =
+ * WriteLogEntriesRequest.newBuilder()
+ * .setLogName(LogName.ofProjectLogName("[PROJECT]", "[LOG]").toString())
+ * .setResource(MonitoredResource.newBuilder().build())
+ * .putAllLabels(new HashMap
+ *
+ * @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)
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (LoggingClient loggingClient = LoggingClient.create()) {
+ * WriteLogEntriesRequest request =
+ * WriteLogEntriesRequest.newBuilder()
+ * .setLogName(LogName.ofProjectLogName("[PROJECT]", "[LOG]").toString())
+ * .setResource(MonitoredResource.newBuilder().build())
+ * .putAllLabels(new HashMap
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (LoggingClient loggingClient = LoggingClient.create()) {
+ * List
+ *
+ * @param resourceNames Required. Names of one or more parent resources from which to retrieve log
+ * entries:
+ *
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (LoggingClient loggingClient = LoggingClient.create()) {
+ * ListLogEntriesRequest request =
+ * ListLogEntriesRequest.newBuilder()
+ * .addAllResourceNames(new ArrayList
+ *
+ * @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](https://cloud.google.com/logging/docs/export).
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (LoggingClient loggingClient = LoggingClient.create()) {
+ * ListLogEntriesRequest request =
+ * ListLogEntriesRequest.newBuilder()
+ * .addAllResourceNames(new ArrayList
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (LoggingClient loggingClient = LoggingClient.create()) {
+ * ListLogEntriesRequest request =
+ * ListLogEntriesRequest.newBuilder()
+ * .addAllResourceNames(new ArrayList
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (LoggingClient loggingClient = LoggingClient.create()) {
+ * ListMonitoredResourceDescriptorsRequest request =
+ * ListMonitoredResourceDescriptorsRequest.newBuilder()
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * for (MonitoredResourceDescriptor element :
+ * loggingClient.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.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (LoggingClient loggingClient = LoggingClient.create()) {
+ * ListMonitoredResourceDescriptorsRequest request =
+ * ListMonitoredResourceDescriptorsRequest.newBuilder()
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable<
+ ListMonitoredResourceDescriptorsRequest, ListMonitoredResourceDescriptorsPagedResponse>
+ listMonitoredResourceDescriptorsPagedCallable() {
+ return stub.listMonitoredResourceDescriptorsPagedCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists the descriptors for monitored resource types used by Logging.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (LoggingClient loggingClient = LoggingClient.create()) {
+ * ListMonitoredResourceDescriptorsRequest request =
+ * ListMonitoredResourceDescriptorsRequest.newBuilder()
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * while (true) {
+ * ListMonitoredResourceDescriptorsResponse response =
+ * loggingClient.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.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (LoggingClient loggingClient = LoggingClient.create()) {
+ * BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]");
+ * for (String element : loggingClient.listLogs(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The resource name to list logs for:
+ *
+ *
+ *
+ * @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.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (LoggingClient loggingClient = LoggingClient.create()) {
+ * FolderName parent = FolderName.of("[FOLDER]");
+ * for (String element : loggingClient.listLogs(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The resource name to list logs for:
+ *
+ *
+ *
+ * @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.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (LoggingClient loggingClient = LoggingClient.create()) {
+ * OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+ * for (String element : loggingClient.listLogs(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The resource name to list logs for:
+ *
+ *
+ *
+ * @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.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (LoggingClient loggingClient = LoggingClient.create()) {
+ * ProjectName parent = ProjectName.of("[PROJECT]");
+ * for (String element : loggingClient.listLogs(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The resource name to list logs for:
+ *
+ *
+ *
+ * @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.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (LoggingClient loggingClient = LoggingClient.create()) {
+ * String parent = ProjectName.of("[PROJECT]").toString();
+ * for (String element : loggingClient.listLogs(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The resource name to list logs for:
+ *
+ *
+ *
+ * @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.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (LoggingClient loggingClient = LoggingClient.create()) {
+ * ListLogsRequest request =
+ * ListLogsRequest.newBuilder()
+ * .setParent(ProjectName.of("[PROJECT]").toString())
+ * .addAllResourceNames(new ArrayList
+ *
+ * @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.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (LoggingClient loggingClient = LoggingClient.create()) {
+ * ListLogsRequest request =
+ * ListLogsRequest.newBuilder()
+ * .setParent(ProjectName.of("[PROJECT]").toString())
+ * .addAllResourceNames(new ArrayList
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (LoggingClient loggingClient = LoggingClient.create()) {
+ * ListLogsRequest request =
+ * ListLogsRequest.newBuilder()
+ * .setParent(ProjectName.of("[PROJECT]").toString())
+ * .addAllResourceNames(new ArrayList
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (LoggingClient loggingClient = LoggingClient.create()) {
+ * BidiStream
+ */
+ public final BidiStreamingCallable