use of com.google.cloud.logging.v2.ConfigClient in project gapic-generator-java by googleapis.
the class AsyncUndeleteBucket method asyncUndeleteBucket.
public static void asyncUndeleteBucket() throws Exception {
// It may require modifications to work in your environment.
try (ConfigClient configClient = ConfigClient.create()) {
UndeleteBucketRequest request = UndeleteBucketRequest.newBuilder().setName(LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]").toString()).build();
ApiFuture<Empty> future = configClient.undeleteBucketCallable().futureCall(request);
// Do something.
future.get();
}
}
use of com.google.cloud.logging.v2.ConfigClient in project gapic-generator-java by googleapis.
the class AsyncUpdateBucket method asyncUpdateBucket.
public static void asyncUpdateBucket() throws Exception {
// It may require modifications to work in your environment.
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<LogBucket> future = configClient.updateBucketCallable().futureCall(request);
// Do something.
LogBucket response = future.get();
}
}
use of com.google.cloud.logging.v2.ConfigClient in project gapic-generator-java by googleapis.
the class AsyncListSinks method asyncListSinks.
public static void asyncListSinks() throws Exception {
// It may require modifications to work in your environment.
try (ConfigClient configClient = ConfigClient.create()) {
ListSinksRequest request = ListSinksRequest.newBuilder().setParent(ProjectName.of("[PROJECT]").toString()).setPageToken("pageToken873572522").setPageSize(883849137).build();
ApiFuture<LogSink> future = configClient.listSinksPagedCallable().futureCall(request);
// Do something.
for (LogSink element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
}
use of com.google.cloud.logging.v2.ConfigClient in project gapic-generator-java by googleapis.
the class AsyncListSinksPaged method asyncListSinksPaged.
public static void asyncListSinksPaged() throws Exception {
// It may require modifications to work in your environment.
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.getResponsesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
}
use of com.google.cloud.logging.v2.ConfigClient in project gapic-generator-java by googleapis.
the class AsyncUpdateView method asyncUpdateView.
public static void asyncUpdateView() throws Exception {
// It may require modifications to work in your environment.
try (ConfigClient configClient = ConfigClient.create()) {
UpdateViewRequest request = UpdateViewRequest.newBuilder().setName("name3373707").setView(LogView.newBuilder().build()).setUpdateMask(FieldMask.newBuilder().build()).build();
ApiFuture<LogView> future = configClient.updateViewCallable().futureCall(request);
// Do something.
LogView response = future.get();
}
}
Aggregations