diff --git a/generation_config.yaml b/generation_config.yaml index b68e2297772b..f36f471f9562 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -1505,6 +1505,7 @@ libraries: cloud_api: true GAPICs: - proto_path: google/cloud/maintenance/api/v1beta + - proto_path: google/cloud/maintenance/api/v1 requires_billing: true rpc_documentation: https://cloud.google.com/unified-maintenance/docs/reference/rpc - api_shortname: managedidentities diff --git a/java-maintenance/google-cloud-maintenance-bom/pom.xml b/java-maintenance/google-cloud-maintenance-bom/pom.xml index 59230c214e05..b85e4d63168f 100644 --- a/java-maintenance/google-cloud-maintenance-bom/pom.xml +++ b/java-maintenance/google-cloud-maintenance-bom/pom.xml @@ -33,11 +33,21 @@ grpc-google-cloud-maintenance-v1beta 0.15.0-SNAPSHOT + + com.google.api.grpc + grpc-google-cloud-maintenance-v1 + 0.15.0-SNAPSHOT + com.google.api.grpc proto-google-cloud-maintenance-v1beta 0.15.0-SNAPSHOT + + com.google.api.grpc + proto-google-cloud-maintenance-v1 + 0.15.0-SNAPSHOT + diff --git a/java-maintenance/google-cloud-maintenance/pom.xml b/java-maintenance/google-cloud-maintenance/pom.xml index e916377a0237..f2148a5b05d0 100644 --- a/java-maintenance/google-cloud-maintenance/pom.xml +++ b/java-maintenance/google-cloud-maintenance/pom.xml @@ -41,6 +41,10 @@ proto-google-common-protos + + com.google.api.grpc + proto-google-cloud-maintenance-v1 + com.google.api.grpc proto-google-cloud-maintenance-v1beta @@ -76,6 +80,11 @@ grpc-google-common-protos test + + com.google.api.grpc + grpc-google-cloud-maintenance-v1 + test + com.google.api.grpc grpc-google-iam-v1 diff --git a/java-maintenance/google-cloud-maintenance/src/main/java/com/google/cloud/maintenance/api/v1/MaintenanceClient.java b/java-maintenance/google-cloud-maintenance/src/main/java/com/google/cloud/maintenance/api/v1/MaintenanceClient.java new file mode 100644 index 000000000000..5c5135f8dbf5 --- /dev/null +++ b/java-maintenance/google-cloud-maintenance/src/main/java/com/google/cloud/maintenance/api/v1/MaintenanceClient.java @@ -0,0 +1,1172 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.maintenance.api.v1; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.maintenance.api.v1.stub.MaintenanceStub; +import com.google.cloud.maintenance.api.v1.stub.MaintenanceStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Unified Maintenance service + * + *

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 (MaintenanceClient maintenanceClient = MaintenanceClient.create()) {
+ *   ResourceMaintenanceName name =
+ *       ResourceMaintenanceName.of("[PROJECT]", "[LOCATION]", "[RESOURCE_MAINTENANCE]");
+ *   ResourceMaintenance response = maintenanceClient.getResourceMaintenance(name);
+ * }
+ * }
+ * + *

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

SummarizeMaintenances

Retrieves the statistics of a specific maintenance.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • summarizeMaintenances(SummarizeMaintenancesRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • summarizeMaintenances(LocationName parent) + *

  • summarizeMaintenances(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.

+ *
    + *
  • summarizeMaintenancesPagedCallable() + *

  • summarizeMaintenancesCallable() + *

+ *

ListResourceMaintenances

Retrieve a collection of resource maintenances.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listResourceMaintenances(ListResourceMaintenancesRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • listResourceMaintenances(LocationName parent) + *

  • listResourceMaintenances(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.

+ *
    + *
  • listResourceMaintenancesPagedCallable() + *

  • listResourceMaintenancesCallable() + *

+ *

GetResourceMaintenance

Retrieve a single resource maintenance.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getResourceMaintenance(GetResourceMaintenanceRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • getResourceMaintenance(ResourceMaintenanceName name) + *

  • getResourceMaintenance(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getResourceMaintenanceCallable() + *

+ *

ListLocations

Lists information about the supported locations for this service.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listLocations(ListLocationsRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listLocationsPagedCallable() + *

  • listLocationsCallable() + *

+ *

GetLocation

Gets information about a location.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getLocation(GetLocationRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getLocationCallable() + *

+ *
+ * + *

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 MaintenanceSettings 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
+ * MaintenanceSettings maintenanceSettings =
+ *     MaintenanceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * MaintenanceClient maintenanceClient = MaintenanceClient.create(maintenanceSettings);
+ * }
+ * + *

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
+ * MaintenanceSettings maintenanceSettings =
+ *     MaintenanceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * MaintenanceClient maintenanceClient = MaintenanceClient.create(maintenanceSettings);
+ * }
+ * + *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

{@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
+ * MaintenanceSettings maintenanceSettings = MaintenanceSettings.newHttpJsonBuilder().build();
+ * MaintenanceClient maintenanceClient = MaintenanceClient.create(maintenanceSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class MaintenanceClient implements BackgroundResource { + private final MaintenanceSettings settings; + private final MaintenanceStub stub; + + /** Constructs an instance of MaintenanceClient with default settings. */ + public static final MaintenanceClient create() throws IOException { + return create(MaintenanceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of MaintenanceClient, 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 MaintenanceClient create(MaintenanceSettings settings) throws IOException { + return new MaintenanceClient(settings); + } + + /** + * Constructs an instance of MaintenanceClient, using the given stub for making calls. This is for + * advanced usage - prefer using create(MaintenanceSettings). + */ + public static final MaintenanceClient create(MaintenanceStub stub) { + return new MaintenanceClient(stub); + } + + /** + * Constructs an instance of MaintenanceClient, 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 MaintenanceClient(MaintenanceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((MaintenanceStubSettings) settings.getStubSettings()).createStub(); + } + + protected MaintenanceClient(MaintenanceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final MaintenanceSettings getSettings() { + return settings; + } + + public MaintenanceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the statistics of a specific maintenance. + * + *

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 (MaintenanceClient maintenanceClient = MaintenanceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (MaintenanceSummary element :
+   *       maintenanceClient.summarizeMaintenances(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent of the resource maintenance. eg. + * `projects/123/locations/*` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final SummarizeMaintenancesPagedResponse summarizeMaintenances(LocationName parent) { + SummarizeMaintenancesRequest request = + SummarizeMaintenancesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return summarizeMaintenances(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the statistics of a specific maintenance. + * + *

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 (MaintenanceClient maintenanceClient = MaintenanceClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   for (MaintenanceSummary element :
+   *       maintenanceClient.summarizeMaintenances(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent of the resource maintenance. eg. + * `projects/123/locations/*` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final SummarizeMaintenancesPagedResponse summarizeMaintenances(String parent) { + SummarizeMaintenancesRequest request = + SummarizeMaintenancesRequest.newBuilder().setParent(parent).build(); + return summarizeMaintenances(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the statistics of a specific maintenance. + * + *

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 (MaintenanceClient maintenanceClient = MaintenanceClient.create()) {
+   *   SummarizeMaintenancesRequest request =
+   *       SummarizeMaintenancesRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   for (MaintenanceSummary element :
+   *       maintenanceClient.summarizeMaintenances(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 SummarizeMaintenancesPagedResponse summarizeMaintenances( + SummarizeMaintenancesRequest request) { + return summarizeMaintenancesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the statistics of a specific maintenance. + * + *

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 (MaintenanceClient maintenanceClient = MaintenanceClient.create()) {
+   *   SummarizeMaintenancesRequest request =
+   *       SummarizeMaintenancesRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   ApiFuture future =
+   *       maintenanceClient.summarizeMaintenancesPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (MaintenanceSummary element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + summarizeMaintenancesPagedCallable() { + return stub.summarizeMaintenancesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the statistics of a specific maintenance. + * + *

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 (MaintenanceClient maintenanceClient = MaintenanceClient.create()) {
+   *   SummarizeMaintenancesRequest request =
+   *       SummarizeMaintenancesRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   while (true) {
+   *     SummarizeMaintenancesResponse response =
+   *         maintenanceClient.summarizeMaintenancesCallable().call(request);
+   *     for (MaintenanceSummary element : response.getMaintenancesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + summarizeMaintenancesCallable() { + return stub.summarizeMaintenancesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieve a collection of resource maintenances. + * + *

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 (MaintenanceClient maintenanceClient = MaintenanceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (ResourceMaintenance element :
+   *       maintenanceClient.listResourceMaintenances(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent of the resource maintenance. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListResourceMaintenancesPagedResponse listResourceMaintenances(LocationName parent) { + ListResourceMaintenancesRequest request = + ListResourceMaintenancesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listResourceMaintenances(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieve a collection of resource maintenances. + * + *

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 (MaintenanceClient maintenanceClient = MaintenanceClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   for (ResourceMaintenance element :
+   *       maintenanceClient.listResourceMaintenances(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent of the resource maintenance. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListResourceMaintenancesPagedResponse listResourceMaintenances(String parent) { + ListResourceMaintenancesRequest request = + ListResourceMaintenancesRequest.newBuilder().setParent(parent).build(); + return listResourceMaintenances(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieve a collection of resource maintenances. + * + *

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 (MaintenanceClient maintenanceClient = MaintenanceClient.create()) {
+   *   ListResourceMaintenancesRequest request =
+   *       ListResourceMaintenancesRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   for (ResourceMaintenance element :
+   *       maintenanceClient.listResourceMaintenances(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 ListResourceMaintenancesPagedResponse listResourceMaintenances( + ListResourceMaintenancesRequest request) { + return listResourceMaintenancesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieve a collection of resource maintenances. + * + *

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 (MaintenanceClient maintenanceClient = MaintenanceClient.create()) {
+   *   ListResourceMaintenancesRequest request =
+   *       ListResourceMaintenancesRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   ApiFuture future =
+   *       maintenanceClient.listResourceMaintenancesPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (ResourceMaintenance element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listResourceMaintenancesPagedCallable() { + return stub.listResourceMaintenancesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieve a collection of resource maintenances. + * + *

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 (MaintenanceClient maintenanceClient = MaintenanceClient.create()) {
+   *   ListResourceMaintenancesRequest request =
+   *       ListResourceMaintenancesRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   while (true) {
+   *     ListResourceMaintenancesResponse response =
+   *         maintenanceClient.listResourceMaintenancesCallable().call(request);
+   *     for (ResourceMaintenance element : response.getResourceMaintenancesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listResourceMaintenancesCallable() { + return stub.listResourceMaintenancesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieve a single resource maintenance. + * + *

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 (MaintenanceClient maintenanceClient = MaintenanceClient.create()) {
+   *   ResourceMaintenanceName name =
+   *       ResourceMaintenanceName.of("[PROJECT]", "[LOCATION]", "[RESOURCE_MAINTENANCE]");
+   *   ResourceMaintenance response = maintenanceClient.getResourceMaintenance(name);
+   * }
+   * }
+ * + * @param name Required. The resource name of the resource within a service. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ResourceMaintenance getResourceMaintenance(ResourceMaintenanceName name) { + GetResourceMaintenanceRequest request = + GetResourceMaintenanceRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getResourceMaintenance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieve a single resource maintenance. + * + *

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 (MaintenanceClient maintenanceClient = MaintenanceClient.create()) {
+   *   String name =
+   *       ResourceMaintenanceName.of("[PROJECT]", "[LOCATION]", "[RESOURCE_MAINTENANCE]")
+   *           .toString();
+   *   ResourceMaintenance response = maintenanceClient.getResourceMaintenance(name);
+   * }
+   * }
+ * + * @param name Required. The resource name of the resource within a service. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ResourceMaintenance getResourceMaintenance(String name) { + GetResourceMaintenanceRequest request = + GetResourceMaintenanceRequest.newBuilder().setName(name).build(); + return getResourceMaintenance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieve a single resource maintenance. + * + *

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 (MaintenanceClient maintenanceClient = MaintenanceClient.create()) {
+   *   GetResourceMaintenanceRequest request =
+   *       GetResourceMaintenanceRequest.newBuilder()
+   *           .setName(
+   *               ResourceMaintenanceName.of("[PROJECT]", "[LOCATION]", "[RESOURCE_MAINTENANCE]")
+   *                   .toString())
+   *           .build();
+   *   ResourceMaintenance response = maintenanceClient.getResourceMaintenance(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 ResourceMaintenance getResourceMaintenance(GetResourceMaintenanceRequest request) { + return getResourceMaintenanceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieve a single resource maintenance. + * + *

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 (MaintenanceClient maintenanceClient = MaintenanceClient.create()) {
+   *   GetResourceMaintenanceRequest request =
+   *       GetResourceMaintenanceRequest.newBuilder()
+   *           .setName(
+   *               ResourceMaintenanceName.of("[PROJECT]", "[LOCATION]", "[RESOURCE_MAINTENANCE]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       maintenanceClient.getResourceMaintenanceCallable().futureCall(request);
+   *   // Do something.
+   *   ResourceMaintenance response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + getResourceMaintenanceCallable() { + return stub.getResourceMaintenanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

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 (MaintenanceClient maintenanceClient = MaintenanceClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Location element : maintenanceClient.listLocations(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 ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

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 (MaintenanceClient maintenanceClient = MaintenanceClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       maintenanceClient.listLocationsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Location element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listLocationsPagedCallable() { + return stub.listLocationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

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 (MaintenanceClient maintenanceClient = MaintenanceClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListLocationsResponse response = maintenanceClient.listLocationsCallable().call(request);
+   *     for (Location element : response.getLocationsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listLocationsCallable() { + return stub.listLocationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

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 (MaintenanceClient maintenanceClient = MaintenanceClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   Location response = maintenanceClient.getLocation(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 Location getLocation(GetLocationRequest request) { + return getLocationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

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 (MaintenanceClient maintenanceClient = MaintenanceClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   ApiFuture future = maintenanceClient.getLocationCallable().futureCall(request);
+   *   // Do something.
+   *   Location response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getLocationCallable() { + return stub.getLocationCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class SummarizeMaintenancesPagedResponse + extends AbstractPagedListResponse< + SummarizeMaintenancesRequest, + SummarizeMaintenancesResponse, + MaintenanceSummary, + SummarizeMaintenancesPage, + SummarizeMaintenancesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + SummarizeMaintenancesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new SummarizeMaintenancesPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private SummarizeMaintenancesPagedResponse(SummarizeMaintenancesPage page) { + super(page, SummarizeMaintenancesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class SummarizeMaintenancesPage + extends AbstractPage< + SummarizeMaintenancesRequest, + SummarizeMaintenancesResponse, + MaintenanceSummary, + SummarizeMaintenancesPage> { + + private SummarizeMaintenancesPage( + PageContext + context, + SummarizeMaintenancesResponse response) { + super(context, response); + } + + private static SummarizeMaintenancesPage createEmptyPage() { + return new SummarizeMaintenancesPage(null, null); + } + + @Override + protected SummarizeMaintenancesPage createPage( + PageContext + context, + SummarizeMaintenancesResponse response) { + return new SummarizeMaintenancesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class SummarizeMaintenancesFixedSizeCollection + extends AbstractFixedSizeCollection< + SummarizeMaintenancesRequest, + SummarizeMaintenancesResponse, + MaintenanceSummary, + SummarizeMaintenancesPage, + SummarizeMaintenancesFixedSizeCollection> { + + private SummarizeMaintenancesFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static SummarizeMaintenancesFixedSizeCollection createEmptyCollection() { + return new SummarizeMaintenancesFixedSizeCollection(null, 0); + } + + @Override + protected SummarizeMaintenancesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new SummarizeMaintenancesFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListResourceMaintenancesPagedResponse + extends AbstractPagedListResponse< + ListResourceMaintenancesRequest, + ListResourceMaintenancesResponse, + ResourceMaintenance, + ListResourceMaintenancesPage, + ListResourceMaintenancesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext< + ListResourceMaintenancesRequest, + ListResourceMaintenancesResponse, + ResourceMaintenance> + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListResourceMaintenancesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListResourceMaintenancesPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListResourceMaintenancesPagedResponse(ListResourceMaintenancesPage page) { + super(page, ListResourceMaintenancesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListResourceMaintenancesPage + extends AbstractPage< + ListResourceMaintenancesRequest, + ListResourceMaintenancesResponse, + ResourceMaintenance, + ListResourceMaintenancesPage> { + + private ListResourceMaintenancesPage( + PageContext< + ListResourceMaintenancesRequest, + ListResourceMaintenancesResponse, + ResourceMaintenance> + context, + ListResourceMaintenancesResponse response) { + super(context, response); + } + + private static ListResourceMaintenancesPage createEmptyPage() { + return new ListResourceMaintenancesPage(null, null); + } + + @Override + protected ListResourceMaintenancesPage createPage( + PageContext< + ListResourceMaintenancesRequest, + ListResourceMaintenancesResponse, + ResourceMaintenance> + context, + ListResourceMaintenancesResponse response) { + return new ListResourceMaintenancesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext< + ListResourceMaintenancesRequest, + ListResourceMaintenancesResponse, + ResourceMaintenance> + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListResourceMaintenancesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListResourceMaintenancesRequest, + ListResourceMaintenancesResponse, + ResourceMaintenance, + ListResourceMaintenancesPage, + ListResourceMaintenancesFixedSizeCollection> { + + private ListResourceMaintenancesFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListResourceMaintenancesFixedSizeCollection createEmptyCollection() { + return new ListResourceMaintenancesFixedSizeCollection(null, 0); + } + + @Override + protected ListResourceMaintenancesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListResourceMaintenancesFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListLocationsPagedResponse + extends AbstractPagedListResponse< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLocationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLocationsPagedResponse(ListLocationsPage page) { + super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLocationsPage + extends AbstractPage< + ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { + + private ListLocationsPage( + PageContext context, + ListLocationsResponse response) { + super(context, response); + } + + private static ListLocationsPage createEmptyPage() { + return new ListLocationsPage(null, null); + } + + @Override + protected ListLocationsPage createPage( + PageContext context, + ListLocationsResponse response) { + return new ListLocationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLocationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLocationsFixedSizeCollection createEmptyCollection() { + return new ListLocationsFixedSizeCollection(null, 0); + } + + @Override + protected ListLocationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLocationsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-maintenance/google-cloud-maintenance/src/main/java/com/google/cloud/maintenance/api/v1/MaintenanceSettings.java b/java-maintenance/google-cloud-maintenance/src/main/java/com/google/cloud/maintenance/api/v1/MaintenanceSettings.java new file mode 100644 index 000000000000..0f54a85d5739 --- /dev/null +++ b/java-maintenance/google-cloud-maintenance/src/main/java/com/google/cloud/maintenance/api/v1/MaintenanceSettings.java @@ -0,0 +1,283 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.maintenance.api.v1; + +import static com.google.cloud.maintenance.api.v1.MaintenanceClient.ListLocationsPagedResponse; +import static com.google.cloud.maintenance.api.v1.MaintenanceClient.ListResourceMaintenancesPagedResponse; +import static com.google.cloud.maintenance.api.v1.MaintenanceClient.SummarizeMaintenancesPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.maintenance.api.v1.stub.MaintenanceStubSettings; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link MaintenanceClient}. + * + *

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

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

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

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of getResourceMaintenance: + * + *

{@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
+ * MaintenanceSettings.Builder maintenanceSettingsBuilder = MaintenanceSettings.newBuilder();
+ * maintenanceSettingsBuilder
+ *     .getResourceMaintenanceSettings()
+ *     .setRetrySettings(
+ *         maintenanceSettingsBuilder
+ *             .getResourceMaintenanceSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ *             .build());
+ * MaintenanceSettings maintenanceSettings = maintenanceSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. + */ +@Generated("by gapic-generator-java") +public class MaintenanceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to summarizeMaintenances. */ + public PagedCallSettings< + SummarizeMaintenancesRequest, + SummarizeMaintenancesResponse, + SummarizeMaintenancesPagedResponse> + summarizeMaintenancesSettings() { + return ((MaintenanceStubSettings) getStubSettings()).summarizeMaintenancesSettings(); + } + + /** Returns the object with the settings used for calls to listResourceMaintenances. */ + public PagedCallSettings< + ListResourceMaintenancesRequest, + ListResourceMaintenancesResponse, + ListResourceMaintenancesPagedResponse> + listResourceMaintenancesSettings() { + return ((MaintenanceStubSettings) getStubSettings()).listResourceMaintenancesSettings(); + } + + /** Returns the object with the settings used for calls to getResourceMaintenance. */ + public UnaryCallSettings + getResourceMaintenanceSettings() { + return ((MaintenanceStubSettings) getStubSettings()).getResourceMaintenanceSettings(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((MaintenanceStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((MaintenanceStubSettings) getStubSettings()).getLocationSettings(); + } + + public static final MaintenanceSettings create(MaintenanceStubSettings stub) throws IOException { + return new MaintenanceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return MaintenanceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return MaintenanceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return MaintenanceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return MaintenanceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return MaintenanceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return MaintenanceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return MaintenanceStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return MaintenanceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected MaintenanceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for MaintenanceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(MaintenanceStubSettings.newBuilder(clientContext)); + } + + protected Builder(MaintenanceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(MaintenanceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(MaintenanceStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(MaintenanceStubSettings.newHttpJsonBuilder()); + } + + public MaintenanceStubSettings.Builder getStubSettingsBuilder() { + return ((MaintenanceStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to summarizeMaintenances. */ + public PagedCallSettings.Builder< + SummarizeMaintenancesRequest, + SummarizeMaintenancesResponse, + SummarizeMaintenancesPagedResponse> + summarizeMaintenancesSettings() { + return getStubSettingsBuilder().summarizeMaintenancesSettings(); + } + + /** Returns the builder for the settings used for calls to listResourceMaintenances. */ + public PagedCallSettings.Builder< + ListResourceMaintenancesRequest, + ListResourceMaintenancesResponse, + ListResourceMaintenancesPagedResponse> + listResourceMaintenancesSettings() { + return getStubSettingsBuilder().listResourceMaintenancesSettings(); + } + + /** Returns the builder for the settings used for calls to getResourceMaintenance. */ + public UnaryCallSettings.Builder + getResourceMaintenanceSettings() { + return getStubSettingsBuilder().getResourceMaintenanceSettings(); + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getStubSettingsBuilder().getLocationSettings(); + } + + @Override + public MaintenanceSettings build() throws IOException { + return new MaintenanceSettings(this); + } + } +} diff --git a/java-maintenance/google-cloud-maintenance/src/main/java/com/google/cloud/maintenance/api/v1/gapic_metadata.json b/java-maintenance/google-cloud-maintenance/src/main/java/com/google/cloud/maintenance/api/v1/gapic_metadata.json new file mode 100644 index 000000000000..d37ff50b5d52 --- /dev/null +++ b/java-maintenance/google-cloud-maintenance/src/main/java/com/google/cloud/maintenance/api/v1/gapic_metadata.json @@ -0,0 +1,33 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.cloud.maintenance.api.v1", + "libraryPackage": "com.google.cloud.maintenance.api.v1", + "services": { + "Maintenance": { + "clients": { + "grpc": { + "libraryClient": "MaintenanceClient", + "rpcs": { + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, + "GetResourceMaintenance": { + "methods": ["getResourceMaintenance", "getResourceMaintenance", "getResourceMaintenance", "getResourceMaintenanceCallable"] + }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, + "ListResourceMaintenances": { + "methods": ["listResourceMaintenances", "listResourceMaintenances", "listResourceMaintenances", "listResourceMaintenancesPagedCallable", "listResourceMaintenancesCallable"] + }, + "SummarizeMaintenances": { + "methods": ["summarizeMaintenances", "summarizeMaintenances", "summarizeMaintenances", "summarizeMaintenancesPagedCallable", "summarizeMaintenancesCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/java-maintenance/google-cloud-maintenance/src/main/java/com/google/cloud/maintenance/api/v1/package-info.java b/java-maintenance/google-cloud-maintenance/src/main/java/com/google/cloud/maintenance/api/v1/package-info.java new file mode 100644 index 000000000000..f82af6a45584 --- /dev/null +++ b/java-maintenance/google-cloud-maintenance/src/main/java/com/google/cloud/maintenance/api/v1/package-info.java @@ -0,0 +1,44 @@ +/* + * Copyright 2025 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. + */ + +/** + * A client to Maintenance API + * + *

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

======================= MaintenanceClient ======================= + * + *

Service Description: Unified Maintenance service + * + *

Sample for MaintenanceClient: + * + *

{@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 (MaintenanceClient maintenanceClient = MaintenanceClient.create()) {
+ *   ResourceMaintenanceName name =
+ *       ResourceMaintenanceName.of("[PROJECT]", "[LOCATION]", "[RESOURCE_MAINTENANCE]");
+ *   ResourceMaintenance response = maintenanceClient.getResourceMaintenance(name);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.cloud.maintenance.api.v1; + +import javax.annotation.Generated; diff --git a/java-maintenance/google-cloud-maintenance/src/main/java/com/google/cloud/maintenance/api/v1/stub/GrpcMaintenanceCallableFactory.java b/java-maintenance/google-cloud-maintenance/src/main/java/com/google/cloud/maintenance/api/v1/stub/GrpcMaintenanceCallableFactory.java new file mode 100644 index 000000000000..28e070bbc87f --- /dev/null +++ b/java-maintenance/google-cloud-maintenance/src/main/java/com/google/cloud/maintenance/api/v1/stub/GrpcMaintenanceCallableFactory.java @@ -0,0 +1,113 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.maintenance.api.v1.stub; + +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the Maintenance service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcMaintenanceCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/java-maintenance/google-cloud-maintenance/src/main/java/com/google/cloud/maintenance/api/v1/stub/GrpcMaintenanceStub.java b/java-maintenance/google-cloud-maintenance/src/main/java/com/google/cloud/maintenance/api/v1/stub/GrpcMaintenanceStub.java new file mode 100644 index 000000000000..5a0b6339f1b7 --- /dev/null +++ b/java-maintenance/google-cloud-maintenance/src/main/java/com/google/cloud/maintenance/api/v1/stub/GrpcMaintenanceStub.java @@ -0,0 +1,355 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.maintenance.api.v1.stub; + +import static com.google.cloud.maintenance.api.v1.MaintenanceClient.ListLocationsPagedResponse; +import static com.google.cloud.maintenance.api.v1.MaintenanceClient.ListResourceMaintenancesPagedResponse; +import static com.google.cloud.maintenance.api.v1.MaintenanceClient.SummarizeMaintenancesPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest; +import com.google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest; +import com.google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse; +import com.google.cloud.maintenance.api.v1.ResourceMaintenance; +import com.google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest; +import com.google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the Maintenance service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcMaintenanceStub extends MaintenanceStub { + private static final MethodDescriptor + summarizeMaintenancesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.maintenance.api.v1.Maintenance/SummarizeMaintenances") + .setRequestMarshaller( + ProtoUtils.marshaller(SummarizeMaintenancesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(SummarizeMaintenancesResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor< + ListResourceMaintenancesRequest, ListResourceMaintenancesResponse> + listResourceMaintenancesMethodDescriptor = + MethodDescriptor + .newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.maintenance.api.v1.Maintenance/ListResourceMaintenances") + .setRequestMarshaller( + ProtoUtils.marshaller(ListResourceMaintenancesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListResourceMaintenancesResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + getResourceMaintenanceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.maintenance.api.v1.Maintenance/GetResourceMaintenance") + .setRequestMarshaller( + ProtoUtils.marshaller(GetResourceMaintenanceRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ResourceMaintenance.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getLocationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private final UnaryCallable + summarizeMaintenancesCallable; + private final UnaryCallable + summarizeMaintenancesPagedCallable; + private final UnaryCallable + listResourceMaintenancesCallable; + private final UnaryCallable< + ListResourceMaintenancesRequest, ListResourceMaintenancesPagedResponse> + listResourceMaintenancesPagedCallable; + private final UnaryCallable + getResourceMaintenanceCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcMaintenanceStub create(MaintenanceStubSettings settings) + throws IOException { + return new GrpcMaintenanceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcMaintenanceStub create(ClientContext clientContext) throws IOException { + return new GrpcMaintenanceStub(MaintenanceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcMaintenanceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcMaintenanceStub( + MaintenanceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcMaintenanceStub, 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 GrpcMaintenanceStub(MaintenanceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcMaintenanceCallableFactory()); + } + + /** + * Constructs an instance of GrpcMaintenanceStub, 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 GrpcMaintenanceStub( + MaintenanceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings + summarizeMaintenancesTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(summarizeMaintenancesMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings + listResourceMaintenancesTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(listResourceMaintenancesMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings + getResourceMaintenanceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getResourceMaintenanceMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + + this.summarizeMaintenancesCallable = + callableFactory.createUnaryCallable( + summarizeMaintenancesTransportSettings, + settings.summarizeMaintenancesSettings(), + clientContext); + this.summarizeMaintenancesPagedCallable = + callableFactory.createPagedCallable( + summarizeMaintenancesTransportSettings, + settings.summarizeMaintenancesSettings(), + clientContext); + this.listResourceMaintenancesCallable = + callableFactory.createUnaryCallable( + listResourceMaintenancesTransportSettings, + settings.listResourceMaintenancesSettings(), + clientContext); + this.listResourceMaintenancesPagedCallable = + callableFactory.createPagedCallable( + listResourceMaintenancesTransportSettings, + settings.listResourceMaintenancesSettings(), + clientContext); + this.getResourceMaintenanceCallable = + callableFactory.createUnaryCallable( + getResourceMaintenanceTransportSettings, + settings.getResourceMaintenanceSettings(), + clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable + summarizeMaintenancesCallable() { + return summarizeMaintenancesCallable; + } + + @Override + public UnaryCallable + summarizeMaintenancesPagedCallable() { + return summarizeMaintenancesPagedCallable; + } + + @Override + public UnaryCallable + listResourceMaintenancesCallable() { + return listResourceMaintenancesCallable; + } + + @Override + public UnaryCallable + listResourceMaintenancesPagedCallable() { + return listResourceMaintenancesPagedCallable; + } + + @Override + public UnaryCallable + getResourceMaintenanceCallable() { + return getResourceMaintenanceCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-maintenance/google-cloud-maintenance/src/main/java/com/google/cloud/maintenance/api/v1/stub/HttpJsonMaintenanceCallableFactory.java b/java-maintenance/google-cloud-maintenance/src/main/java/com/google/cloud/maintenance/api/v1/stub/HttpJsonMaintenanceCallableFactory.java new file mode 100644 index 000000000000..009a2987e0b0 --- /dev/null +++ b/java-maintenance/google-cloud-maintenance/src/main/java/com/google/cloud/maintenance/api/v1/stub/HttpJsonMaintenanceCallableFactory.java @@ -0,0 +1,101 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.maintenance.api.v1.stub; + +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the Maintenance service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class HttpJsonMaintenanceCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/java-maintenance/google-cloud-maintenance/src/main/java/com/google/cloud/maintenance/api/v1/stub/HttpJsonMaintenanceStub.java b/java-maintenance/google-cloud-maintenance/src/main/java/com/google/cloud/maintenance/api/v1/stub/HttpJsonMaintenanceStub.java new file mode 100644 index 000000000000..f777f0f66cb4 --- /dev/null +++ b/java-maintenance/google-cloud-maintenance/src/main/java/com/google/cloud/maintenance/api/v1/stub/HttpJsonMaintenanceStub.java @@ -0,0 +1,500 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.maintenance.api.v1.stub; + +import static com.google.cloud.maintenance.api.v1.MaintenanceClient.ListLocationsPagedResponse; +import static com.google.cloud.maintenance.api.v1.MaintenanceClient.ListResourceMaintenancesPagedResponse; +import static com.google.cloud.maintenance.api.v1.MaintenanceClient.SummarizeMaintenancesPagedResponse; + +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest; +import com.google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest; +import com.google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse; +import com.google.cloud.maintenance.api.v1.ResourceMaintenance; +import com.google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest; +import com.google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse; +import com.google.protobuf.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the Maintenance service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class HttpJsonMaintenanceStub extends MaintenanceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor< + SummarizeMaintenancesRequest, SummarizeMaintenancesResponse> + summarizeMaintenancesMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName( + "google.cloud.maintenance.api.v1.Maintenance/SummarizeMaintenances") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/resourceMaintenances:summarize", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam(fields, "orderBy", request.getOrderBy()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(SummarizeMaintenancesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + ListResourceMaintenancesRequest, ListResourceMaintenancesResponse> + listResourceMaintenancesMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName( + "google.cloud.maintenance.api.v1.Maintenance/ListResourceMaintenances") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/resourceMaintenances", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam(fields, "orderBy", request.getOrderBy()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListResourceMaintenancesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getResourceMaintenanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.maintenance.api.v1.Maintenance/GetResourceMaintenance") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/resourceMaintenances/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ResourceMaintenance.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listLocationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*}/locations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListLocationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getLocationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Location.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable + summarizeMaintenancesCallable; + private final UnaryCallable + summarizeMaintenancesPagedCallable; + private final UnaryCallable + listResourceMaintenancesCallable; + private final UnaryCallable< + ListResourceMaintenancesRequest, ListResourceMaintenancesPagedResponse> + listResourceMaintenancesPagedCallable; + private final UnaryCallable + getResourceMaintenanceCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonMaintenanceStub create(MaintenanceStubSettings settings) + throws IOException { + return new HttpJsonMaintenanceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonMaintenanceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonMaintenanceStub( + MaintenanceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonMaintenanceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonMaintenanceStub( + MaintenanceStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonMaintenanceStub, 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 HttpJsonMaintenanceStub(MaintenanceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonMaintenanceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonMaintenanceStub, 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 HttpJsonMaintenanceStub( + MaintenanceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings + summarizeMaintenancesTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(summarizeMaintenancesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listResourceMaintenancesTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(listResourceMaintenancesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + getResourceMaintenanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getResourceMaintenanceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listLocationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getLocationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + + this.summarizeMaintenancesCallable = + callableFactory.createUnaryCallable( + summarizeMaintenancesTransportSettings, + settings.summarizeMaintenancesSettings(), + clientContext); + this.summarizeMaintenancesPagedCallable = + callableFactory.createPagedCallable( + summarizeMaintenancesTransportSettings, + settings.summarizeMaintenancesSettings(), + clientContext); + this.listResourceMaintenancesCallable = + callableFactory.createUnaryCallable( + listResourceMaintenancesTransportSettings, + settings.listResourceMaintenancesSettings(), + clientContext); + this.listResourceMaintenancesPagedCallable = + callableFactory.createPagedCallable( + listResourceMaintenancesTransportSettings, + settings.listResourceMaintenancesSettings(), + clientContext); + this.getResourceMaintenanceCallable = + callableFactory.createUnaryCallable( + getResourceMaintenanceTransportSettings, + settings.getResourceMaintenanceSettings(), + clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(summarizeMaintenancesMethodDescriptor); + methodDescriptors.add(listResourceMaintenancesMethodDescriptor); + methodDescriptors.add(getResourceMaintenanceMethodDescriptor); + methodDescriptors.add(listLocationsMethodDescriptor); + methodDescriptors.add(getLocationMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable + summarizeMaintenancesCallable() { + return summarizeMaintenancesCallable; + } + + @Override + public UnaryCallable + summarizeMaintenancesPagedCallable() { + return summarizeMaintenancesPagedCallable; + } + + @Override + public UnaryCallable + listResourceMaintenancesCallable() { + return listResourceMaintenancesCallable; + } + + @Override + public UnaryCallable + listResourceMaintenancesPagedCallable() { + return listResourceMaintenancesPagedCallable; + } + + @Override + public UnaryCallable + getResourceMaintenanceCallable() { + return getResourceMaintenanceCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-maintenance/google-cloud-maintenance/src/main/java/com/google/cloud/maintenance/api/v1/stub/MaintenanceStub.java b/java-maintenance/google-cloud-maintenance/src/main/java/com/google/cloud/maintenance/api/v1/stub/MaintenanceStub.java new file mode 100644 index 000000000000..6ee1349fc8da --- /dev/null +++ b/java-maintenance/google-cloud-maintenance/src/main/java/com/google/cloud/maintenance/api/v1/stub/MaintenanceStub.java @@ -0,0 +1,88 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.maintenance.api.v1.stub; + +import static com.google.cloud.maintenance.api.v1.MaintenanceClient.ListLocationsPagedResponse; +import static com.google.cloud.maintenance.api.v1.MaintenanceClient.ListResourceMaintenancesPagedResponse; +import static com.google.cloud.maintenance.api.v1.MaintenanceClient.SummarizeMaintenancesPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest; +import com.google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest; +import com.google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse; +import com.google.cloud.maintenance.api.v1.ResourceMaintenance; +import com.google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest; +import com.google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the Maintenance service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class MaintenanceStub implements BackgroundResource { + + public UnaryCallable + summarizeMaintenancesPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: summarizeMaintenancesPagedCallable()"); + } + + public UnaryCallable + summarizeMaintenancesCallable() { + throw new UnsupportedOperationException("Not implemented: summarizeMaintenancesCallable()"); + } + + public UnaryCallable + listResourceMaintenancesPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listResourceMaintenancesPagedCallable()"); + } + + public UnaryCallable + listResourceMaintenancesCallable() { + throw new UnsupportedOperationException("Not implemented: listResourceMaintenancesCallable()"); + } + + public UnaryCallable + getResourceMaintenanceCallable() { + throw new UnsupportedOperationException("Not implemented: getResourceMaintenanceCallable()"); + } + + public UnaryCallable + listLocationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); + } + + public UnaryCallable listLocationsCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsCallable()"); + } + + public UnaryCallable getLocationCallable() { + throw new UnsupportedOperationException("Not implemented: getLocationCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-maintenance/google-cloud-maintenance/src/main/java/com/google/cloud/maintenance/api/v1/stub/MaintenanceStubSettings.java b/java-maintenance/google-cloud-maintenance/src/main/java/com/google/cloud/maintenance/api/v1/stub/MaintenanceStubSettings.java new file mode 100644 index 000000000000..fd4eead90164 --- /dev/null +++ b/java-maintenance/google-cloud-maintenance/src/main/java/com/google/cloud/maintenance/api/v1/stub/MaintenanceStubSettings.java @@ -0,0 +1,673 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.maintenance.api.v1.stub; + +import static com.google.cloud.maintenance.api.v1.MaintenanceClient.ListLocationsPagedResponse; +import static com.google.cloud.maintenance.api.v1.MaintenanceClient.ListResourceMaintenancesPagedResponse; +import static com.google.cloud.maintenance.api.v1.MaintenanceClient.SummarizeMaintenancesPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.core.ObsoleteApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest; +import com.google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest; +import com.google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse; +import com.google.cloud.maintenance.api.v1.MaintenanceSummary; +import com.google.cloud.maintenance.api.v1.ResourceMaintenance; +import com.google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest; +import com.google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link MaintenanceStub}. + * + *

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

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

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

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of getResourceMaintenance: + * + *

{@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
+ * MaintenanceStubSettings.Builder maintenanceSettingsBuilder =
+ *     MaintenanceStubSettings.newBuilder();
+ * maintenanceSettingsBuilder
+ *     .getResourceMaintenanceSettings()
+ *     .setRetrySettings(
+ *         maintenanceSettingsBuilder
+ *             .getResourceMaintenanceSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ *             .build());
+ * MaintenanceStubSettings maintenanceSettings = maintenanceSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. + */ +@Generated("by gapic-generator-java") +public class MaintenanceStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final PagedCallSettings< + SummarizeMaintenancesRequest, + SummarizeMaintenancesResponse, + SummarizeMaintenancesPagedResponse> + summarizeMaintenancesSettings; + private final PagedCallSettings< + ListResourceMaintenancesRequest, + ListResourceMaintenancesResponse, + ListResourceMaintenancesPagedResponse> + listResourceMaintenancesSettings; + private final UnaryCallSettings + getResourceMaintenanceSettings; + private final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; + + private static final PagedListDescriptor< + SummarizeMaintenancesRequest, SummarizeMaintenancesResponse, MaintenanceSummary> + SUMMARIZE_MAINTENANCES_PAGE_STR_DESC = + new PagedListDescriptor< + SummarizeMaintenancesRequest, SummarizeMaintenancesResponse, MaintenanceSummary>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public SummarizeMaintenancesRequest injectToken( + SummarizeMaintenancesRequest payload, String token) { + return SummarizeMaintenancesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public SummarizeMaintenancesRequest injectPageSize( + SummarizeMaintenancesRequest payload, int pageSize) { + return SummarizeMaintenancesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(SummarizeMaintenancesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(SummarizeMaintenancesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + SummarizeMaintenancesResponse payload) { + return payload.getMaintenancesList(); + } + }; + + private static final PagedListDescriptor< + ListResourceMaintenancesRequest, ListResourceMaintenancesResponse, ResourceMaintenance> + LIST_RESOURCE_MAINTENANCES_PAGE_STR_DESC = + new PagedListDescriptor< + ListResourceMaintenancesRequest, + ListResourceMaintenancesResponse, + ResourceMaintenance>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListResourceMaintenancesRequest injectToken( + ListResourceMaintenancesRequest payload, String token) { + return ListResourceMaintenancesRequest.newBuilder(payload) + .setPageToken(token) + .build(); + } + + @Override + public ListResourceMaintenancesRequest injectPageSize( + ListResourceMaintenancesRequest payload, int pageSize) { + return ListResourceMaintenancesRequest.newBuilder(payload) + .setPageSize(pageSize) + .build(); + } + + @Override + public Integer extractPageSize(ListResourceMaintenancesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListResourceMaintenancesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + ListResourceMaintenancesResponse payload) { + return payload.getResourceMaintenancesList(); + } + }; + + private static final PagedListDescriptor + LIST_LOCATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) { + return ListLocationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) { + return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLocationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLocationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLocationsResponse payload) { + return payload.getLocationsList(); + } + }; + + private static final PagedListResponseFactory< + SummarizeMaintenancesRequest, + SummarizeMaintenancesResponse, + SummarizeMaintenancesPagedResponse> + SUMMARIZE_MAINTENANCES_PAGE_STR_FACT = + new PagedListResponseFactory< + SummarizeMaintenancesRequest, + SummarizeMaintenancesResponse, + SummarizeMaintenancesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + SummarizeMaintenancesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + SummarizeMaintenancesRequest, + SummarizeMaintenancesResponse, + MaintenanceSummary> + pageContext = + PageContext.create( + callable, SUMMARIZE_MAINTENANCES_PAGE_STR_DESC, request, context); + return SummarizeMaintenancesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListResourceMaintenancesRequest, + ListResourceMaintenancesResponse, + ListResourceMaintenancesPagedResponse> + LIST_RESOURCE_MAINTENANCES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListResourceMaintenancesRequest, + ListResourceMaintenancesResponse, + ListResourceMaintenancesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable + callable, + ListResourceMaintenancesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + ListResourceMaintenancesRequest, + ListResourceMaintenancesResponse, + ResourceMaintenance> + pageContext = + PageContext.create( + callable, LIST_RESOURCE_MAINTENANCES_PAGE_STR_DESC, request, context); + return ListResourceMaintenancesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + LIST_LOCATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLocationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context); + return ListLocationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to summarizeMaintenances. */ + public PagedCallSettings< + SummarizeMaintenancesRequest, + SummarizeMaintenancesResponse, + SummarizeMaintenancesPagedResponse> + summarizeMaintenancesSettings() { + return summarizeMaintenancesSettings; + } + + /** Returns the object with the settings used for calls to listResourceMaintenances. */ + public PagedCallSettings< + ListResourceMaintenancesRequest, + ListResourceMaintenancesResponse, + ListResourceMaintenancesPagedResponse> + listResourceMaintenancesSettings() { + return listResourceMaintenancesSettings; + } + + /** Returns the object with the settings used for calls to getResourceMaintenance. */ + public UnaryCallSettings + getResourceMaintenanceSettings() { + return getResourceMaintenanceSettings; + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return getLocationSettings; + } + + public MaintenanceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcMaintenanceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonMaintenanceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "maintenance"; + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + @ObsoleteApi("Use getEndpoint() instead") + public static String getDefaultEndpoint() { + return "maintenance.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "maintenance.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(MaintenanceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(MaintenanceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return MaintenanceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected MaintenanceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + summarizeMaintenancesSettings = settingsBuilder.summarizeMaintenancesSettings().build(); + listResourceMaintenancesSettings = settingsBuilder.listResourceMaintenancesSettings().build(); + getResourceMaintenanceSettings = settingsBuilder.getResourceMaintenanceSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); + } + + /** Builder for MaintenanceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final PagedCallSettings.Builder< + SummarizeMaintenancesRequest, + SummarizeMaintenancesResponse, + SummarizeMaintenancesPagedResponse> + summarizeMaintenancesSettings; + private final PagedCallSettings.Builder< + ListResourceMaintenancesRequest, + ListResourceMaintenancesResponse, + ListResourceMaintenancesPagedResponse> + listResourceMaintenancesSettings; + private final UnaryCallSettings.Builder + getResourceMaintenanceSettings; + private final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings.Builder getLocationSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + summarizeMaintenancesSettings = + PagedCallSettings.newBuilder(SUMMARIZE_MAINTENANCES_PAGE_STR_FACT); + listResourceMaintenancesSettings = + PagedCallSettings.newBuilder(LIST_RESOURCE_MAINTENANCES_PAGE_STR_FACT); + getResourceMaintenanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + summarizeMaintenancesSettings, + listResourceMaintenancesSettings, + getResourceMaintenanceSettings, + listLocationsSettings, + getLocationSettings); + initDefaults(this); + } + + protected Builder(MaintenanceStubSettings settings) { + super(settings); + + summarizeMaintenancesSettings = settings.summarizeMaintenancesSettings.toBuilder(); + listResourceMaintenancesSettings = settings.listResourceMaintenancesSettings.toBuilder(); + getResourceMaintenanceSettings = settings.getResourceMaintenanceSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + summarizeMaintenancesSettings, + listResourceMaintenancesSettings, + getResourceMaintenanceSettings, + listLocationsSettings, + getLocationSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .summarizeMaintenancesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listResourceMaintenancesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getResourceMaintenanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getLocationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to summarizeMaintenances. */ + public PagedCallSettings.Builder< + SummarizeMaintenancesRequest, + SummarizeMaintenancesResponse, + SummarizeMaintenancesPagedResponse> + summarizeMaintenancesSettings() { + return summarizeMaintenancesSettings; + } + + /** Returns the builder for the settings used for calls to listResourceMaintenances. */ + public PagedCallSettings.Builder< + ListResourceMaintenancesRequest, + ListResourceMaintenancesResponse, + ListResourceMaintenancesPagedResponse> + listResourceMaintenancesSettings() { + return listResourceMaintenancesSettings; + } + + /** Returns the builder for the settings used for calls to getResourceMaintenance. */ + public UnaryCallSettings.Builder + getResourceMaintenanceSettings() { + return getResourceMaintenanceSettings; + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getLocationSettings; + } + + @Override + public MaintenanceStubSettings build() throws IOException { + return new MaintenanceStubSettings(this); + } + } +} diff --git a/java-maintenance/google-cloud-maintenance/src/main/resources/META-INF/native-image/com.google.cloud.maintenance.api.v1/reflect-config.json b/java-maintenance/google-cloud-maintenance/src/main/resources/META-INF/native-image/com.google.cloud.maintenance.api.v1/reflect-config.json new file mode 100644 index 000000000000..82784135cf4c --- /dev/null +++ b/java-maintenance/google-cloud-maintenance/src/main/resources/META-INF/native-image/com.google.cloud.maintenance.api.v1/reflect-config.json @@ -0,0 +1,1559 @@ +[ + { + "name": "com.google.api.ClientLibraryDestination", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibraryOrganization", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibrarySettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibrarySettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CommonLanguageSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CommonLanguageSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CppSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CppSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CustomHttpPattern", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CustomHttpPattern$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.DotnetSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.DotnetSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.FieldBehavior", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.FieldInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.FieldInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.FieldInfo$Format", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.GoSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.GoSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Http", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Http$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.HttpRule", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.HttpRule$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.JavaSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.JavaSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.LaunchStage", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$LongRunning", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$LongRunning$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.NodeSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.NodeSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PhpSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PhpSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Publishing", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Publishing$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings$ExperimentalFeatures", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings$ExperimentalFeatures$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$History", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$Style", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceReference", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceReference$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RubySettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RubySettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.SelectiveGapicGeneration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.SelectiveGapicGeneration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.TypeReference", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.TypeReference$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.GetLocationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.GetLocationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.ListLocationsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.ListLocationsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.ListLocationsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.ListLocationsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.Location", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.Location$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.maintenance.api.v1.MaintenanceCategory", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.maintenance.api.v1.MaintenanceControl", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.maintenance.api.v1.MaintenanceControl$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.maintenance.api.v1.MaintenanceControl$Control", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.maintenance.api.v1.MaintenanceSummary", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.maintenance.api.v1.MaintenanceSummary$Aggregate", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.maintenance.api.v1.MaintenanceSummary$Aggregate$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.maintenance.api.v1.MaintenanceSummary$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.maintenance.api.v1.MaintenanceSummary$Stats", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.maintenance.api.v1.MaintenanceSummary$Stats$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.maintenance.api.v1.ResourceMaintenance", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.maintenance.api.v1.ResourceMaintenance$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.maintenance.api.v1.ResourceMaintenance$Maintenance", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.maintenance.api.v1.ResourceMaintenance$Maintenance$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.maintenance.api.v1.ResourceMaintenance$Resource", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.maintenance.api.v1.ResourceMaintenance$Resource$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.maintenance.api.v1.ResourceMaintenance$State", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Any", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Any$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ReservedRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ReservedRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$Edition", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$EnumReservedRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$EnumReservedRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Declaration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Declaration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$VerificationState", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$EnumType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$FieldPresence", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$JsonFormat", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$MessageEncoding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$RepeatedFieldEncoding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$Utf8Validation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$FeatureSetEditionDefault", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$FeatureSetEditionDefault$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Label", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Type", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$CType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$EditionDefault", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$EditionDefault$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$JSType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$OptionRetention", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$OptionTargetType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorSet", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorSet$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions$OptimizeMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation$Semantic", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MessageOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MessageOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions$IdempotencyLevel", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Location", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Location$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$NamePart", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$NamePart$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Duration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Duration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Timestamp", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Timestamp$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + } +] \ No newline at end of file diff --git a/java-maintenance/google-cloud-maintenance/src/test/java/com/google/cloud/maintenance/api/v1/MaintenanceClientHttpJsonTest.java b/java-maintenance/google-cloud-maintenance/src/test/java/com/google/cloud/maintenance/api/v1/MaintenanceClientHttpJsonTest.java new file mode 100644 index 000000000000..9de8b25dcf6b --- /dev/null +++ b/java-maintenance/google-cloud-maintenance/src/test/java/com/google/cloud/maintenance/api/v1/MaintenanceClientHttpJsonTest.java @@ -0,0 +1,531 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.maintenance.api.v1; + +import static com.google.cloud.maintenance.api.v1.MaintenanceClient.ListLocationsPagedResponse; +import static com.google.cloud.maintenance.api.v1.MaintenanceClient.ListResourceMaintenancesPagedResponse; +import static com.google.cloud.maintenance.api.v1.MaintenanceClient.SummarizeMaintenancesPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.maintenance.api.v1.stub.HttpJsonMaintenanceStub; +import com.google.common.collect.Lists; +import com.google.protobuf.Any; +import com.google.protobuf.Timestamp; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class MaintenanceClientHttpJsonTest { + private static MockHttpService mockService; + private static MaintenanceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonMaintenanceStub.getMethodDescriptors(), + MaintenanceSettings.getDefaultEndpoint()); + MaintenanceSettings settings = + MaintenanceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + MaintenanceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = MaintenanceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void summarizeMaintenancesTest() throws Exception { + MaintenanceSummary responsesElement = MaintenanceSummary.newBuilder().build(); + SummarizeMaintenancesResponse expectedResponse = + SummarizeMaintenancesResponse.newBuilder() + .setNextPageToken("") + .addAllMaintenances(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + SummarizeMaintenancesPagedResponse pagedListResponse = client.summarizeMaintenances(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getMaintenancesList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void summarizeMaintenancesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.summarizeMaintenances(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void summarizeMaintenancesTest2() throws Exception { + MaintenanceSummary responsesElement = MaintenanceSummary.newBuilder().build(); + SummarizeMaintenancesResponse expectedResponse = + SummarizeMaintenancesResponse.newBuilder() + .setNextPageToken("") + .addAllMaintenances(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + SummarizeMaintenancesPagedResponse pagedListResponse = client.summarizeMaintenances(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getMaintenancesList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void summarizeMaintenancesExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + client.summarizeMaintenances(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listResourceMaintenancesTest() throws Exception { + ResourceMaintenance responsesElement = ResourceMaintenance.newBuilder().build(); + ListResourceMaintenancesResponse expectedResponse = + ListResourceMaintenancesResponse.newBuilder() + .setNextPageToken("") + .addAllResourceMaintenances(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListResourceMaintenancesPagedResponse pagedListResponse = + client.listResourceMaintenances(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getResourceMaintenancesList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listResourceMaintenancesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listResourceMaintenances(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listResourceMaintenancesTest2() throws Exception { + ResourceMaintenance responsesElement = ResourceMaintenance.newBuilder().build(); + ListResourceMaintenancesResponse expectedResponse = + ListResourceMaintenancesResponse.newBuilder() + .setNextPageToken("") + .addAllResourceMaintenances(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListResourceMaintenancesPagedResponse pagedListResponse = + client.listResourceMaintenances(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getResourceMaintenancesList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listResourceMaintenancesExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + client.listResourceMaintenances(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getResourceMaintenanceTest() throws Exception { + ResourceMaintenance expectedResponse = + ResourceMaintenance.newBuilder() + .setName( + ResourceMaintenanceName.of("[PROJECT]", "[LOCATION]", "[RESOURCE_MAINTENANCE]") + .toString()) + .setResource(ResourceMaintenance.Resource.newBuilder().build()) + .setMaintenance(ResourceMaintenance.Maintenance.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setMaintenanceStartTime(Timestamp.newBuilder().build()) + .setMaintenanceEndTime(Timestamp.newBuilder().build()) + .setMaintenanceCancelTime(Timestamp.newBuilder().build()) + .setMaintenanceScheduledStartTime(Timestamp.newBuilder().build()) + .setMaintenanceScheduledEndTime(Timestamp.newBuilder().build()) + .setUserControllable(true) + .addAllControls(new ArrayList()) + .putAllLabels(new HashMap()) + .putAllAnnotations(new HashMap()) + .setUid("uid115792") + .setEtag("etag3123477") + .build(); + mockService.addResponse(expectedResponse); + + ResourceMaintenanceName name = + ResourceMaintenanceName.of("[PROJECT]", "[LOCATION]", "[RESOURCE_MAINTENANCE]"); + + ResourceMaintenance actualResponse = client.getResourceMaintenance(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getResourceMaintenanceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ResourceMaintenanceName name = + ResourceMaintenanceName.of("[PROJECT]", "[LOCATION]", "[RESOURCE_MAINTENANCE]"); + client.getResourceMaintenance(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getResourceMaintenanceTest2() throws Exception { + ResourceMaintenance expectedResponse = + ResourceMaintenance.newBuilder() + .setName( + ResourceMaintenanceName.of("[PROJECT]", "[LOCATION]", "[RESOURCE_MAINTENANCE]") + .toString()) + .setResource(ResourceMaintenance.Resource.newBuilder().build()) + .setMaintenance(ResourceMaintenance.Maintenance.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setMaintenanceStartTime(Timestamp.newBuilder().build()) + .setMaintenanceEndTime(Timestamp.newBuilder().build()) + .setMaintenanceCancelTime(Timestamp.newBuilder().build()) + .setMaintenanceScheduledStartTime(Timestamp.newBuilder().build()) + .setMaintenanceScheduledEndTime(Timestamp.newBuilder().build()) + .setUserControllable(true) + .addAllControls(new ArrayList()) + .putAllLabels(new HashMap()) + .putAllAnnotations(new HashMap()) + .setUid("uid115792") + .setEtag("etag3123477") + .build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-6286/locations/location-6286/resourceMaintenances/resourceMaintenance-6286"; + + ResourceMaintenance actualResponse = client.getResourceMaintenance(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getResourceMaintenanceExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-6286/locations/location-6286/resourceMaintenances/resourceMaintenance-6286"; + client.getResourceMaintenance(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getLocationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-maintenance/google-cloud-maintenance/src/test/java/com/google/cloud/maintenance/api/v1/MaintenanceClientTest.java b/java-maintenance/google-cloud-maintenance/src/test/java/com/google/cloud/maintenance/api/v1/MaintenanceClientTest.java new file mode 100644 index 000000000000..fa8121404399 --- /dev/null +++ b/java-maintenance/google-cloud-maintenance/src/test/java/com/google/cloud/maintenance/api/v1/MaintenanceClientTest.java @@ -0,0 +1,490 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.maintenance.api.v1; + +import static com.google.cloud.maintenance.api.v1.MaintenanceClient.ListLocationsPagedResponse; +import static com.google.cloud.maintenance.api.v1.MaintenanceClient.ListResourceMaintenancesPagedResponse; +import static com.google.cloud.maintenance.api.v1.MaintenanceClient.SummarizeMaintenancesPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.UUID; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class MaintenanceClientTest { + private static MockLocations mockLocations; + private static MockMaintenance mockMaintenance; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private MaintenanceClient client; + + @BeforeClass + public static void startStaticServer() { + mockMaintenance = new MockMaintenance(); + mockLocations = new MockLocations(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockMaintenance, mockLocations)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + MaintenanceSettings settings = + MaintenanceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = MaintenanceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void summarizeMaintenancesTest() throws Exception { + MaintenanceSummary responsesElement = MaintenanceSummary.newBuilder().build(); + SummarizeMaintenancesResponse expectedResponse = + SummarizeMaintenancesResponse.newBuilder() + .setNextPageToken("") + .addAllMaintenances(Arrays.asList(responsesElement)) + .build(); + mockMaintenance.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + SummarizeMaintenancesPagedResponse pagedListResponse = client.summarizeMaintenances(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getMaintenancesList().get(0), resources.get(0)); + + List actualRequests = mockMaintenance.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SummarizeMaintenancesRequest actualRequest = + ((SummarizeMaintenancesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void summarizeMaintenancesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMaintenance.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.summarizeMaintenances(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void summarizeMaintenancesTest2() throws Exception { + MaintenanceSummary responsesElement = MaintenanceSummary.newBuilder().build(); + SummarizeMaintenancesResponse expectedResponse = + SummarizeMaintenancesResponse.newBuilder() + .setNextPageToken("") + .addAllMaintenances(Arrays.asList(responsesElement)) + .build(); + mockMaintenance.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + SummarizeMaintenancesPagedResponse pagedListResponse = client.summarizeMaintenances(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getMaintenancesList().get(0), resources.get(0)); + + List actualRequests = mockMaintenance.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SummarizeMaintenancesRequest actualRequest = + ((SummarizeMaintenancesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void summarizeMaintenancesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMaintenance.addException(exception); + + try { + String parent = "parent-995424086"; + client.summarizeMaintenances(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listResourceMaintenancesTest() throws Exception { + ResourceMaintenance responsesElement = ResourceMaintenance.newBuilder().build(); + ListResourceMaintenancesResponse expectedResponse = + ListResourceMaintenancesResponse.newBuilder() + .setNextPageToken("") + .addAllResourceMaintenances(Arrays.asList(responsesElement)) + .build(); + mockMaintenance.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListResourceMaintenancesPagedResponse pagedListResponse = + client.listResourceMaintenances(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getResourceMaintenancesList().get(0), resources.get(0)); + + List actualRequests = mockMaintenance.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListResourceMaintenancesRequest actualRequest = + ((ListResourceMaintenancesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listResourceMaintenancesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMaintenance.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listResourceMaintenances(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listResourceMaintenancesTest2() throws Exception { + ResourceMaintenance responsesElement = ResourceMaintenance.newBuilder().build(); + ListResourceMaintenancesResponse expectedResponse = + ListResourceMaintenancesResponse.newBuilder() + .setNextPageToken("") + .addAllResourceMaintenances(Arrays.asList(responsesElement)) + .build(); + mockMaintenance.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListResourceMaintenancesPagedResponse pagedListResponse = + client.listResourceMaintenances(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getResourceMaintenancesList().get(0), resources.get(0)); + + List actualRequests = mockMaintenance.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListResourceMaintenancesRequest actualRequest = + ((ListResourceMaintenancesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listResourceMaintenancesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMaintenance.addException(exception); + + try { + String parent = "parent-995424086"; + client.listResourceMaintenances(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getResourceMaintenanceTest() throws Exception { + ResourceMaintenance expectedResponse = + ResourceMaintenance.newBuilder() + .setName( + ResourceMaintenanceName.of("[PROJECT]", "[LOCATION]", "[RESOURCE_MAINTENANCE]") + .toString()) + .setResource(ResourceMaintenance.Resource.newBuilder().build()) + .setMaintenance(ResourceMaintenance.Maintenance.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setMaintenanceStartTime(Timestamp.newBuilder().build()) + .setMaintenanceEndTime(Timestamp.newBuilder().build()) + .setMaintenanceCancelTime(Timestamp.newBuilder().build()) + .setMaintenanceScheduledStartTime(Timestamp.newBuilder().build()) + .setMaintenanceScheduledEndTime(Timestamp.newBuilder().build()) + .setUserControllable(true) + .addAllControls(new ArrayList()) + .putAllLabels(new HashMap()) + .putAllAnnotations(new HashMap()) + .setUid("uid115792") + .setEtag("etag3123477") + .build(); + mockMaintenance.addResponse(expectedResponse); + + ResourceMaintenanceName name = + ResourceMaintenanceName.of("[PROJECT]", "[LOCATION]", "[RESOURCE_MAINTENANCE]"); + + ResourceMaintenance actualResponse = client.getResourceMaintenance(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMaintenance.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetResourceMaintenanceRequest actualRequest = + ((GetResourceMaintenanceRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getResourceMaintenanceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMaintenance.addException(exception); + + try { + ResourceMaintenanceName name = + ResourceMaintenanceName.of("[PROJECT]", "[LOCATION]", "[RESOURCE_MAINTENANCE]"); + client.getResourceMaintenance(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getResourceMaintenanceTest2() throws Exception { + ResourceMaintenance expectedResponse = + ResourceMaintenance.newBuilder() + .setName( + ResourceMaintenanceName.of("[PROJECT]", "[LOCATION]", "[RESOURCE_MAINTENANCE]") + .toString()) + .setResource(ResourceMaintenance.Resource.newBuilder().build()) + .setMaintenance(ResourceMaintenance.Maintenance.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setMaintenanceStartTime(Timestamp.newBuilder().build()) + .setMaintenanceEndTime(Timestamp.newBuilder().build()) + .setMaintenanceCancelTime(Timestamp.newBuilder().build()) + .setMaintenanceScheduledStartTime(Timestamp.newBuilder().build()) + .setMaintenanceScheduledEndTime(Timestamp.newBuilder().build()) + .setUserControllable(true) + .addAllControls(new ArrayList()) + .putAllLabels(new HashMap()) + .putAllAnnotations(new HashMap()) + .setUid("uid115792") + .setEtag("etag3123477") + .build(); + mockMaintenance.addResponse(expectedResponse); + + String name = "name3373707"; + + ResourceMaintenance actualResponse = client.getResourceMaintenance(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMaintenance.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetResourceMaintenanceRequest actualRequest = + ((GetResourceMaintenanceRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getResourceMaintenanceExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMaintenance.addException(exception); + + try { + String name = "name3373707"; + client.getResourceMaintenance(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockLocations.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockLocations.addResponse(expectedResponse); + + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLocationRequest actualRequest = ((GetLocationRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLocationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-maintenance/google-cloud-maintenance/src/test/java/com/google/cloud/maintenance/api/v1/MockLocations.java b/java-maintenance/google-cloud-maintenance/src/test/java/com/google/cloud/maintenance/api/v1/MockLocations.java new file mode 100644 index 000000000000..54757fa9c7d3 --- /dev/null +++ b/java-maintenance/google-cloud-maintenance/src/test/java/com/google/cloud/maintenance/api/v1/MockLocations.java @@ -0,0 +1,59 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.maintenance.api.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockLocations implements MockGrpcService { + private final MockLocationsImpl serviceImpl; + + public MockLocations() { + serviceImpl = new MockLocationsImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-maintenance/google-cloud-maintenance/src/test/java/com/google/cloud/maintenance/api/v1/MockLocationsImpl.java b/java-maintenance/google-cloud-maintenance/src/test/java/com/google/cloud/maintenance/api/v1/MockLocationsImpl.java new file mode 100644 index 000000000000..3bc0307c69ad --- /dev/null +++ b/java-maintenance/google-cloud-maintenance/src/test/java/com/google/cloud/maintenance/api/v1/MockLocationsImpl.java @@ -0,0 +1,105 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.maintenance.api.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.location.LocationsGrpc.LocationsImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockLocationsImpl extends LocationsImplBase { + private List requests; + private Queue responses; + + public MockLocationsImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void listLocations( + ListLocationsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListLocationsResponse) { + requests.add(request); + responseObserver.onNext(((ListLocationsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListLocations, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListLocationsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getLocation(GetLocationRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Location) { + requests.add(request); + responseObserver.onNext(((Location) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetLocation, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Location.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-maintenance/google-cloud-maintenance/src/test/java/com/google/cloud/maintenance/api/v1/MockMaintenance.java b/java-maintenance/google-cloud-maintenance/src/test/java/com/google/cloud/maintenance/api/v1/MockMaintenance.java new file mode 100644 index 000000000000..76be8b094e41 --- /dev/null +++ b/java-maintenance/google-cloud-maintenance/src/test/java/com/google/cloud/maintenance/api/v1/MockMaintenance.java @@ -0,0 +1,59 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.maintenance.api.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockMaintenance implements MockGrpcService { + private final MockMaintenanceImpl serviceImpl; + + public MockMaintenance() { + serviceImpl = new MockMaintenanceImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-maintenance/google-cloud-maintenance/src/test/java/com/google/cloud/maintenance/api/v1/MockMaintenanceImpl.java b/java-maintenance/google-cloud-maintenance/src/test/java/com/google/cloud/maintenance/api/v1/MockMaintenanceImpl.java new file mode 100644 index 000000000000..d84eb3ea5170 --- /dev/null +++ b/java-maintenance/google-cloud-maintenance/src/test/java/com/google/cloud/maintenance/api/v1/MockMaintenanceImpl.java @@ -0,0 +1,128 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.maintenance.api.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.maintenance.api.v1.MaintenanceGrpc.MaintenanceImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockMaintenanceImpl extends MaintenanceImplBase { + private List requests; + private Queue responses; + + public MockMaintenanceImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void summarizeMaintenances( + SummarizeMaintenancesRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof SummarizeMaintenancesResponse) { + requests.add(request); + responseObserver.onNext(((SummarizeMaintenancesResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method SummarizeMaintenances, expected %s or" + + " %s", + response == null ? "null" : response.getClass().getName(), + SummarizeMaintenancesResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listResourceMaintenances( + ListResourceMaintenancesRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListResourceMaintenancesResponse) { + requests.add(request); + responseObserver.onNext(((ListResourceMaintenancesResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListResourceMaintenances, expected %s" + + " or %s", + response == null ? "null" : response.getClass().getName(), + ListResourceMaintenancesResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getResourceMaintenance( + GetResourceMaintenanceRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ResourceMaintenance) { + requests.add(request); + responseObserver.onNext(((ResourceMaintenance) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetResourceMaintenance, expected %s or" + + " %s", + response == null ? "null" : response.getClass().getName(), + ResourceMaintenance.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-maintenance/grpc-google-cloud-maintenance-v1/pom.xml b/java-maintenance/grpc-google-cloud-maintenance-v1/pom.xml new file mode 100644 index 000000000000..24952259c3f1 --- /dev/null +++ b/java-maintenance/grpc-google-cloud-maintenance-v1/pom.xml @@ -0,0 +1,45 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-maintenance-v1 + 0.15.0-SNAPSHOT + grpc-google-cloud-maintenance-v1 + GRPC library for google-cloud-maintenance + + com.google.cloud + google-cloud-maintenance-parent + 0.15.0-SNAPSHOT + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-cloud-maintenance-v1 + + + com.google.guava + guava + + + diff --git a/java-maintenance/grpc-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/MaintenanceGrpc.java b/java-maintenance/grpc-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/MaintenanceGrpc.java new file mode 100644 index 000000000000..49bad27abf2b --- /dev/null +++ b/java-maintenance/grpc-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/MaintenanceGrpc.java @@ -0,0 +1,710 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.maintenance.api.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Unified Maintenance service
+ * 
+ */ +@io.grpc.stub.annotations.GrpcGenerated +public final class MaintenanceGrpc { + + private MaintenanceGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.cloud.maintenance.api.v1.Maintenance"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest, + com.google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse> + getSummarizeMaintenancesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SummarizeMaintenances", + requestType = com.google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest.class, + responseType = com.google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest, + com.google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse> + getSummarizeMaintenancesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest, + com.google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse> + getSummarizeMaintenancesMethod; + if ((getSummarizeMaintenancesMethod = MaintenanceGrpc.getSummarizeMaintenancesMethod) == null) { + synchronized (MaintenanceGrpc.class) { + if ((getSummarizeMaintenancesMethod = MaintenanceGrpc.getSummarizeMaintenancesMethod) + == null) { + MaintenanceGrpc.getSummarizeMaintenancesMethod = + getSummarizeMaintenancesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "SummarizeMaintenances")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new MaintenanceMethodDescriptorSupplier("SummarizeMaintenances")) + .build(); + } + } + } + return getSummarizeMaintenancesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest, + com.google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse> + getListResourceMaintenancesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListResourceMaintenances", + requestType = com.google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest.class, + responseType = com.google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest, + com.google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse> + getListResourceMaintenancesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest, + com.google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse> + getListResourceMaintenancesMethod; + if ((getListResourceMaintenancesMethod = MaintenanceGrpc.getListResourceMaintenancesMethod) + == null) { + synchronized (MaintenanceGrpc.class) { + if ((getListResourceMaintenancesMethod = MaintenanceGrpc.getListResourceMaintenancesMethod) + == null) { + MaintenanceGrpc.getListResourceMaintenancesMethod = + getListResourceMaintenancesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ListResourceMaintenances")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new MaintenanceMethodDescriptorSupplier("ListResourceMaintenances")) + .build(); + } + } + } + return getListResourceMaintenancesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest, + com.google.cloud.maintenance.api.v1.ResourceMaintenance> + getGetResourceMaintenanceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetResourceMaintenance", + requestType = com.google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest.class, + responseType = com.google.cloud.maintenance.api.v1.ResourceMaintenance.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest, + com.google.cloud.maintenance.api.v1.ResourceMaintenance> + getGetResourceMaintenanceMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest, + com.google.cloud.maintenance.api.v1.ResourceMaintenance> + getGetResourceMaintenanceMethod; + if ((getGetResourceMaintenanceMethod = MaintenanceGrpc.getGetResourceMaintenanceMethod) + == null) { + synchronized (MaintenanceGrpc.class) { + if ((getGetResourceMaintenanceMethod = MaintenanceGrpc.getGetResourceMaintenanceMethod) + == null) { + MaintenanceGrpc.getGetResourceMaintenanceMethod = + getGetResourceMaintenanceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "GetResourceMaintenance")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.maintenance.api.v1.ResourceMaintenance + .getDefaultInstance())) + .setSchemaDescriptor( + new MaintenanceMethodDescriptorSupplier("GetResourceMaintenance")) + .build(); + } + } + } + return getGetResourceMaintenanceMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static MaintenanceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public MaintenanceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MaintenanceStub(channel, callOptions); + } + }; + return MaintenanceStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static MaintenanceBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public MaintenanceBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MaintenanceBlockingV2Stub(channel, callOptions); + } + }; + return MaintenanceBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static MaintenanceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public MaintenanceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MaintenanceBlockingStub(channel, callOptions); + } + }; + return MaintenanceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static MaintenanceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public MaintenanceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MaintenanceFutureStub(channel, callOptions); + } + }; + return MaintenanceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Unified Maintenance service
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Retrieves the statistics of a specific maintenance.
+     * 
+ */ + default void summarizeMaintenances( + com.google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getSummarizeMaintenancesMethod(), responseObserver); + } + + /** + * + * + *
+     * Retrieve a collection of resource maintenances.
+     * 
+ */ + default void listResourceMaintenances( + com.google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListResourceMaintenancesMethod(), responseObserver); + } + + /** + * + * + *
+     * Retrieve a single resource maintenance.
+     * 
+ */ + default void getResourceMaintenance( + com.google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetResourceMaintenanceMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service Maintenance. + * + *
+   * Unified Maintenance service
+   * 
+ */ + public abstract static class MaintenanceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return MaintenanceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service Maintenance. + * + *
+   * Unified Maintenance service
+   * 
+ */ + public static final class MaintenanceStub + extends io.grpc.stub.AbstractAsyncStub { + private MaintenanceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected MaintenanceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MaintenanceStub(channel, callOptions); + } + + /** + * + * + *
+     * Retrieves the statistics of a specific maintenance.
+     * 
+ */ + public void summarizeMaintenances( + com.google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getSummarizeMaintenancesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Retrieve a collection of resource maintenances.
+     * 
+ */ + public void listResourceMaintenances( + com.google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListResourceMaintenancesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Retrieve a single resource maintenance.
+     * 
+ */ + public void getResourceMaintenance( + com.google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetResourceMaintenanceMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service Maintenance. + * + *
+   * Unified Maintenance service
+   * 
+ */ + public static final class MaintenanceBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private MaintenanceBlockingV2Stub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected MaintenanceBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MaintenanceBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
+     * Retrieves the statistics of a specific maintenance.
+     * 
+ */ + public com.google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse summarizeMaintenances( + com.google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getSummarizeMaintenancesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieve a collection of resource maintenances.
+     * 
+ */ + public com.google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse + listResourceMaintenances( + com.google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListResourceMaintenancesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieve a single resource maintenance.
+     * 
+ */ + public com.google.cloud.maintenance.api.v1.ResourceMaintenance getResourceMaintenance( + com.google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetResourceMaintenanceMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service Maintenance. + * + *
+   * Unified Maintenance service
+   * 
+ */ + public static final class MaintenanceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private MaintenanceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected MaintenanceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MaintenanceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Retrieves the statistics of a specific maintenance.
+     * 
+ */ + public com.google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse summarizeMaintenances( + com.google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSummarizeMaintenancesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieve a collection of resource maintenances.
+     * 
+ */ + public com.google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse + listResourceMaintenances( + com.google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListResourceMaintenancesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieve a single resource maintenance.
+     * 
+ */ + public com.google.cloud.maintenance.api.v1.ResourceMaintenance getResourceMaintenance( + com.google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetResourceMaintenanceMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service Maintenance. + * + *
+   * Unified Maintenance service
+   * 
+ */ + public static final class MaintenanceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private MaintenanceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected MaintenanceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MaintenanceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Retrieves the statistics of a specific maintenance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse> + summarizeMaintenances( + com.google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getSummarizeMaintenancesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Retrieve a collection of resource maintenances.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse> + listResourceMaintenances( + com.google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListResourceMaintenancesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Retrieve a single resource maintenance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.maintenance.api.v1.ResourceMaintenance> + getResourceMaintenance( + com.google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetResourceMaintenanceMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_SUMMARIZE_MAINTENANCES = 0; + private static final int METHODID_LIST_RESOURCE_MAINTENANCES = 1; + private static final int METHODID_GET_RESOURCE_MAINTENANCE = 2; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_SUMMARIZE_MAINTENANCES: + serviceImpl.summarizeMaintenances( + (com.google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse>) + responseObserver); + break; + case METHODID_LIST_RESOURCE_MAINTENANCES: + serviceImpl.listResourceMaintenances( + (com.google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse>) + responseObserver); + break; + case METHODID_GET_RESOURCE_MAINTENANCE: + serviceImpl.getResourceMaintenance( + (com.google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getSummarizeMaintenancesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest, + com.google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse>( + service, METHODID_SUMMARIZE_MAINTENANCES))) + .addMethod( + getListResourceMaintenancesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest, + com.google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse>( + service, METHODID_LIST_RESOURCE_MAINTENANCES))) + .addMethod( + getGetResourceMaintenanceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest, + com.google.cloud.maintenance.api.v1.ResourceMaintenance>( + service, METHODID_GET_RESOURCE_MAINTENANCE))) + .build(); + } + + private abstract static class MaintenanceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + MaintenanceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("Maintenance"); + } + } + + private static final class MaintenanceFileDescriptorSupplier + extends MaintenanceBaseDescriptorSupplier { + MaintenanceFileDescriptorSupplier() {} + } + + private static final class MaintenanceMethodDescriptorSupplier + extends MaintenanceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + MaintenanceMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (MaintenanceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new MaintenanceFileDescriptorSupplier()) + .addMethod(getSummarizeMaintenancesMethod()) + .addMethod(getListResourceMaintenancesMethod()) + .addMethod(getGetResourceMaintenanceMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-maintenance/pom.xml b/java-maintenance/pom.xml index 21f5c7618e5c..e9300a2e21d9 100644 --- a/java-maintenance/pom.xml +++ b/java-maintenance/pom.xml @@ -31,6 +31,16 @@ google-cloud-maintenance 0.15.0-SNAPSHOT + + com.google.api.grpc + proto-google-cloud-maintenance-v1 + 0.15.0-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-maintenance-v1 + 0.15.0-SNAPSHOT + com.google.api.grpc grpc-google-cloud-maintenance-v1beta @@ -48,7 +58,9 @@ google-cloud-maintenance grpc-google-cloud-maintenance-v1beta + grpc-google-cloud-maintenance-v1 proto-google-cloud-maintenance-v1beta + proto-google-cloud-maintenance-v1 google-cloud-maintenance-bom diff --git a/java-maintenance/proto-google-cloud-maintenance-v1/clirr-ignored-differences.xml b/java-maintenance/proto-google-cloud-maintenance-v1/clirr-ignored-differences.xml new file mode 100644 index 000000000000..18ae57c530d6 --- /dev/null +++ b/java-maintenance/proto-google-cloud-maintenance-v1/clirr-ignored-differences.xml @@ -0,0 +1,80 @@ + + + + + 7012 + com/google/cloud/maintenance/api/v1/*OrBuilder + * get*(*) + + + 7012 + com/google/cloud/maintenance/api/v1/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/cloud/maintenance/api/v1/*OrBuilder + boolean has*(*) + + + + 7006 + com/google/cloud/maintenance/api/v1/** + * getDefaultInstanceForType() + ** + + + 7006 + com/google/cloud/maintenance/api/v1/** + * addRepeatedField(*) + ** + + + 7006 + com/google/cloud/maintenance/api/v1/** + * clear() + ** + + + 7006 + com/google/cloud/maintenance/api/v1/** + * clearField(*) + ** + + + 7006 + com/google/cloud/maintenance/api/v1/** + * clearOneof(*) + ** + + + 7006 + com/google/cloud/maintenance/api/v1/** + * clone() + ** + + + 7006 + com/google/cloud/maintenance/api/v1/** + * mergeUnknownFields(*) + ** + + + 7006 + com/google/cloud/maintenance/api/v1/** + * setField(*) + ** + + + 7006 + com/google/cloud/maintenance/api/v1/** + * setRepeatedField(*) + ** + + + 7006 + com/google/cloud/maintenance/api/v1/** + * setUnknownFields(*) + ** + + diff --git a/java-maintenance/proto-google-cloud-maintenance-v1/pom.xml b/java-maintenance/proto-google-cloud-maintenance-v1/pom.xml new file mode 100644 index 000000000000..3daeb5319486 --- /dev/null +++ b/java-maintenance/proto-google-cloud-maintenance-v1/pom.xml @@ -0,0 +1,37 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-maintenance-v1 + 0.15.0-SNAPSHOT + proto-google-cloud-maintenance-v1 + Proto library for google-cloud-maintenance + + com.google.cloud + google-cloud-maintenance-parent + 0.15.0-SNAPSHOT + + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.api + api-common + + + com.google.guava + guava + + + diff --git a/java-maintenance/proto-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/GetResourceMaintenanceRequest.java b/java-maintenance/proto-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/GetResourceMaintenanceRequest.java new file mode 100644 index 000000000000..502a10444c16 --- /dev/null +++ b/java-maintenance/proto-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/GetResourceMaintenanceRequest.java @@ -0,0 +1,658 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/maintenance/api/v1/maintenance_service.proto + +// Protobuf Java Version: 3.25.8 +package com.google.cloud.maintenance.api.v1; + +/** + * + * + *
+ * The request structure for the GetResourceMaintenance method.
+ * 
+ * + * Protobuf type {@code google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest} + */ +public final class GetResourceMaintenanceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest) + GetResourceMaintenanceRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use GetResourceMaintenanceRequest.newBuilder() to construct. + private GetResourceMaintenanceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetResourceMaintenanceRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetResourceMaintenanceRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_GetResourceMaintenanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_GetResourceMaintenanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest.class, + com.google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 10001; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The resource name of the resource within a service.
+   * 
+ * + * + * string name = 10001 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The resource name of the resource within a service.
+   * 
+ * + * + * string name = 10001 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10001, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10001, name_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest)) { + return super.equals(obj); + } + com.google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest other = + (com.google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The request structure for the GetResourceMaintenance method.
+   * 
+ * + * Protobuf type {@code google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest) + com.google.cloud.maintenance.api.v1.GetResourceMaintenanceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_GetResourceMaintenanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_GetResourceMaintenanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest.class, + com.google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest.Builder.class); + } + + // Construct using + // com.google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_GetResourceMaintenanceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest + getDefaultInstanceForType() { + return com.google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest build() { + com.google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest buildPartial() { + com.google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest result = + new com.google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest) { + return mergeFrom((com.google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest other) { + if (other + == com.google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 80010: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 80010 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. The resource name of the resource within a service.
+     * 
+ * + * + * string name = 10001 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The resource name of the resource within a service.
+     * 
+ * + * + * string name = 10001 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The resource name of the resource within a service.
+     * 
+ * + * + * string name = 10001 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The resource name of the resource within a service.
+     * 
+ * + * + * string name = 10001 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The resource name of the resource within a service.
+     * 
+ * + * + * string name = 10001 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest) + private static final com.google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest(); + } + + public static com.google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetResourceMaintenanceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maintenance/proto-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/GetResourceMaintenanceRequestOrBuilder.java b/java-maintenance/proto-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/GetResourceMaintenanceRequestOrBuilder.java new file mode 100644 index 000000000000..dfa18e47aa32 --- /dev/null +++ b/java-maintenance/proto-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/GetResourceMaintenanceRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/maintenance/api/v1/maintenance_service.proto + +// Protobuf Java Version: 3.25.8 +package com.google.cloud.maintenance.api.v1; + +public interface GetResourceMaintenanceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the resource within a service.
+   * 
+ * + * + * string name = 10001 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Required. The resource name of the resource within a service.
+   * 
+ * + * + * string name = 10001 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-maintenance/proto-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/ListResourceMaintenancesRequest.java b/java-maintenance/proto-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/ListResourceMaintenancesRequest.java new file mode 100644 index 000000000000..38f90639ce6e --- /dev/null +++ b/java-maintenance/proto-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/ListResourceMaintenancesRequest.java @@ -0,0 +1,1332 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/maintenance/api/v1/maintenance_service.proto + +// Protobuf Java Version: 3.25.8 +package com.google.cloud.maintenance.api.v1; + +/** + * + * + *
+ * The request structure for the ListResourceMaintenances method.
+ * 
+ * + * Protobuf type {@code google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest} + */ +public final class ListResourceMaintenancesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest) + ListResourceMaintenancesRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ListResourceMaintenancesRequest.newBuilder() to construct. + private ListResourceMaintenancesRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListResourceMaintenancesRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListResourceMaintenancesRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_ListResourceMaintenancesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_ListResourceMaintenancesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest.class, + com.google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 10006; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
+   * Required. The parent of the resource maintenance.
+   * 
+ * + * + * string parent = 10006 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The parent of the resource maintenance.
+   * 
+ * + * + * string parent = 10006 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 10505; + private int pageSize_ = 0; + + /** + * + * + *
+   * The maximum number of resource maintenances to send per page.
+   * 
+ * + * int32 page_size = 10505; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 10506; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + + /** + * + * + *
+   * The page token: If the next_page_token from a previous response
+   * is provided, this request will send the subsequent page.
+   * 
+ * + * string page_token = 10506; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * The page token: If the next_page_token from a previous response
+   * is provided, this request will send the subsequent page.
+   * 
+ * + * string page_token = 10506; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 10507; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + + /** + * + * + *
+   * Filter the list as specified in https://google.aip.dev/160.
+   * 
+ * + * string filter = 10507; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + + /** + * + * + *
+   * Filter the list as specified in https://google.aip.dev/160.
+   * 
+ * + * string filter = 10507; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 10508; + + @SuppressWarnings("serial") + private volatile java.lang.Object orderBy_ = ""; + + /** + * + * + *
+   * Order results as specified in https://google.aip.dev/132.
+   * 
+ * + * string order_by = 10508; + * + * @return The orderBy. + */ + @java.lang.Override + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } + } + + /** + * + * + *
+   * Order results as specified in https://google.aip.dev/132.
+   * 
+ * + * string order_by = 10508; + * + * @return The bytes for orderBy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10006, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(10505, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10506, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10507, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10508, orderBy_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10006, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(10505, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10506, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10507, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10508, orderBy_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest)) { + return super.equals(obj); + } + com.google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest other = + (com.google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getOrderBy().equals(other.getOrderBy())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The request structure for the ListResourceMaintenances method.
+   * 
+ * + * Protobuf type {@code google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest) + com.google.cloud.maintenance.api.v1.ListResourceMaintenancesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_ListResourceMaintenancesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_ListResourceMaintenancesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest.class, + com.google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest.Builder.class); + } + + // Construct using + // com.google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_ListResourceMaintenancesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest + getDefaultInstanceForType() { + return com.google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest build() { + com.google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest buildPartial() { + com.google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest result = + new com.google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.filter_ = filter_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.orderBy_ = orderBy_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest) { + return mergeFrom( + (com.google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest other) { + if (other + == com.google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest + .getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + bitField0_ |= 0x00000010; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 80050: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 80050 + case 84040: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 84040 + case 84050: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 84050 + case 84058: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 84058 + case 84066: + { + orderBy_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 84066 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + + /** + * + * + *
+     * Required. The parent of the resource maintenance.
+     * 
+ * + * + * string parent = 10006 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The parent of the resource maintenance.
+     * 
+ * + * + * string parent = 10006 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The parent of the resource maintenance.
+     * 
+ * + * + * string parent = 10006 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The parent of the resource maintenance.
+     * 
+ * + * + * string parent = 10006 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The parent of the resource maintenance.
+     * 
+ * + * + * string parent = 10006 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + + /** + * + * + *
+     * The maximum number of resource maintenances to send per page.
+     * 
+ * + * int32 page_size = 10505; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + /** + * + * + *
+     * The maximum number of resource maintenances to send per page.
+     * 
+ * + * int32 page_size = 10505; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The maximum number of resource maintenances to send per page.
+     * 
+ * + * int32 page_size = 10505; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
+     * The page token: If the next_page_token from a previous response
+     * is provided, this request will send the subsequent page.
+     * 
+ * + * string page_token = 10506; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The page token: If the next_page_token from a previous response
+     * is provided, this request will send the subsequent page.
+     * 
+ * + * string page_token = 10506; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The page token: If the next_page_token from a previous response
+     * is provided, this request will send the subsequent page.
+     * 
+ * + * string page_token = 10506; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The page token: If the next_page_token from a previous response
+     * is provided, this request will send the subsequent page.
+     * 
+ * + * string page_token = 10506; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * The page token: If the next_page_token from a previous response
+     * is provided, this request will send the subsequent page.
+     * 
+ * + * string page_token = 10506; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + + /** + * + * + *
+     * Filter the list as specified in https://google.aip.dev/160.
+     * 
+ * + * string filter = 10507; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Filter the list as specified in https://google.aip.dev/160.
+     * 
+ * + * string filter = 10507; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Filter the list as specified in https://google.aip.dev/160.
+     * 
+ * + * string filter = 10507; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Filter the list as specified in https://google.aip.dev/160.
+     * 
+ * + * string filter = 10507; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * Filter the list as specified in https://google.aip.dev/160.
+     * 
+ * + * string filter = 10507; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + filter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + + /** + * + * + *
+     * Order results as specified in https://google.aip.dev/132.
+     * 
+ * + * string order_by = 10508; + * + * @return The orderBy. + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Order results as specified in https://google.aip.dev/132.
+     * 
+ * + * string order_by = 10508; + * + * @return The bytes for orderBy. + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Order results as specified in https://google.aip.dev/132.
+     * 
+ * + * string order_by = 10508; + * + * @param value The orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + orderBy_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Order results as specified in https://google.aip.dev/132.
+     * 
+ * + * string order_by = 10508; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + orderBy_ = getDefaultInstance().getOrderBy(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + + /** + * + * + *
+     * Order results as specified in https://google.aip.dev/132.
+     * 
+ * + * string order_by = 10508; + * + * @param value The bytes for orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + orderBy_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest) + private static final com.google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest(); + } + + public static com.google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListResourceMaintenancesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maintenance/proto-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/ListResourceMaintenancesRequestOrBuilder.java b/java-maintenance/proto-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/ListResourceMaintenancesRequestOrBuilder.java new file mode 100644 index 000000000000..073d53fe3aa6 --- /dev/null +++ b/java-maintenance/proto-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/ListResourceMaintenancesRequestOrBuilder.java @@ -0,0 +1,149 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/maintenance/api/v1/maintenance_service.proto + +// Protobuf Java Version: 3.25.8 +package com.google.cloud.maintenance.api.v1; + +public interface ListResourceMaintenancesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent of the resource maintenance.
+   * 
+ * + * + * string parent = 10006 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
+   * Required. The parent of the resource maintenance.
+   * 
+ * + * + * string parent = 10006 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The maximum number of resource maintenances to send per page.
+   * 
+ * + * int32 page_size = 10505; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * The page token: If the next_page_token from a previous response
+   * is provided, this request will send the subsequent page.
+   * 
+ * + * string page_token = 10506; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
+   * The page token: If the next_page_token from a previous response
+   * is provided, this request will send the subsequent page.
+   * 
+ * + * string page_token = 10506; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Filter the list as specified in https://google.aip.dev/160.
+   * 
+ * + * string filter = 10507; + * + * @return The filter. + */ + java.lang.String getFilter(); + + /** + * + * + *
+   * Filter the list as specified in https://google.aip.dev/160.
+   * 
+ * + * string filter = 10507; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Order results as specified in https://google.aip.dev/132.
+   * 
+ * + * string order_by = 10508; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + + /** + * + * + *
+   * Order results as specified in https://google.aip.dev/132.
+   * 
+ * + * string order_by = 10508; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); +} diff --git a/java-maintenance/proto-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/ListResourceMaintenancesResponse.java b/java-maintenance/proto-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/ListResourceMaintenancesResponse.java new file mode 100644 index 000000000000..c73eb4bd43be --- /dev/null +++ b/java-maintenance/proto-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/ListResourceMaintenancesResponse.java @@ -0,0 +1,1539 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/maintenance/api/v1/maintenance_service.proto + +// Protobuf Java Version: 3.25.8 +package com.google.cloud.maintenance.api.v1; + +/** + * + * + *
+ * The response structure for the ListResourceMaintenances method.
+ * 
+ * + * Protobuf type {@code google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse} + */ +public final class ListResourceMaintenancesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse) + ListResourceMaintenancesResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ListResourceMaintenancesResponse.newBuilder() to construct. + private ListResourceMaintenancesResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListResourceMaintenancesResponse() { + resourceMaintenances_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListResourceMaintenancesResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_ListResourceMaintenancesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_ListResourceMaintenancesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse.class, + com.google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse.Builder.class); + } + + public static final int RESOURCE_MAINTENANCES_FIELD_NUMBER = 10509; + + @SuppressWarnings("serial") + private java.util.List + resourceMaintenances_; + + /** + * + * + *
+   * The resulting resource maintenances.
+   * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.ResourceMaintenance resource_maintenances = 10509; + * + */ + @java.lang.Override + public java.util.List + getResourceMaintenancesList() { + return resourceMaintenances_; + } + + /** + * + * + *
+   * The resulting resource maintenances.
+   * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.ResourceMaintenance resource_maintenances = 10509; + * + */ + @java.lang.Override + public java.util.List + getResourceMaintenancesOrBuilderList() { + return resourceMaintenances_; + } + + /** + * + * + *
+   * The resulting resource maintenances.
+   * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.ResourceMaintenance resource_maintenances = 10509; + * + */ + @java.lang.Override + public int getResourceMaintenancesCount() { + return resourceMaintenances_.size(); + } + + /** + * + * + *
+   * The resulting resource maintenances.
+   * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.ResourceMaintenance resource_maintenances = 10509; + * + */ + @java.lang.Override + public com.google.cloud.maintenance.api.v1.ResourceMaintenance getResourceMaintenances( + int index) { + return resourceMaintenances_.get(index); + } + + /** + * + * + *
+   * The resulting resource maintenances.
+   * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.ResourceMaintenance resource_maintenances = 10509; + * + */ + @java.lang.Override + public com.google.cloud.maintenance.api.v1.ResourceMaintenanceOrBuilder + getResourceMaintenancesOrBuilder(int index) { + return resourceMaintenances_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 10510; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+   * If present, the next page token can be provided to a subsequent
+   * ListResourceMaintenances call to list the next page.
+   * If empty, there are no more pages.
+   * 
+ * + * string next_page_token = 10510; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * If present, the next page token can be provided to a subsequent
+   * ListResourceMaintenances call to list the next page.
+   * If empty, there are no more pages.
+   * 
+ * + * string next_page_token = 10510; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int UNREACHABLE_FIELD_NUMBER = 10511; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList unreachable_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 10511; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_; + } + + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 10511; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 10511; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 10511; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < resourceMaintenances_.size(); i++) { + output.writeMessage(10509, resourceMaintenances_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10510, nextPageToken_); + } + for (int i = 0; i < unreachable_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10511, unreachable_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < resourceMaintenances_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 10509, resourceMaintenances_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10510, nextPageToken_); + } + { + int dataSize = 0; + for (int i = 0; i < unreachable_.size(); i++) { + dataSize += computeStringSizeNoTag(unreachable_.getRaw(i)); + } + size += dataSize; + size += 3 * getUnreachableList().size(); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse)) { + return super.equals(obj); + } + com.google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse other = + (com.google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse) obj; + + if (!getResourceMaintenancesList().equals(other.getResourceMaintenancesList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnreachableList().equals(other.getUnreachableList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getResourceMaintenancesCount() > 0) { + hash = (37 * hash) + RESOURCE_MAINTENANCES_FIELD_NUMBER; + hash = (53 * hash) + getResourceMaintenancesList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + if (getUnreachableCount() > 0) { + hash = (37 * hash) + UNREACHABLE_FIELD_NUMBER; + hash = (53 * hash) + getUnreachableList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The response structure for the ListResourceMaintenances method.
+   * 
+ * + * Protobuf type {@code google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse) + com.google.cloud.maintenance.api.v1.ListResourceMaintenancesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_ListResourceMaintenancesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_ListResourceMaintenancesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse.class, + com.google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse.Builder.class); + } + + // Construct using + // com.google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (resourceMaintenancesBuilder_ == null) { + resourceMaintenances_ = java.util.Collections.emptyList(); + } else { + resourceMaintenances_ = null; + resourceMaintenancesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_ListResourceMaintenancesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse + getDefaultInstanceForType() { + return com.google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse build() { + com.google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse buildPartial() { + com.google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse result = + new com.google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse result) { + if (resourceMaintenancesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + resourceMaintenances_ = java.util.Collections.unmodifiableList(resourceMaintenances_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.resourceMaintenances_ = resourceMaintenances_; + } else { + result.resourceMaintenances_ = resourceMaintenancesBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + unreachable_.makeImmutable(); + result.unreachable_ = unreachable_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse) { + return mergeFrom( + (com.google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse other) { + if (other + == com.google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse + .getDefaultInstance()) return this; + if (resourceMaintenancesBuilder_ == null) { + if (!other.resourceMaintenances_.isEmpty()) { + if (resourceMaintenances_.isEmpty()) { + resourceMaintenances_ = other.resourceMaintenances_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureResourceMaintenancesIsMutable(); + resourceMaintenances_.addAll(other.resourceMaintenances_); + } + onChanged(); + } + } else { + if (!other.resourceMaintenances_.isEmpty()) { + if (resourceMaintenancesBuilder_.isEmpty()) { + resourceMaintenancesBuilder_.dispose(); + resourceMaintenancesBuilder_ = null; + resourceMaintenances_ = other.resourceMaintenances_; + bitField0_ = (bitField0_ & ~0x00000001); + resourceMaintenancesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getResourceMaintenancesFieldBuilder() + : null; + } else { + resourceMaintenancesBuilder_.addAllMessages(other.resourceMaintenances_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.unreachable_.isEmpty()) { + if (unreachable_.isEmpty()) { + unreachable_ = other.unreachable_; + bitField0_ |= 0x00000004; + } else { + ensureUnreachableIsMutable(); + unreachable_.addAll(other.unreachable_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 84074: + { + com.google.cloud.maintenance.api.v1.ResourceMaintenance m = + input.readMessage( + com.google.cloud.maintenance.api.v1.ResourceMaintenance.parser(), + extensionRegistry); + if (resourceMaintenancesBuilder_ == null) { + ensureResourceMaintenancesIsMutable(); + resourceMaintenances_.add(m); + } else { + resourceMaintenancesBuilder_.addMessage(m); + } + break; + } // case 84074 + case 84082: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 84082 + case 84090: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureUnreachableIsMutable(); + unreachable_.add(s); + break; + } // case 84090 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List + resourceMaintenances_ = java.util.Collections.emptyList(); + + private void ensureResourceMaintenancesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + resourceMaintenances_ = + new java.util.ArrayList( + resourceMaintenances_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.maintenance.api.v1.ResourceMaintenance, + com.google.cloud.maintenance.api.v1.ResourceMaintenance.Builder, + com.google.cloud.maintenance.api.v1.ResourceMaintenanceOrBuilder> + resourceMaintenancesBuilder_; + + /** + * + * + *
+     * The resulting resource maintenances.
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.ResourceMaintenance resource_maintenances = 10509; + * + */ + public java.util.List + getResourceMaintenancesList() { + if (resourceMaintenancesBuilder_ == null) { + return java.util.Collections.unmodifiableList(resourceMaintenances_); + } else { + return resourceMaintenancesBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * The resulting resource maintenances.
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.ResourceMaintenance resource_maintenances = 10509; + * + */ + public int getResourceMaintenancesCount() { + if (resourceMaintenancesBuilder_ == null) { + return resourceMaintenances_.size(); + } else { + return resourceMaintenancesBuilder_.getCount(); + } + } + + /** + * + * + *
+     * The resulting resource maintenances.
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.ResourceMaintenance resource_maintenances = 10509; + * + */ + public com.google.cloud.maintenance.api.v1.ResourceMaintenance getResourceMaintenances( + int index) { + if (resourceMaintenancesBuilder_ == null) { + return resourceMaintenances_.get(index); + } else { + return resourceMaintenancesBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * The resulting resource maintenances.
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.ResourceMaintenance resource_maintenances = 10509; + * + */ + public Builder setResourceMaintenances( + int index, com.google.cloud.maintenance.api.v1.ResourceMaintenance value) { + if (resourceMaintenancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResourceMaintenancesIsMutable(); + resourceMaintenances_.set(index, value); + onChanged(); + } else { + resourceMaintenancesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The resulting resource maintenances.
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.ResourceMaintenance resource_maintenances = 10509; + * + */ + public Builder setResourceMaintenances( + int index, + com.google.cloud.maintenance.api.v1.ResourceMaintenance.Builder builderForValue) { + if (resourceMaintenancesBuilder_ == null) { + ensureResourceMaintenancesIsMutable(); + resourceMaintenances_.set(index, builderForValue.build()); + onChanged(); + } else { + resourceMaintenancesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The resulting resource maintenances.
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.ResourceMaintenance resource_maintenances = 10509; + * + */ + public Builder addResourceMaintenances( + com.google.cloud.maintenance.api.v1.ResourceMaintenance value) { + if (resourceMaintenancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResourceMaintenancesIsMutable(); + resourceMaintenances_.add(value); + onChanged(); + } else { + resourceMaintenancesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * The resulting resource maintenances.
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.ResourceMaintenance resource_maintenances = 10509; + * + */ + public Builder addResourceMaintenances( + int index, com.google.cloud.maintenance.api.v1.ResourceMaintenance value) { + if (resourceMaintenancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResourceMaintenancesIsMutable(); + resourceMaintenances_.add(index, value); + onChanged(); + } else { + resourceMaintenancesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The resulting resource maintenances.
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.ResourceMaintenance resource_maintenances = 10509; + * + */ + public Builder addResourceMaintenances( + com.google.cloud.maintenance.api.v1.ResourceMaintenance.Builder builderForValue) { + if (resourceMaintenancesBuilder_ == null) { + ensureResourceMaintenancesIsMutable(); + resourceMaintenances_.add(builderForValue.build()); + onChanged(); + } else { + resourceMaintenancesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The resulting resource maintenances.
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.ResourceMaintenance resource_maintenances = 10509; + * + */ + public Builder addResourceMaintenances( + int index, + com.google.cloud.maintenance.api.v1.ResourceMaintenance.Builder builderForValue) { + if (resourceMaintenancesBuilder_ == null) { + ensureResourceMaintenancesIsMutable(); + resourceMaintenances_.add(index, builderForValue.build()); + onChanged(); + } else { + resourceMaintenancesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The resulting resource maintenances.
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.ResourceMaintenance resource_maintenances = 10509; + * + */ + public Builder addAllResourceMaintenances( + java.lang.Iterable + values) { + if (resourceMaintenancesBuilder_ == null) { + ensureResourceMaintenancesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, resourceMaintenances_); + onChanged(); + } else { + resourceMaintenancesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * The resulting resource maintenances.
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.ResourceMaintenance resource_maintenances = 10509; + * + */ + public Builder clearResourceMaintenances() { + if (resourceMaintenancesBuilder_ == null) { + resourceMaintenances_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + resourceMaintenancesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * The resulting resource maintenances.
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.ResourceMaintenance resource_maintenances = 10509; + * + */ + public Builder removeResourceMaintenances(int index) { + if (resourceMaintenancesBuilder_ == null) { + ensureResourceMaintenancesIsMutable(); + resourceMaintenances_.remove(index); + onChanged(); + } else { + resourceMaintenancesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * The resulting resource maintenances.
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.ResourceMaintenance resource_maintenances = 10509; + * + */ + public com.google.cloud.maintenance.api.v1.ResourceMaintenance.Builder + getResourceMaintenancesBuilder(int index) { + return getResourceMaintenancesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * The resulting resource maintenances.
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.ResourceMaintenance resource_maintenances = 10509; + * + */ + public com.google.cloud.maintenance.api.v1.ResourceMaintenanceOrBuilder + getResourceMaintenancesOrBuilder(int index) { + if (resourceMaintenancesBuilder_ == null) { + return resourceMaintenances_.get(index); + } else { + return resourceMaintenancesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * The resulting resource maintenances.
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.ResourceMaintenance resource_maintenances = 10509; + * + */ + public java.util.List< + ? extends com.google.cloud.maintenance.api.v1.ResourceMaintenanceOrBuilder> + getResourceMaintenancesOrBuilderList() { + if (resourceMaintenancesBuilder_ != null) { + return resourceMaintenancesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(resourceMaintenances_); + } + } + + /** + * + * + *
+     * The resulting resource maintenances.
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.ResourceMaintenance resource_maintenances = 10509; + * + */ + public com.google.cloud.maintenance.api.v1.ResourceMaintenance.Builder + addResourceMaintenancesBuilder() { + return getResourceMaintenancesFieldBuilder() + .addBuilder(com.google.cloud.maintenance.api.v1.ResourceMaintenance.getDefaultInstance()); + } + + /** + * + * + *
+     * The resulting resource maintenances.
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.ResourceMaintenance resource_maintenances = 10509; + * + */ + public com.google.cloud.maintenance.api.v1.ResourceMaintenance.Builder + addResourceMaintenancesBuilder(int index) { + return getResourceMaintenancesFieldBuilder() + .addBuilder( + index, com.google.cloud.maintenance.api.v1.ResourceMaintenance.getDefaultInstance()); + } + + /** + * + * + *
+     * The resulting resource maintenances.
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.ResourceMaintenance resource_maintenances = 10509; + * + */ + public java.util.List + getResourceMaintenancesBuilderList() { + return getResourceMaintenancesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.maintenance.api.v1.ResourceMaintenance, + com.google.cloud.maintenance.api.v1.ResourceMaintenance.Builder, + com.google.cloud.maintenance.api.v1.ResourceMaintenanceOrBuilder> + getResourceMaintenancesFieldBuilder() { + if (resourceMaintenancesBuilder_ == null) { + resourceMaintenancesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.maintenance.api.v1.ResourceMaintenance, + com.google.cloud.maintenance.api.v1.ResourceMaintenance.Builder, + com.google.cloud.maintenance.api.v1.ResourceMaintenanceOrBuilder>( + resourceMaintenances_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + resourceMaintenances_ = null; + } + return resourceMaintenancesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+     * If present, the next page token can be provided to a subsequent
+     * ListResourceMaintenances call to list the next page.
+     * If empty, there are no more pages.
+     * 
+ * + * string next_page_token = 10510; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * If present, the next page token can be provided to a subsequent
+     * ListResourceMaintenances call to list the next page.
+     * If empty, there are no more pages.
+     * 
+ * + * string next_page_token = 10510; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * If present, the next page token can be provided to a subsequent
+     * ListResourceMaintenances call to list the next page.
+     * If empty, there are no more pages.
+     * 
+ * + * string next_page_token = 10510; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * If present, the next page token can be provided to a subsequent
+     * ListResourceMaintenances call to list the next page.
+     * If empty, there are no more pages.
+     * 
+ * + * string next_page_token = 10510; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * If present, the next page token can be provided to a subsequent
+     * ListResourceMaintenances call to list the next page.
+     * If empty, there are no more pages.
+     * 
+ * + * string next_page_token = 10510; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList unreachable_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureUnreachableIsMutable() { + if (!unreachable_.isModifiable()) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(unreachable_); + } + bitField0_ |= 0x00000004; + } + + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 10511; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + unreachable_.makeImmutable(); + return unreachable_; + } + + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 10511; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 10511; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 10511; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 10511; + * + * @param index The index to set the value at. + * @param value The unreachable to set. + * @return This builder for chaining. + */ + public Builder setUnreachable(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.set(index, value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 10511; + * + * @param value The unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachable(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 10511; + * + * @param values The unreachable to add. + * @return This builder for chaining. + */ + public Builder addAllUnreachable(java.lang.Iterable values) { + ensureUnreachableIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, unreachable_); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 10511; + * + * @return This builder for chaining. + */ + public Builder clearUnreachable() { + unreachable_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + ; + onChanged(); + return this; + } + + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 10511; + * + * @param value The bytes of the unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachableBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureUnreachableIsMutable(); + unreachable_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse) + private static final com.google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse(); + } + + public static com.google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListResourceMaintenancesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maintenance/proto-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/ListResourceMaintenancesResponseOrBuilder.java b/java-maintenance/proto-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/ListResourceMaintenancesResponseOrBuilder.java new file mode 100644 index 000000000000..037a99bd1d50 --- /dev/null +++ b/java-maintenance/proto-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/ListResourceMaintenancesResponseOrBuilder.java @@ -0,0 +1,178 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/maintenance/api/v1/maintenance_service.proto + +// Protobuf Java Version: 3.25.8 +package com.google.cloud.maintenance.api.v1; + +public interface ListResourceMaintenancesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The resulting resource maintenances.
+   * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.ResourceMaintenance resource_maintenances = 10509; + * + */ + java.util.List + getResourceMaintenancesList(); + + /** + * + * + *
+   * The resulting resource maintenances.
+   * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.ResourceMaintenance resource_maintenances = 10509; + * + */ + com.google.cloud.maintenance.api.v1.ResourceMaintenance getResourceMaintenances(int index); + + /** + * + * + *
+   * The resulting resource maintenances.
+   * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.ResourceMaintenance resource_maintenances = 10509; + * + */ + int getResourceMaintenancesCount(); + + /** + * + * + *
+   * The resulting resource maintenances.
+   * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.ResourceMaintenance resource_maintenances = 10509; + * + */ + java.util.List + getResourceMaintenancesOrBuilderList(); + + /** + * + * + *
+   * The resulting resource maintenances.
+   * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.ResourceMaintenance resource_maintenances = 10509; + * + */ + com.google.cloud.maintenance.api.v1.ResourceMaintenanceOrBuilder getResourceMaintenancesOrBuilder( + int index); + + /** + * + * + *
+   * If present, the next page token can be provided to a subsequent
+   * ListResourceMaintenances call to list the next page.
+   * If empty, there are no more pages.
+   * 
+ * + * string next_page_token = 10510; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
+   * If present, the next page token can be provided to a subsequent
+   * ListResourceMaintenances call to list the next page.
+   * If empty, there are no more pages.
+   * 
+ * + * string next_page_token = 10510; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 10511; + * + * @return A list containing the unreachable. + */ + java.util.List getUnreachableList(); + + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 10511; + * + * @return The count of unreachable. + */ + int getUnreachableCount(); + + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 10511; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + java.lang.String getUnreachable(int index); + + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 10511; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + com.google.protobuf.ByteString getUnreachableBytes(int index); +} diff --git a/java-maintenance/proto-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/LocationName.java b/java-maintenance/proto-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/LocationName.java new file mode 100644 index 000000000000..ba21d1686010 --- /dev/null +++ b/java-maintenance/proto-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/LocationName.java @@ -0,0 +1,192 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.maintenance.api.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class LocationName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + + @Deprecated + protected LocationName() { + project = null; + location = null; + } + + private LocationName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static LocationName of(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build(); + } + + public static String format(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build().toString(); + } + + public static LocationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION.validatedMatch( + formattedString, "LocationName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (LocationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION.instantiate("project", project, "location", location); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + LocationName that = ((LocationName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + return h; + } + + /** Builder for projects/{project}/locations/{location}. */ + public static class Builder { + private String project; + private String location; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + private Builder(LocationName locationName) { + this.project = locationName.project; + this.location = locationName.location; + } + + public LocationName build() { + return new LocationName(this); + } + } +} diff --git a/java-maintenance/proto-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/MaintenanceCategory.java b/java-maintenance/proto-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/MaintenanceCategory.java new file mode 100644 index 000000000000..a33307e79154 --- /dev/null +++ b/java-maintenance/proto-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/MaintenanceCategory.java @@ -0,0 +1,202 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/maintenance/api/v1/maintenance_service.proto + +// Protobuf Java Version: 3.25.8 +package com.google.cloud.maintenance.api.v1; + +/** + * + * + *
+ * The Category of the maintenance.
+ * 
+ * + * Protobuf enum {@code google.cloud.maintenance.api.v1.MaintenanceCategory} + */ +public enum MaintenanceCategory implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Unspecified category.
+   * 
+ * + * MAINTENANCE_CATEGORY_UNSPECIFIED = 0; + */ + MAINTENANCE_CATEGORY_UNSPECIFIED(0), + /** + * + * + *
+   * Infrastructure maintenance events are times that Google Cloud performs
+   * regular maintenance on network equipment e.g. Google Cloud Interconnect
+   * These events are usually scheduled in advance and we provide
+   * notification, when possible, so that users can plan for the
+   * infrastructure maintenance event and prevent downtime. Infrastructure
+   * maintenance events don't have a set interval between occurrences, but
+   * generally occur several times a year.
+   * 
+ * + * INFRASTRUCTURE = 1; + */ + INFRASTRUCTURE(1), + /** + * + * + *
+   * Updates that can include bug fixes, changes, or new features that are
+   * backward compatible with existing versions (including patches).
+   * Some SPs allow users to control the scheduling of these maintenance
+   * events using maintenance windows and/or deny maintenance features.
+   * 
+ * + * SERVICE_UPDATE = 3; + */ + SERVICE_UPDATE(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * Unspecified category.
+   * 
+ * + * MAINTENANCE_CATEGORY_UNSPECIFIED = 0; + */ + public static final int MAINTENANCE_CATEGORY_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+   * Infrastructure maintenance events are times that Google Cloud performs
+   * regular maintenance on network equipment e.g. Google Cloud Interconnect
+   * These events are usually scheduled in advance and we provide
+   * notification, when possible, so that users can plan for the
+   * infrastructure maintenance event and prevent downtime. Infrastructure
+   * maintenance events don't have a set interval between occurrences, but
+   * generally occur several times a year.
+   * 
+ * + * INFRASTRUCTURE = 1; + */ + public static final int INFRASTRUCTURE_VALUE = 1; + + /** + * + * + *
+   * Updates that can include bug fixes, changes, or new features that are
+   * backward compatible with existing versions (including patches).
+   * Some SPs allow users to control the scheduling of these maintenance
+   * events using maintenance windows and/or deny maintenance features.
+   * 
+ * + * SERVICE_UPDATE = 3; + */ + public static final int SERVICE_UPDATE_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static MaintenanceCategory valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static MaintenanceCategory forNumber(int value) { + switch (value) { + case 0: + return MAINTENANCE_CATEGORY_UNSPECIFIED; + case 1: + return INFRASTRUCTURE; + case 3: + return SERVICE_UPDATE; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public MaintenanceCategory findValueByNumber(int number) { + return MaintenanceCategory.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final MaintenanceCategory[] VALUES = values(); + + public static MaintenanceCategory valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private MaintenanceCategory(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.maintenance.api.v1.MaintenanceCategory) +} diff --git a/java-maintenance/proto-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/MaintenanceControl.java b/java-maintenance/proto-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/MaintenanceControl.java new file mode 100644 index 000000000000..629d43376f4d --- /dev/null +++ b/java-maintenance/proto-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/MaintenanceControl.java @@ -0,0 +1,1091 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/maintenance/api/v1/maintenance_service.proto + +// Protobuf Java Version: 3.25.8 +package com.google.cloud.maintenance.api.v1; + +/** + * + * + *
+ * The control of the maintenance.
+ * 
+ * + * Protobuf type {@code google.cloud.maintenance.api.v1.MaintenanceControl} + */ +public final class MaintenanceControl extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.maintenance.api.v1.MaintenanceControl) + MaintenanceControlOrBuilder { + private static final long serialVersionUID = 0L; + + // Use MaintenanceControl.newBuilder() to construct. + private MaintenanceControl(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private MaintenanceControl() { + control_ = 0; + documentation_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new MaintenanceControl(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_MaintenanceControl_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_MaintenanceControl_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.maintenance.api.v1.MaintenanceControl.class, + com.google.cloud.maintenance.api.v1.MaintenanceControl.Builder.class); + } + + /** + * + * + *
+   * Sets the type of control supported. comment (as in logs).
+   * 
+ * + * Protobuf enum {@code google.cloud.maintenance.api.v1.MaintenanceControl.Control} + */ + public enum Control implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified control.
+     * 
+ * + * CONTROL_UNSPECIFIED = 0; + */ + CONTROL_UNSPECIFIED(0), + /** + * + * + *
+     * Apply control.
+     * 
+ * + * APPLY = 1; + */ + APPLY(1), + /** + * + * + *
+     * Manage policy control.
+     * 
+ * + * MANAGE_POLICY = 2; + */ + MANAGE_POLICY(2), + /** + * + * + *
+     * Reschedule control.
+     * 
+ * + * RESCHEDULE = 3; + */ + RESCHEDULE(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified control.
+     * 
+ * + * CONTROL_UNSPECIFIED = 0; + */ + public static final int CONTROL_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * Apply control.
+     * 
+ * + * APPLY = 1; + */ + public static final int APPLY_VALUE = 1; + + /** + * + * + *
+     * Manage policy control.
+     * 
+ * + * MANAGE_POLICY = 2; + */ + public static final int MANAGE_POLICY_VALUE = 2; + + /** + * + * + *
+     * Reschedule control.
+     * 
+ * + * RESCHEDULE = 3; + */ + public static final int RESCHEDULE_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Control valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Control forNumber(int value) { + switch (value) { + case 0: + return CONTROL_UNSPECIFIED; + case 1: + return APPLY; + case 2: + return MANAGE_POLICY; + case 3: + return RESCHEDULE; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Control findValueByNumber(int number) { + return Control.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.maintenance.api.v1.MaintenanceControl.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Control[] VALUES = values(); + + public static Control valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Control(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.maintenance.api.v1.MaintenanceControl.Control) + } + + public static final int CONTROL_FIELD_NUMBER = 1; + private int control_ = 0; + + /** + * + * + *
+   * The control of the resource maintenance.
+   * 
+ * + * .google.cloud.maintenance.api.v1.MaintenanceControl.Control control = 1; + * + * @return The enum numeric value on the wire for control. + */ + @java.lang.Override + public int getControlValue() { + return control_; + } + + /** + * + * + *
+   * The control of the resource maintenance.
+   * 
+ * + * .google.cloud.maintenance.api.v1.MaintenanceControl.Control control = 1; + * + * @return The control. + */ + @java.lang.Override + public com.google.cloud.maintenance.api.v1.MaintenanceControl.Control getControl() { + com.google.cloud.maintenance.api.v1.MaintenanceControl.Control result = + com.google.cloud.maintenance.api.v1.MaintenanceControl.Control.forNumber(control_); + return result == null + ? com.google.cloud.maintenance.api.v1.MaintenanceControl.Control.UNRECOGNIZED + : result; + } + + public static final int IS_CUSTOM_FIELD_NUMBER = 2; + private boolean isCustom_ = false; + + /** + * + * + *
+   * Indicates whether the control is available only in Service Producer API
+   * (not through Unified Maintenance).
+   * 
+ * + * bool is_custom = 2; + * + * @return The isCustom. + */ + @java.lang.Override + public boolean getIsCustom() { + return isCustom_; + } + + public static final int DOCUMENTATION_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object documentation_ = ""; + + /** + * + * + *
+   * Link to Service Producer documentation about maintenance control. Provided
+   * only when `isCustom` is `true`.
+   * 
+ * + * string documentation = 3; + * + * @return The documentation. + */ + @java.lang.Override + public java.lang.String getDocumentation() { + java.lang.Object ref = documentation_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + documentation_ = s; + return s; + } + } + + /** + * + * + *
+   * Link to Service Producer documentation about maintenance control. Provided
+   * only when `isCustom` is `true`.
+   * 
+ * + * string documentation = 3; + * + * @return The bytes for documentation. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDocumentationBytes() { + java.lang.Object ref = documentation_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + documentation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (control_ + != com.google.cloud.maintenance.api.v1.MaintenanceControl.Control.CONTROL_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, control_); + } + if (isCustom_ != false) { + output.writeBool(2, isCustom_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(documentation_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, documentation_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (control_ + != com.google.cloud.maintenance.api.v1.MaintenanceControl.Control.CONTROL_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, control_); + } + if (isCustom_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, isCustom_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(documentation_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, documentation_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.maintenance.api.v1.MaintenanceControl)) { + return super.equals(obj); + } + com.google.cloud.maintenance.api.v1.MaintenanceControl other = + (com.google.cloud.maintenance.api.v1.MaintenanceControl) obj; + + if (control_ != other.control_) return false; + if (getIsCustom() != other.getIsCustom()) return false; + if (!getDocumentation().equals(other.getDocumentation())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CONTROL_FIELD_NUMBER; + hash = (53 * hash) + control_; + hash = (37 * hash) + IS_CUSTOM_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIsCustom()); + hash = (37 * hash) + DOCUMENTATION_FIELD_NUMBER; + hash = (53 * hash) + getDocumentation().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.maintenance.api.v1.MaintenanceControl parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.maintenance.api.v1.MaintenanceControl parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.maintenance.api.v1.MaintenanceControl parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.maintenance.api.v1.MaintenanceControl parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.maintenance.api.v1.MaintenanceControl parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.maintenance.api.v1.MaintenanceControl parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.maintenance.api.v1.MaintenanceControl parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.maintenance.api.v1.MaintenanceControl parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.maintenance.api.v1.MaintenanceControl parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.maintenance.api.v1.MaintenanceControl parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.maintenance.api.v1.MaintenanceControl parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.maintenance.api.v1.MaintenanceControl parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.maintenance.api.v1.MaintenanceControl prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The control of the maintenance.
+   * 
+ * + * Protobuf type {@code google.cloud.maintenance.api.v1.MaintenanceControl} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.maintenance.api.v1.MaintenanceControl) + com.google.cloud.maintenance.api.v1.MaintenanceControlOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_MaintenanceControl_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_MaintenanceControl_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.maintenance.api.v1.MaintenanceControl.class, + com.google.cloud.maintenance.api.v1.MaintenanceControl.Builder.class); + } + + // Construct using com.google.cloud.maintenance.api.v1.MaintenanceControl.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + control_ = 0; + isCustom_ = false; + documentation_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_MaintenanceControl_descriptor; + } + + @java.lang.Override + public com.google.cloud.maintenance.api.v1.MaintenanceControl getDefaultInstanceForType() { + return com.google.cloud.maintenance.api.v1.MaintenanceControl.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.maintenance.api.v1.MaintenanceControl build() { + com.google.cloud.maintenance.api.v1.MaintenanceControl result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.maintenance.api.v1.MaintenanceControl buildPartial() { + com.google.cloud.maintenance.api.v1.MaintenanceControl result = + new com.google.cloud.maintenance.api.v1.MaintenanceControl(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.maintenance.api.v1.MaintenanceControl result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.control_ = control_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.isCustom_ = isCustom_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.documentation_ = documentation_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.maintenance.api.v1.MaintenanceControl) { + return mergeFrom((com.google.cloud.maintenance.api.v1.MaintenanceControl) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.maintenance.api.v1.MaintenanceControl other) { + if (other == com.google.cloud.maintenance.api.v1.MaintenanceControl.getDefaultInstance()) + return this; + if (other.control_ != 0) { + setControlValue(other.getControlValue()); + } + if (other.getIsCustom() != false) { + setIsCustom(other.getIsCustom()); + } + if (!other.getDocumentation().isEmpty()) { + documentation_ = other.documentation_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + control_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + isCustom_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + documentation_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int control_ = 0; + + /** + * + * + *
+     * The control of the resource maintenance.
+     * 
+ * + * .google.cloud.maintenance.api.v1.MaintenanceControl.Control control = 1; + * + * @return The enum numeric value on the wire for control. + */ + @java.lang.Override + public int getControlValue() { + return control_; + } + + /** + * + * + *
+     * The control of the resource maintenance.
+     * 
+ * + * .google.cloud.maintenance.api.v1.MaintenanceControl.Control control = 1; + * + * @param value The enum numeric value on the wire for control to set. + * @return This builder for chaining. + */ + public Builder setControlValue(int value) { + control_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The control of the resource maintenance.
+     * 
+ * + * .google.cloud.maintenance.api.v1.MaintenanceControl.Control control = 1; + * + * @return The control. + */ + @java.lang.Override + public com.google.cloud.maintenance.api.v1.MaintenanceControl.Control getControl() { + com.google.cloud.maintenance.api.v1.MaintenanceControl.Control result = + com.google.cloud.maintenance.api.v1.MaintenanceControl.Control.forNumber(control_); + return result == null + ? com.google.cloud.maintenance.api.v1.MaintenanceControl.Control.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * The control of the resource maintenance.
+     * 
+ * + * .google.cloud.maintenance.api.v1.MaintenanceControl.Control control = 1; + * + * @param value The control to set. + * @return This builder for chaining. + */ + public Builder setControl( + com.google.cloud.maintenance.api.v1.MaintenanceControl.Control value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + control_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * The control of the resource maintenance.
+     * 
+ * + * .google.cloud.maintenance.api.v1.MaintenanceControl.Control control = 1; + * + * @return This builder for chaining. + */ + public Builder clearControl() { + bitField0_ = (bitField0_ & ~0x00000001); + control_ = 0; + onChanged(); + return this; + } + + private boolean isCustom_; + + /** + * + * + *
+     * Indicates whether the control is available only in Service Producer API
+     * (not through Unified Maintenance).
+     * 
+ * + * bool is_custom = 2; + * + * @return The isCustom. + */ + @java.lang.Override + public boolean getIsCustom() { + return isCustom_; + } + + /** + * + * + *
+     * Indicates whether the control is available only in Service Producer API
+     * (not through Unified Maintenance).
+     * 
+ * + * bool is_custom = 2; + * + * @param value The isCustom to set. + * @return This builder for chaining. + */ + public Builder setIsCustom(boolean value) { + + isCustom_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Indicates whether the control is available only in Service Producer API
+     * (not through Unified Maintenance).
+     * 
+ * + * bool is_custom = 2; + * + * @return This builder for chaining. + */ + public Builder clearIsCustom() { + bitField0_ = (bitField0_ & ~0x00000002); + isCustom_ = false; + onChanged(); + return this; + } + + private java.lang.Object documentation_ = ""; + + /** + * + * + *
+     * Link to Service Producer documentation about maintenance control. Provided
+     * only when `isCustom` is `true`.
+     * 
+ * + * string documentation = 3; + * + * @return The documentation. + */ + public java.lang.String getDocumentation() { + java.lang.Object ref = documentation_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + documentation_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Link to Service Producer documentation about maintenance control. Provided
+     * only when `isCustom` is `true`.
+     * 
+ * + * string documentation = 3; + * + * @return The bytes for documentation. + */ + public com.google.protobuf.ByteString getDocumentationBytes() { + java.lang.Object ref = documentation_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + documentation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Link to Service Producer documentation about maintenance control. Provided
+     * only when `isCustom` is `true`.
+     * 
+ * + * string documentation = 3; + * + * @param value The documentation to set. + * @return This builder for chaining. + */ + public Builder setDocumentation(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + documentation_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Link to Service Producer documentation about maintenance control. Provided
+     * only when `isCustom` is `true`.
+     * 
+ * + * string documentation = 3; + * + * @return This builder for chaining. + */ + public Builder clearDocumentation() { + documentation_ = getDefaultInstance().getDocumentation(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Link to Service Producer documentation about maintenance control. Provided
+     * only when `isCustom` is `true`.
+     * 
+ * + * string documentation = 3; + * + * @param value The bytes for documentation to set. + * @return This builder for chaining. + */ + public Builder setDocumentationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + documentation_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.maintenance.api.v1.MaintenanceControl) + } + + // @@protoc_insertion_point(class_scope:google.cloud.maintenance.api.v1.MaintenanceControl) + private static final com.google.cloud.maintenance.api.v1.MaintenanceControl DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.maintenance.api.v1.MaintenanceControl(); + } + + public static com.google.cloud.maintenance.api.v1.MaintenanceControl getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MaintenanceControl parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.maintenance.api.v1.MaintenanceControl getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maintenance/proto-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/MaintenanceControlOrBuilder.java b/java-maintenance/proto-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/MaintenanceControlOrBuilder.java new file mode 100644 index 000000000000..76e094342280 --- /dev/null +++ b/java-maintenance/proto-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/MaintenanceControlOrBuilder.java @@ -0,0 +1,94 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/maintenance/api/v1/maintenance_service.proto + +// Protobuf Java Version: 3.25.8 +package com.google.cloud.maintenance.api.v1; + +public interface MaintenanceControlOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.maintenance.api.v1.MaintenanceControl) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The control of the resource maintenance.
+   * 
+ * + * .google.cloud.maintenance.api.v1.MaintenanceControl.Control control = 1; + * + * @return The enum numeric value on the wire for control. + */ + int getControlValue(); + + /** + * + * + *
+   * The control of the resource maintenance.
+   * 
+ * + * .google.cloud.maintenance.api.v1.MaintenanceControl.Control control = 1; + * + * @return The control. + */ + com.google.cloud.maintenance.api.v1.MaintenanceControl.Control getControl(); + + /** + * + * + *
+   * Indicates whether the control is available only in Service Producer API
+   * (not through Unified Maintenance).
+   * 
+ * + * bool is_custom = 2; + * + * @return The isCustom. + */ + boolean getIsCustom(); + + /** + * + * + *
+   * Link to Service Producer documentation about maintenance control. Provided
+   * only when `isCustom` is `true`.
+   * 
+ * + * string documentation = 3; + * + * @return The documentation. + */ + java.lang.String getDocumentation(); + + /** + * + * + *
+   * Link to Service Producer documentation about maintenance control. Provided
+   * only when `isCustom` is `true`.
+   * 
+ * + * string documentation = 3; + * + * @return The bytes for documentation. + */ + com.google.protobuf.ByteString getDocumentationBytes(); +} diff --git a/java-maintenance/proto-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/MaintenanceSummary.java b/java-maintenance/proto-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/MaintenanceSummary.java new file mode 100644 index 000000000000..4963c5d37ed6 --- /dev/null +++ b/java-maintenance/proto-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/MaintenanceSummary.java @@ -0,0 +1,5981 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/maintenance/api/v1/maintenance_service.proto + +// Protobuf Java Version: 3.25.8 +package com.google.cloud.maintenance.api.v1; + +/** + * + * + *
+ * MaintenanceSummary contains maintenance statistics calculated based on
+ * ResourceMaintenances within the scope: project and location.
+ * 
+ * + * Protobuf type {@code google.cloud.maintenance.api.v1.MaintenanceSummary} + */ +public final class MaintenanceSummary extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.maintenance.api.v1.MaintenanceSummary) + MaintenanceSummaryOrBuilder { + private static final long serialVersionUID = 0L; + + // Use MaintenanceSummary.newBuilder() to construct. + private MaintenanceSummary(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private MaintenanceSummary() { + maintenanceName_ = ""; + title_ = ""; + description_ = ""; + category_ = 0; + controls_ = java.util.Collections.emptyList(); + stats_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new MaintenanceSummary(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_MaintenanceSummary_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_MaintenanceSummary_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.maintenance.api.v1.MaintenanceSummary.class, + com.google.cloud.maintenance.api.v1.MaintenanceSummary.Builder.class); + } + + public interface StatsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.maintenance.api.v1.MaintenanceSummary.Stats) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * groupBy specifies the type of aggregate.
+     * For example a group_by might be `"state"`
+     * 
+ * + * string group_by = 1; + * + * @return The groupBy. + */ + java.lang.String getGroupBy(); + + /** + * + * + *
+     * groupBy specifies the type of aggregate.
+     * For example a group_by might be `"state"`
+     * 
+ * + * string group_by = 1; + * + * @return The bytes for groupBy. + */ + com.google.protobuf.ByteString getGroupByBytes(); + + /** + * + * + *
+     * Aggregates is a list <group, count> pairs. For example, if the
+     * group_by is `"state"` a possible tuple in the aggregates list could be
+     * "SCHEDULED" : `11`,
+     * 
+ * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate aggregates = 2; + * + */ + java.util.List + getAggregatesList(); + + /** + * + * + *
+     * Aggregates is a list <group, count> pairs. For example, if the
+     * group_by is `"state"` a possible tuple in the aggregates list could be
+     * "SCHEDULED" : `11`,
+     * 
+ * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate aggregates = 2; + * + */ + com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate getAggregates(int index); + + /** + * + * + *
+     * Aggregates is a list <group, count> pairs. For example, if the
+     * group_by is `"state"` a possible tuple in the aggregates list could be
+     * "SCHEDULED" : `11`,
+     * 
+ * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate aggregates = 2; + * + */ + int getAggregatesCount(); + + /** + * + * + *
+     * Aggregates is a list <group, count> pairs. For example, if the
+     * group_by is `"state"` a possible tuple in the aggregates list could be
+     * "SCHEDULED" : `11`,
+     * 
+ * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate aggregates = 2; + * + */ + java.util.List< + ? extends com.google.cloud.maintenance.api.v1.MaintenanceSummary.AggregateOrBuilder> + getAggregatesOrBuilderList(); + + /** + * + * + *
+     * Aggregates is a list <group, count> pairs. For example, if the
+     * group_by is `"state"` a possible tuple in the aggregates list could be
+     * "SCHEDULED" : `11`,
+     * 
+ * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate aggregates = 2; + * + */ + com.google.cloud.maintenance.api.v1.MaintenanceSummary.AggregateOrBuilder + getAggregatesOrBuilder(int index); + } + + /** + * + * + *
+   * Stats indicates the type of aggregate and the corresponding aggregates.
+   * 
+ * + * Protobuf type {@code google.cloud.maintenance.api.v1.MaintenanceSummary.Stats} + */ + public static final class Stats extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.maintenance.api.v1.MaintenanceSummary.Stats) + StatsOrBuilder { + private static final long serialVersionUID = 0L; + + // Use Stats.newBuilder() to construct. + private Stats(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Stats() { + groupBy_ = ""; + aggregates_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Stats(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_MaintenanceSummary_Stats_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_MaintenanceSummary_Stats_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.maintenance.api.v1.MaintenanceSummary.Stats.class, + com.google.cloud.maintenance.api.v1.MaintenanceSummary.Stats.Builder.class); + } + + public static final int GROUP_BY_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object groupBy_ = ""; + + /** + * + * + *
+     * groupBy specifies the type of aggregate.
+     * For example a group_by might be `"state"`
+     * 
+ * + * string group_by = 1; + * + * @return The groupBy. + */ + @java.lang.Override + public java.lang.String getGroupBy() { + java.lang.Object ref = groupBy_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + groupBy_ = s; + return s; + } + } + + /** + * + * + *
+     * groupBy specifies the type of aggregate.
+     * For example a group_by might be `"state"`
+     * 
+ * + * string group_by = 1; + * + * @return The bytes for groupBy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getGroupByBytes() { + java.lang.Object ref = groupBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + groupBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int AGGREGATES_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List + aggregates_; + + /** + * + * + *
+     * Aggregates is a list <group, count> pairs. For example, if the
+     * group_by is `"state"` a possible tuple in the aggregates list could be
+     * "SCHEDULED" : `11`,
+     * 
+ * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate aggregates = 2; + * + */ + @java.lang.Override + public java.util.List + getAggregatesList() { + return aggregates_; + } + + /** + * + * + *
+     * Aggregates is a list <group, count> pairs. For example, if the
+     * group_by is `"state"` a possible tuple in the aggregates list could be
+     * "SCHEDULED" : `11`,
+     * 
+ * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate aggregates = 2; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.maintenance.api.v1.MaintenanceSummary.AggregateOrBuilder> + getAggregatesOrBuilderList() { + return aggregates_; + } + + /** + * + * + *
+     * Aggregates is a list <group, count> pairs. For example, if the
+     * group_by is `"state"` a possible tuple in the aggregates list could be
+     * "SCHEDULED" : `11`,
+     * 
+ * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate aggregates = 2; + * + */ + @java.lang.Override + public int getAggregatesCount() { + return aggregates_.size(); + } + + /** + * + * + *
+     * Aggregates is a list <group, count> pairs. For example, if the
+     * group_by is `"state"` a possible tuple in the aggregates list could be
+     * "SCHEDULED" : `11`,
+     * 
+ * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate aggregates = 2; + * + */ + @java.lang.Override + public com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate getAggregates( + int index) { + return aggregates_.get(index); + } + + /** + * + * + *
+     * Aggregates is a list <group, count> pairs. For example, if the
+     * group_by is `"state"` a possible tuple in the aggregates list could be
+     * "SCHEDULED" : `11`,
+     * 
+ * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate aggregates = 2; + * + */ + @java.lang.Override + public com.google.cloud.maintenance.api.v1.MaintenanceSummary.AggregateOrBuilder + getAggregatesOrBuilder(int index) { + return aggregates_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(groupBy_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, groupBy_); + } + for (int i = 0; i < aggregates_.size(); i++) { + output.writeMessage(2, aggregates_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(groupBy_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, groupBy_); + } + for (int i = 0; i < aggregates_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, aggregates_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.maintenance.api.v1.MaintenanceSummary.Stats)) { + return super.equals(obj); + } + com.google.cloud.maintenance.api.v1.MaintenanceSummary.Stats other = + (com.google.cloud.maintenance.api.v1.MaintenanceSummary.Stats) obj; + + if (!getGroupBy().equals(other.getGroupBy())) return false; + if (!getAggregatesList().equals(other.getAggregatesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + GROUP_BY_FIELD_NUMBER; + hash = (53 * hash) + getGroupBy().hashCode(); + if (getAggregatesCount() > 0) { + hash = (37 * hash) + AGGREGATES_FIELD_NUMBER; + hash = (53 * hash) + getAggregatesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.maintenance.api.v1.MaintenanceSummary.Stats parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.maintenance.api.v1.MaintenanceSummary.Stats parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.maintenance.api.v1.MaintenanceSummary.Stats parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.maintenance.api.v1.MaintenanceSummary.Stats parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.maintenance.api.v1.MaintenanceSummary.Stats parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.maintenance.api.v1.MaintenanceSummary.Stats parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.maintenance.api.v1.MaintenanceSummary.Stats parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.maintenance.api.v1.MaintenanceSummary.Stats parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.maintenance.api.v1.MaintenanceSummary.Stats parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.maintenance.api.v1.MaintenanceSummary.Stats parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.maintenance.api.v1.MaintenanceSummary.Stats parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.maintenance.api.v1.MaintenanceSummary.Stats parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.maintenance.api.v1.MaintenanceSummary.Stats prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * Stats indicates the type of aggregate and the corresponding aggregates.
+     * 
+ * + * Protobuf type {@code google.cloud.maintenance.api.v1.MaintenanceSummary.Stats} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.maintenance.api.v1.MaintenanceSummary.Stats) + com.google.cloud.maintenance.api.v1.MaintenanceSummary.StatsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_MaintenanceSummary_Stats_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_MaintenanceSummary_Stats_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.maintenance.api.v1.MaintenanceSummary.Stats.class, + com.google.cloud.maintenance.api.v1.MaintenanceSummary.Stats.Builder.class); + } + + // Construct using com.google.cloud.maintenance.api.v1.MaintenanceSummary.Stats.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + groupBy_ = ""; + if (aggregatesBuilder_ == null) { + aggregates_ = java.util.Collections.emptyList(); + } else { + aggregates_ = null; + aggregatesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_MaintenanceSummary_Stats_descriptor; + } + + @java.lang.Override + public com.google.cloud.maintenance.api.v1.MaintenanceSummary.Stats + getDefaultInstanceForType() { + return com.google.cloud.maintenance.api.v1.MaintenanceSummary.Stats.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.maintenance.api.v1.MaintenanceSummary.Stats build() { + com.google.cloud.maintenance.api.v1.MaintenanceSummary.Stats result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.maintenance.api.v1.MaintenanceSummary.Stats buildPartial() { + com.google.cloud.maintenance.api.v1.MaintenanceSummary.Stats result = + new com.google.cloud.maintenance.api.v1.MaintenanceSummary.Stats(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.maintenance.api.v1.MaintenanceSummary.Stats result) { + if (aggregatesBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + aggregates_ = java.util.Collections.unmodifiableList(aggregates_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.aggregates_ = aggregates_; + } else { + result.aggregates_ = aggregatesBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.maintenance.api.v1.MaintenanceSummary.Stats result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.groupBy_ = groupBy_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.maintenance.api.v1.MaintenanceSummary.Stats) { + return mergeFrom((com.google.cloud.maintenance.api.v1.MaintenanceSummary.Stats) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.maintenance.api.v1.MaintenanceSummary.Stats other) { + if (other + == com.google.cloud.maintenance.api.v1.MaintenanceSummary.Stats.getDefaultInstance()) + return this; + if (!other.getGroupBy().isEmpty()) { + groupBy_ = other.groupBy_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (aggregatesBuilder_ == null) { + if (!other.aggregates_.isEmpty()) { + if (aggregates_.isEmpty()) { + aggregates_ = other.aggregates_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureAggregatesIsMutable(); + aggregates_.addAll(other.aggregates_); + } + onChanged(); + } + } else { + if (!other.aggregates_.isEmpty()) { + if (aggregatesBuilder_.isEmpty()) { + aggregatesBuilder_.dispose(); + aggregatesBuilder_ = null; + aggregates_ = other.aggregates_; + bitField0_ = (bitField0_ & ~0x00000002); + aggregatesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getAggregatesFieldBuilder() + : null; + } else { + aggregatesBuilder_.addAllMessages(other.aggregates_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + groupBy_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate m = + input.readMessage( + com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate.parser(), + extensionRegistry); + if (aggregatesBuilder_ == null) { + ensureAggregatesIsMutable(); + aggregates_.add(m); + } else { + aggregatesBuilder_.addMessage(m); + } + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object groupBy_ = ""; + + /** + * + * + *
+       * groupBy specifies the type of aggregate.
+       * For example a group_by might be `"state"`
+       * 
+ * + * string group_by = 1; + * + * @return The groupBy. + */ + public java.lang.String getGroupBy() { + java.lang.Object ref = groupBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + groupBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * groupBy specifies the type of aggregate.
+       * For example a group_by might be `"state"`
+       * 
+ * + * string group_by = 1; + * + * @return The bytes for groupBy. + */ + public com.google.protobuf.ByteString getGroupByBytes() { + java.lang.Object ref = groupBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + groupBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * groupBy specifies the type of aggregate.
+       * For example a group_by might be `"state"`
+       * 
+ * + * string group_by = 1; + * + * @param value The groupBy to set. + * @return This builder for chaining. + */ + public Builder setGroupBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + groupBy_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * groupBy specifies the type of aggregate.
+       * For example a group_by might be `"state"`
+       * 
+ * + * string group_by = 1; + * + * @return This builder for chaining. + */ + public Builder clearGroupBy() { + groupBy_ = getDefaultInstance().getGroupBy(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+       * groupBy specifies the type of aggregate.
+       * For example a group_by might be `"state"`
+       * 
+ * + * string group_by = 1; + * + * @param value The bytes for groupBy to set. + * @return This builder for chaining. + */ + public Builder setGroupByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + groupBy_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List + aggregates_ = java.util.Collections.emptyList(); + + private void ensureAggregatesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + aggregates_ = + new java.util.ArrayList< + com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate>(aggregates_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate, + com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate.Builder, + com.google.cloud.maintenance.api.v1.MaintenanceSummary.AggregateOrBuilder> + aggregatesBuilder_; + + /** + * + * + *
+       * Aggregates is a list <group, count> pairs. For example, if the
+       * group_by is `"state"` a possible tuple in the aggregates list could be
+       * "SCHEDULED" : `11`,
+       * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate aggregates = 2; + * + */ + public java.util.List + getAggregatesList() { + if (aggregatesBuilder_ == null) { + return java.util.Collections.unmodifiableList(aggregates_); + } else { + return aggregatesBuilder_.getMessageList(); + } + } + + /** + * + * + *
+       * Aggregates is a list <group, count> pairs. For example, if the
+       * group_by is `"state"` a possible tuple in the aggregates list could be
+       * "SCHEDULED" : `11`,
+       * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate aggregates = 2; + * + */ + public int getAggregatesCount() { + if (aggregatesBuilder_ == null) { + return aggregates_.size(); + } else { + return aggregatesBuilder_.getCount(); + } + } + + /** + * + * + *
+       * Aggregates is a list <group, count> pairs. For example, if the
+       * group_by is `"state"` a possible tuple in the aggregates list could be
+       * "SCHEDULED" : `11`,
+       * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate aggregates = 2; + * + */ + public com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate getAggregates( + int index) { + if (aggregatesBuilder_ == null) { + return aggregates_.get(index); + } else { + return aggregatesBuilder_.getMessage(index); + } + } + + /** + * + * + *
+       * Aggregates is a list <group, count> pairs. For example, if the
+       * group_by is `"state"` a possible tuple in the aggregates list could be
+       * "SCHEDULED" : `11`,
+       * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate aggregates = 2; + * + */ + public Builder setAggregates( + int index, com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate value) { + if (aggregatesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAggregatesIsMutable(); + aggregates_.set(index, value); + onChanged(); + } else { + aggregatesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+       * Aggregates is a list <group, count> pairs. For example, if the
+       * group_by is `"state"` a possible tuple in the aggregates list could be
+       * "SCHEDULED" : `11`,
+       * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate aggregates = 2; + * + */ + public Builder setAggregates( + int index, + com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate.Builder + builderForValue) { + if (aggregatesBuilder_ == null) { + ensureAggregatesIsMutable(); + aggregates_.set(index, builderForValue.build()); + onChanged(); + } else { + aggregatesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Aggregates is a list <group, count> pairs. For example, if the
+       * group_by is `"state"` a possible tuple in the aggregates list could be
+       * "SCHEDULED" : `11`,
+       * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate aggregates = 2; + * + */ + public Builder addAggregates( + com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate value) { + if (aggregatesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAggregatesIsMutable(); + aggregates_.add(value); + onChanged(); + } else { + aggregatesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+       * Aggregates is a list <group, count> pairs. For example, if the
+       * group_by is `"state"` a possible tuple in the aggregates list could be
+       * "SCHEDULED" : `11`,
+       * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate aggregates = 2; + * + */ + public Builder addAggregates( + int index, com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate value) { + if (aggregatesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAggregatesIsMutable(); + aggregates_.add(index, value); + onChanged(); + } else { + aggregatesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+       * Aggregates is a list <group, count> pairs. For example, if the
+       * group_by is `"state"` a possible tuple in the aggregates list could be
+       * "SCHEDULED" : `11`,
+       * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate aggregates = 2; + * + */ + public Builder addAggregates( + com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate.Builder + builderForValue) { + if (aggregatesBuilder_ == null) { + ensureAggregatesIsMutable(); + aggregates_.add(builderForValue.build()); + onChanged(); + } else { + aggregatesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Aggregates is a list <group, count> pairs. For example, if the
+       * group_by is `"state"` a possible tuple in the aggregates list could be
+       * "SCHEDULED" : `11`,
+       * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate aggregates = 2; + * + */ + public Builder addAggregates( + int index, + com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate.Builder + builderForValue) { + if (aggregatesBuilder_ == null) { + ensureAggregatesIsMutable(); + aggregates_.add(index, builderForValue.build()); + onChanged(); + } else { + aggregatesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Aggregates is a list <group, count> pairs. For example, if the
+       * group_by is `"state"` a possible tuple in the aggregates list could be
+       * "SCHEDULED" : `11`,
+       * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate aggregates = 2; + * + */ + public Builder addAllAggregates( + java.lang.Iterable< + ? extends com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate> + values) { + if (aggregatesBuilder_ == null) { + ensureAggregatesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, aggregates_); + onChanged(); + } else { + aggregatesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+       * Aggregates is a list <group, count> pairs. For example, if the
+       * group_by is `"state"` a possible tuple in the aggregates list could be
+       * "SCHEDULED" : `11`,
+       * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate aggregates = 2; + * + */ + public Builder clearAggregates() { + if (aggregatesBuilder_ == null) { + aggregates_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + aggregatesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+       * Aggregates is a list <group, count> pairs. For example, if the
+       * group_by is `"state"` a possible tuple in the aggregates list could be
+       * "SCHEDULED" : `11`,
+       * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate aggregates = 2; + * + */ + public Builder removeAggregates(int index) { + if (aggregatesBuilder_ == null) { + ensureAggregatesIsMutable(); + aggregates_.remove(index); + onChanged(); + } else { + aggregatesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+       * Aggregates is a list <group, count> pairs. For example, if the
+       * group_by is `"state"` a possible tuple in the aggregates list could be
+       * "SCHEDULED" : `11`,
+       * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate aggregates = 2; + * + */ + public com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate.Builder + getAggregatesBuilder(int index) { + return getAggregatesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+       * Aggregates is a list <group, count> pairs. For example, if the
+       * group_by is `"state"` a possible tuple in the aggregates list could be
+       * "SCHEDULED" : `11`,
+       * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate aggregates = 2; + * + */ + public com.google.cloud.maintenance.api.v1.MaintenanceSummary.AggregateOrBuilder + getAggregatesOrBuilder(int index) { + if (aggregatesBuilder_ == null) { + return aggregates_.get(index); + } else { + return aggregatesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+       * Aggregates is a list <group, count> pairs. For example, if the
+       * group_by is `"state"` a possible tuple in the aggregates list could be
+       * "SCHEDULED" : `11`,
+       * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate aggregates = 2; + * + */ + public java.util.List< + ? extends com.google.cloud.maintenance.api.v1.MaintenanceSummary.AggregateOrBuilder> + getAggregatesOrBuilderList() { + if (aggregatesBuilder_ != null) { + return aggregatesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(aggregates_); + } + } + + /** + * + * + *
+       * Aggregates is a list <group, count> pairs. For example, if the
+       * group_by is `"state"` a possible tuple in the aggregates list could be
+       * "SCHEDULED" : `11`,
+       * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate aggregates = 2; + * + */ + public com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate.Builder + addAggregatesBuilder() { + return getAggregatesFieldBuilder() + .addBuilder( + com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate + .getDefaultInstance()); + } + + /** + * + * + *
+       * Aggregates is a list <group, count> pairs. For example, if the
+       * group_by is `"state"` a possible tuple in the aggregates list could be
+       * "SCHEDULED" : `11`,
+       * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate aggregates = 2; + * + */ + public com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate.Builder + addAggregatesBuilder(int index) { + return getAggregatesFieldBuilder() + .addBuilder( + index, + com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate + .getDefaultInstance()); + } + + /** + * + * + *
+       * Aggregates is a list <group, count> pairs. For example, if the
+       * group_by is `"state"` a possible tuple in the aggregates list could be
+       * "SCHEDULED" : `11`,
+       * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate aggregates = 2; + * + */ + public java.util.List< + com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate.Builder> + getAggregatesBuilderList() { + return getAggregatesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate, + com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate.Builder, + com.google.cloud.maintenance.api.v1.MaintenanceSummary.AggregateOrBuilder> + getAggregatesFieldBuilder() { + if (aggregatesBuilder_ == null) { + aggregatesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate, + com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate.Builder, + com.google.cloud.maintenance.api.v1.MaintenanceSummary.AggregateOrBuilder>( + aggregates_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + aggregates_ = null; + } + return aggregatesBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.maintenance.api.v1.MaintenanceSummary.Stats) + } + + // @@protoc_insertion_point(class_scope:google.cloud.maintenance.api.v1.MaintenanceSummary.Stats) + private static final com.google.cloud.maintenance.api.v1.MaintenanceSummary.Stats + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.maintenance.api.v1.MaintenanceSummary.Stats(); + } + + public static com.google.cloud.maintenance.api.v1.MaintenanceSummary.Stats + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Stats parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.maintenance.api.v1.MaintenanceSummary.Stats + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface AggregateOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Specifies what specific value of the group_by the count represents. For
+     * example if group_by is `"state"` its corresponding group could be
+     * `"SCHEDULED"`.
+     * 
+ * + * string group = 1; + * + * @return The group. + */ + java.lang.String getGroup(); + + /** + * + * + *
+     * Specifies what specific value of the group_by the count represents. For
+     * example if group_by is `"state"` its corresponding group could be
+     * `"SCHEDULED"`.
+     * 
+ * + * string group = 1; + * + * @return The bytes for group. + */ + com.google.protobuf.ByteString getGroupBytes(); + + /** + * + * + *
+     * The count of the group.
+     * 
+ * + * int64 count = 2; + * + * @return The count. + */ + long getCount(); + } + + /** + * + * + *
+   * Aggregate is a <group, count> pair.
+   * 
+ * + * Protobuf type {@code google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate} + */ + public static final class Aggregate extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate) + AggregateOrBuilder { + private static final long serialVersionUID = 0L; + + // Use Aggregate.newBuilder() to construct. + private Aggregate(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Aggregate() { + group_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Aggregate(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_MaintenanceSummary_Aggregate_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_MaintenanceSummary_Aggregate_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate.class, + com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate.Builder.class); + } + + public static final int GROUP_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object group_ = ""; + + /** + * + * + *
+     * Specifies what specific value of the group_by the count represents. For
+     * example if group_by is `"state"` its corresponding group could be
+     * `"SCHEDULED"`.
+     * 
+ * + * string group = 1; + * + * @return The group. + */ + @java.lang.Override + public java.lang.String getGroup() { + java.lang.Object ref = group_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + group_ = s; + return s; + } + } + + /** + * + * + *
+     * Specifies what specific value of the group_by the count represents. For
+     * example if group_by is `"state"` its corresponding group could be
+     * `"SCHEDULED"`.
+     * 
+ * + * string group = 1; + * + * @return The bytes for group. + */ + @java.lang.Override + public com.google.protobuf.ByteString getGroupBytes() { + java.lang.Object ref = group_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + group_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int COUNT_FIELD_NUMBER = 2; + private long count_ = 0L; + + /** + * + * + *
+     * The count of the group.
+     * 
+ * + * int64 count = 2; + * + * @return The count. + */ + @java.lang.Override + public long getCount() { + return count_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(group_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, group_); + } + if (count_ != 0L) { + output.writeInt64(2, count_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(group_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, group_); + } + if (count_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, count_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate)) { + return super.equals(obj); + } + com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate other = + (com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate) obj; + + if (!getGroup().equals(other.getGroup())) return false; + if (getCount() != other.getCount()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + GROUP_FIELD_NUMBER; + hash = (53 * hash) + getGroup().hashCode(); + hash = (37 * hash) + COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getCount()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * Aggregate is a <group, count> pair.
+     * 
+ * + * Protobuf type {@code google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate) + com.google.cloud.maintenance.api.v1.MaintenanceSummary.AggregateOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_MaintenanceSummary_Aggregate_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_MaintenanceSummary_Aggregate_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate.class, + com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate.Builder.class); + } + + // Construct using + // com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + group_ = ""; + count_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_MaintenanceSummary_Aggregate_descriptor; + } + + @java.lang.Override + public com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate + getDefaultInstanceForType() { + return com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate build() { + com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate buildPartial() { + com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate result = + new com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.group_ = group_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.count_ = count_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate) { + return mergeFrom( + (com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate other) { + if (other + == com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate + .getDefaultInstance()) return this; + if (!other.getGroup().isEmpty()) { + group_ = other.group_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getCount() != 0L) { + setCount(other.getCount()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + group_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + count_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object group_ = ""; + + /** + * + * + *
+       * Specifies what specific value of the group_by the count represents. For
+       * example if group_by is `"state"` its corresponding group could be
+       * `"SCHEDULED"`.
+       * 
+ * + * string group = 1; + * + * @return The group. + */ + public java.lang.String getGroup() { + java.lang.Object ref = group_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + group_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Specifies what specific value of the group_by the count represents. For
+       * example if group_by is `"state"` its corresponding group could be
+       * `"SCHEDULED"`.
+       * 
+ * + * string group = 1; + * + * @return The bytes for group. + */ + public com.google.protobuf.ByteString getGroupBytes() { + java.lang.Object ref = group_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + group_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Specifies what specific value of the group_by the count represents. For
+       * example if group_by is `"state"` its corresponding group could be
+       * `"SCHEDULED"`.
+       * 
+ * + * string group = 1; + * + * @param value The group to set. + * @return This builder for chaining. + */ + public Builder setGroup(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + group_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Specifies what specific value of the group_by the count represents. For
+       * example if group_by is `"state"` its corresponding group could be
+       * `"SCHEDULED"`.
+       * 
+ * + * string group = 1; + * + * @return This builder for chaining. + */ + public Builder clearGroup() { + group_ = getDefaultInstance().getGroup(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+       * Specifies what specific value of the group_by the count represents. For
+       * example if group_by is `"state"` its corresponding group could be
+       * `"SCHEDULED"`.
+       * 
+ * + * string group = 1; + * + * @param value The bytes for group to set. + * @return This builder for chaining. + */ + public Builder setGroupBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + group_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private long count_; + + /** + * + * + *
+       * The count of the group.
+       * 
+ * + * int64 count = 2; + * + * @return The count. + */ + @java.lang.Override + public long getCount() { + return count_; + } + + /** + * + * + *
+       * The count of the group.
+       * 
+ * + * int64 count = 2; + * + * @param value The count to set. + * @return This builder for chaining. + */ + public Builder setCount(long value) { + + count_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * The count of the group.
+       * 
+ * + * int64 count = 2; + * + * @return This builder for chaining. + */ + public Builder clearCount() { + bitField0_ = (bitField0_ & ~0x00000002); + count_ = 0L; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate) + } + + // @@protoc_insertion_point(class_scope:google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate) + private static final com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate(); + } + + public static com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Aggregate parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.maintenance.api.v1.MaintenanceSummary.Aggregate + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int MAINTENANCE_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object maintenanceName_ = ""; + + /** + * + * + *
+   * Output only. The name of the maintenance.
+   * 
+ * + * string maintenance_name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The maintenanceName. + */ + @java.lang.Override + public java.lang.String getMaintenanceName() { + java.lang.Object ref = maintenanceName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + maintenanceName_ = s; + return s; + } + } + + /** + * + * + *
+   * Output only. The name of the maintenance.
+   * 
+ * + * string maintenance_name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for maintenanceName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMaintenanceNameBytes() { + java.lang.Object ref = maintenanceName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + maintenanceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TITLE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object title_ = ""; + + /** + * + * + *
+   * Output only. The title of the maintenance.
+   * 
+ * + * string title = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The title. + */ + @java.lang.Override + public java.lang.String getTitle() { + java.lang.Object ref = title_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + title_ = s; + return s; + } + } + + /** + * + * + *
+   * Output only. The title of the maintenance.
+   * 
+ * + * string title = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for title. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTitleBytes() { + java.lang.Object ref = title_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + + /** + * + * + *
+   * Output only. The description of the maintenance.
+   * 
+ * + * string description = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } + } + + /** + * + * + *
+   * Output only. The description of the maintenance.
+   * 
+ * + * string description = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CATEGORY_FIELD_NUMBER = 13; + private int category_ = 0; + + /** + * + * + *
+   * Output only. The category of the maintenance event.
+   * 
+ * + * + * .google.cloud.maintenance.api.v1.MaintenanceCategory category = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for category. + */ + @java.lang.Override + public int getCategoryValue() { + return category_; + } + + /** + * + * + *
+   * Output only. The category of the maintenance event.
+   * 
+ * + * + * .google.cloud.maintenance.api.v1.MaintenanceCategory category = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The category. + */ + @java.lang.Override + public com.google.cloud.maintenance.api.v1.MaintenanceCategory getCategory() { + com.google.cloud.maintenance.api.v1.MaintenanceCategory result = + com.google.cloud.maintenance.api.v1.MaintenanceCategory.forNumber(category_); + return result == null + ? com.google.cloud.maintenance.api.v1.MaintenanceCategory.UNRECOGNIZED + : result; + } + + public static final int MAINTENANCE_SCHEDULED_START_TIME_FIELD_NUMBER = 6; + private com.google.protobuf.Timestamp maintenanceScheduledStartTime_; + + /** + * + * + *
+   * Output only. Scheduled start time of the maintenance. The maintenance will
+   * start at `maintenanceScheduledStartTime` or later, with best effort to
+   * finish before `maintenanceScheduledEndTime`.
+   * 
+ * + * + * .google.protobuf.Timestamp maintenance_scheduled_start_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the maintenanceScheduledStartTime field is set. + */ + @java.lang.Override + public boolean hasMaintenanceScheduledStartTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Output only. Scheduled start time of the maintenance. The maintenance will
+   * start at `maintenanceScheduledStartTime` or later, with best effort to
+   * finish before `maintenanceScheduledEndTime`.
+   * 
+ * + * + * .google.protobuf.Timestamp maintenance_scheduled_start_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The maintenanceScheduledStartTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getMaintenanceScheduledStartTime() { + return maintenanceScheduledStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : maintenanceScheduledStartTime_; + } + + /** + * + * + *
+   * Output only. Scheduled start time of the maintenance. The maintenance will
+   * start at `maintenanceScheduledStartTime` or later, with best effort to
+   * finish before `maintenanceScheduledEndTime`.
+   * 
+ * + * + * .google.protobuf.Timestamp maintenance_scheduled_start_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getMaintenanceScheduledStartTimeOrBuilder() { + return maintenanceScheduledStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : maintenanceScheduledStartTime_; + } + + public static final int MAINTENANCE_SCHEDULED_END_TIME_FIELD_NUMBER = 7; + private com.google.protobuf.Timestamp maintenanceScheduledEndTime_; + + /** + * + * + *
+   * Output only. An estimated (best effort, not guaranteed) end time of the
+   * scheduled maintenance.
+   * 
+ * + * + * .google.protobuf.Timestamp maintenance_scheduled_end_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the maintenanceScheduledEndTime field is set. + */ + @java.lang.Override + public boolean hasMaintenanceScheduledEndTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Output only. An estimated (best effort, not guaranteed) end time of the
+   * scheduled maintenance.
+   * 
+ * + * + * .google.protobuf.Timestamp maintenance_scheduled_end_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The maintenanceScheduledEndTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getMaintenanceScheduledEndTime() { + return maintenanceScheduledEndTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : maintenanceScheduledEndTime_; + } + + /** + * + * + *
+   * Output only. An estimated (best effort, not guaranteed) end time of the
+   * scheduled maintenance.
+   * 
+ * + * + * .google.protobuf.Timestamp maintenance_scheduled_end_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getMaintenanceScheduledEndTimeOrBuilder() { + return maintenanceScheduledEndTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : maintenanceScheduledEndTime_; + } + + public static final int MAINTENANCE_START_TIME_FIELD_NUMBER = 8; + private com.google.protobuf.Timestamp maintenanceStartTime_; + + /** + * + * + *
+   * Output only. Actual date when the maintenance started. Field present only
+   * after the state changed to `RUNNING`.
+   * 
+ * + * + * .google.protobuf.Timestamp maintenance_start_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the maintenanceStartTime field is set. + */ + @java.lang.Override + public boolean hasMaintenanceStartTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * Output only. Actual date when the maintenance started. Field present only
+   * after the state changed to `RUNNING`.
+   * 
+ * + * + * .google.protobuf.Timestamp maintenance_start_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The maintenanceStartTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getMaintenanceStartTime() { + return maintenanceStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : maintenanceStartTime_; + } + + /** + * + * + *
+   * Output only. Actual date when the maintenance started. Field present only
+   * after the state changed to `RUNNING`.
+   * 
+ * + * + * .google.protobuf.Timestamp maintenance_start_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getMaintenanceStartTimeOrBuilder() { + return maintenanceStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : maintenanceStartTime_; + } + + public static final int MAINTENANCE_END_TIME_FIELD_NUMBER = 9; + private com.google.protobuf.Timestamp maintenanceEndTime_; + + /** + * + * + *
+   * Output only. Actual date when the maintenance successfully completed. Field
+   * present only after the state changed to `SUCCEEDED`.
+   * 
+ * + * + * .google.protobuf.Timestamp maintenance_end_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the maintenanceEndTime field is set. + */ + @java.lang.Override + public boolean hasMaintenanceEndTime() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+   * Output only. Actual date when the maintenance successfully completed. Field
+   * present only after the state changed to `SUCCEEDED`.
+   * 
+ * + * + * .google.protobuf.Timestamp maintenance_end_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The maintenanceEndTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getMaintenanceEndTime() { + return maintenanceEndTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : maintenanceEndTime_; + } + + /** + * + * + *
+   * Output only. Actual date when the maintenance successfully completed. Field
+   * present only after the state changed to `SUCCEEDED`.
+   * 
+ * + * + * .google.protobuf.Timestamp maintenance_end_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getMaintenanceEndTimeOrBuilder() { + return maintenanceEndTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : maintenanceEndTime_; + } + + public static final int USER_CONTROLLABLE_FIELD_NUMBER = 10; + private boolean userControllable_ = false; + + /** + * + * + *
+   * Output only. Indicates whether the user has some control over that
+   * maintenance, either proactively before maintenance was scheduled with
+   * maintenance policy or with reactive controls after it was scheduled (see
+   * controls field).
+   * 
+ * + * bool user_controllable = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The userControllable. + */ + @java.lang.Override + public boolean getUserControllable() { + return userControllable_; + } + + public static final int CONTROLS_FIELD_NUMBER = 14; + + @SuppressWarnings("serial") + private java.util.List controls_; + + /** + * + * + *
+   * Output only. Control available for that Maintenance (might not be available
+   * for every resource that maintenance is applied to).
+   * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceControl controls = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List getControlsList() { + return controls_; + } + + /** + * + * + *
+   * Output only. Control available for that Maintenance (might not be available
+   * for every resource that maintenance is applied to).
+   * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceControl controls = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getControlsOrBuilderList() { + return controls_; + } + + /** + * + * + *
+   * Output only. Control available for that Maintenance (might not be available
+   * for every resource that maintenance is applied to).
+   * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceControl controls = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getControlsCount() { + return controls_.size(); + } + + /** + * + * + *
+   * Output only. Control available for that Maintenance (might not be available
+   * for every resource that maintenance is applied to).
+   * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceControl controls = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.maintenance.api.v1.MaintenanceControl getControls(int index) { + return controls_.get(index); + } + + /** + * + * + *
+   * Output only. Control available for that Maintenance (might not be available
+   * for every resource that maintenance is applied to).
+   * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceControl controls = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.maintenance.api.v1.MaintenanceControlOrBuilder getControlsOrBuilder( + int index) { + return controls_.get(index); + } + + public static final int STATS_FIELD_NUMBER = 12; + + @SuppressWarnings("serial") + private java.util.List stats_; + + /** + * + * + *
+   * Output only. Stats is a field of ResourceMaintenance used to aggregate the
+   * stats.
+   * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary.Stats stats = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getStatsList() { + return stats_; + } + + /** + * + * + *
+   * Output only. Stats is a field of ResourceMaintenance used to aggregate the
+   * stats.
+   * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary.Stats stats = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.maintenance.api.v1.MaintenanceSummary.StatsOrBuilder> + getStatsOrBuilderList() { + return stats_; + } + + /** + * + * + *
+   * Output only. Stats is a field of ResourceMaintenance used to aggregate the
+   * stats.
+   * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary.Stats stats = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getStatsCount() { + return stats_.size(); + } + + /** + * + * + *
+   * Output only. Stats is a field of ResourceMaintenance used to aggregate the
+   * stats.
+   * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary.Stats stats = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.maintenance.api.v1.MaintenanceSummary.Stats getStats(int index) { + return stats_.get(index); + } + + /** + * + * + *
+   * Output only. Stats is a field of ResourceMaintenance used to aggregate the
+   * stats.
+   * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary.Stats stats = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.maintenance.api.v1.MaintenanceSummary.StatsOrBuilder getStatsOrBuilder( + int index) { + return stats_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(maintenanceName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, maintenanceName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(title_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, title_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(6, getMaintenanceScheduledStartTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(7, getMaintenanceScheduledEndTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(8, getMaintenanceStartTime()); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(9, getMaintenanceEndTime()); + } + if (userControllable_ != false) { + output.writeBool(10, userControllable_); + } + for (int i = 0; i < stats_.size(); i++) { + output.writeMessage(12, stats_.get(i)); + } + if (category_ + != com.google.cloud.maintenance.api.v1.MaintenanceCategory.MAINTENANCE_CATEGORY_UNSPECIFIED + .getNumber()) { + output.writeEnum(13, category_); + } + for (int i = 0; i < controls_.size(); i++) { + output.writeMessage(14, controls_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(maintenanceName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, maintenanceName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(title_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, title_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, getMaintenanceScheduledStartTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 7, getMaintenanceScheduledEndTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(8, getMaintenanceStartTime()); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getMaintenanceEndTime()); + } + if (userControllable_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(10, userControllable_); + } + for (int i = 0; i < stats_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, stats_.get(i)); + } + if (category_ + != com.google.cloud.maintenance.api.v1.MaintenanceCategory.MAINTENANCE_CATEGORY_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(13, category_); + } + for (int i = 0; i < controls_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(14, controls_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.maintenance.api.v1.MaintenanceSummary)) { + return super.equals(obj); + } + com.google.cloud.maintenance.api.v1.MaintenanceSummary other = + (com.google.cloud.maintenance.api.v1.MaintenanceSummary) obj; + + if (!getMaintenanceName().equals(other.getMaintenanceName())) return false; + if (!getTitle().equals(other.getTitle())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (category_ != other.category_) return false; + if (hasMaintenanceScheduledStartTime() != other.hasMaintenanceScheduledStartTime()) + return false; + if (hasMaintenanceScheduledStartTime()) { + if (!getMaintenanceScheduledStartTime().equals(other.getMaintenanceScheduledStartTime())) + return false; + } + if (hasMaintenanceScheduledEndTime() != other.hasMaintenanceScheduledEndTime()) return false; + if (hasMaintenanceScheduledEndTime()) { + if (!getMaintenanceScheduledEndTime().equals(other.getMaintenanceScheduledEndTime())) + return false; + } + if (hasMaintenanceStartTime() != other.hasMaintenanceStartTime()) return false; + if (hasMaintenanceStartTime()) { + if (!getMaintenanceStartTime().equals(other.getMaintenanceStartTime())) return false; + } + if (hasMaintenanceEndTime() != other.hasMaintenanceEndTime()) return false; + if (hasMaintenanceEndTime()) { + if (!getMaintenanceEndTime().equals(other.getMaintenanceEndTime())) return false; + } + if (getUserControllable() != other.getUserControllable()) return false; + if (!getControlsList().equals(other.getControlsList())) return false; + if (!getStatsList().equals(other.getStatsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + MAINTENANCE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getMaintenanceName().hashCode(); + hash = (37 * hash) + TITLE_FIELD_NUMBER; + hash = (53 * hash) + getTitle().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + CATEGORY_FIELD_NUMBER; + hash = (53 * hash) + category_; + if (hasMaintenanceScheduledStartTime()) { + hash = (37 * hash) + MAINTENANCE_SCHEDULED_START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getMaintenanceScheduledStartTime().hashCode(); + } + if (hasMaintenanceScheduledEndTime()) { + hash = (37 * hash) + MAINTENANCE_SCHEDULED_END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getMaintenanceScheduledEndTime().hashCode(); + } + if (hasMaintenanceStartTime()) { + hash = (37 * hash) + MAINTENANCE_START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getMaintenanceStartTime().hashCode(); + } + if (hasMaintenanceEndTime()) { + hash = (37 * hash) + MAINTENANCE_END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getMaintenanceEndTime().hashCode(); + } + hash = (37 * hash) + USER_CONTROLLABLE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getUserControllable()); + if (getControlsCount() > 0) { + hash = (37 * hash) + CONTROLS_FIELD_NUMBER; + hash = (53 * hash) + getControlsList().hashCode(); + } + if (getStatsCount() > 0) { + hash = (37 * hash) + STATS_FIELD_NUMBER; + hash = (53 * hash) + getStatsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.maintenance.api.v1.MaintenanceSummary parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.maintenance.api.v1.MaintenanceSummary parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.maintenance.api.v1.MaintenanceSummary parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.maintenance.api.v1.MaintenanceSummary parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.maintenance.api.v1.MaintenanceSummary parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.maintenance.api.v1.MaintenanceSummary parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.maintenance.api.v1.MaintenanceSummary parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.maintenance.api.v1.MaintenanceSummary parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.maintenance.api.v1.MaintenanceSummary parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.maintenance.api.v1.MaintenanceSummary parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.maintenance.api.v1.MaintenanceSummary parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.maintenance.api.v1.MaintenanceSummary parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.maintenance.api.v1.MaintenanceSummary prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * MaintenanceSummary contains maintenance statistics calculated based on
+   * ResourceMaintenances within the scope: project and location.
+   * 
+ * + * Protobuf type {@code google.cloud.maintenance.api.v1.MaintenanceSummary} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.maintenance.api.v1.MaintenanceSummary) + com.google.cloud.maintenance.api.v1.MaintenanceSummaryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_MaintenanceSummary_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_MaintenanceSummary_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.maintenance.api.v1.MaintenanceSummary.class, + com.google.cloud.maintenance.api.v1.MaintenanceSummary.Builder.class); + } + + // Construct using com.google.cloud.maintenance.api.v1.MaintenanceSummary.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getMaintenanceScheduledStartTimeFieldBuilder(); + getMaintenanceScheduledEndTimeFieldBuilder(); + getMaintenanceStartTimeFieldBuilder(); + getMaintenanceEndTimeFieldBuilder(); + getControlsFieldBuilder(); + getStatsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + maintenanceName_ = ""; + title_ = ""; + description_ = ""; + category_ = 0; + maintenanceScheduledStartTime_ = null; + if (maintenanceScheduledStartTimeBuilder_ != null) { + maintenanceScheduledStartTimeBuilder_.dispose(); + maintenanceScheduledStartTimeBuilder_ = null; + } + maintenanceScheduledEndTime_ = null; + if (maintenanceScheduledEndTimeBuilder_ != null) { + maintenanceScheduledEndTimeBuilder_.dispose(); + maintenanceScheduledEndTimeBuilder_ = null; + } + maintenanceStartTime_ = null; + if (maintenanceStartTimeBuilder_ != null) { + maintenanceStartTimeBuilder_.dispose(); + maintenanceStartTimeBuilder_ = null; + } + maintenanceEndTime_ = null; + if (maintenanceEndTimeBuilder_ != null) { + maintenanceEndTimeBuilder_.dispose(); + maintenanceEndTimeBuilder_ = null; + } + userControllable_ = false; + if (controlsBuilder_ == null) { + controls_ = java.util.Collections.emptyList(); + } else { + controls_ = null; + controlsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000200); + if (statsBuilder_ == null) { + stats_ = java.util.Collections.emptyList(); + } else { + stats_ = null; + statsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000400); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_MaintenanceSummary_descriptor; + } + + @java.lang.Override + public com.google.cloud.maintenance.api.v1.MaintenanceSummary getDefaultInstanceForType() { + return com.google.cloud.maintenance.api.v1.MaintenanceSummary.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.maintenance.api.v1.MaintenanceSummary build() { + com.google.cloud.maintenance.api.v1.MaintenanceSummary result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.maintenance.api.v1.MaintenanceSummary buildPartial() { + com.google.cloud.maintenance.api.v1.MaintenanceSummary result = + new com.google.cloud.maintenance.api.v1.MaintenanceSummary(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.maintenance.api.v1.MaintenanceSummary result) { + if (controlsBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0)) { + controls_ = java.util.Collections.unmodifiableList(controls_); + bitField0_ = (bitField0_ & ~0x00000200); + } + result.controls_ = controls_; + } else { + result.controls_ = controlsBuilder_.build(); + } + if (statsBuilder_ == null) { + if (((bitField0_ & 0x00000400) != 0)) { + stats_ = java.util.Collections.unmodifiableList(stats_); + bitField0_ = (bitField0_ & ~0x00000400); + } + result.stats_ = stats_; + } else { + result.stats_ = statsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.maintenance.api.v1.MaintenanceSummary result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.maintenanceName_ = maintenanceName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.title_ = title_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.description_ = description_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.category_ = category_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000010) != 0)) { + result.maintenanceScheduledStartTime_ = + maintenanceScheduledStartTimeBuilder_ == null + ? maintenanceScheduledStartTime_ + : maintenanceScheduledStartTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.maintenanceScheduledEndTime_ = + maintenanceScheduledEndTimeBuilder_ == null + ? maintenanceScheduledEndTime_ + : maintenanceScheduledEndTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.maintenanceStartTime_ = + maintenanceStartTimeBuilder_ == null + ? maintenanceStartTime_ + : maintenanceStartTimeBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.maintenanceEndTime_ = + maintenanceEndTimeBuilder_ == null + ? maintenanceEndTime_ + : maintenanceEndTimeBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.userControllable_ = userControllable_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.maintenance.api.v1.MaintenanceSummary) { + return mergeFrom((com.google.cloud.maintenance.api.v1.MaintenanceSummary) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.maintenance.api.v1.MaintenanceSummary other) { + if (other == com.google.cloud.maintenance.api.v1.MaintenanceSummary.getDefaultInstance()) + return this; + if (!other.getMaintenanceName().isEmpty()) { + maintenanceName_ = other.maintenanceName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getTitle().isEmpty()) { + title_ = other.title_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.category_ != 0) { + setCategoryValue(other.getCategoryValue()); + } + if (other.hasMaintenanceScheduledStartTime()) { + mergeMaintenanceScheduledStartTime(other.getMaintenanceScheduledStartTime()); + } + if (other.hasMaintenanceScheduledEndTime()) { + mergeMaintenanceScheduledEndTime(other.getMaintenanceScheduledEndTime()); + } + if (other.hasMaintenanceStartTime()) { + mergeMaintenanceStartTime(other.getMaintenanceStartTime()); + } + if (other.hasMaintenanceEndTime()) { + mergeMaintenanceEndTime(other.getMaintenanceEndTime()); + } + if (other.getUserControllable() != false) { + setUserControllable(other.getUserControllable()); + } + if (controlsBuilder_ == null) { + if (!other.controls_.isEmpty()) { + if (controls_.isEmpty()) { + controls_ = other.controls_; + bitField0_ = (bitField0_ & ~0x00000200); + } else { + ensureControlsIsMutable(); + controls_.addAll(other.controls_); + } + onChanged(); + } + } else { + if (!other.controls_.isEmpty()) { + if (controlsBuilder_.isEmpty()) { + controlsBuilder_.dispose(); + controlsBuilder_ = null; + controls_ = other.controls_; + bitField0_ = (bitField0_ & ~0x00000200); + controlsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getControlsFieldBuilder() + : null; + } else { + controlsBuilder_.addAllMessages(other.controls_); + } + } + } + if (statsBuilder_ == null) { + if (!other.stats_.isEmpty()) { + if (stats_.isEmpty()) { + stats_ = other.stats_; + bitField0_ = (bitField0_ & ~0x00000400); + } else { + ensureStatsIsMutable(); + stats_.addAll(other.stats_); + } + onChanged(); + } + } else { + if (!other.stats_.isEmpty()) { + if (statsBuilder_.isEmpty()) { + statsBuilder_.dispose(); + statsBuilder_ = null; + stats_ = other.stats_; + bitField0_ = (bitField0_ & ~0x00000400); + statsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getStatsFieldBuilder() + : null; + } else { + statsBuilder_.addAllMessages(other.stats_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + maintenanceName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + title_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 50: + { + input.readMessage( + getMaintenanceScheduledStartTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 50 + case 58: + { + input.readMessage( + getMaintenanceScheduledEndTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 58 + case 66: + { + input.readMessage( + getMaintenanceStartTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 66 + case 74: + { + input.readMessage( + getMaintenanceEndTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 74 + case 80: + { + userControllable_ = input.readBool(); + bitField0_ |= 0x00000100; + break; + } // case 80 + case 98: + { + com.google.cloud.maintenance.api.v1.MaintenanceSummary.Stats m = + input.readMessage( + com.google.cloud.maintenance.api.v1.MaintenanceSummary.Stats.parser(), + extensionRegistry); + if (statsBuilder_ == null) { + ensureStatsIsMutable(); + stats_.add(m); + } else { + statsBuilder_.addMessage(m); + } + break; + } // case 98 + case 104: + { + category_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 104 + case 114: + { + com.google.cloud.maintenance.api.v1.MaintenanceControl m = + input.readMessage( + com.google.cloud.maintenance.api.v1.MaintenanceControl.parser(), + extensionRegistry); + if (controlsBuilder_ == null) { + ensureControlsIsMutable(); + controls_.add(m); + } else { + controlsBuilder_.addMessage(m); + } + break; + } // case 114 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object maintenanceName_ = ""; + + /** + * + * + *
+     * Output only. The name of the maintenance.
+     * 
+ * + * string maintenance_name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The maintenanceName. + */ + public java.lang.String getMaintenanceName() { + java.lang.Object ref = maintenanceName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + maintenanceName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Output only. The name of the maintenance.
+     * 
+ * + * string maintenance_name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for maintenanceName. + */ + public com.google.protobuf.ByteString getMaintenanceNameBytes() { + java.lang.Object ref = maintenanceName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + maintenanceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Output only. The name of the maintenance.
+     * 
+ * + * string maintenance_name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The maintenanceName to set. + * @return This builder for chaining. + */ + public Builder setMaintenanceName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + maintenanceName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The name of the maintenance.
+     * 
+ * + * string maintenance_name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearMaintenanceName() { + maintenanceName_ = getDefaultInstance().getMaintenanceName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The name of the maintenance.
+     * 
+ * + * string maintenance_name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for maintenanceName to set. + * @return This builder for chaining. + */ + public Builder setMaintenanceNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + maintenanceName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object title_ = ""; + + /** + * + * + *
+     * Output only. The title of the maintenance.
+     * 
+ * + * string title = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The title. + */ + public java.lang.String getTitle() { + java.lang.Object ref = title_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + title_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Output only. The title of the maintenance.
+     * 
+ * + * string title = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for title. + */ + public com.google.protobuf.ByteString getTitleBytes() { + java.lang.Object ref = title_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Output only. The title of the maintenance.
+     * 
+ * + * string title = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The title to set. + * @return This builder for chaining. + */ + public Builder setTitle(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + title_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The title of the maintenance.
+     * 
+ * + * string title = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearTitle() { + title_ = getDefaultInstance().getTitle(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The title of the maintenance.
+     * 
+ * + * string title = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for title to set. + * @return This builder for chaining. + */ + public Builder setTitleBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + title_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + + /** + * + * + *
+     * Output only. The description of the maintenance.
+     * 
+ * + * string description = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Output only. The description of the maintenance.
+     * 
+ * + * string description = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Output only. The description of the maintenance.
+     * 
+ * + * string description = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + description_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The description of the maintenance.
+     * 
+ * + * string description = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The description of the maintenance.
+     * 
+ * + * string description = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + description_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private int category_ = 0; + + /** + * + * + *
+     * Output only. The category of the maintenance event.
+     * 
+ * + * + * .google.cloud.maintenance.api.v1.MaintenanceCategory category = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for category. + */ + @java.lang.Override + public int getCategoryValue() { + return category_; + } + + /** + * + * + *
+     * Output only. The category of the maintenance event.
+     * 
+ * + * + * .google.cloud.maintenance.api.v1.MaintenanceCategory category = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for category to set. + * @return This builder for chaining. + */ + public Builder setCategoryValue(int value) { + category_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The category of the maintenance event.
+     * 
+ * + * + * .google.cloud.maintenance.api.v1.MaintenanceCategory category = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The category. + */ + @java.lang.Override + public com.google.cloud.maintenance.api.v1.MaintenanceCategory getCategory() { + com.google.cloud.maintenance.api.v1.MaintenanceCategory result = + com.google.cloud.maintenance.api.v1.MaintenanceCategory.forNumber(category_); + return result == null + ? com.google.cloud.maintenance.api.v1.MaintenanceCategory.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Output only. The category of the maintenance event.
+     * 
+ * + * + * .google.cloud.maintenance.api.v1.MaintenanceCategory category = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The category to set. + * @return This builder for chaining. + */ + public Builder setCategory(com.google.cloud.maintenance.api.v1.MaintenanceCategory value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + category_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The category of the maintenance event.
+     * 
+ * + * + * .google.cloud.maintenance.api.v1.MaintenanceCategory category = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearCategory() { + bitField0_ = (bitField0_ & ~0x00000008); + category_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp maintenanceScheduledStartTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + maintenanceScheduledStartTimeBuilder_; + + /** + * + * + *
+     * Output only. Scheduled start time of the maintenance. The maintenance will
+     * start at `maintenanceScheduledStartTime` or later, with best effort to
+     * finish before `maintenanceScheduledEndTime`.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_scheduled_start_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the maintenanceScheduledStartTime field is set. + */ + public boolean hasMaintenanceScheduledStartTime() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * Output only. Scheduled start time of the maintenance. The maintenance will
+     * start at `maintenanceScheduledStartTime` or later, with best effort to
+     * finish before `maintenanceScheduledEndTime`.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_scheduled_start_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The maintenanceScheduledStartTime. + */ + public com.google.protobuf.Timestamp getMaintenanceScheduledStartTime() { + if (maintenanceScheduledStartTimeBuilder_ == null) { + return maintenanceScheduledStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : maintenanceScheduledStartTime_; + } else { + return maintenanceScheduledStartTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Output only. Scheduled start time of the maintenance. The maintenance will
+     * start at `maintenanceScheduledStartTime` or later, with best effort to
+     * finish before `maintenanceScheduledEndTime`.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_scheduled_start_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setMaintenanceScheduledStartTime(com.google.protobuf.Timestamp value) { + if (maintenanceScheduledStartTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + maintenanceScheduledStartTime_ = value; + } else { + maintenanceScheduledStartTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Scheduled start time of the maintenance. The maintenance will
+     * start at `maintenanceScheduledStartTime` or later, with best effort to
+     * finish before `maintenanceScheduledEndTime`.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_scheduled_start_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setMaintenanceScheduledStartTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (maintenanceScheduledStartTimeBuilder_ == null) { + maintenanceScheduledStartTime_ = builderForValue.build(); + } else { + maintenanceScheduledStartTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Scheduled start time of the maintenance. The maintenance will
+     * start at `maintenanceScheduledStartTime` or later, with best effort to
+     * finish before `maintenanceScheduledEndTime`.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_scheduled_start_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeMaintenanceScheduledStartTime(com.google.protobuf.Timestamp value) { + if (maintenanceScheduledStartTimeBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && maintenanceScheduledStartTime_ != null + && maintenanceScheduledStartTime_ + != com.google.protobuf.Timestamp.getDefaultInstance()) { + getMaintenanceScheduledStartTimeBuilder().mergeFrom(value); + } else { + maintenanceScheduledStartTime_ = value; + } + } else { + maintenanceScheduledStartTimeBuilder_.mergeFrom(value); + } + if (maintenanceScheduledStartTime_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Output only. Scheduled start time of the maintenance. The maintenance will
+     * start at `maintenanceScheduledStartTime` or later, with best effort to
+     * finish before `maintenanceScheduledEndTime`.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_scheduled_start_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearMaintenanceScheduledStartTime() { + bitField0_ = (bitField0_ & ~0x00000010); + maintenanceScheduledStartTime_ = null; + if (maintenanceScheduledStartTimeBuilder_ != null) { + maintenanceScheduledStartTimeBuilder_.dispose(); + maintenanceScheduledStartTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Scheduled start time of the maintenance. The maintenance will
+     * start at `maintenanceScheduledStartTime` or later, with best effort to
+     * finish before `maintenanceScheduledEndTime`.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_scheduled_start_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getMaintenanceScheduledStartTimeBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getMaintenanceScheduledStartTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. Scheduled start time of the maintenance. The maintenance will
+     * start at `maintenanceScheduledStartTime` or later, with best effort to
+     * finish before `maintenanceScheduledEndTime`.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_scheduled_start_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getMaintenanceScheduledStartTimeOrBuilder() { + if (maintenanceScheduledStartTimeBuilder_ != null) { + return maintenanceScheduledStartTimeBuilder_.getMessageOrBuilder(); + } else { + return maintenanceScheduledStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : maintenanceScheduledStartTime_; + } + } + + /** + * + * + *
+     * Output only. Scheduled start time of the maintenance. The maintenance will
+     * start at `maintenanceScheduledStartTime` or later, with best effort to
+     * finish before `maintenanceScheduledEndTime`.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_scheduled_start_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getMaintenanceScheduledStartTimeFieldBuilder() { + if (maintenanceScheduledStartTimeBuilder_ == null) { + maintenanceScheduledStartTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getMaintenanceScheduledStartTime(), getParentForChildren(), isClean()); + maintenanceScheduledStartTime_ = null; + } + return maintenanceScheduledStartTimeBuilder_; + } + + private com.google.protobuf.Timestamp maintenanceScheduledEndTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + maintenanceScheduledEndTimeBuilder_; + + /** + * + * + *
+     * Output only. An estimated (best effort, not guaranteed) end time of the
+     * scheduled maintenance.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_scheduled_end_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the maintenanceScheduledEndTime field is set. + */ + public boolean hasMaintenanceScheduledEndTime() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+     * Output only. An estimated (best effort, not guaranteed) end time of the
+     * scheduled maintenance.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_scheduled_end_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The maintenanceScheduledEndTime. + */ + public com.google.protobuf.Timestamp getMaintenanceScheduledEndTime() { + if (maintenanceScheduledEndTimeBuilder_ == null) { + return maintenanceScheduledEndTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : maintenanceScheduledEndTime_; + } else { + return maintenanceScheduledEndTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Output only. An estimated (best effort, not guaranteed) end time of the
+     * scheduled maintenance.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_scheduled_end_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setMaintenanceScheduledEndTime(com.google.protobuf.Timestamp value) { + if (maintenanceScheduledEndTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + maintenanceScheduledEndTime_ = value; + } else { + maintenanceScheduledEndTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. An estimated (best effort, not guaranteed) end time of the
+     * scheduled maintenance.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_scheduled_end_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setMaintenanceScheduledEndTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (maintenanceScheduledEndTimeBuilder_ == null) { + maintenanceScheduledEndTime_ = builderForValue.build(); + } else { + maintenanceScheduledEndTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. An estimated (best effort, not guaranteed) end time of the
+     * scheduled maintenance.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_scheduled_end_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeMaintenanceScheduledEndTime(com.google.protobuf.Timestamp value) { + if (maintenanceScheduledEndTimeBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && maintenanceScheduledEndTime_ != null + && maintenanceScheduledEndTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getMaintenanceScheduledEndTimeBuilder().mergeFrom(value); + } else { + maintenanceScheduledEndTime_ = value; + } + } else { + maintenanceScheduledEndTimeBuilder_.mergeFrom(value); + } + if (maintenanceScheduledEndTime_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Output only. An estimated (best effort, not guaranteed) end time of the
+     * scheduled maintenance.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_scheduled_end_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearMaintenanceScheduledEndTime() { + bitField0_ = (bitField0_ & ~0x00000020); + maintenanceScheduledEndTime_ = null; + if (maintenanceScheduledEndTimeBuilder_ != null) { + maintenanceScheduledEndTimeBuilder_.dispose(); + maintenanceScheduledEndTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. An estimated (best effort, not guaranteed) end time of the
+     * scheduled maintenance.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_scheduled_end_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getMaintenanceScheduledEndTimeBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getMaintenanceScheduledEndTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. An estimated (best effort, not guaranteed) end time of the
+     * scheduled maintenance.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_scheduled_end_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getMaintenanceScheduledEndTimeOrBuilder() { + if (maintenanceScheduledEndTimeBuilder_ != null) { + return maintenanceScheduledEndTimeBuilder_.getMessageOrBuilder(); + } else { + return maintenanceScheduledEndTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : maintenanceScheduledEndTime_; + } + } + + /** + * + * + *
+     * Output only. An estimated (best effort, not guaranteed) end time of the
+     * scheduled maintenance.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_scheduled_end_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getMaintenanceScheduledEndTimeFieldBuilder() { + if (maintenanceScheduledEndTimeBuilder_ == null) { + maintenanceScheduledEndTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getMaintenanceScheduledEndTime(), getParentForChildren(), isClean()); + maintenanceScheduledEndTime_ = null; + } + return maintenanceScheduledEndTimeBuilder_; + } + + private com.google.protobuf.Timestamp maintenanceStartTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + maintenanceStartTimeBuilder_; + + /** + * + * + *
+     * Output only. Actual date when the maintenance started. Field present only
+     * after the state changed to `RUNNING`.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_start_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the maintenanceStartTime field is set. + */ + public boolean hasMaintenanceStartTime() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
+     * Output only. Actual date when the maintenance started. Field present only
+     * after the state changed to `RUNNING`.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_start_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The maintenanceStartTime. + */ + public com.google.protobuf.Timestamp getMaintenanceStartTime() { + if (maintenanceStartTimeBuilder_ == null) { + return maintenanceStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : maintenanceStartTime_; + } else { + return maintenanceStartTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Output only. Actual date when the maintenance started. Field present only
+     * after the state changed to `RUNNING`.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_start_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setMaintenanceStartTime(com.google.protobuf.Timestamp value) { + if (maintenanceStartTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + maintenanceStartTime_ = value; + } else { + maintenanceStartTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Actual date when the maintenance started. Field present only
+     * after the state changed to `RUNNING`.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_start_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setMaintenanceStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (maintenanceStartTimeBuilder_ == null) { + maintenanceStartTime_ = builderForValue.build(); + } else { + maintenanceStartTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Actual date when the maintenance started. Field present only
+     * after the state changed to `RUNNING`.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_start_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeMaintenanceStartTime(com.google.protobuf.Timestamp value) { + if (maintenanceStartTimeBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && maintenanceStartTime_ != null + && maintenanceStartTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getMaintenanceStartTimeBuilder().mergeFrom(value); + } else { + maintenanceStartTime_ = value; + } + } else { + maintenanceStartTimeBuilder_.mergeFrom(value); + } + if (maintenanceStartTime_ != null) { + bitField0_ |= 0x00000040; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Output only. Actual date when the maintenance started. Field present only
+     * after the state changed to `RUNNING`.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_start_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearMaintenanceStartTime() { + bitField0_ = (bitField0_ & ~0x00000040); + maintenanceStartTime_ = null; + if (maintenanceStartTimeBuilder_ != null) { + maintenanceStartTimeBuilder_.dispose(); + maintenanceStartTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Actual date when the maintenance started. Field present only
+     * after the state changed to `RUNNING`.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_start_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getMaintenanceStartTimeBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return getMaintenanceStartTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. Actual date when the maintenance started. Field present only
+     * after the state changed to `RUNNING`.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_start_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getMaintenanceStartTimeOrBuilder() { + if (maintenanceStartTimeBuilder_ != null) { + return maintenanceStartTimeBuilder_.getMessageOrBuilder(); + } else { + return maintenanceStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : maintenanceStartTime_; + } + } + + /** + * + * + *
+     * Output only. Actual date when the maintenance started. Field present only
+     * after the state changed to `RUNNING`.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_start_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getMaintenanceStartTimeFieldBuilder() { + if (maintenanceStartTimeBuilder_ == null) { + maintenanceStartTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getMaintenanceStartTime(), getParentForChildren(), isClean()); + maintenanceStartTime_ = null; + } + return maintenanceStartTimeBuilder_; + } + + private com.google.protobuf.Timestamp maintenanceEndTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + maintenanceEndTimeBuilder_; + + /** + * + * + *
+     * Output only. Actual date when the maintenance successfully completed. Field
+     * present only after the state changed to `SUCCEEDED`.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_end_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the maintenanceEndTime field is set. + */ + public boolean hasMaintenanceEndTime() { + return ((bitField0_ & 0x00000080) != 0); + } + + /** + * + * + *
+     * Output only. Actual date when the maintenance successfully completed. Field
+     * present only after the state changed to `SUCCEEDED`.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_end_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The maintenanceEndTime. + */ + public com.google.protobuf.Timestamp getMaintenanceEndTime() { + if (maintenanceEndTimeBuilder_ == null) { + return maintenanceEndTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : maintenanceEndTime_; + } else { + return maintenanceEndTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Output only. Actual date when the maintenance successfully completed. Field
+     * present only after the state changed to `SUCCEEDED`.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_end_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setMaintenanceEndTime(com.google.protobuf.Timestamp value) { + if (maintenanceEndTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + maintenanceEndTime_ = value; + } else { + maintenanceEndTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Actual date when the maintenance successfully completed. Field
+     * present only after the state changed to `SUCCEEDED`.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_end_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setMaintenanceEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (maintenanceEndTimeBuilder_ == null) { + maintenanceEndTime_ = builderForValue.build(); + } else { + maintenanceEndTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Actual date when the maintenance successfully completed. Field
+     * present only after the state changed to `SUCCEEDED`.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_end_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeMaintenanceEndTime(com.google.protobuf.Timestamp value) { + if (maintenanceEndTimeBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) + && maintenanceEndTime_ != null + && maintenanceEndTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getMaintenanceEndTimeBuilder().mergeFrom(value); + } else { + maintenanceEndTime_ = value; + } + } else { + maintenanceEndTimeBuilder_.mergeFrom(value); + } + if (maintenanceEndTime_ != null) { + bitField0_ |= 0x00000080; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Output only. Actual date when the maintenance successfully completed. Field
+     * present only after the state changed to `SUCCEEDED`.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_end_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearMaintenanceEndTime() { + bitField0_ = (bitField0_ & ~0x00000080); + maintenanceEndTime_ = null; + if (maintenanceEndTimeBuilder_ != null) { + maintenanceEndTimeBuilder_.dispose(); + maintenanceEndTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Actual date when the maintenance successfully completed. Field
+     * present only after the state changed to `SUCCEEDED`.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_end_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getMaintenanceEndTimeBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return getMaintenanceEndTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. Actual date when the maintenance successfully completed. Field
+     * present only after the state changed to `SUCCEEDED`.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_end_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getMaintenanceEndTimeOrBuilder() { + if (maintenanceEndTimeBuilder_ != null) { + return maintenanceEndTimeBuilder_.getMessageOrBuilder(); + } else { + return maintenanceEndTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : maintenanceEndTime_; + } + } + + /** + * + * + *
+     * Output only. Actual date when the maintenance successfully completed. Field
+     * present only after the state changed to `SUCCEEDED`.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_end_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getMaintenanceEndTimeFieldBuilder() { + if (maintenanceEndTimeBuilder_ == null) { + maintenanceEndTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getMaintenanceEndTime(), getParentForChildren(), isClean()); + maintenanceEndTime_ = null; + } + return maintenanceEndTimeBuilder_; + } + + private boolean userControllable_; + + /** + * + * + *
+     * Output only. Indicates whether the user has some control over that
+     * maintenance, either proactively before maintenance was scheduled with
+     * maintenance policy or with reactive controls after it was scheduled (see
+     * controls field).
+     * 
+ * + * bool user_controllable = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The userControllable. + */ + @java.lang.Override + public boolean getUserControllable() { + return userControllable_; + } + + /** + * + * + *
+     * Output only. Indicates whether the user has some control over that
+     * maintenance, either proactively before maintenance was scheduled with
+     * maintenance policy or with reactive controls after it was scheduled (see
+     * controls field).
+     * 
+ * + * bool user_controllable = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The userControllable to set. + * @return This builder for chaining. + */ + public Builder setUserControllable(boolean value) { + + userControllable_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Indicates whether the user has some control over that
+     * maintenance, either proactively before maintenance was scheduled with
+     * maintenance policy or with reactive controls after it was scheduled (see
+     * controls field).
+     * 
+ * + * bool user_controllable = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearUserControllable() { + bitField0_ = (bitField0_ & ~0x00000100); + userControllable_ = false; + onChanged(); + return this; + } + + private java.util.List controls_ = + java.util.Collections.emptyList(); + + private void ensureControlsIsMutable() { + if (!((bitField0_ & 0x00000200) != 0)) { + controls_ = + new java.util.ArrayList( + controls_); + bitField0_ |= 0x00000200; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.maintenance.api.v1.MaintenanceControl, + com.google.cloud.maintenance.api.v1.MaintenanceControl.Builder, + com.google.cloud.maintenance.api.v1.MaintenanceControlOrBuilder> + controlsBuilder_; + + /** + * + * + *
+     * Output only. Control available for that Maintenance (might not be available
+     * for every resource that maintenance is applied to).
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceControl controls = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getControlsList() { + if (controlsBuilder_ == null) { + return java.util.Collections.unmodifiableList(controls_); + } else { + return controlsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * Output only. Control available for that Maintenance (might not be available
+     * for every resource that maintenance is applied to).
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceControl controls = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getControlsCount() { + if (controlsBuilder_ == null) { + return controls_.size(); + } else { + return controlsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * Output only. Control available for that Maintenance (might not be available
+     * for every resource that maintenance is applied to).
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceControl controls = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.maintenance.api.v1.MaintenanceControl getControls(int index) { + if (controlsBuilder_ == null) { + return controls_.get(index); + } else { + return controlsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * Output only. Control available for that Maintenance (might not be available
+     * for every resource that maintenance is applied to).
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceControl controls = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setControls( + int index, com.google.cloud.maintenance.api.v1.MaintenanceControl value) { + if (controlsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureControlsIsMutable(); + controls_.set(index, value); + onChanged(); + } else { + controlsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Output only. Control available for that Maintenance (might not be available
+     * for every resource that maintenance is applied to).
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceControl controls = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setControls( + int index, com.google.cloud.maintenance.api.v1.MaintenanceControl.Builder builderForValue) { + if (controlsBuilder_ == null) { + ensureControlsIsMutable(); + controls_.set(index, builderForValue.build()); + onChanged(); + } else { + controlsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Output only. Control available for that Maintenance (might not be available
+     * for every resource that maintenance is applied to).
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceControl controls = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addControls(com.google.cloud.maintenance.api.v1.MaintenanceControl value) { + if (controlsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureControlsIsMutable(); + controls_.add(value); + onChanged(); + } else { + controlsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * Output only. Control available for that Maintenance (might not be available
+     * for every resource that maintenance is applied to).
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceControl controls = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addControls( + int index, com.google.cloud.maintenance.api.v1.MaintenanceControl value) { + if (controlsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureControlsIsMutable(); + controls_.add(index, value); + onChanged(); + } else { + controlsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Output only. Control available for that Maintenance (might not be available
+     * for every resource that maintenance is applied to).
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceControl controls = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addControls( + com.google.cloud.maintenance.api.v1.MaintenanceControl.Builder builderForValue) { + if (controlsBuilder_ == null) { + ensureControlsIsMutable(); + controls_.add(builderForValue.build()); + onChanged(); + } else { + controlsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Output only. Control available for that Maintenance (might not be available
+     * for every resource that maintenance is applied to).
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceControl controls = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addControls( + int index, com.google.cloud.maintenance.api.v1.MaintenanceControl.Builder builderForValue) { + if (controlsBuilder_ == null) { + ensureControlsIsMutable(); + controls_.add(index, builderForValue.build()); + onChanged(); + } else { + controlsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Output only. Control available for that Maintenance (might not be available
+     * for every resource that maintenance is applied to).
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceControl controls = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllControls( + java.lang.Iterable + values) { + if (controlsBuilder_ == null) { + ensureControlsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, controls_); + onChanged(); + } else { + controlsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * Output only. Control available for that Maintenance (might not be available
+     * for every resource that maintenance is applied to).
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceControl controls = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearControls() { + if (controlsBuilder_ == null) { + controls_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000200); + onChanged(); + } else { + controlsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Output only. Control available for that Maintenance (might not be available
+     * for every resource that maintenance is applied to).
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceControl controls = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeControls(int index) { + if (controlsBuilder_ == null) { + ensureControlsIsMutable(); + controls_.remove(index); + onChanged(); + } else { + controlsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * Output only. Control available for that Maintenance (might not be available
+     * for every resource that maintenance is applied to).
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceControl controls = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.maintenance.api.v1.MaintenanceControl.Builder getControlsBuilder( + int index) { + return getControlsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * Output only. Control available for that Maintenance (might not be available
+     * for every resource that maintenance is applied to).
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceControl controls = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.maintenance.api.v1.MaintenanceControlOrBuilder getControlsOrBuilder( + int index) { + if (controlsBuilder_ == null) { + return controls_.get(index); + } else { + return controlsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * Output only. Control available for that Maintenance (might not be available
+     * for every resource that maintenance is applied to).
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceControl controls = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getControlsOrBuilderList() { + if (controlsBuilder_ != null) { + return controlsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(controls_); + } + } + + /** + * + * + *
+     * Output only. Control available for that Maintenance (might not be available
+     * for every resource that maintenance is applied to).
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceControl controls = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.maintenance.api.v1.MaintenanceControl.Builder addControlsBuilder() { + return getControlsFieldBuilder() + .addBuilder(com.google.cloud.maintenance.api.v1.MaintenanceControl.getDefaultInstance()); + } + + /** + * + * + *
+     * Output only. Control available for that Maintenance (might not be available
+     * for every resource that maintenance is applied to).
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceControl controls = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.maintenance.api.v1.MaintenanceControl.Builder addControlsBuilder( + int index) { + return getControlsFieldBuilder() + .addBuilder( + index, com.google.cloud.maintenance.api.v1.MaintenanceControl.getDefaultInstance()); + } + + /** + * + * + *
+     * Output only. Control available for that Maintenance (might not be available
+     * for every resource that maintenance is applied to).
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceControl controls = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getControlsBuilderList() { + return getControlsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.maintenance.api.v1.MaintenanceControl, + com.google.cloud.maintenance.api.v1.MaintenanceControl.Builder, + com.google.cloud.maintenance.api.v1.MaintenanceControlOrBuilder> + getControlsFieldBuilder() { + if (controlsBuilder_ == null) { + controlsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.maintenance.api.v1.MaintenanceControl, + com.google.cloud.maintenance.api.v1.MaintenanceControl.Builder, + com.google.cloud.maintenance.api.v1.MaintenanceControlOrBuilder>( + controls_, ((bitField0_ & 0x00000200) != 0), getParentForChildren(), isClean()); + controls_ = null; + } + return controlsBuilder_; + } + + private java.util.List stats_ = + java.util.Collections.emptyList(); + + private void ensureStatsIsMutable() { + if (!((bitField0_ & 0x00000400) != 0)) { + stats_ = + new java.util.ArrayList( + stats_); + bitField0_ |= 0x00000400; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.maintenance.api.v1.MaintenanceSummary.Stats, + com.google.cloud.maintenance.api.v1.MaintenanceSummary.Stats.Builder, + com.google.cloud.maintenance.api.v1.MaintenanceSummary.StatsOrBuilder> + statsBuilder_; + + /** + * + * + *
+     * Output only. Stats is a field of ResourceMaintenance used to aggregate the
+     * stats.
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary.Stats stats = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getStatsList() { + if (statsBuilder_ == null) { + return java.util.Collections.unmodifiableList(stats_); + } else { + return statsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * Output only. Stats is a field of ResourceMaintenance used to aggregate the
+     * stats.
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary.Stats stats = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getStatsCount() { + if (statsBuilder_ == null) { + return stats_.size(); + } else { + return statsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * Output only. Stats is a field of ResourceMaintenance used to aggregate the
+     * stats.
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary.Stats stats = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.maintenance.api.v1.MaintenanceSummary.Stats getStats(int index) { + if (statsBuilder_ == null) { + return stats_.get(index); + } else { + return statsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * Output only. Stats is a field of ResourceMaintenance used to aggregate the
+     * stats.
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary.Stats stats = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setStats( + int index, com.google.cloud.maintenance.api.v1.MaintenanceSummary.Stats value) { + if (statsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStatsIsMutable(); + stats_.set(index, value); + onChanged(); + } else { + statsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Output only. Stats is a field of ResourceMaintenance used to aggregate the
+     * stats.
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary.Stats stats = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setStats( + int index, + com.google.cloud.maintenance.api.v1.MaintenanceSummary.Stats.Builder builderForValue) { + if (statsBuilder_ == null) { + ensureStatsIsMutable(); + stats_.set(index, builderForValue.build()); + onChanged(); + } else { + statsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Output only. Stats is a field of ResourceMaintenance used to aggregate the
+     * stats.
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary.Stats stats = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addStats(com.google.cloud.maintenance.api.v1.MaintenanceSummary.Stats value) { + if (statsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStatsIsMutable(); + stats_.add(value); + onChanged(); + } else { + statsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * Output only. Stats is a field of ResourceMaintenance used to aggregate the
+     * stats.
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary.Stats stats = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addStats( + int index, com.google.cloud.maintenance.api.v1.MaintenanceSummary.Stats value) { + if (statsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStatsIsMutable(); + stats_.add(index, value); + onChanged(); + } else { + statsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Output only. Stats is a field of ResourceMaintenance used to aggregate the
+     * stats.
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary.Stats stats = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addStats( + com.google.cloud.maintenance.api.v1.MaintenanceSummary.Stats.Builder builderForValue) { + if (statsBuilder_ == null) { + ensureStatsIsMutable(); + stats_.add(builderForValue.build()); + onChanged(); + } else { + statsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Output only. Stats is a field of ResourceMaintenance used to aggregate the
+     * stats.
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary.Stats stats = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addStats( + int index, + com.google.cloud.maintenance.api.v1.MaintenanceSummary.Stats.Builder builderForValue) { + if (statsBuilder_ == null) { + ensureStatsIsMutable(); + stats_.add(index, builderForValue.build()); + onChanged(); + } else { + statsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Output only. Stats is a field of ResourceMaintenance used to aggregate the
+     * stats.
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary.Stats stats = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllStats( + java.lang.Iterable + values) { + if (statsBuilder_ == null) { + ensureStatsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, stats_); + onChanged(); + } else { + statsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * Output only. Stats is a field of ResourceMaintenance used to aggregate the
+     * stats.
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary.Stats stats = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearStats() { + if (statsBuilder_ == null) { + stats_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000400); + onChanged(); + } else { + statsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Output only. Stats is a field of ResourceMaintenance used to aggregate the
+     * stats.
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary.Stats stats = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeStats(int index) { + if (statsBuilder_ == null) { + ensureStatsIsMutable(); + stats_.remove(index); + onChanged(); + } else { + statsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * Output only. Stats is a field of ResourceMaintenance used to aggregate the
+     * stats.
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary.Stats stats = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.maintenance.api.v1.MaintenanceSummary.Stats.Builder getStatsBuilder( + int index) { + return getStatsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * Output only. Stats is a field of ResourceMaintenance used to aggregate the
+     * stats.
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary.Stats stats = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.maintenance.api.v1.MaintenanceSummary.StatsOrBuilder getStatsOrBuilder( + int index) { + if (statsBuilder_ == null) { + return stats_.get(index); + } else { + return statsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * Output only. Stats is a field of ResourceMaintenance used to aggregate the
+     * stats.
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary.Stats stats = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List< + ? extends com.google.cloud.maintenance.api.v1.MaintenanceSummary.StatsOrBuilder> + getStatsOrBuilderList() { + if (statsBuilder_ != null) { + return statsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(stats_); + } + } + + /** + * + * + *
+     * Output only. Stats is a field of ResourceMaintenance used to aggregate the
+     * stats.
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary.Stats stats = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.maintenance.api.v1.MaintenanceSummary.Stats.Builder addStatsBuilder() { + return getStatsFieldBuilder() + .addBuilder( + com.google.cloud.maintenance.api.v1.MaintenanceSummary.Stats.getDefaultInstance()); + } + + /** + * + * + *
+     * Output only. Stats is a field of ResourceMaintenance used to aggregate the
+     * stats.
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary.Stats stats = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.maintenance.api.v1.MaintenanceSummary.Stats.Builder addStatsBuilder( + int index) { + return getStatsFieldBuilder() + .addBuilder( + index, + com.google.cloud.maintenance.api.v1.MaintenanceSummary.Stats.getDefaultInstance()); + } + + /** + * + * + *
+     * Output only. Stats is a field of ResourceMaintenance used to aggregate the
+     * stats.
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary.Stats stats = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getStatsBuilderList() { + return getStatsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.maintenance.api.v1.MaintenanceSummary.Stats, + com.google.cloud.maintenance.api.v1.MaintenanceSummary.Stats.Builder, + com.google.cloud.maintenance.api.v1.MaintenanceSummary.StatsOrBuilder> + getStatsFieldBuilder() { + if (statsBuilder_ == null) { + statsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.maintenance.api.v1.MaintenanceSummary.Stats, + com.google.cloud.maintenance.api.v1.MaintenanceSummary.Stats.Builder, + com.google.cloud.maintenance.api.v1.MaintenanceSummary.StatsOrBuilder>( + stats_, ((bitField0_ & 0x00000400) != 0), getParentForChildren(), isClean()); + stats_ = null; + } + return statsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.maintenance.api.v1.MaintenanceSummary) + } + + // @@protoc_insertion_point(class_scope:google.cloud.maintenance.api.v1.MaintenanceSummary) + private static final com.google.cloud.maintenance.api.v1.MaintenanceSummary DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.maintenance.api.v1.MaintenanceSummary(); + } + + public static com.google.cloud.maintenance.api.v1.MaintenanceSummary getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MaintenanceSummary parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.maintenance.api.v1.MaintenanceSummary getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maintenance/proto-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/MaintenanceSummaryOrBuilder.java b/java-maintenance/proto-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/MaintenanceSummaryOrBuilder.java new file mode 100644 index 000000000000..5393395063cb --- /dev/null +++ b/java-maintenance/proto-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/MaintenanceSummaryOrBuilder.java @@ -0,0 +1,480 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/maintenance/api/v1/maintenance_service.proto + +// Protobuf Java Version: 3.25.8 +package com.google.cloud.maintenance.api.v1; + +public interface MaintenanceSummaryOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.maintenance.api.v1.MaintenanceSummary) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The name of the maintenance.
+   * 
+ * + * string maintenance_name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The maintenanceName. + */ + java.lang.String getMaintenanceName(); + + /** + * + * + *
+   * Output only. The name of the maintenance.
+   * 
+ * + * string maintenance_name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for maintenanceName. + */ + com.google.protobuf.ByteString getMaintenanceNameBytes(); + + /** + * + * + *
+   * Output only. The title of the maintenance.
+   * 
+ * + * string title = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The title. + */ + java.lang.String getTitle(); + + /** + * + * + *
+   * Output only. The title of the maintenance.
+   * 
+ * + * string title = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for title. + */ + com.google.protobuf.ByteString getTitleBytes(); + + /** + * + * + *
+   * Output only. The description of the maintenance.
+   * 
+ * + * string description = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The description. + */ + java.lang.String getDescription(); + + /** + * + * + *
+   * Output only. The description of the maintenance.
+   * 
+ * + * string description = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Output only. The category of the maintenance event.
+   * 
+ * + * + * .google.cloud.maintenance.api.v1.MaintenanceCategory category = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for category. + */ + int getCategoryValue(); + + /** + * + * + *
+   * Output only. The category of the maintenance event.
+   * 
+ * + * + * .google.cloud.maintenance.api.v1.MaintenanceCategory category = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The category. + */ + com.google.cloud.maintenance.api.v1.MaintenanceCategory getCategory(); + + /** + * + * + *
+   * Output only. Scheduled start time of the maintenance. The maintenance will
+   * start at `maintenanceScheduledStartTime` or later, with best effort to
+   * finish before `maintenanceScheduledEndTime`.
+   * 
+ * + * + * .google.protobuf.Timestamp maintenance_scheduled_start_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the maintenanceScheduledStartTime field is set. + */ + boolean hasMaintenanceScheduledStartTime(); + + /** + * + * + *
+   * Output only. Scheduled start time of the maintenance. The maintenance will
+   * start at `maintenanceScheduledStartTime` or later, with best effort to
+   * finish before `maintenanceScheduledEndTime`.
+   * 
+ * + * + * .google.protobuf.Timestamp maintenance_scheduled_start_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The maintenanceScheduledStartTime. + */ + com.google.protobuf.Timestamp getMaintenanceScheduledStartTime(); + + /** + * + * + *
+   * Output only. Scheduled start time of the maintenance. The maintenance will
+   * start at `maintenanceScheduledStartTime` or later, with best effort to
+   * finish before `maintenanceScheduledEndTime`.
+   * 
+ * + * + * .google.protobuf.Timestamp maintenance_scheduled_start_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getMaintenanceScheduledStartTimeOrBuilder(); + + /** + * + * + *
+   * Output only. An estimated (best effort, not guaranteed) end time of the
+   * scheduled maintenance.
+   * 
+ * + * + * .google.protobuf.Timestamp maintenance_scheduled_end_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the maintenanceScheduledEndTime field is set. + */ + boolean hasMaintenanceScheduledEndTime(); + + /** + * + * + *
+   * Output only. An estimated (best effort, not guaranteed) end time of the
+   * scheduled maintenance.
+   * 
+ * + * + * .google.protobuf.Timestamp maintenance_scheduled_end_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The maintenanceScheduledEndTime. + */ + com.google.protobuf.Timestamp getMaintenanceScheduledEndTime(); + + /** + * + * + *
+   * Output only. An estimated (best effort, not guaranteed) end time of the
+   * scheduled maintenance.
+   * 
+ * + * + * .google.protobuf.Timestamp maintenance_scheduled_end_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getMaintenanceScheduledEndTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Actual date when the maintenance started. Field present only
+   * after the state changed to `RUNNING`.
+   * 
+ * + * + * .google.protobuf.Timestamp maintenance_start_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the maintenanceStartTime field is set. + */ + boolean hasMaintenanceStartTime(); + + /** + * + * + *
+   * Output only. Actual date when the maintenance started. Field present only
+   * after the state changed to `RUNNING`.
+   * 
+ * + * + * .google.protobuf.Timestamp maintenance_start_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The maintenanceStartTime. + */ + com.google.protobuf.Timestamp getMaintenanceStartTime(); + + /** + * + * + *
+   * Output only. Actual date when the maintenance started. Field present only
+   * after the state changed to `RUNNING`.
+   * 
+ * + * + * .google.protobuf.Timestamp maintenance_start_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getMaintenanceStartTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Actual date when the maintenance successfully completed. Field
+   * present only after the state changed to `SUCCEEDED`.
+   * 
+ * + * + * .google.protobuf.Timestamp maintenance_end_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the maintenanceEndTime field is set. + */ + boolean hasMaintenanceEndTime(); + + /** + * + * + *
+   * Output only. Actual date when the maintenance successfully completed. Field
+   * present only after the state changed to `SUCCEEDED`.
+   * 
+ * + * + * .google.protobuf.Timestamp maintenance_end_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The maintenanceEndTime. + */ + com.google.protobuf.Timestamp getMaintenanceEndTime(); + + /** + * + * + *
+   * Output only. Actual date when the maintenance successfully completed. Field
+   * present only after the state changed to `SUCCEEDED`.
+   * 
+ * + * + * .google.protobuf.Timestamp maintenance_end_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getMaintenanceEndTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Indicates whether the user has some control over that
+   * maintenance, either proactively before maintenance was scheduled with
+   * maintenance policy or with reactive controls after it was scheduled (see
+   * controls field).
+   * 
+ * + * bool user_controllable = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The userControllable. + */ + boolean getUserControllable(); + + /** + * + * + *
+   * Output only. Control available for that Maintenance (might not be available
+   * for every resource that maintenance is applied to).
+   * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceControl controls = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getControlsList(); + + /** + * + * + *
+   * Output only. Control available for that Maintenance (might not be available
+   * for every resource that maintenance is applied to).
+   * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceControl controls = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.maintenance.api.v1.MaintenanceControl getControls(int index); + + /** + * + * + *
+   * Output only. Control available for that Maintenance (might not be available
+   * for every resource that maintenance is applied to).
+   * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceControl controls = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getControlsCount(); + + /** + * + * + *
+   * Output only. Control available for that Maintenance (might not be available
+   * for every resource that maintenance is applied to).
+   * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceControl controls = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getControlsOrBuilderList(); + + /** + * + * + *
+   * Output only. Control available for that Maintenance (might not be available
+   * for every resource that maintenance is applied to).
+   * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceControl controls = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.maintenance.api.v1.MaintenanceControlOrBuilder getControlsOrBuilder(int index); + + /** + * + * + *
+   * Output only. Stats is a field of ResourceMaintenance used to aggregate the
+   * stats.
+   * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary.Stats stats = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getStatsList(); + + /** + * + * + *
+   * Output only. Stats is a field of ResourceMaintenance used to aggregate the
+   * stats.
+   * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary.Stats stats = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.maintenance.api.v1.MaintenanceSummary.Stats getStats(int index); + + /** + * + * + *
+   * Output only. Stats is a field of ResourceMaintenance used to aggregate the
+   * stats.
+   * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary.Stats stats = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getStatsCount(); + + /** + * + * + *
+   * Output only. Stats is a field of ResourceMaintenance used to aggregate the
+   * stats.
+   * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary.Stats stats = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getStatsOrBuilderList(); + + /** + * + * + *
+   * Output only. Stats is a field of ResourceMaintenance used to aggregate the
+   * stats.
+   * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary.Stats stats = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.maintenance.api.v1.MaintenanceSummary.StatsOrBuilder getStatsOrBuilder( + int index); +} diff --git a/java-maintenance/proto-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/ResourceMaintenance.java b/java-maintenance/proto-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/ResourceMaintenance.java new file mode 100644 index 000000000000..117758958323 --- /dev/null +++ b/java-maintenance/proto-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/ResourceMaintenance.java @@ -0,0 +1,8215 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/maintenance/api/v1/maintenance_service.proto + +// Protobuf Java Version: 3.25.8 +package com.google.cloud.maintenance.api.v1; + +/** + * + * + *
+ * ResourceMaintenance is a resource that represents a maintenance operation
+ * on a resource.
+ * 
+ * + * Protobuf type {@code google.cloud.maintenance.api.v1.ResourceMaintenance} + */ +public final class ResourceMaintenance extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.maintenance.api.v1.ResourceMaintenance) + ResourceMaintenanceOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ResourceMaintenance.newBuilder() to construct. + private ResourceMaintenance(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ResourceMaintenance() { + name_ = ""; + state_ = 0; + controls_ = java.util.Collections.emptyList(); + uid_ = ""; + etag_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ResourceMaintenance(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_ResourceMaintenance_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 10401: + return internalGetLabels(); + case 10402: + return internalGetAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_ResourceMaintenance_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.maintenance.api.v1.ResourceMaintenance.class, + com.google.cloud.maintenance.api.v1.ResourceMaintenance.Builder.class); + } + + /** + * + * + *
+   * State is the state of a resource maintenance.
+   * 
+ * + * Protobuf enum {@code google.cloud.maintenance.api.v1.ResourceMaintenance.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified state.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * Scheduled for a particular window. For disruptive maintenance it should
+     * respect maintenance policy, i.e. its available windows, exclusions and
+     * notification period.
+     * 
+ * + * SCHEDULED = 1; + */ + SCHEDULED(1), + /** + * + * + *
+     * Maintenance is ongoing.
+     * 
+ * + * RUNNING = 2; + */ + RUNNING(2), + /** + * + * + *
+     * No longer planned, typically when other maintenance (e.g. upgrade to
+     * newer version) already happened, or the user skipped the maintenance.
+     * 
+ * + * CANCELLED = 3; + */ + CANCELLED(3), + /** + * + * + *
+     * Successfully completed.
+     * 
+ * + * SUCCEEDED = 4; + */ + SUCCEEDED(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified state.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * Scheduled for a particular window. For disruptive maintenance it should
+     * respect maintenance policy, i.e. its available windows, exclusions and
+     * notification period.
+     * 
+ * + * SCHEDULED = 1; + */ + public static final int SCHEDULED_VALUE = 1; + + /** + * + * + *
+     * Maintenance is ongoing.
+     * 
+ * + * RUNNING = 2; + */ + public static final int RUNNING_VALUE = 2; + + /** + * + * + *
+     * No longer planned, typically when other maintenance (e.g. upgrade to
+     * newer version) already happened, or the user skipped the maintenance.
+     * 
+ * + * CANCELLED = 3; + */ + public static final int CANCELLED_VALUE = 3; + + /** + * + * + *
+     * Successfully completed.
+     * 
+ * + * SUCCEEDED = 4; + */ + public static final int SUCCEEDED_VALUE = 4; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static State valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static State forNumber(int value) { + switch (value) { + case 0: + return STATE_UNSPECIFIED; + case 1: + return SCHEDULED; + case 2: + return RUNNING; + case 3: + return CANCELLED; + case 4: + return SUCCEEDED; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public State findValueByNumber(int number) { + return State.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.maintenance.api.v1.ResourceMaintenance.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final State[] VALUES = values(); + + public static State valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private State(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.maintenance.api.v1.ResourceMaintenance.State) + } + + public interface ResourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.maintenance.api.v1.ResourceMaintenance.Resource) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Output only. Name is the reference to the consumer resource affected by
+     * the maintenance. Available values can be found here:
+     * https://cloud.google.com/asset-inventory/docs/asset-names
+     * 
+ * + * string resource_name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The resourceName. + */ + java.lang.String getResourceName(); + + /** + * + * + *
+     * Output only. Name is the reference to the consumer resource affected by
+     * the maintenance. Available values can be found here:
+     * https://cloud.google.com/asset-inventory/docs/asset-names
+     * 
+ * + * string resource_name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for resourceName. + */ + com.google.protobuf.ByteString getResourceNameBytes(); + + /** + * + * + *
+     * Output only. The location of the resource.
+     * Format:
+     * `us-central1`
+     * 
+ * + * string location = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The location. + */ + java.lang.String getLocation(); + + /** + * + * + *
+     * Output only. The location of the resource.
+     * Format:
+     * `us-central1`
+     * 
+ * + * string location = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for location. + */ + com.google.protobuf.ByteString getLocationBytes(); + + /** + * + * + *
+     * Output only. The type of the resource.
+     * Available values can be found here:
+     * https://cloud.google.com/asset-inventory/docs/asset-types#supported_resource_types
+     * Please note that not all the resource types will have their maintenances
+     * reported.
+     * 
+ * + * string type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The type. + */ + java.lang.String getType(); + + /** + * + * + *
+     * Output only. The type of the resource.
+     * Available values can be found here:
+     * https://cloud.google.com/asset-inventory/docs/asset-types#supported_resource_types
+     * Please note that not all the resource types will have their maintenances
+     * reported.
+     * 
+ * + * string type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for type. + */ + com.google.protobuf.ByteString getTypeBytes(); + } + + /** + * + * + *
+   * Resource contains information about the resource affected by maintenance.
+   * 
+ * + * Protobuf type {@code google.cloud.maintenance.api.v1.ResourceMaintenance.Resource} + */ + public static final class Resource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.maintenance.api.v1.ResourceMaintenance.Resource) + ResourceOrBuilder { + private static final long serialVersionUID = 0L; + + // Use Resource.newBuilder() to construct. + private Resource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Resource() { + resourceName_ = ""; + location_ = ""; + type_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Resource(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_ResourceMaintenance_Resource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_ResourceMaintenance_Resource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.maintenance.api.v1.ResourceMaintenance.Resource.class, + com.google.cloud.maintenance.api.v1.ResourceMaintenance.Resource.Builder.class); + } + + public static final int RESOURCE_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object resourceName_ = ""; + + /** + * + * + *
+     * Output only. Name is the reference to the consumer resource affected by
+     * the maintenance. Available values can be found here:
+     * https://cloud.google.com/asset-inventory/docs/asset-names
+     * 
+ * + * string resource_name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The resourceName. + */ + @java.lang.Override + public java.lang.String getResourceName() { + java.lang.Object ref = resourceName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resourceName_ = s; + return s; + } + } + + /** + * + * + *
+     * Output only. Name is the reference to the consumer resource affected by
+     * the maintenance. Available values can be found here:
+     * https://cloud.google.com/asset-inventory/docs/asset-names
+     * 
+ * + * string resource_name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for resourceName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getResourceNameBytes() { + java.lang.Object ref = resourceName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resourceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LOCATION_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object location_ = ""; + + /** + * + * + *
+     * Output only. The location of the resource.
+     * Format:
+     * `us-central1`
+     * 
+ * + * string location = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The location. + */ + @java.lang.Override + public java.lang.String getLocation() { + java.lang.Object ref = location_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + location_ = s; + return s; + } + } + + /** + * + * + *
+     * Output only. The location of the resource.
+     * Format:
+     * `us-central1`
+     * 
+ * + * string location = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for location. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLocationBytes() { + java.lang.Object ref = location_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + location_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TYPE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object type_ = ""; + + /** + * + * + *
+     * Output only. The type of the resource.
+     * Available values can be found here:
+     * https://cloud.google.com/asset-inventory/docs/asset-types#supported_resource_types
+     * Please note that not all the resource types will have their maintenances
+     * reported.
+     * 
+ * + * string type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The type. + */ + @java.lang.Override + public java.lang.String getType() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } + } + + /** + * + * + *
+     * Output only. The type of the resource.
+     * Available values can be found here:
+     * https://cloud.google.com/asset-inventory/docs/asset-types#supported_resource_types
+     * Please note that not all the resource types will have their maintenances
+     * reported.
+     * 
+ * + * string type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for type. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(resourceName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, resourceName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(location_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, location_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, type_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(resourceName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, resourceName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(location_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, location_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, type_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.maintenance.api.v1.ResourceMaintenance.Resource)) { + return super.equals(obj); + } + com.google.cloud.maintenance.api.v1.ResourceMaintenance.Resource other = + (com.google.cloud.maintenance.api.v1.ResourceMaintenance.Resource) obj; + + if (!getResourceName().equals(other.getResourceName())) return false; + if (!getLocation().equals(other.getLocation())) return false; + if (!getType().equals(other.getType())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + RESOURCE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getResourceName().hashCode(); + hash = (37 * hash) + LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getLocation().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.maintenance.api.v1.ResourceMaintenance.Resource parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.maintenance.api.v1.ResourceMaintenance.Resource parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.maintenance.api.v1.ResourceMaintenance.Resource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.maintenance.api.v1.ResourceMaintenance.Resource parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.maintenance.api.v1.ResourceMaintenance.Resource parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.maintenance.api.v1.ResourceMaintenance.Resource parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.maintenance.api.v1.ResourceMaintenance.Resource parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.maintenance.api.v1.ResourceMaintenance.Resource parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.maintenance.api.v1.ResourceMaintenance.Resource + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.maintenance.api.v1.ResourceMaintenance.Resource + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.maintenance.api.v1.ResourceMaintenance.Resource parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.maintenance.api.v1.ResourceMaintenance.Resource parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.maintenance.api.v1.ResourceMaintenance.Resource prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * Resource contains information about the resource affected by maintenance.
+     * 
+ * + * Protobuf type {@code google.cloud.maintenance.api.v1.ResourceMaintenance.Resource} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.maintenance.api.v1.ResourceMaintenance.Resource) + com.google.cloud.maintenance.api.v1.ResourceMaintenance.ResourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_ResourceMaintenance_Resource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_ResourceMaintenance_Resource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.maintenance.api.v1.ResourceMaintenance.Resource.class, + com.google.cloud.maintenance.api.v1.ResourceMaintenance.Resource.Builder.class); + } + + // Construct using + // com.google.cloud.maintenance.api.v1.ResourceMaintenance.Resource.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + resourceName_ = ""; + location_ = ""; + type_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_ResourceMaintenance_Resource_descriptor; + } + + @java.lang.Override + public com.google.cloud.maintenance.api.v1.ResourceMaintenance.Resource + getDefaultInstanceForType() { + return com.google.cloud.maintenance.api.v1.ResourceMaintenance.Resource + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.maintenance.api.v1.ResourceMaintenance.Resource build() { + com.google.cloud.maintenance.api.v1.ResourceMaintenance.Resource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.maintenance.api.v1.ResourceMaintenance.Resource buildPartial() { + com.google.cloud.maintenance.api.v1.ResourceMaintenance.Resource result = + new com.google.cloud.maintenance.api.v1.ResourceMaintenance.Resource(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.maintenance.api.v1.ResourceMaintenance.Resource result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.resourceName_ = resourceName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.location_ = location_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.type_ = type_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.maintenance.api.v1.ResourceMaintenance.Resource) { + return mergeFrom( + (com.google.cloud.maintenance.api.v1.ResourceMaintenance.Resource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.maintenance.api.v1.ResourceMaintenance.Resource other) { + if (other + == com.google.cloud.maintenance.api.v1.ResourceMaintenance.Resource + .getDefaultInstance()) return this; + if (!other.getResourceName().isEmpty()) { + resourceName_ = other.resourceName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getLocation().isEmpty()) { + location_ = other.location_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getType().isEmpty()) { + type_ = other.type_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + resourceName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + location_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + type_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object resourceName_ = ""; + + /** + * + * + *
+       * Output only. Name is the reference to the consumer resource affected by
+       * the maintenance. Available values can be found here:
+       * https://cloud.google.com/asset-inventory/docs/asset-names
+       * 
+ * + * string resource_name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The resourceName. + */ + public java.lang.String getResourceName() { + java.lang.Object ref = resourceName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resourceName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Output only. Name is the reference to the consumer resource affected by
+       * the maintenance. Available values can be found here:
+       * https://cloud.google.com/asset-inventory/docs/asset-names
+       * 
+ * + * string resource_name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for resourceName. + */ + public com.google.protobuf.ByteString getResourceNameBytes() { + java.lang.Object ref = resourceName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resourceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Output only. Name is the reference to the consumer resource affected by
+       * the maintenance. Available values can be found here:
+       * https://cloud.google.com/asset-inventory/docs/asset-names
+       * 
+ * + * string resource_name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The resourceName to set. + * @return This builder for chaining. + */ + public Builder setResourceName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + resourceName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. Name is the reference to the consumer resource affected by
+       * the maintenance. Available values can be found here:
+       * https://cloud.google.com/asset-inventory/docs/asset-names
+       * 
+ * + * string resource_name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearResourceName() { + resourceName_ = getDefaultInstance().getResourceName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. Name is the reference to the consumer resource affected by
+       * the maintenance. Available values can be found here:
+       * https://cloud.google.com/asset-inventory/docs/asset-names
+       * 
+ * + * string resource_name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for resourceName to set. + * @return This builder for chaining. + */ + public Builder setResourceNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + resourceName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object location_ = ""; + + /** + * + * + *
+       * Output only. The location of the resource.
+       * Format:
+       * `us-central1`
+       * 
+ * + * string location = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The location. + */ + public java.lang.String getLocation() { + java.lang.Object ref = location_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + location_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Output only. The location of the resource.
+       * Format:
+       * `us-central1`
+       * 
+ * + * string location = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for location. + */ + public com.google.protobuf.ByteString getLocationBytes() { + java.lang.Object ref = location_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + location_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Output only. The location of the resource.
+       * Format:
+       * `us-central1`
+       * 
+ * + * string location = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The location to set. + * @return This builder for chaining. + */ + public Builder setLocation(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + location_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. The location of the resource.
+       * Format:
+       * `us-central1`
+       * 
+ * + * string location = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearLocation() { + location_ = getDefaultInstance().getLocation(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. The location of the resource.
+       * Format:
+       * `us-central1`
+       * 
+ * + * string location = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for location to set. + * @return This builder for chaining. + */ + public Builder setLocationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + location_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object type_ = ""; + + /** + * + * + *
+       * Output only. The type of the resource.
+       * Available values can be found here:
+       * https://cloud.google.com/asset-inventory/docs/asset-types#supported_resource_types
+       * Please note that not all the resource types will have their maintenances
+       * reported.
+       * 
+ * + * string type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The type. + */ + public java.lang.String getType() { + java.lang.Object ref = type_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Output only. The type of the resource.
+       * Available values can be found here:
+       * https://cloud.google.com/asset-inventory/docs/asset-types#supported_resource_types
+       * Please note that not all the resource types will have their maintenances
+       * reported.
+       * 
+ * + * string type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for type. + */ + public com.google.protobuf.ByteString getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Output only. The type of the resource.
+       * Available values can be found here:
+       * https://cloud.google.com/asset-inventory/docs/asset-types#supported_resource_types
+       * Please note that not all the resource types will have their maintenances
+       * reported.
+       * 
+ * + * string type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + type_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. The type of the resource.
+       * Available values can be found here:
+       * https://cloud.google.com/asset-inventory/docs/asset-types#supported_resource_types
+       * Please note that not all the resource types will have their maintenances
+       * reported.
+       * 
+ * + * string type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearType() { + type_ = getDefaultInstance().getType(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. The type of the resource.
+       * Available values can be found here:
+       * https://cloud.google.com/asset-inventory/docs/asset-types#supported_resource_types
+       * Please note that not all the resource types will have their maintenances
+       * reported.
+       * 
+ * + * string type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for type to set. + * @return This builder for chaining. + */ + public Builder setTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + type_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.maintenance.api.v1.ResourceMaintenance.Resource) + } + + // @@protoc_insertion_point(class_scope:google.cloud.maintenance.api.v1.ResourceMaintenance.Resource) + private static final com.google.cloud.maintenance.api.v1.ResourceMaintenance.Resource + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.maintenance.api.v1.ResourceMaintenance.Resource(); + } + + public static com.google.cloud.maintenance.api.v1.ResourceMaintenance.Resource + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Resource parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.maintenance.api.v1.ResourceMaintenance.Resource + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface MaintenanceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Maintenance is the name of the corresponding maintenance resource
+     * following the standard naming scheme: `"{maintenance-id}"`
+     * 
+ * + * string maintenance_name = 1; + * + * @return The maintenanceName. + */ + java.lang.String getMaintenanceName(); + + /** + * + * + *
+     * Maintenance is the name of the corresponding maintenance resource
+     * following the standard naming scheme: `"{maintenance-id}"`
+     * 
+ * + * string maintenance_name = 1; + * + * @return The bytes for maintenanceName. + */ + com.google.protobuf.ByteString getMaintenanceNameBytes(); + + /** + * + * + *
+     * Output only. The title of the maintenance.
+     * 
+ * + * string title = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The title. + */ + java.lang.String getTitle(); + + /** + * + * + *
+     * Output only. The title of the maintenance.
+     * 
+ * + * string title = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for title. + */ + com.google.protobuf.ByteString getTitleBytes(); + + /** + * + * + *
+     * Output only. The description of the maintenance.
+     * 
+ * + * string description = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The description. + */ + java.lang.String getDescription(); + + /** + * + * + *
+     * Output only. The description of the maintenance.
+     * 
+ * + * string description = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+     * Output only. The category of the maintenance.
+     * 
+ * + * + * .google.cloud.maintenance.api.v1.MaintenanceCategory category = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for category. + */ + int getCategoryValue(); + + /** + * + * + *
+     * Output only. The category of the maintenance.
+     * 
+ * + * + * .google.cloud.maintenance.api.v1.MaintenanceCategory category = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The category. + */ + com.google.cloud.maintenance.api.v1.MaintenanceCategory getCategory(); + } + + /** + * + * + *
+   * Maintenance is the maintenance details of a resource's maintenance.
+   * 
+ * + * Protobuf type {@code google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance} + */ + public static final class Maintenance extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance) + MaintenanceOrBuilder { + private static final long serialVersionUID = 0L; + + // Use Maintenance.newBuilder() to construct. + private Maintenance(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Maintenance() { + maintenanceName_ = ""; + title_ = ""; + description_ = ""; + category_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Maintenance(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_ResourceMaintenance_Maintenance_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_ResourceMaintenance_Maintenance_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance.class, + com.google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance.Builder.class); + } + + public static final int MAINTENANCE_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object maintenanceName_ = ""; + + /** + * + * + *
+     * Maintenance is the name of the corresponding maintenance resource
+     * following the standard naming scheme: `"{maintenance-id}"`
+     * 
+ * + * string maintenance_name = 1; + * + * @return The maintenanceName. + */ + @java.lang.Override + public java.lang.String getMaintenanceName() { + java.lang.Object ref = maintenanceName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + maintenanceName_ = s; + return s; + } + } + + /** + * + * + *
+     * Maintenance is the name of the corresponding maintenance resource
+     * following the standard naming scheme: `"{maintenance-id}"`
+     * 
+ * + * string maintenance_name = 1; + * + * @return The bytes for maintenanceName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMaintenanceNameBytes() { + java.lang.Object ref = maintenanceName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + maintenanceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TITLE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object title_ = ""; + + /** + * + * + *
+     * Output only. The title of the maintenance.
+     * 
+ * + * string title = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The title. + */ + @java.lang.Override + public java.lang.String getTitle() { + java.lang.Object ref = title_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + title_ = s; + return s; + } + } + + /** + * + * + *
+     * Output only. The title of the maintenance.
+     * 
+ * + * string title = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for title. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTitleBytes() { + java.lang.Object ref = title_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + + /** + * + * + *
+     * Output only. The description of the maintenance.
+     * 
+ * + * string description = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } + } + + /** + * + * + *
+     * Output only. The description of the maintenance.
+     * 
+ * + * string description = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CATEGORY_FIELD_NUMBER = 4; + private int category_ = 0; + + /** + * + * + *
+     * Output only. The category of the maintenance.
+     * 
+ * + * + * .google.cloud.maintenance.api.v1.MaintenanceCategory category = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for category. + */ + @java.lang.Override + public int getCategoryValue() { + return category_; + } + + /** + * + * + *
+     * Output only. The category of the maintenance.
+     * 
+ * + * + * .google.cloud.maintenance.api.v1.MaintenanceCategory category = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The category. + */ + @java.lang.Override + public com.google.cloud.maintenance.api.v1.MaintenanceCategory getCategory() { + com.google.cloud.maintenance.api.v1.MaintenanceCategory result = + com.google.cloud.maintenance.api.v1.MaintenanceCategory.forNumber(category_); + return result == null + ? com.google.cloud.maintenance.api.v1.MaintenanceCategory.UNRECOGNIZED + : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(maintenanceName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, maintenanceName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(title_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, title_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); + } + if (category_ + != com.google.cloud.maintenance.api.v1.MaintenanceCategory + .MAINTENANCE_CATEGORY_UNSPECIFIED + .getNumber()) { + output.writeEnum(4, category_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(maintenanceName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, maintenanceName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(title_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, title_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); + } + if (category_ + != com.google.cloud.maintenance.api.v1.MaintenanceCategory + .MAINTENANCE_CATEGORY_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, category_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance)) { + return super.equals(obj); + } + com.google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance other = + (com.google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance) obj; + + if (!getMaintenanceName().equals(other.getMaintenanceName())) return false; + if (!getTitle().equals(other.getTitle())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (category_ != other.category_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + MAINTENANCE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getMaintenanceName().hashCode(); + hash = (37 * hash) + TITLE_FIELD_NUMBER; + hash = (53 * hash) + getTitle().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + CATEGORY_FIELD_NUMBER; + hash = (53 * hash) + category_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+     * Maintenance is the maintenance details of a resource's maintenance.
+     * 
+ * + * Protobuf type {@code google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance) + com.google.cloud.maintenance.api.v1.ResourceMaintenance.MaintenanceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_ResourceMaintenance_Maintenance_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_ResourceMaintenance_Maintenance_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance.class, + com.google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance.Builder.class); + } + + // Construct using + // com.google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + maintenanceName_ = ""; + title_ = ""; + description_ = ""; + category_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_ResourceMaintenance_Maintenance_descriptor; + } + + @java.lang.Override + public com.google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance + getDefaultInstanceForType() { + return com.google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance build() { + com.google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance buildPartial() { + com.google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance result = + new com.google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.maintenanceName_ = maintenanceName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.title_ = title_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.description_ = description_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.category_ = category_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance) { + return mergeFrom( + (com.google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance other) { + if (other + == com.google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance + .getDefaultInstance()) return this; + if (!other.getMaintenanceName().isEmpty()) { + maintenanceName_ = other.maintenanceName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getTitle().isEmpty()) { + title_ = other.title_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.category_ != 0) { + setCategoryValue(other.getCategoryValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + maintenanceName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + title_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + category_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 32 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object maintenanceName_ = ""; + + /** + * + * + *
+       * Maintenance is the name of the corresponding maintenance resource
+       * following the standard naming scheme: `"{maintenance-id}"`
+       * 
+ * + * string maintenance_name = 1; + * + * @return The maintenanceName. + */ + public java.lang.String getMaintenanceName() { + java.lang.Object ref = maintenanceName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + maintenanceName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Maintenance is the name of the corresponding maintenance resource
+       * following the standard naming scheme: `"{maintenance-id}"`
+       * 
+ * + * string maintenance_name = 1; + * + * @return The bytes for maintenanceName. + */ + public com.google.protobuf.ByteString getMaintenanceNameBytes() { + java.lang.Object ref = maintenanceName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + maintenanceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Maintenance is the name of the corresponding maintenance resource
+       * following the standard naming scheme: `"{maintenance-id}"`
+       * 
+ * + * string maintenance_name = 1; + * + * @param value The maintenanceName to set. + * @return This builder for chaining. + */ + public Builder setMaintenanceName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + maintenanceName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Maintenance is the name of the corresponding maintenance resource
+       * following the standard naming scheme: `"{maintenance-id}"`
+       * 
+ * + * string maintenance_name = 1; + * + * @return This builder for chaining. + */ + public Builder clearMaintenanceName() { + maintenanceName_ = getDefaultInstance().getMaintenanceName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+       * Maintenance is the name of the corresponding maintenance resource
+       * following the standard naming scheme: `"{maintenance-id}"`
+       * 
+ * + * string maintenance_name = 1; + * + * @param value The bytes for maintenanceName to set. + * @return This builder for chaining. + */ + public Builder setMaintenanceNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + maintenanceName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object title_ = ""; + + /** + * + * + *
+       * Output only. The title of the maintenance.
+       * 
+ * + * string title = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The title. + */ + public java.lang.String getTitle() { + java.lang.Object ref = title_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + title_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Output only. The title of the maintenance.
+       * 
+ * + * string title = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for title. + */ + public com.google.protobuf.ByteString getTitleBytes() { + java.lang.Object ref = title_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Output only. The title of the maintenance.
+       * 
+ * + * string title = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The title to set. + * @return This builder for chaining. + */ + public Builder setTitle(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + title_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. The title of the maintenance.
+       * 
+ * + * string title = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearTitle() { + title_ = getDefaultInstance().getTitle(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. The title of the maintenance.
+       * 
+ * + * string title = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for title to set. + * @return This builder for chaining. + */ + public Builder setTitleBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + title_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + + /** + * + * + *
+       * Output only. The description of the maintenance.
+       * 
+ * + * string description = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Output only. The description of the maintenance.
+       * 
+ * + * string description = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Output only. The description of the maintenance.
+       * 
+ * + * string description = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + description_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. The description of the maintenance.
+       * 
+ * + * string description = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. The description of the maintenance.
+       * 
+ * + * string description = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + description_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private int category_ = 0; + + /** + * + * + *
+       * Output only. The category of the maintenance.
+       * 
+ * + * + * .google.cloud.maintenance.api.v1.MaintenanceCategory category = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for category. + */ + @java.lang.Override + public int getCategoryValue() { + return category_; + } + + /** + * + * + *
+       * Output only. The category of the maintenance.
+       * 
+ * + * + * .google.cloud.maintenance.api.v1.MaintenanceCategory category = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for category to set. + * @return This builder for chaining. + */ + public Builder setCategoryValue(int value) { + category_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. The category of the maintenance.
+       * 
+ * + * + * .google.cloud.maintenance.api.v1.MaintenanceCategory category = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The category. + */ + @java.lang.Override + public com.google.cloud.maintenance.api.v1.MaintenanceCategory getCategory() { + com.google.cloud.maintenance.api.v1.MaintenanceCategory result = + com.google.cloud.maintenance.api.v1.MaintenanceCategory.forNumber(category_); + return result == null + ? com.google.cloud.maintenance.api.v1.MaintenanceCategory.UNRECOGNIZED + : result; + } + + /** + * + * + *
+       * Output only. The category of the maintenance.
+       * 
+ * + * + * .google.cloud.maintenance.api.v1.MaintenanceCategory category = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The category to set. + * @return This builder for chaining. + */ + public Builder setCategory(com.google.cloud.maintenance.api.v1.MaintenanceCategory value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + category_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. The category of the maintenance.
+       * 
+ * + * + * .google.cloud.maintenance.api.v1.MaintenanceCategory category = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearCategory() { + bitField0_ = (bitField0_ & ~0x00000008); + category_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance) + } + + // @@protoc_insertion_point(class_scope:google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance) + private static final com.google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance(); + } + + public static com.google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Maintenance parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Identifier. The name of the resource_maintenance resource.
+   * Format:
+   * `"projects/{project}/locations/{location}/resourceMaintenance/{resource-maintenance-id}"`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * Identifier. The name of the resource_maintenance resource.
+   * Format:
+   * `"projects/{project}/locations/{location}/resourceMaintenance/{resource-maintenance-id}"`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESOURCE_FIELD_NUMBER = 2; + private com.google.cloud.maintenance.api.v1.ResourceMaintenance.Resource resource_; + + /** + * + * + *
+   * Output only. The resource spec of the resource maintenance.
+   * 
+ * + * + * .google.cloud.maintenance.api.v1.ResourceMaintenance.Resource resource = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the resource field is set. + */ + @java.lang.Override + public boolean hasResource() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Output only. The resource spec of the resource maintenance.
+   * 
+ * + * + * .google.cloud.maintenance.api.v1.ResourceMaintenance.Resource resource = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The resource. + */ + @java.lang.Override + public com.google.cloud.maintenance.api.v1.ResourceMaintenance.Resource getResource() { + return resource_ == null + ? com.google.cloud.maintenance.api.v1.ResourceMaintenance.Resource.getDefaultInstance() + : resource_; + } + + /** + * + * + *
+   * Output only. The resource spec of the resource maintenance.
+   * 
+ * + * + * .google.cloud.maintenance.api.v1.ResourceMaintenance.Resource resource = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.maintenance.api.v1.ResourceMaintenance.ResourceOrBuilder + getResourceOrBuilder() { + return resource_ == null + ? com.google.cloud.maintenance.api.v1.ResourceMaintenance.Resource.getDefaultInstance() + : resource_; + } + + public static final int MAINTENANCE_FIELD_NUMBER = 3; + private com.google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance maintenance_; + + /** + * + * + *
+   * Output only. The details of the maintenance.
+   * 
+ * + * + * .google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance maintenance = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the maintenance field is set. + */ + @java.lang.Override + public boolean hasMaintenance() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Output only. The details of the maintenance.
+   * 
+ * + * + * .google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance maintenance = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The maintenance. + */ + @java.lang.Override + public com.google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance getMaintenance() { + return maintenance_ == null + ? com.google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance.getDefaultInstance() + : maintenance_; + } + + /** + * + * + *
+   * Output only. The details of the maintenance.
+   * 
+ * + * + * .google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance maintenance = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.maintenance.api.v1.ResourceMaintenance.MaintenanceOrBuilder + getMaintenanceOrBuilder() { + return maintenance_ == null + ? com.google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance.getDefaultInstance() + : maintenance_; + } + + public static final int STATE_FIELD_NUMBER = 4; + private int state_ = 0; + + /** + * + * + *
+   * Output only. The state of the resource maintenance.
+   * 
+ * + * + * .google.cloud.maintenance.api.v1.ResourceMaintenance.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + + /** + * + * + *
+   * Output only. The state of the resource maintenance.
+   * 
+ * + * + * .google.cloud.maintenance.api.v1.ResourceMaintenance.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.maintenance.api.v1.ResourceMaintenance.State getState() { + com.google.cloud.maintenance.api.v1.ResourceMaintenance.State result = + com.google.cloud.maintenance.api.v1.ResourceMaintenance.State.forNumber(state_); + return result == null + ? com.google.cloud.maintenance.api.v1.ResourceMaintenance.State.UNRECOGNIZED + : result; + } + + public static final int CREATE_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp createTime_; + + /** + * + * + *
+   * Output only. The create time of the resource maintenance.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * Output only. The create time of the resource maintenance.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + /** + * + * + *
+   * Output only. The create time of the resource maintenance.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 6; + private com.google.protobuf.Timestamp updateTime_; + + /** + * + * + *
+   * Output only. The update time of the resource maintenance.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+   * Output only. The update time of the resource maintenance.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + /** + * + * + *
+   * Output only. The update time of the resource maintenance.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + public static final int MAINTENANCE_START_TIME_FIELD_NUMBER = 7; + private com.google.protobuf.Timestamp maintenanceStartTime_; + + /** + * + * + *
+   * Output only. The time when the resource maintenance has started.
+   * 
+ * + * + * .google.protobuf.Timestamp maintenance_start_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the maintenanceStartTime field is set. + */ + @java.lang.Override + public boolean hasMaintenanceStartTime() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+   * Output only. The time when the resource maintenance has started.
+   * 
+ * + * + * .google.protobuf.Timestamp maintenance_start_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The maintenanceStartTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getMaintenanceStartTime() { + return maintenanceStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : maintenanceStartTime_; + } + + /** + * + * + *
+   * Output only. The time when the resource maintenance has started.
+   * 
+ * + * + * .google.protobuf.Timestamp maintenance_start_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getMaintenanceStartTimeOrBuilder() { + return maintenanceStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : maintenanceStartTime_; + } + + public static final int MAINTENANCE_END_TIME_FIELD_NUMBER = 8; + private com.google.protobuf.Timestamp maintenanceEndTime_; + + /** + * + * + *
+   * Output only. The time when the resource maintenance has completed.
+   * 
+ * + * + * .google.protobuf.Timestamp maintenance_end_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the maintenanceEndTime field is set. + */ + @java.lang.Override + public boolean hasMaintenanceEndTime() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+   * Output only. The time when the resource maintenance has completed.
+   * 
+ * + * + * .google.protobuf.Timestamp maintenance_end_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The maintenanceEndTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getMaintenanceEndTime() { + return maintenanceEndTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : maintenanceEndTime_; + } + + /** + * + * + *
+   * Output only. The time when the resource maintenance has completed.
+   * 
+ * + * + * .google.protobuf.Timestamp maintenance_end_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getMaintenanceEndTimeOrBuilder() { + return maintenanceEndTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : maintenanceEndTime_; + } + + public static final int MAINTENANCE_CANCEL_TIME_FIELD_NUMBER = 9; + private com.google.protobuf.Timestamp maintenanceCancelTime_; + + /** + * + * + *
+   * Output only. The time when the resource maintenance was cancelled.
+   * 
+ * + * + * .google.protobuf.Timestamp maintenance_cancel_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the maintenanceCancelTime field is set. + */ + @java.lang.Override + public boolean hasMaintenanceCancelTime() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
+   * Output only. The time when the resource maintenance was cancelled.
+   * 
+ * + * + * .google.protobuf.Timestamp maintenance_cancel_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The maintenanceCancelTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getMaintenanceCancelTime() { + return maintenanceCancelTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : maintenanceCancelTime_; + } + + /** + * + * + *
+   * Output only. The time when the resource maintenance was cancelled.
+   * 
+ * + * + * .google.protobuf.Timestamp maintenance_cancel_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getMaintenanceCancelTimeOrBuilder() { + return maintenanceCancelTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : maintenanceCancelTime_; + } + + public static final int MAINTENANCE_SCHEDULED_START_TIME_FIELD_NUMBER = 10; + private com.google.protobuf.Timestamp maintenanceScheduledStartTime_; + + /** + * + * + *
+   * Output only. The time when the maintenance on the resource was scheduled to
+   * start.
+   * 
+ * + * + * .google.protobuf.Timestamp maintenance_scheduled_start_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the maintenanceScheduledStartTime field is set. + */ + @java.lang.Override + public boolean hasMaintenanceScheduledStartTime() { + return ((bitField0_ & 0x00000080) != 0); + } + + /** + * + * + *
+   * Output only. The time when the maintenance on the resource was scheduled to
+   * start.
+   * 
+ * + * + * .google.protobuf.Timestamp maintenance_scheduled_start_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The maintenanceScheduledStartTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getMaintenanceScheduledStartTime() { + return maintenanceScheduledStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : maintenanceScheduledStartTime_; + } + + /** + * + * + *
+   * Output only. The time when the maintenance on the resource was scheduled to
+   * start.
+   * 
+ * + * + * .google.protobuf.Timestamp maintenance_scheduled_start_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getMaintenanceScheduledStartTimeOrBuilder() { + return maintenanceScheduledStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : maintenanceScheduledStartTime_; + } + + public static final int MAINTENANCE_SCHEDULED_END_TIME_FIELD_NUMBER = 11; + private com.google.protobuf.Timestamp maintenanceScheduledEndTime_; + + /** + * + * + *
+   * Output only. The time when the maintenance on the resource was scheduled to
+   * end.
+   * 
+ * + * + * .google.protobuf.Timestamp maintenance_scheduled_end_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the maintenanceScheduledEndTime field is set. + */ + @java.lang.Override + public boolean hasMaintenanceScheduledEndTime() { + return ((bitField0_ & 0x00000100) != 0); + } + + /** + * + * + *
+   * Output only. The time when the maintenance on the resource was scheduled to
+   * end.
+   * 
+ * + * + * .google.protobuf.Timestamp maintenance_scheduled_end_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The maintenanceScheduledEndTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getMaintenanceScheduledEndTime() { + return maintenanceScheduledEndTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : maintenanceScheduledEndTime_; + } + + /** + * + * + *
+   * Output only. The time when the maintenance on the resource was scheduled to
+   * end.
+   * 
+ * + * + * .google.protobuf.Timestamp maintenance_scheduled_end_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getMaintenanceScheduledEndTimeOrBuilder() { + return maintenanceScheduledEndTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : maintenanceScheduledEndTime_; + } + + public static final int USER_CONTROLLABLE_FIELD_NUMBER = 12; + private boolean userControllable_ = false; + + /** + * + * + *
+   * Output only. Indicates whether the user has some control over that
+   * maintenance, either proactively before maintenance was scheduled with
+   * maintenance policy or with reactive controls after it was scheduled (see
+   * controls field)
+   * 
+ * + * bool user_controllable = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The userControllable. + */ + @java.lang.Override + public boolean getUserControllable() { + return userControllable_; + } + + public static final int CONTROLS_FIELD_NUMBER = 13; + + @SuppressWarnings("serial") + private java.util.List controls_; + + /** + * + * + *
+   * Output only. The controls of the maintenance.
+   * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceControl controls = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List getControlsList() { + return controls_; + } + + /** + * + * + *
+   * Output only. The controls of the maintenance.
+   * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceControl controls = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getControlsOrBuilderList() { + return controls_; + } + + /** + * + * + *
+   * Output only. The controls of the maintenance.
+   * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceControl controls = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getControlsCount() { + return controls_.size(); + } + + /** + * + * + *
+   * Output only. The controls of the maintenance.
+   * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceControl controls = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.maintenance.api.v1.MaintenanceControl getControls(int index) { + return controls_.get(index); + } + + /** + * + * + *
+   * Output only. The controls of the maintenance.
+   * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceControl controls = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.maintenance.api.v1.MaintenanceControlOrBuilder getControlsOrBuilder( + int index) { + return controls_.get(index); + } + + public static final int LABELS_FIELD_NUMBER = 10401; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_ResourceMaintenance_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + + /** + * + * + *
+   * Optional. The labels on the resource, which can be used for categorization.
+   * similar to Kubernetes resource labels.
+   * 
+ * + * map<string, string> labels = 10401 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + + /** + * + * + *
+   * Optional. The labels on the resource, which can be used for categorization.
+   * similar to Kubernetes resource labels.
+   * 
+ * + * map<string, string> labels = 10401 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + + /** + * + * + *
+   * Optional. The labels on the resource, which can be used for categorization.
+   * similar to Kubernetes resource labels.
+   * 
+ * + * map<string, string> labels = 10401 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
+   * Optional. The labels on the resource, which can be used for categorization.
+   * similar to Kubernetes resource labels.
+   * 
+ * + * map<string, string> labels = 10401 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int ANNOTATIONS_FIELD_NUMBER = 10402; + + private static final class AnnotationsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_ResourceMaintenance_AnnotationsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField annotations_; + + private com.google.protobuf.MapField + internalGetAnnotations() { + if (annotations_ == null) { + return com.google.protobuf.MapField.emptyMapField(AnnotationsDefaultEntryHolder.defaultEntry); + } + return annotations_; + } + + public int getAnnotationsCount() { + return internalGetAnnotations().getMap().size(); + } + + /** + * + * + *
+   * Optional. Annotations is an unstructured key-value map stored with a
+   * resource that may be set by external tools to store and retrieve arbitrary
+   * metadata. They are not queryable and should be preserved when modifying
+   * objects.
+   *
+   * More info: https://kubernetes.io/docs/user-guide/annotations
+   * 
+ * + * map<string, string> annotations = 10402 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAnnotations().getMap().containsKey(key); + } + + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAnnotations() { + return getAnnotationsMap(); + } + + /** + * + * + *
+   * Optional. Annotations is an unstructured key-value map stored with a
+   * resource that may be set by external tools to store and retrieve arbitrary
+   * metadata. They are not queryable and should be preserved when modifying
+   * objects.
+   *
+   * More info: https://kubernetes.io/docs/user-guide/annotations
+   * 
+ * + * map<string, string> annotations = 10402 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map getAnnotationsMap() { + return internalGetAnnotations().getMap(); + } + + /** + * + * + *
+   * Optional. Annotations is an unstructured key-value map stored with a
+   * resource that may be set by external tools to store and retrieve arbitrary
+   * metadata. They are not queryable and should be preserved when modifying
+   * objects.
+   *
+   * More info: https://kubernetes.io/docs/user-guide/annotations
+   * 
+ * + * map<string, string> annotations = 10402 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public /* nullable */ java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
+   * Optional. Annotations is an unstructured key-value map stored with a
+   * resource that may be set by external tools to store and retrieve arbitrary
+   * metadata. They are not queryable and should be preserved when modifying
+   * objects.
+   *
+   * More info: https://kubernetes.io/docs/user-guide/annotations
+   * 
+ * + * map<string, string> annotations = 10402 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.lang.String getAnnotationsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int UID_FIELD_NUMBER = 10201; + + @SuppressWarnings("serial") + private volatile java.lang.Object uid_ = ""; + + /** + * + * + *
+   * Output only. The unique identifier of the resource. UID is unique in the
+   * time and space for this resource within the scope of the service. It is
+   * typically generated by the server on successful creation of a resource
+   * and must not be changed. UID is used to uniquely identify resources
+   * with resource name reuses. This should be a UUID4.
+   * 
+ * + * + * string uid = 10201 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @return The uid. + */ + @java.lang.Override + public java.lang.String getUid() { + java.lang.Object ref = uid_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uid_ = s; + return s; + } + } + + /** + * + * + *
+   * Output only. The unique identifier of the resource. UID is unique in the
+   * time and space for this resource within the scope of the service. It is
+   * typically generated by the server on successful creation of a resource
+   * and must not be changed. UID is used to uniquely identify resources
+   * with resource name reuses. This should be a UUID4.
+   * 
+ * + * + * string uid = 10201 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @return The bytes for uid. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUidBytes() { + java.lang.Object ref = uid_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ETAG_FIELD_NUMBER = 10202; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + + /** + * + * + *
+   * Output only. An opaque value that uniquely identifies a version or
+   * generation of a resource. It can be used to confirm that the client
+   * and server agree on the ordering of a resource being written.
+   * 
+ * + * string etag = 10202 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } + } + + /** + * + * + *
+   * Output only. An opaque value that uniquely identifies a version or
+   * generation of a resource. It can be used to confirm that the client
+   * and server agree on the ordering of a resource being written.
+   * 
+ * + * string etag = 10202 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getResource()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getMaintenance()); + } + if (state_ + != com.google.cloud.maintenance.api.v1.ResourceMaintenance.State.STATE_UNSPECIFIED + .getNumber()) { + output.writeEnum(4, state_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(5, getCreateTime()); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(6, getUpdateTime()); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeMessage(7, getMaintenanceStartTime()); + } + if (((bitField0_ & 0x00000020) != 0)) { + output.writeMessage(8, getMaintenanceEndTime()); + } + if (((bitField0_ & 0x00000040) != 0)) { + output.writeMessage(9, getMaintenanceCancelTime()); + } + if (((bitField0_ & 0x00000080) != 0)) { + output.writeMessage(10, getMaintenanceScheduledStartTime()); + } + if (((bitField0_ & 0x00000100) != 0)) { + output.writeMessage(11, getMaintenanceScheduledEndTime()); + } + if (userControllable_ != false) { + output.writeBool(12, userControllable_); + } + for (int i = 0; i < controls_.size(); i++) { + output.writeMessage(13, controls_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uid_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10201, uid_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10202, etag_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 10401); + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetAnnotations(), AnnotationsDefaultEntryHolder.defaultEntry, 10402); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getResource()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getMaintenance()); + } + if (state_ + != com.google.cloud.maintenance.api.v1.ResourceMaintenance.State.STATE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, state_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getCreateTime()); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getUpdateTime()); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(7, getMaintenanceStartTime()); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getMaintenanceEndTime()); + } + if (((bitField0_ & 0x00000040) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(9, getMaintenanceCancelTime()); + } + if (((bitField0_ & 0x00000080) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 10, getMaintenanceScheduledStartTime()); + } + if (((bitField0_ & 0x00000100) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 11, getMaintenanceScheduledEndTime()); + } + if (userControllable_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(12, userControllable_); + } + for (int i = 0; i < controls_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(13, controls_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uid_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10201, uid_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10202, etag_); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10401, labels__); + } + for (java.util.Map.Entry entry : + internalGetAnnotations().getMap().entrySet()) { + com.google.protobuf.MapEntry annotations__ = + AnnotationsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10402, annotations__); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.maintenance.api.v1.ResourceMaintenance)) { + return super.equals(obj); + } + com.google.cloud.maintenance.api.v1.ResourceMaintenance other = + (com.google.cloud.maintenance.api.v1.ResourceMaintenance) obj; + + if (!getName().equals(other.getName())) return false; + if (hasResource() != other.hasResource()) return false; + if (hasResource()) { + if (!getResource().equals(other.getResource())) return false; + } + if (hasMaintenance() != other.hasMaintenance()) return false; + if (hasMaintenance()) { + if (!getMaintenance().equals(other.getMaintenance())) return false; + } + if (state_ != other.state_) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (hasMaintenanceStartTime() != other.hasMaintenanceStartTime()) return false; + if (hasMaintenanceStartTime()) { + if (!getMaintenanceStartTime().equals(other.getMaintenanceStartTime())) return false; + } + if (hasMaintenanceEndTime() != other.hasMaintenanceEndTime()) return false; + if (hasMaintenanceEndTime()) { + if (!getMaintenanceEndTime().equals(other.getMaintenanceEndTime())) return false; + } + if (hasMaintenanceCancelTime() != other.hasMaintenanceCancelTime()) return false; + if (hasMaintenanceCancelTime()) { + if (!getMaintenanceCancelTime().equals(other.getMaintenanceCancelTime())) return false; + } + if (hasMaintenanceScheduledStartTime() != other.hasMaintenanceScheduledStartTime()) + return false; + if (hasMaintenanceScheduledStartTime()) { + if (!getMaintenanceScheduledStartTime().equals(other.getMaintenanceScheduledStartTime())) + return false; + } + if (hasMaintenanceScheduledEndTime() != other.hasMaintenanceScheduledEndTime()) return false; + if (hasMaintenanceScheduledEndTime()) { + if (!getMaintenanceScheduledEndTime().equals(other.getMaintenanceScheduledEndTime())) + return false; + } + if (getUserControllable() != other.getUserControllable()) return false; + if (!getControlsList().equals(other.getControlsList())) return false; + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (!internalGetAnnotations().equals(other.internalGetAnnotations())) return false; + if (!getUid().equals(other.getUid())) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasResource()) { + hash = (37 * hash) + RESOURCE_FIELD_NUMBER; + hash = (53 * hash) + getResource().hashCode(); + } + if (hasMaintenance()) { + hash = (37 * hash) + MAINTENANCE_FIELD_NUMBER; + hash = (53 * hash) + getMaintenance().hashCode(); + } + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + if (hasMaintenanceStartTime()) { + hash = (37 * hash) + MAINTENANCE_START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getMaintenanceStartTime().hashCode(); + } + if (hasMaintenanceEndTime()) { + hash = (37 * hash) + MAINTENANCE_END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getMaintenanceEndTime().hashCode(); + } + if (hasMaintenanceCancelTime()) { + hash = (37 * hash) + MAINTENANCE_CANCEL_TIME_FIELD_NUMBER; + hash = (53 * hash) + getMaintenanceCancelTime().hashCode(); + } + if (hasMaintenanceScheduledStartTime()) { + hash = (37 * hash) + MAINTENANCE_SCHEDULED_START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getMaintenanceScheduledStartTime().hashCode(); + } + if (hasMaintenanceScheduledEndTime()) { + hash = (37 * hash) + MAINTENANCE_SCHEDULED_END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getMaintenanceScheduledEndTime().hashCode(); + } + hash = (37 * hash) + USER_CONTROLLABLE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getUserControllable()); + if (getControlsCount() > 0) { + hash = (37 * hash) + CONTROLS_FIELD_NUMBER; + hash = (53 * hash) + getControlsList().hashCode(); + } + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + if (!internalGetAnnotations().getMap().isEmpty()) { + hash = (37 * hash) + ANNOTATIONS_FIELD_NUMBER; + hash = (53 * hash) + internalGetAnnotations().hashCode(); + } + hash = (37 * hash) + UID_FIELD_NUMBER; + hash = (53 * hash) + getUid().hashCode(); + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.maintenance.api.v1.ResourceMaintenance parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.maintenance.api.v1.ResourceMaintenance parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.maintenance.api.v1.ResourceMaintenance parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.maintenance.api.v1.ResourceMaintenance parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.maintenance.api.v1.ResourceMaintenance parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.maintenance.api.v1.ResourceMaintenance parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.maintenance.api.v1.ResourceMaintenance parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.maintenance.api.v1.ResourceMaintenance parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.maintenance.api.v1.ResourceMaintenance parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.maintenance.api.v1.ResourceMaintenance parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.maintenance.api.v1.ResourceMaintenance parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.maintenance.api.v1.ResourceMaintenance parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.maintenance.api.v1.ResourceMaintenance prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * ResourceMaintenance is a resource that represents a maintenance operation
+   * on a resource.
+   * 
+ * + * Protobuf type {@code google.cloud.maintenance.api.v1.ResourceMaintenance} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.maintenance.api.v1.ResourceMaintenance) + com.google.cloud.maintenance.api.v1.ResourceMaintenanceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_ResourceMaintenance_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 10401: + return internalGetLabels(); + case 10402: + return internalGetAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 10401: + return internalGetMutableLabels(); + case 10402: + return internalGetMutableAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_ResourceMaintenance_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.maintenance.api.v1.ResourceMaintenance.class, + com.google.cloud.maintenance.api.v1.ResourceMaintenance.Builder.class); + } + + // Construct using com.google.cloud.maintenance.api.v1.ResourceMaintenance.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getResourceFieldBuilder(); + getMaintenanceFieldBuilder(); + getCreateTimeFieldBuilder(); + getUpdateTimeFieldBuilder(); + getMaintenanceStartTimeFieldBuilder(); + getMaintenanceEndTimeFieldBuilder(); + getMaintenanceCancelTimeFieldBuilder(); + getMaintenanceScheduledStartTimeFieldBuilder(); + getMaintenanceScheduledEndTimeFieldBuilder(); + getControlsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + resource_ = null; + if (resourceBuilder_ != null) { + resourceBuilder_.dispose(); + resourceBuilder_ = null; + } + maintenance_ = null; + if (maintenanceBuilder_ != null) { + maintenanceBuilder_.dispose(); + maintenanceBuilder_ = null; + } + state_ = 0; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + maintenanceStartTime_ = null; + if (maintenanceStartTimeBuilder_ != null) { + maintenanceStartTimeBuilder_.dispose(); + maintenanceStartTimeBuilder_ = null; + } + maintenanceEndTime_ = null; + if (maintenanceEndTimeBuilder_ != null) { + maintenanceEndTimeBuilder_.dispose(); + maintenanceEndTimeBuilder_ = null; + } + maintenanceCancelTime_ = null; + if (maintenanceCancelTimeBuilder_ != null) { + maintenanceCancelTimeBuilder_.dispose(); + maintenanceCancelTimeBuilder_ = null; + } + maintenanceScheduledStartTime_ = null; + if (maintenanceScheduledStartTimeBuilder_ != null) { + maintenanceScheduledStartTimeBuilder_.dispose(); + maintenanceScheduledStartTimeBuilder_ = null; + } + maintenanceScheduledEndTime_ = null; + if (maintenanceScheduledEndTimeBuilder_ != null) { + maintenanceScheduledEndTimeBuilder_.dispose(); + maintenanceScheduledEndTimeBuilder_ = null; + } + userControllable_ = false; + if (controlsBuilder_ == null) { + controls_ = java.util.Collections.emptyList(); + } else { + controls_ = null; + controlsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00001000); + internalGetMutableLabels().clear(); + internalGetMutableAnnotations().clear(); + uid_ = ""; + etag_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_ResourceMaintenance_descriptor; + } + + @java.lang.Override + public com.google.cloud.maintenance.api.v1.ResourceMaintenance getDefaultInstanceForType() { + return com.google.cloud.maintenance.api.v1.ResourceMaintenance.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.maintenance.api.v1.ResourceMaintenance build() { + com.google.cloud.maintenance.api.v1.ResourceMaintenance result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.maintenance.api.v1.ResourceMaintenance buildPartial() { + com.google.cloud.maintenance.api.v1.ResourceMaintenance result = + new com.google.cloud.maintenance.api.v1.ResourceMaintenance(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.maintenance.api.v1.ResourceMaintenance result) { + if (controlsBuilder_ == null) { + if (((bitField0_ & 0x00001000) != 0)) { + controls_ = java.util.Collections.unmodifiableList(controls_); + bitField0_ = (bitField0_ & ~0x00001000); + } + result.controls_ = controls_; + } else { + result.controls_ = controlsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.maintenance.api.v1.ResourceMaintenance result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.resource_ = resourceBuilder_ == null ? resource_ : resourceBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.maintenance_ = + maintenanceBuilder_ == null ? maintenance_ : maintenanceBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.state_ = state_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.maintenanceStartTime_ = + maintenanceStartTimeBuilder_ == null + ? maintenanceStartTime_ + : maintenanceStartTimeBuilder_.build(); + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.maintenanceEndTime_ = + maintenanceEndTimeBuilder_ == null + ? maintenanceEndTime_ + : maintenanceEndTimeBuilder_.build(); + to_bitField0_ |= 0x00000020; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.maintenanceCancelTime_ = + maintenanceCancelTimeBuilder_ == null + ? maintenanceCancelTime_ + : maintenanceCancelTimeBuilder_.build(); + to_bitField0_ |= 0x00000040; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.maintenanceScheduledStartTime_ = + maintenanceScheduledStartTimeBuilder_ == null + ? maintenanceScheduledStartTime_ + : maintenanceScheduledStartTimeBuilder_.build(); + to_bitField0_ |= 0x00000080; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.maintenanceScheduledEndTime_ = + maintenanceScheduledEndTimeBuilder_ == null + ? maintenanceScheduledEndTime_ + : maintenanceScheduledEndTimeBuilder_.build(); + to_bitField0_ |= 0x00000100; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.userControllable_ = userControllable_; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + } + if (((from_bitField0_ & 0x00004000) != 0)) { + result.annotations_ = internalGetAnnotations(); + result.annotations_.makeImmutable(); + } + if (((from_bitField0_ & 0x00008000) != 0)) { + result.uid_ = uid_; + } + if (((from_bitField0_ & 0x00010000) != 0)) { + result.etag_ = etag_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.maintenance.api.v1.ResourceMaintenance) { + return mergeFrom((com.google.cloud.maintenance.api.v1.ResourceMaintenance) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.maintenance.api.v1.ResourceMaintenance other) { + if (other == com.google.cloud.maintenance.api.v1.ResourceMaintenance.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasResource()) { + mergeResource(other.getResource()); + } + if (other.hasMaintenance()) { + mergeMaintenance(other.getMaintenance()); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.hasMaintenanceStartTime()) { + mergeMaintenanceStartTime(other.getMaintenanceStartTime()); + } + if (other.hasMaintenanceEndTime()) { + mergeMaintenanceEndTime(other.getMaintenanceEndTime()); + } + if (other.hasMaintenanceCancelTime()) { + mergeMaintenanceCancelTime(other.getMaintenanceCancelTime()); + } + if (other.hasMaintenanceScheduledStartTime()) { + mergeMaintenanceScheduledStartTime(other.getMaintenanceScheduledStartTime()); + } + if (other.hasMaintenanceScheduledEndTime()) { + mergeMaintenanceScheduledEndTime(other.getMaintenanceScheduledEndTime()); + } + if (other.getUserControllable() != false) { + setUserControllable(other.getUserControllable()); + } + if (controlsBuilder_ == null) { + if (!other.controls_.isEmpty()) { + if (controls_.isEmpty()) { + controls_ = other.controls_; + bitField0_ = (bitField0_ & ~0x00001000); + } else { + ensureControlsIsMutable(); + controls_.addAll(other.controls_); + } + onChanged(); + } + } else { + if (!other.controls_.isEmpty()) { + if (controlsBuilder_.isEmpty()) { + controlsBuilder_.dispose(); + controlsBuilder_ = null; + controls_ = other.controls_; + bitField0_ = (bitField0_ & ~0x00001000); + controlsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getControlsFieldBuilder() + : null; + } else { + controlsBuilder_.addAllMessages(other.controls_); + } + } + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + bitField0_ |= 0x00002000; + internalGetMutableAnnotations().mergeFrom(other.internalGetAnnotations()); + bitField0_ |= 0x00004000; + if (!other.getUid().isEmpty()) { + uid_ = other.uid_; + bitField0_ |= 0x00008000; + onChanged(); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00010000; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getResourceFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getMaintenanceFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + state_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + input.readMessage( + getMaintenanceStartTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 66: + { + input.readMessage( + getMaintenanceEndTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 66 + case 74: + { + input.readMessage( + getMaintenanceCancelTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000100; + break; + } // case 74 + case 82: + { + input.readMessage( + getMaintenanceScheduledStartTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000200; + break; + } // case 82 + case 90: + { + input.readMessage( + getMaintenanceScheduledEndTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000400; + break; + } // case 90 + case 96: + { + userControllable_ = input.readBool(); + bitField0_ |= 0x00000800; + break; + } // case 96 + case 106: + { + com.google.cloud.maintenance.api.v1.MaintenanceControl m = + input.readMessage( + com.google.cloud.maintenance.api.v1.MaintenanceControl.parser(), + extensionRegistry); + if (controlsBuilder_ == null) { + ensureControlsIsMutable(); + controls_.add(m); + } else { + controlsBuilder_.addMessage(m); + } + break; + } // case 106 + case 81610: + { + uid_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00008000; + break; + } // case 81610 + case 81618: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00010000; + break; + } // case 81618 + case 83210: + { + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableLabels() + .getMutableMap() + .put(labels__.getKey(), labels__.getValue()); + bitField0_ |= 0x00002000; + break; + } // case 83210 + case 83218: + { + com.google.protobuf.MapEntry annotations__ = + input.readMessage( + AnnotationsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableAnnotations() + .getMutableMap() + .put(annotations__.getKey(), annotations__.getValue()); + bitField0_ |= 0x00004000; + break; + } // case 83218 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Identifier. The name of the resource_maintenance resource.
+     * Format:
+     * `"projects/{project}/locations/{location}/resourceMaintenance/{resource-maintenance-id}"`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Identifier. The name of the resource_maintenance resource.
+     * Format:
+     * `"projects/{project}/locations/{location}/resourceMaintenance/{resource-maintenance-id}"`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Identifier. The name of the resource_maintenance resource.
+     * Format:
+     * `"projects/{project}/locations/{location}/resourceMaintenance/{resource-maintenance-id}"`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Identifier. The name of the resource_maintenance resource.
+     * Format:
+     * `"projects/{project}/locations/{location}/resourceMaintenance/{resource-maintenance-id}"`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Identifier. The name of the resource_maintenance resource.
+     * Format:
+     * `"projects/{project}/locations/{location}/resourceMaintenance/{resource-maintenance-id}"`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.cloud.maintenance.api.v1.ResourceMaintenance.Resource resource_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.maintenance.api.v1.ResourceMaintenance.Resource, + com.google.cloud.maintenance.api.v1.ResourceMaintenance.Resource.Builder, + com.google.cloud.maintenance.api.v1.ResourceMaintenance.ResourceOrBuilder> + resourceBuilder_; + + /** + * + * + *
+     * Output only. The resource spec of the resource maintenance.
+     * 
+ * + * + * .google.cloud.maintenance.api.v1.ResourceMaintenance.Resource resource = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the resource field is set. + */ + public boolean hasResource() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Output only. The resource spec of the resource maintenance.
+     * 
+ * + * + * .google.cloud.maintenance.api.v1.ResourceMaintenance.Resource resource = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The resource. + */ + public com.google.cloud.maintenance.api.v1.ResourceMaintenance.Resource getResource() { + if (resourceBuilder_ == null) { + return resource_ == null + ? com.google.cloud.maintenance.api.v1.ResourceMaintenance.Resource.getDefaultInstance() + : resource_; + } else { + return resourceBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Output only. The resource spec of the resource maintenance.
+     * 
+ * + * + * .google.cloud.maintenance.api.v1.ResourceMaintenance.Resource resource = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setResource( + com.google.cloud.maintenance.api.v1.ResourceMaintenance.Resource value) { + if (resourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + resource_ = value; + } else { + resourceBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The resource spec of the resource maintenance.
+     * 
+ * + * + * .google.cloud.maintenance.api.v1.ResourceMaintenance.Resource resource = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setResource( + com.google.cloud.maintenance.api.v1.ResourceMaintenance.Resource.Builder builderForValue) { + if (resourceBuilder_ == null) { + resource_ = builderForValue.build(); + } else { + resourceBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The resource spec of the resource maintenance.
+     * 
+ * + * + * .google.cloud.maintenance.api.v1.ResourceMaintenance.Resource resource = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeResource( + com.google.cloud.maintenance.api.v1.ResourceMaintenance.Resource value) { + if (resourceBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && resource_ != null + && resource_ + != com.google.cloud.maintenance.api.v1.ResourceMaintenance.Resource + .getDefaultInstance()) { + getResourceBuilder().mergeFrom(value); + } else { + resource_ = value; + } + } else { + resourceBuilder_.mergeFrom(value); + } + if (resource_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Output only. The resource spec of the resource maintenance.
+     * 
+ * + * + * .google.cloud.maintenance.api.v1.ResourceMaintenance.Resource resource = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearResource() { + bitField0_ = (bitField0_ & ~0x00000002); + resource_ = null; + if (resourceBuilder_ != null) { + resourceBuilder_.dispose(); + resourceBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The resource spec of the resource maintenance.
+     * 
+ * + * + * .google.cloud.maintenance.api.v1.ResourceMaintenance.Resource resource = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.maintenance.api.v1.ResourceMaintenance.Resource.Builder + getResourceBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getResourceFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. The resource spec of the resource maintenance.
+     * 
+ * + * + * .google.cloud.maintenance.api.v1.ResourceMaintenance.Resource resource = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.maintenance.api.v1.ResourceMaintenance.ResourceOrBuilder + getResourceOrBuilder() { + if (resourceBuilder_ != null) { + return resourceBuilder_.getMessageOrBuilder(); + } else { + return resource_ == null + ? com.google.cloud.maintenance.api.v1.ResourceMaintenance.Resource.getDefaultInstance() + : resource_; + } + } + + /** + * + * + *
+     * Output only. The resource spec of the resource maintenance.
+     * 
+ * + * + * .google.cloud.maintenance.api.v1.ResourceMaintenance.Resource resource = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.maintenance.api.v1.ResourceMaintenance.Resource, + com.google.cloud.maintenance.api.v1.ResourceMaintenance.Resource.Builder, + com.google.cloud.maintenance.api.v1.ResourceMaintenance.ResourceOrBuilder> + getResourceFieldBuilder() { + if (resourceBuilder_ == null) { + resourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.maintenance.api.v1.ResourceMaintenance.Resource, + com.google.cloud.maintenance.api.v1.ResourceMaintenance.Resource.Builder, + com.google.cloud.maintenance.api.v1.ResourceMaintenance.ResourceOrBuilder>( + getResource(), getParentForChildren(), isClean()); + resource_ = null; + } + return resourceBuilder_; + } + + private com.google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance maintenance_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance, + com.google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance.Builder, + com.google.cloud.maintenance.api.v1.ResourceMaintenance.MaintenanceOrBuilder> + maintenanceBuilder_; + + /** + * + * + *
+     * Output only. The details of the maintenance.
+     * 
+ * + * + * .google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance maintenance = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the maintenance field is set. + */ + public boolean hasMaintenance() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Output only. The details of the maintenance.
+     * 
+ * + * + * .google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance maintenance = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The maintenance. + */ + public com.google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance getMaintenance() { + if (maintenanceBuilder_ == null) { + return maintenance_ == null + ? com.google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance + .getDefaultInstance() + : maintenance_; + } else { + return maintenanceBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Output only. The details of the maintenance.
+     * 
+ * + * + * .google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance maintenance = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setMaintenance( + com.google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance value) { + if (maintenanceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + maintenance_ = value; + } else { + maintenanceBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The details of the maintenance.
+     * 
+ * + * + * .google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance maintenance = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setMaintenance( + com.google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance.Builder + builderForValue) { + if (maintenanceBuilder_ == null) { + maintenance_ = builderForValue.build(); + } else { + maintenanceBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The details of the maintenance.
+     * 
+ * + * + * .google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance maintenance = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeMaintenance( + com.google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance value) { + if (maintenanceBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && maintenance_ != null + && maintenance_ + != com.google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance + .getDefaultInstance()) { + getMaintenanceBuilder().mergeFrom(value); + } else { + maintenance_ = value; + } + } else { + maintenanceBuilder_.mergeFrom(value); + } + if (maintenance_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Output only. The details of the maintenance.
+     * 
+ * + * + * .google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance maintenance = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearMaintenance() { + bitField0_ = (bitField0_ & ~0x00000004); + maintenance_ = null; + if (maintenanceBuilder_ != null) { + maintenanceBuilder_.dispose(); + maintenanceBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The details of the maintenance.
+     * 
+ * + * + * .google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance maintenance = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance.Builder + getMaintenanceBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getMaintenanceFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. The details of the maintenance.
+     * 
+ * + * + * .google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance maintenance = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.maintenance.api.v1.ResourceMaintenance.MaintenanceOrBuilder + getMaintenanceOrBuilder() { + if (maintenanceBuilder_ != null) { + return maintenanceBuilder_.getMessageOrBuilder(); + } else { + return maintenance_ == null + ? com.google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance + .getDefaultInstance() + : maintenance_; + } + } + + /** + * + * + *
+     * Output only. The details of the maintenance.
+     * 
+ * + * + * .google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance maintenance = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance, + com.google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance.Builder, + com.google.cloud.maintenance.api.v1.ResourceMaintenance.MaintenanceOrBuilder> + getMaintenanceFieldBuilder() { + if (maintenanceBuilder_ == null) { + maintenanceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance, + com.google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance.Builder, + com.google.cloud.maintenance.api.v1.ResourceMaintenance.MaintenanceOrBuilder>( + getMaintenance(), getParentForChildren(), isClean()); + maintenance_ = null; + } + return maintenanceBuilder_; + } + + private int state_ = 0; + + /** + * + * + *
+     * Output only. The state of the resource maintenance.
+     * 
+ * + * + * .google.cloud.maintenance.api.v1.ResourceMaintenance.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + + /** + * + * + *
+     * Output only. The state of the resource maintenance.
+     * 
+ * + * + * .google.cloud.maintenance.api.v1.ResourceMaintenance.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. + */ + public Builder setStateValue(int value) { + state_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The state of the resource maintenance.
+     * 
+ * + * + * .google.cloud.maintenance.api.v1.ResourceMaintenance.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.maintenance.api.v1.ResourceMaintenance.State getState() { + com.google.cloud.maintenance.api.v1.ResourceMaintenance.State result = + com.google.cloud.maintenance.api.v1.ResourceMaintenance.State.forNumber(state_); + return result == null + ? com.google.cloud.maintenance.api.v1.ResourceMaintenance.State.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Output only. The state of the resource maintenance.
+     * 
+ * + * + * .google.cloud.maintenance.api.v1.ResourceMaintenance.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.maintenance.api.v1.ResourceMaintenance.State value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + state_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The state of the resource maintenance.
+     * 
+ * + * + * .google.cloud.maintenance.api.v1.ResourceMaintenance.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + bitField0_ = (bitField0_ & ~0x00000008); + state_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + + /** + * + * + *
+     * Output only. The create time of the resource maintenance.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * Output only. The create time of the resource maintenance.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Output only. The create time of the resource maintenance.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The create time of the resource maintenance.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The create time of the resource maintenance.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + if (createTime_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Output only. The create time of the resource maintenance.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000010); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The create time of the resource maintenance.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. The create time of the resource maintenance.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + + /** + * + * + *
+     * Output only. The create time of the resource maintenance.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + + /** + * + * + *
+     * Output only. The update time of the resource maintenance.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+     * Output only. The update time of the resource maintenance.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Output only. The update time of the resource maintenance.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The update time of the resource maintenance.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The update time of the resource maintenance.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + if (updateTime_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Output only. The update time of the resource maintenance.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000020); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The update time of the resource maintenance.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. The update time of the resource maintenance.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + + /** + * + * + *
+     * Output only. The update time of the resource maintenance.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private com.google.protobuf.Timestamp maintenanceStartTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + maintenanceStartTimeBuilder_; + + /** + * + * + *
+     * Output only. The time when the resource maintenance has started.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_start_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the maintenanceStartTime field is set. + */ + public boolean hasMaintenanceStartTime() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
+     * Output only. The time when the resource maintenance has started.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_start_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The maintenanceStartTime. + */ + public com.google.protobuf.Timestamp getMaintenanceStartTime() { + if (maintenanceStartTimeBuilder_ == null) { + return maintenanceStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : maintenanceStartTime_; + } else { + return maintenanceStartTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Output only. The time when the resource maintenance has started.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_start_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setMaintenanceStartTime(com.google.protobuf.Timestamp value) { + if (maintenanceStartTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + maintenanceStartTime_ = value; + } else { + maintenanceStartTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The time when the resource maintenance has started.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_start_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setMaintenanceStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (maintenanceStartTimeBuilder_ == null) { + maintenanceStartTime_ = builderForValue.build(); + } else { + maintenanceStartTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The time when the resource maintenance has started.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_start_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeMaintenanceStartTime(com.google.protobuf.Timestamp value) { + if (maintenanceStartTimeBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && maintenanceStartTime_ != null + && maintenanceStartTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getMaintenanceStartTimeBuilder().mergeFrom(value); + } else { + maintenanceStartTime_ = value; + } + } else { + maintenanceStartTimeBuilder_.mergeFrom(value); + } + if (maintenanceStartTime_ != null) { + bitField0_ |= 0x00000040; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Output only. The time when the resource maintenance has started.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_start_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearMaintenanceStartTime() { + bitField0_ = (bitField0_ & ~0x00000040); + maintenanceStartTime_ = null; + if (maintenanceStartTimeBuilder_ != null) { + maintenanceStartTimeBuilder_.dispose(); + maintenanceStartTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The time when the resource maintenance has started.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_start_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getMaintenanceStartTimeBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return getMaintenanceStartTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. The time when the resource maintenance has started.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_start_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getMaintenanceStartTimeOrBuilder() { + if (maintenanceStartTimeBuilder_ != null) { + return maintenanceStartTimeBuilder_.getMessageOrBuilder(); + } else { + return maintenanceStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : maintenanceStartTime_; + } + } + + /** + * + * + *
+     * Output only. The time when the resource maintenance has started.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_start_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getMaintenanceStartTimeFieldBuilder() { + if (maintenanceStartTimeBuilder_ == null) { + maintenanceStartTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getMaintenanceStartTime(), getParentForChildren(), isClean()); + maintenanceStartTime_ = null; + } + return maintenanceStartTimeBuilder_; + } + + private com.google.protobuf.Timestamp maintenanceEndTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + maintenanceEndTimeBuilder_; + + /** + * + * + *
+     * Output only. The time when the resource maintenance has completed.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_end_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the maintenanceEndTime field is set. + */ + public boolean hasMaintenanceEndTime() { + return ((bitField0_ & 0x00000080) != 0); + } + + /** + * + * + *
+     * Output only. The time when the resource maintenance has completed.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_end_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The maintenanceEndTime. + */ + public com.google.protobuf.Timestamp getMaintenanceEndTime() { + if (maintenanceEndTimeBuilder_ == null) { + return maintenanceEndTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : maintenanceEndTime_; + } else { + return maintenanceEndTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Output only. The time when the resource maintenance has completed.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_end_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setMaintenanceEndTime(com.google.protobuf.Timestamp value) { + if (maintenanceEndTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + maintenanceEndTime_ = value; + } else { + maintenanceEndTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The time when the resource maintenance has completed.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_end_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setMaintenanceEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (maintenanceEndTimeBuilder_ == null) { + maintenanceEndTime_ = builderForValue.build(); + } else { + maintenanceEndTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The time when the resource maintenance has completed.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_end_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeMaintenanceEndTime(com.google.protobuf.Timestamp value) { + if (maintenanceEndTimeBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) + && maintenanceEndTime_ != null + && maintenanceEndTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getMaintenanceEndTimeBuilder().mergeFrom(value); + } else { + maintenanceEndTime_ = value; + } + } else { + maintenanceEndTimeBuilder_.mergeFrom(value); + } + if (maintenanceEndTime_ != null) { + bitField0_ |= 0x00000080; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Output only. The time when the resource maintenance has completed.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_end_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearMaintenanceEndTime() { + bitField0_ = (bitField0_ & ~0x00000080); + maintenanceEndTime_ = null; + if (maintenanceEndTimeBuilder_ != null) { + maintenanceEndTimeBuilder_.dispose(); + maintenanceEndTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The time when the resource maintenance has completed.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_end_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getMaintenanceEndTimeBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return getMaintenanceEndTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. The time when the resource maintenance has completed.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_end_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getMaintenanceEndTimeOrBuilder() { + if (maintenanceEndTimeBuilder_ != null) { + return maintenanceEndTimeBuilder_.getMessageOrBuilder(); + } else { + return maintenanceEndTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : maintenanceEndTime_; + } + } + + /** + * + * + *
+     * Output only. The time when the resource maintenance has completed.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_end_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getMaintenanceEndTimeFieldBuilder() { + if (maintenanceEndTimeBuilder_ == null) { + maintenanceEndTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getMaintenanceEndTime(), getParentForChildren(), isClean()); + maintenanceEndTime_ = null; + } + return maintenanceEndTimeBuilder_; + } + + private com.google.protobuf.Timestamp maintenanceCancelTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + maintenanceCancelTimeBuilder_; + + /** + * + * + *
+     * Output only. The time when the resource maintenance was cancelled.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_cancel_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the maintenanceCancelTime field is set. + */ + public boolean hasMaintenanceCancelTime() { + return ((bitField0_ & 0x00000100) != 0); + } + + /** + * + * + *
+     * Output only. The time when the resource maintenance was cancelled.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_cancel_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The maintenanceCancelTime. + */ + public com.google.protobuf.Timestamp getMaintenanceCancelTime() { + if (maintenanceCancelTimeBuilder_ == null) { + return maintenanceCancelTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : maintenanceCancelTime_; + } else { + return maintenanceCancelTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Output only. The time when the resource maintenance was cancelled.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_cancel_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setMaintenanceCancelTime(com.google.protobuf.Timestamp value) { + if (maintenanceCancelTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + maintenanceCancelTime_ = value; + } else { + maintenanceCancelTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The time when the resource maintenance was cancelled.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_cancel_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setMaintenanceCancelTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (maintenanceCancelTimeBuilder_ == null) { + maintenanceCancelTime_ = builderForValue.build(); + } else { + maintenanceCancelTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The time when the resource maintenance was cancelled.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_cancel_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeMaintenanceCancelTime(com.google.protobuf.Timestamp value) { + if (maintenanceCancelTimeBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0) + && maintenanceCancelTime_ != null + && maintenanceCancelTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getMaintenanceCancelTimeBuilder().mergeFrom(value); + } else { + maintenanceCancelTime_ = value; + } + } else { + maintenanceCancelTimeBuilder_.mergeFrom(value); + } + if (maintenanceCancelTime_ != null) { + bitField0_ |= 0x00000100; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Output only. The time when the resource maintenance was cancelled.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_cancel_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearMaintenanceCancelTime() { + bitField0_ = (bitField0_ & ~0x00000100); + maintenanceCancelTime_ = null; + if (maintenanceCancelTimeBuilder_ != null) { + maintenanceCancelTimeBuilder_.dispose(); + maintenanceCancelTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The time when the resource maintenance was cancelled.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_cancel_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getMaintenanceCancelTimeBuilder() { + bitField0_ |= 0x00000100; + onChanged(); + return getMaintenanceCancelTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. The time when the resource maintenance was cancelled.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_cancel_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getMaintenanceCancelTimeOrBuilder() { + if (maintenanceCancelTimeBuilder_ != null) { + return maintenanceCancelTimeBuilder_.getMessageOrBuilder(); + } else { + return maintenanceCancelTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : maintenanceCancelTime_; + } + } + + /** + * + * + *
+     * Output only. The time when the resource maintenance was cancelled.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_cancel_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getMaintenanceCancelTimeFieldBuilder() { + if (maintenanceCancelTimeBuilder_ == null) { + maintenanceCancelTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getMaintenanceCancelTime(), getParentForChildren(), isClean()); + maintenanceCancelTime_ = null; + } + return maintenanceCancelTimeBuilder_; + } + + private com.google.protobuf.Timestamp maintenanceScheduledStartTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + maintenanceScheduledStartTimeBuilder_; + + /** + * + * + *
+     * Output only. The time when the maintenance on the resource was scheduled to
+     * start.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_scheduled_start_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the maintenanceScheduledStartTime field is set. + */ + public boolean hasMaintenanceScheduledStartTime() { + return ((bitField0_ & 0x00000200) != 0); + } + + /** + * + * + *
+     * Output only. The time when the maintenance on the resource was scheduled to
+     * start.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_scheduled_start_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The maintenanceScheduledStartTime. + */ + public com.google.protobuf.Timestamp getMaintenanceScheduledStartTime() { + if (maintenanceScheduledStartTimeBuilder_ == null) { + return maintenanceScheduledStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : maintenanceScheduledStartTime_; + } else { + return maintenanceScheduledStartTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Output only. The time when the maintenance on the resource was scheduled to
+     * start.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_scheduled_start_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setMaintenanceScheduledStartTime(com.google.protobuf.Timestamp value) { + if (maintenanceScheduledStartTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + maintenanceScheduledStartTime_ = value; + } else { + maintenanceScheduledStartTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The time when the maintenance on the resource was scheduled to
+     * start.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_scheduled_start_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setMaintenanceScheduledStartTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (maintenanceScheduledStartTimeBuilder_ == null) { + maintenanceScheduledStartTime_ = builderForValue.build(); + } else { + maintenanceScheduledStartTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The time when the maintenance on the resource was scheduled to
+     * start.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_scheduled_start_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeMaintenanceScheduledStartTime(com.google.protobuf.Timestamp value) { + if (maintenanceScheduledStartTimeBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0) + && maintenanceScheduledStartTime_ != null + && maintenanceScheduledStartTime_ + != com.google.protobuf.Timestamp.getDefaultInstance()) { + getMaintenanceScheduledStartTimeBuilder().mergeFrom(value); + } else { + maintenanceScheduledStartTime_ = value; + } + } else { + maintenanceScheduledStartTimeBuilder_.mergeFrom(value); + } + if (maintenanceScheduledStartTime_ != null) { + bitField0_ |= 0x00000200; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Output only. The time when the maintenance on the resource was scheduled to
+     * start.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_scheduled_start_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearMaintenanceScheduledStartTime() { + bitField0_ = (bitField0_ & ~0x00000200); + maintenanceScheduledStartTime_ = null; + if (maintenanceScheduledStartTimeBuilder_ != null) { + maintenanceScheduledStartTimeBuilder_.dispose(); + maintenanceScheduledStartTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The time when the maintenance on the resource was scheduled to
+     * start.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_scheduled_start_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getMaintenanceScheduledStartTimeBuilder() { + bitField0_ |= 0x00000200; + onChanged(); + return getMaintenanceScheduledStartTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. The time when the maintenance on the resource was scheduled to
+     * start.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_scheduled_start_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getMaintenanceScheduledStartTimeOrBuilder() { + if (maintenanceScheduledStartTimeBuilder_ != null) { + return maintenanceScheduledStartTimeBuilder_.getMessageOrBuilder(); + } else { + return maintenanceScheduledStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : maintenanceScheduledStartTime_; + } + } + + /** + * + * + *
+     * Output only. The time when the maintenance on the resource was scheduled to
+     * start.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_scheduled_start_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getMaintenanceScheduledStartTimeFieldBuilder() { + if (maintenanceScheduledStartTimeBuilder_ == null) { + maintenanceScheduledStartTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getMaintenanceScheduledStartTime(), getParentForChildren(), isClean()); + maintenanceScheduledStartTime_ = null; + } + return maintenanceScheduledStartTimeBuilder_; + } + + private com.google.protobuf.Timestamp maintenanceScheduledEndTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + maintenanceScheduledEndTimeBuilder_; + + /** + * + * + *
+     * Output only. The time when the maintenance on the resource was scheduled to
+     * end.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_scheduled_end_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the maintenanceScheduledEndTime field is set. + */ + public boolean hasMaintenanceScheduledEndTime() { + return ((bitField0_ & 0x00000400) != 0); + } + + /** + * + * + *
+     * Output only. The time when the maintenance on the resource was scheduled to
+     * end.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_scheduled_end_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The maintenanceScheduledEndTime. + */ + public com.google.protobuf.Timestamp getMaintenanceScheduledEndTime() { + if (maintenanceScheduledEndTimeBuilder_ == null) { + return maintenanceScheduledEndTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : maintenanceScheduledEndTime_; + } else { + return maintenanceScheduledEndTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Output only. The time when the maintenance on the resource was scheduled to
+     * end.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_scheduled_end_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setMaintenanceScheduledEndTime(com.google.protobuf.Timestamp value) { + if (maintenanceScheduledEndTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + maintenanceScheduledEndTime_ = value; + } else { + maintenanceScheduledEndTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The time when the maintenance on the resource was scheduled to
+     * end.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_scheduled_end_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setMaintenanceScheduledEndTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (maintenanceScheduledEndTimeBuilder_ == null) { + maintenanceScheduledEndTime_ = builderForValue.build(); + } else { + maintenanceScheduledEndTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The time when the maintenance on the resource was scheduled to
+     * end.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_scheduled_end_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeMaintenanceScheduledEndTime(com.google.protobuf.Timestamp value) { + if (maintenanceScheduledEndTimeBuilder_ == null) { + if (((bitField0_ & 0x00000400) != 0) + && maintenanceScheduledEndTime_ != null + && maintenanceScheduledEndTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getMaintenanceScheduledEndTimeBuilder().mergeFrom(value); + } else { + maintenanceScheduledEndTime_ = value; + } + } else { + maintenanceScheduledEndTimeBuilder_.mergeFrom(value); + } + if (maintenanceScheduledEndTime_ != null) { + bitField0_ |= 0x00000400; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Output only. The time when the maintenance on the resource was scheduled to
+     * end.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_scheduled_end_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearMaintenanceScheduledEndTime() { + bitField0_ = (bitField0_ & ~0x00000400); + maintenanceScheduledEndTime_ = null; + if (maintenanceScheduledEndTimeBuilder_ != null) { + maintenanceScheduledEndTimeBuilder_.dispose(); + maintenanceScheduledEndTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The time when the maintenance on the resource was scheduled to
+     * end.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_scheduled_end_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getMaintenanceScheduledEndTimeBuilder() { + bitField0_ |= 0x00000400; + onChanged(); + return getMaintenanceScheduledEndTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. The time when the maintenance on the resource was scheduled to
+     * end.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_scheduled_end_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getMaintenanceScheduledEndTimeOrBuilder() { + if (maintenanceScheduledEndTimeBuilder_ != null) { + return maintenanceScheduledEndTimeBuilder_.getMessageOrBuilder(); + } else { + return maintenanceScheduledEndTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : maintenanceScheduledEndTime_; + } + } + + /** + * + * + *
+     * Output only. The time when the maintenance on the resource was scheduled to
+     * end.
+     * 
+ * + * + * .google.protobuf.Timestamp maintenance_scheduled_end_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getMaintenanceScheduledEndTimeFieldBuilder() { + if (maintenanceScheduledEndTimeBuilder_ == null) { + maintenanceScheduledEndTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getMaintenanceScheduledEndTime(), getParentForChildren(), isClean()); + maintenanceScheduledEndTime_ = null; + } + return maintenanceScheduledEndTimeBuilder_; + } + + private boolean userControllable_; + + /** + * + * + *
+     * Output only. Indicates whether the user has some control over that
+     * maintenance, either proactively before maintenance was scheduled with
+     * maintenance policy or with reactive controls after it was scheduled (see
+     * controls field)
+     * 
+ * + * bool user_controllable = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The userControllable. + */ + @java.lang.Override + public boolean getUserControllable() { + return userControllable_; + } + + /** + * + * + *
+     * Output only. Indicates whether the user has some control over that
+     * maintenance, either proactively before maintenance was scheduled with
+     * maintenance policy or with reactive controls after it was scheduled (see
+     * controls field)
+     * 
+ * + * bool user_controllable = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The userControllable to set. + * @return This builder for chaining. + */ + public Builder setUserControllable(boolean value) { + + userControllable_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Indicates whether the user has some control over that
+     * maintenance, either proactively before maintenance was scheduled with
+     * maintenance policy or with reactive controls after it was scheduled (see
+     * controls field)
+     * 
+ * + * bool user_controllable = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearUserControllable() { + bitField0_ = (bitField0_ & ~0x00000800); + userControllable_ = false; + onChanged(); + return this; + } + + private java.util.List controls_ = + java.util.Collections.emptyList(); + + private void ensureControlsIsMutable() { + if (!((bitField0_ & 0x00001000) != 0)) { + controls_ = + new java.util.ArrayList( + controls_); + bitField0_ |= 0x00001000; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.maintenance.api.v1.MaintenanceControl, + com.google.cloud.maintenance.api.v1.MaintenanceControl.Builder, + com.google.cloud.maintenance.api.v1.MaintenanceControlOrBuilder> + controlsBuilder_; + + /** + * + * + *
+     * Output only. The controls of the maintenance.
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceControl controls = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getControlsList() { + if (controlsBuilder_ == null) { + return java.util.Collections.unmodifiableList(controls_); + } else { + return controlsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * Output only. The controls of the maintenance.
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceControl controls = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getControlsCount() { + if (controlsBuilder_ == null) { + return controls_.size(); + } else { + return controlsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * Output only. The controls of the maintenance.
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceControl controls = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.maintenance.api.v1.MaintenanceControl getControls(int index) { + if (controlsBuilder_ == null) { + return controls_.get(index); + } else { + return controlsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * Output only. The controls of the maintenance.
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceControl controls = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setControls( + int index, com.google.cloud.maintenance.api.v1.MaintenanceControl value) { + if (controlsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureControlsIsMutable(); + controls_.set(index, value); + onChanged(); + } else { + controlsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Output only. The controls of the maintenance.
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceControl controls = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setControls( + int index, com.google.cloud.maintenance.api.v1.MaintenanceControl.Builder builderForValue) { + if (controlsBuilder_ == null) { + ensureControlsIsMutable(); + controls_.set(index, builderForValue.build()); + onChanged(); + } else { + controlsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Output only. The controls of the maintenance.
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceControl controls = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addControls(com.google.cloud.maintenance.api.v1.MaintenanceControl value) { + if (controlsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureControlsIsMutable(); + controls_.add(value); + onChanged(); + } else { + controlsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * Output only. The controls of the maintenance.
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceControl controls = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addControls( + int index, com.google.cloud.maintenance.api.v1.MaintenanceControl value) { + if (controlsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureControlsIsMutable(); + controls_.add(index, value); + onChanged(); + } else { + controlsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Output only. The controls of the maintenance.
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceControl controls = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addControls( + com.google.cloud.maintenance.api.v1.MaintenanceControl.Builder builderForValue) { + if (controlsBuilder_ == null) { + ensureControlsIsMutable(); + controls_.add(builderForValue.build()); + onChanged(); + } else { + controlsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Output only. The controls of the maintenance.
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceControl controls = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addControls( + int index, com.google.cloud.maintenance.api.v1.MaintenanceControl.Builder builderForValue) { + if (controlsBuilder_ == null) { + ensureControlsIsMutable(); + controls_.add(index, builderForValue.build()); + onChanged(); + } else { + controlsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Output only. The controls of the maintenance.
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceControl controls = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllControls( + java.lang.Iterable + values) { + if (controlsBuilder_ == null) { + ensureControlsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, controls_); + onChanged(); + } else { + controlsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * Output only. The controls of the maintenance.
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceControl controls = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearControls() { + if (controlsBuilder_ == null) { + controls_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00001000); + onChanged(); + } else { + controlsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Output only. The controls of the maintenance.
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceControl controls = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeControls(int index) { + if (controlsBuilder_ == null) { + ensureControlsIsMutable(); + controls_.remove(index); + onChanged(); + } else { + controlsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * Output only. The controls of the maintenance.
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceControl controls = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.maintenance.api.v1.MaintenanceControl.Builder getControlsBuilder( + int index) { + return getControlsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * Output only. The controls of the maintenance.
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceControl controls = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.maintenance.api.v1.MaintenanceControlOrBuilder getControlsOrBuilder( + int index) { + if (controlsBuilder_ == null) { + return controls_.get(index); + } else { + return controlsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * Output only. The controls of the maintenance.
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceControl controls = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getControlsOrBuilderList() { + if (controlsBuilder_ != null) { + return controlsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(controls_); + } + } + + /** + * + * + *
+     * Output only. The controls of the maintenance.
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceControl controls = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.maintenance.api.v1.MaintenanceControl.Builder addControlsBuilder() { + return getControlsFieldBuilder() + .addBuilder(com.google.cloud.maintenance.api.v1.MaintenanceControl.getDefaultInstance()); + } + + /** + * + * + *
+     * Output only. The controls of the maintenance.
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceControl controls = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.maintenance.api.v1.MaintenanceControl.Builder addControlsBuilder( + int index) { + return getControlsFieldBuilder() + .addBuilder( + index, com.google.cloud.maintenance.api.v1.MaintenanceControl.getDefaultInstance()); + } + + /** + * + * + *
+     * Output only. The controls of the maintenance.
+     * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceControl controls = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getControlsBuilderList() { + return getControlsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.maintenance.api.v1.MaintenanceControl, + com.google.cloud.maintenance.api.v1.MaintenanceControl.Builder, + com.google.cloud.maintenance.api.v1.MaintenanceControlOrBuilder> + getControlsFieldBuilder() { + if (controlsBuilder_ == null) { + controlsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.maintenance.api.v1.MaintenanceControl, + com.google.cloud.maintenance.api.v1.MaintenanceControl.Builder, + com.google.cloud.maintenance.api.v1.MaintenanceControlOrBuilder>( + controls_, ((bitField0_ & 0x00001000) != 0), getParentForChildren(), isClean()); + controls_ = null; + } + return controlsBuilder_; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + bitField0_ |= 0x00002000; + onChanged(); + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + + /** + * + * + *
+     * Optional. The labels on the resource, which can be used for categorization.
+     * similar to Kubernetes resource labels.
+     * 
+ * + * map<string, string> labels = 10401 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + + /** + * + * + *
+     * Optional. The labels on the resource, which can be used for categorization.
+     * similar to Kubernetes resource labels.
+     * 
+ * + * map<string, string> labels = 10401 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + + /** + * + * + *
+     * Optional. The labels on the resource, which can be used for categorization.
+     * similar to Kubernetes resource labels.
+     * 
+ * + * map<string, string> labels = 10401 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
+     * Optional. The labels on the resource, which can be used for categorization.
+     * similar to Kubernetes resource labels.
+     * 
+ * + * map<string, string> labels = 10401 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + bitField0_ = (bitField0_ & ~0x00002000); + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + + /** + * + * + *
+     * Optional. The labels on the resource, which can be used for categorization.
+     * similar to Kubernetes resource labels.
+     * 
+ * + * map<string, string> labels = 10401 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + bitField0_ |= 0x00002000; + return internalGetMutableLabels().getMutableMap(); + } + + /** + * + * + *
+     * Optional. The labels on the resource, which can be used for categorization.
+     * similar to Kubernetes resource labels.
+     * 
+ * + * map<string, string> labels = 10401 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableLabels().getMutableMap().put(key, value); + bitField0_ |= 0x00002000; + return this; + } + + /** + * + * + *
+     * Optional. The labels on the resource, which can be used for categorization.
+     * similar to Kubernetes resource labels.
+     * 
+ * + * map<string, string> labels = 10401 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + bitField0_ |= 0x00002000; + return this; + } + + private com.google.protobuf.MapField annotations_; + + private com.google.protobuf.MapField + internalGetAnnotations() { + if (annotations_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AnnotationsDefaultEntryHolder.defaultEntry); + } + return annotations_; + } + + private com.google.protobuf.MapField + internalGetMutableAnnotations() { + if (annotations_ == null) { + annotations_ = + com.google.protobuf.MapField.newMapField(AnnotationsDefaultEntryHolder.defaultEntry); + } + if (!annotations_.isMutable()) { + annotations_ = annotations_.copy(); + } + bitField0_ |= 0x00004000; + onChanged(); + return annotations_; + } + + public int getAnnotationsCount() { + return internalGetAnnotations().getMap().size(); + } + + /** + * + * + *
+     * Optional. Annotations is an unstructured key-value map stored with a
+     * resource that may be set by external tools to store and retrieve arbitrary
+     * metadata. They are not queryable and should be preserved when modifying
+     * objects.
+     *
+     * More info: https://kubernetes.io/docs/user-guide/annotations
+     * 
+ * + * + * map<string, string> annotations = 10402 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAnnotations().getMap().containsKey(key); + } + + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAnnotations() { + return getAnnotationsMap(); + } + + /** + * + * + *
+     * Optional. Annotations is an unstructured key-value map stored with a
+     * resource that may be set by external tools to store and retrieve arbitrary
+     * metadata. They are not queryable and should be preserved when modifying
+     * objects.
+     *
+     * More info: https://kubernetes.io/docs/user-guide/annotations
+     * 
+ * + * + * map<string, string> annotations = 10402 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map getAnnotationsMap() { + return internalGetAnnotations().getMap(); + } + + /** + * + * + *
+     * Optional. Annotations is an unstructured key-value map stored with a
+     * resource that may be set by external tools to store and retrieve arbitrary
+     * metadata. They are not queryable and should be preserved when modifying
+     * objects.
+     *
+     * More info: https://kubernetes.io/docs/user-guide/annotations
+     * 
+ * + * + * map<string, string> annotations = 10402 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public /* nullable */ java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
+     * Optional. Annotations is an unstructured key-value map stored with a
+     * resource that may be set by external tools to store and retrieve arbitrary
+     * metadata. They are not queryable and should be preserved when modifying
+     * objects.
+     *
+     * More info: https://kubernetes.io/docs/user-guide/annotations
+     * 
+ * + * + * map<string, string> annotations = 10402 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.lang.String getAnnotationsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearAnnotations() { + bitField0_ = (bitField0_ & ~0x00004000); + internalGetMutableAnnotations().getMutableMap().clear(); + return this; + } + + /** + * + * + *
+     * Optional. Annotations is an unstructured key-value map stored with a
+     * resource that may be set by external tools to store and retrieve arbitrary
+     * metadata. They are not queryable and should be preserved when modifying
+     * objects.
+     *
+     * More info: https://kubernetes.io/docs/user-guide/annotations
+     * 
+ * + * + * map<string, string> annotations = 10402 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableAnnotations().getMutableMap().remove(key); + return this; + } + + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableAnnotations() { + bitField0_ |= 0x00004000; + return internalGetMutableAnnotations().getMutableMap(); + } + + /** + * + * + *
+     * Optional. Annotations is an unstructured key-value map stored with a
+     * resource that may be set by external tools to store and retrieve arbitrary
+     * metadata. They are not queryable and should be preserved when modifying
+     * objects.
+     *
+     * More info: https://kubernetes.io/docs/user-guide/annotations
+     * 
+ * + * + * map<string, string> annotations = 10402 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putAnnotations(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableAnnotations().getMutableMap().put(key, value); + bitField0_ |= 0x00004000; + return this; + } + + /** + * + * + *
+     * Optional. Annotations is an unstructured key-value map stored with a
+     * resource that may be set by external tools to store and retrieve arbitrary
+     * metadata. They are not queryable and should be preserved when modifying
+     * objects.
+     *
+     * More info: https://kubernetes.io/docs/user-guide/annotations
+     * 
+ * + * + * map<string, string> annotations = 10402 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putAllAnnotations(java.util.Map values) { + internalGetMutableAnnotations().getMutableMap().putAll(values); + bitField0_ |= 0x00004000; + return this; + } + + private java.lang.Object uid_ = ""; + + /** + * + * + *
+     * Output only. The unique identifier of the resource. UID is unique in the
+     * time and space for this resource within the scope of the service. It is
+     * typically generated by the server on successful creation of a resource
+     * and must not be changed. UID is used to uniquely identify resources
+     * with resource name reuses. This should be a UUID4.
+     * 
+ * + * + * string uid = 10201 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @return The uid. + */ + public java.lang.String getUid() { + java.lang.Object ref = uid_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uid_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Output only. The unique identifier of the resource. UID is unique in the
+     * time and space for this resource within the scope of the service. It is
+     * typically generated by the server on successful creation of a resource
+     * and must not be changed. UID is used to uniquely identify resources
+     * with resource name reuses. This should be a UUID4.
+     * 
+ * + * + * string uid = 10201 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @return The bytes for uid. + */ + public com.google.protobuf.ByteString getUidBytes() { + java.lang.Object ref = uid_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Output only. The unique identifier of the resource. UID is unique in the
+     * time and space for this resource within the scope of the service. It is
+     * typically generated by the server on successful creation of a resource
+     * and must not be changed. UID is used to uniquely identify resources
+     * with resource name reuses. This should be a UUID4.
+     * 
+ * + * + * string uid = 10201 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @param value The uid to set. + * @return This builder for chaining. + */ + public Builder setUid(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + uid_ = value; + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The unique identifier of the resource. UID is unique in the
+     * time and space for this resource within the scope of the service. It is
+     * typically generated by the server on successful creation of a resource
+     * and must not be changed. UID is used to uniquely identify resources
+     * with resource name reuses. This should be a UUID4.
+     * 
+ * + * + * string uid = 10201 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearUid() { + uid_ = getDefaultInstance().getUid(); + bitField0_ = (bitField0_ & ~0x00008000); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The unique identifier of the resource. UID is unique in the
+     * time and space for this resource within the scope of the service. It is
+     * typically generated by the server on successful creation of a resource
+     * and must not be changed. UID is used to uniquely identify resources
+     * with resource name reuses. This should be a UUID4.
+     * 
+ * + * + * string uid = 10201 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @param value The bytes for uid to set. + * @return This builder for chaining. + */ + public Builder setUidBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + uid_ = value; + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + + private java.lang.Object etag_ = ""; + + /** + * + * + *
+     * Output only. An opaque value that uniquely identifies a version or
+     * generation of a resource. It can be used to confirm that the client
+     * and server agree on the ordering of a resource being written.
+     * 
+ * + * string etag = 10202 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Output only. An opaque value that uniquely identifies a version or
+     * generation of a resource. It can be used to confirm that the client
+     * and server agree on the ordering of a resource being written.
+     * 
+ * + * string etag = 10202 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Output only. An opaque value that uniquely identifies a version or
+     * generation of a resource. It can be used to confirm that the client
+     * and server agree on the ordering of a resource being written.
+     * 
+ * + * string etag = 10202 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. An opaque value that uniquely identifies a version or
+     * generation of a resource. It can be used to confirm that the client
+     * and server agree on the ordering of a resource being written.
+     * 
+ * + * string etag = 10202 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00010000); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. An opaque value that uniquely identifies a version or
+     * generation of a resource. It can be used to confirm that the client
+     * and server agree on the ordering of a resource being written.
+     * 
+ * + * string etag = 10202 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.maintenance.api.v1.ResourceMaintenance) + } + + // @@protoc_insertion_point(class_scope:google.cloud.maintenance.api.v1.ResourceMaintenance) + private static final com.google.cloud.maintenance.api.v1.ResourceMaintenance DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.maintenance.api.v1.ResourceMaintenance(); + } + + public static com.google.cloud.maintenance.api.v1.ResourceMaintenance getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ResourceMaintenance parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.maintenance.api.v1.ResourceMaintenance getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maintenance/proto-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/ResourceMaintenanceName.java b/java-maintenance/proto-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/ResourceMaintenanceName.java new file mode 100644 index 000000000000..6da58d8515f8 --- /dev/null +++ b/java-maintenance/proto-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/ResourceMaintenanceName.java @@ -0,0 +1,232 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.maintenance.api.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class ResourceMaintenanceName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_RESOURCE_MAINTENANCE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/resourceMaintenances/{resource_maintenance}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String resourceMaintenance; + + @Deprecated + protected ResourceMaintenanceName() { + project = null; + location = null; + resourceMaintenance = null; + } + + private ResourceMaintenanceName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + resourceMaintenance = Preconditions.checkNotNull(builder.getResourceMaintenance()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getResourceMaintenance() { + return resourceMaintenance; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static ResourceMaintenanceName of( + String project, String location, String resourceMaintenance) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setResourceMaintenance(resourceMaintenance) + .build(); + } + + public static String format(String project, String location, String resourceMaintenance) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setResourceMaintenance(resourceMaintenance) + .build() + .toString(); + } + + public static ResourceMaintenanceName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_RESOURCE_MAINTENANCE.validatedMatch( + formattedString, "ResourceMaintenanceName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), matchMap.get("location"), matchMap.get("resource_maintenance")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (ResourceMaintenanceName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_RESOURCE_MAINTENANCE.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (resourceMaintenance != null) { + fieldMapBuilder.put("resource_maintenance", resourceMaintenance); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_RESOURCE_MAINTENANCE.instantiate( + "project", project, "location", location, "resource_maintenance", resourceMaintenance); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + ResourceMaintenanceName that = ((ResourceMaintenanceName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.resourceMaintenance, that.resourceMaintenance); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(resourceMaintenance); + return h; + } + + /** + * Builder for + * projects/{project}/locations/{location}/resourceMaintenances/{resource_maintenance}. + */ + public static class Builder { + private String project; + private String location; + private String resourceMaintenance; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getResourceMaintenance() { + return resourceMaintenance; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setResourceMaintenance(String resourceMaintenance) { + this.resourceMaintenance = resourceMaintenance; + return this; + } + + private Builder(ResourceMaintenanceName resourceMaintenanceName) { + this.project = resourceMaintenanceName.project; + this.location = resourceMaintenanceName.location; + this.resourceMaintenance = resourceMaintenanceName.resourceMaintenance; + } + + public ResourceMaintenanceName build() { + return new ResourceMaintenanceName(this); + } + } +} diff --git a/java-maintenance/proto-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/ResourceMaintenanceOrBuilder.java b/java-maintenance/proto-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/ResourceMaintenanceOrBuilder.java new file mode 100644 index 000000000000..f287bff1e4f4 --- /dev/null +++ b/java-maintenance/proto-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/ResourceMaintenanceOrBuilder.java @@ -0,0 +1,790 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/maintenance/api/v1/maintenance_service.proto + +// Protobuf Java Version: 3.25.8 +package com.google.cloud.maintenance.api.v1; + +public interface ResourceMaintenanceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.maintenance.api.v1.ResourceMaintenance) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Identifier. The name of the resource_maintenance resource.
+   * Format:
+   * `"projects/{project}/locations/{location}/resourceMaintenance/{resource-maintenance-id}"`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Identifier. The name of the resource_maintenance resource.
+   * Format:
+   * `"projects/{project}/locations/{location}/resourceMaintenance/{resource-maintenance-id}"`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. The resource spec of the resource maintenance.
+   * 
+ * + * + * .google.cloud.maintenance.api.v1.ResourceMaintenance.Resource resource = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the resource field is set. + */ + boolean hasResource(); + + /** + * + * + *
+   * Output only. The resource spec of the resource maintenance.
+   * 
+ * + * + * .google.cloud.maintenance.api.v1.ResourceMaintenance.Resource resource = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The resource. + */ + com.google.cloud.maintenance.api.v1.ResourceMaintenance.Resource getResource(); + + /** + * + * + *
+   * Output only. The resource spec of the resource maintenance.
+   * 
+ * + * + * .google.cloud.maintenance.api.v1.ResourceMaintenance.Resource resource = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.maintenance.api.v1.ResourceMaintenance.ResourceOrBuilder getResourceOrBuilder(); + + /** + * + * + *
+   * Output only. The details of the maintenance.
+   * 
+ * + * + * .google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance maintenance = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the maintenance field is set. + */ + boolean hasMaintenance(); + + /** + * + * + *
+   * Output only. The details of the maintenance.
+   * 
+ * + * + * .google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance maintenance = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The maintenance. + */ + com.google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance getMaintenance(); + + /** + * + * + *
+   * Output only. The details of the maintenance.
+   * 
+ * + * + * .google.cloud.maintenance.api.v1.ResourceMaintenance.Maintenance maintenance = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.maintenance.api.v1.ResourceMaintenance.MaintenanceOrBuilder + getMaintenanceOrBuilder(); + + /** + * + * + *
+   * Output only. The state of the resource maintenance.
+   * 
+ * + * + * .google.cloud.maintenance.api.v1.ResourceMaintenance.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + + /** + * + * + *
+   * Output only. The state of the resource maintenance.
+   * 
+ * + * + * .google.cloud.maintenance.api.v1.ResourceMaintenance.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.maintenance.api.v1.ResourceMaintenance.State getState(); + + /** + * + * + *
+   * Output only. The create time of the resource maintenance.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + + /** + * + * + *
+   * Output only. The create time of the resource maintenance.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + + /** + * + * + *
+   * Output only. The create time of the resource maintenance.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The update time of the resource maintenance.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + + /** + * + * + *
+   * Output only. The update time of the resource maintenance.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + + /** + * + * + *
+   * Output only. The update time of the resource maintenance.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The time when the resource maintenance has started.
+   * 
+ * + * + * .google.protobuf.Timestamp maintenance_start_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the maintenanceStartTime field is set. + */ + boolean hasMaintenanceStartTime(); + + /** + * + * + *
+   * Output only. The time when the resource maintenance has started.
+   * 
+ * + * + * .google.protobuf.Timestamp maintenance_start_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The maintenanceStartTime. + */ + com.google.protobuf.Timestamp getMaintenanceStartTime(); + + /** + * + * + *
+   * Output only. The time when the resource maintenance has started.
+   * 
+ * + * + * .google.protobuf.Timestamp maintenance_start_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getMaintenanceStartTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The time when the resource maintenance has completed.
+   * 
+ * + * + * .google.protobuf.Timestamp maintenance_end_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the maintenanceEndTime field is set. + */ + boolean hasMaintenanceEndTime(); + + /** + * + * + *
+   * Output only. The time when the resource maintenance has completed.
+   * 
+ * + * + * .google.protobuf.Timestamp maintenance_end_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The maintenanceEndTime. + */ + com.google.protobuf.Timestamp getMaintenanceEndTime(); + + /** + * + * + *
+   * Output only. The time when the resource maintenance has completed.
+   * 
+ * + * + * .google.protobuf.Timestamp maintenance_end_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getMaintenanceEndTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The time when the resource maintenance was cancelled.
+   * 
+ * + * + * .google.protobuf.Timestamp maintenance_cancel_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the maintenanceCancelTime field is set. + */ + boolean hasMaintenanceCancelTime(); + + /** + * + * + *
+   * Output only. The time when the resource maintenance was cancelled.
+   * 
+ * + * + * .google.protobuf.Timestamp maintenance_cancel_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The maintenanceCancelTime. + */ + com.google.protobuf.Timestamp getMaintenanceCancelTime(); + + /** + * + * + *
+   * Output only. The time when the resource maintenance was cancelled.
+   * 
+ * + * + * .google.protobuf.Timestamp maintenance_cancel_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getMaintenanceCancelTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The time when the maintenance on the resource was scheduled to
+   * start.
+   * 
+ * + * + * .google.protobuf.Timestamp maintenance_scheduled_start_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the maintenanceScheduledStartTime field is set. + */ + boolean hasMaintenanceScheduledStartTime(); + + /** + * + * + *
+   * Output only. The time when the maintenance on the resource was scheduled to
+   * start.
+   * 
+ * + * + * .google.protobuf.Timestamp maintenance_scheduled_start_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The maintenanceScheduledStartTime. + */ + com.google.protobuf.Timestamp getMaintenanceScheduledStartTime(); + + /** + * + * + *
+   * Output only. The time when the maintenance on the resource was scheduled to
+   * start.
+   * 
+ * + * + * .google.protobuf.Timestamp maintenance_scheduled_start_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getMaintenanceScheduledStartTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The time when the maintenance on the resource was scheduled to
+   * end.
+   * 
+ * + * + * .google.protobuf.Timestamp maintenance_scheduled_end_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the maintenanceScheduledEndTime field is set. + */ + boolean hasMaintenanceScheduledEndTime(); + + /** + * + * + *
+   * Output only. The time when the maintenance on the resource was scheduled to
+   * end.
+   * 
+ * + * + * .google.protobuf.Timestamp maintenance_scheduled_end_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The maintenanceScheduledEndTime. + */ + com.google.protobuf.Timestamp getMaintenanceScheduledEndTime(); + + /** + * + * + *
+   * Output only. The time when the maintenance on the resource was scheduled to
+   * end.
+   * 
+ * + * + * .google.protobuf.Timestamp maintenance_scheduled_end_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getMaintenanceScheduledEndTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Indicates whether the user has some control over that
+   * maintenance, either proactively before maintenance was scheduled with
+   * maintenance policy or with reactive controls after it was scheduled (see
+   * controls field)
+   * 
+ * + * bool user_controllable = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The userControllable. + */ + boolean getUserControllable(); + + /** + * + * + *
+   * Output only. The controls of the maintenance.
+   * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceControl controls = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getControlsList(); + + /** + * + * + *
+   * Output only. The controls of the maintenance.
+   * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceControl controls = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.maintenance.api.v1.MaintenanceControl getControls(int index); + + /** + * + * + *
+   * Output only. The controls of the maintenance.
+   * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceControl controls = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getControlsCount(); + + /** + * + * + *
+   * Output only. The controls of the maintenance.
+   * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceControl controls = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getControlsOrBuilderList(); + + /** + * + * + *
+   * Output only. The controls of the maintenance.
+   * 
+ * + * + * repeated .google.cloud.maintenance.api.v1.MaintenanceControl controls = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.maintenance.api.v1.MaintenanceControlOrBuilder getControlsOrBuilder(int index); + + /** + * + * + *
+   * Optional. The labels on the resource, which can be used for categorization.
+   * similar to Kubernetes resource labels.
+   * 
+ * + * map<string, string> labels = 10401 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getLabelsCount(); + + /** + * + * + *
+   * Optional. The labels on the resource, which can be used for categorization.
+   * similar to Kubernetes resource labels.
+   * 
+ * + * map<string, string> labels = 10401 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + boolean containsLabels(java.lang.String key); + + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + + /** + * + * + *
+   * Optional. The labels on the resource, which can be used for categorization.
+   * similar to Kubernetes resource labels.
+   * 
+ * + * map<string, string> labels = 10401 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.Map getLabelsMap(); + + /** + * + * + *
+   * Optional. The labels on the resource, which can be used for categorization.
+   * similar to Kubernetes resource labels.
+   * 
+ * + * map<string, string> labels = 10401 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + /* nullable */ + java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + + /** + * + * + *
+   * Optional. The labels on the resource, which can be used for categorization.
+   * similar to Kubernetes resource labels.
+   * 
+ * + * map<string, string> labels = 10401 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Optional. Annotations is an unstructured key-value map stored with a
+   * resource that may be set by external tools to store and retrieve arbitrary
+   * metadata. They are not queryable and should be preserved when modifying
+   * objects.
+   *
+   * More info: https://kubernetes.io/docs/user-guide/annotations
+   * 
+ * + * map<string, string> annotations = 10402 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getAnnotationsCount(); + + /** + * + * + *
+   * Optional. Annotations is an unstructured key-value map stored with a
+   * resource that may be set by external tools to store and retrieve arbitrary
+   * metadata. They are not queryable and should be preserved when modifying
+   * objects.
+   *
+   * More info: https://kubernetes.io/docs/user-guide/annotations
+   * 
+ * + * map<string, string> annotations = 10402 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + boolean containsAnnotations(java.lang.String key); + + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getAnnotations(); + + /** + * + * + *
+   * Optional. Annotations is an unstructured key-value map stored with a
+   * resource that may be set by external tools to store and retrieve arbitrary
+   * metadata. They are not queryable and should be preserved when modifying
+   * objects.
+   *
+   * More info: https://kubernetes.io/docs/user-guide/annotations
+   * 
+ * + * map<string, string> annotations = 10402 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.Map getAnnotationsMap(); + + /** + * + * + *
+   * Optional. Annotations is an unstructured key-value map stored with a
+   * resource that may be set by external tools to store and retrieve arbitrary
+   * metadata. They are not queryable and should be preserved when modifying
+   * objects.
+   *
+   * More info: https://kubernetes.io/docs/user-guide/annotations
+   * 
+ * + * map<string, string> annotations = 10402 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + /* nullable */ + java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + + /** + * + * + *
+   * Optional. Annotations is an unstructured key-value map stored with a
+   * resource that may be set by external tools to store and retrieve arbitrary
+   * metadata. They are not queryable and should be preserved when modifying
+   * objects.
+   *
+   * More info: https://kubernetes.io/docs/user-guide/annotations
+   * 
+ * + * map<string, string> annotations = 10402 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.lang.String getAnnotationsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Output only. The unique identifier of the resource. UID is unique in the
+   * time and space for this resource within the scope of the service. It is
+   * typically generated by the server on successful creation of a resource
+   * and must not be changed. UID is used to uniquely identify resources
+   * with resource name reuses. This should be a UUID4.
+   * 
+ * + * + * string uid = 10201 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @return The uid. + */ + java.lang.String getUid(); + + /** + * + * + *
+   * Output only. The unique identifier of the resource. UID is unique in the
+   * time and space for this resource within the scope of the service. It is
+   * typically generated by the server on successful creation of a resource
+   * and must not be changed. UID is used to uniquely identify resources
+   * with resource name reuses. This should be a UUID4.
+   * 
+ * + * + * string uid = 10201 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @return The bytes for uid. + */ + com.google.protobuf.ByteString getUidBytes(); + + /** + * + * + *
+   * Output only. An opaque value that uniquely identifies a version or
+   * generation of a resource. It can be used to confirm that the client
+   * and server agree on the ordering of a resource being written.
+   * 
+ * + * string etag = 10202 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The etag. + */ + java.lang.String getEtag(); + + /** + * + * + *
+   * Output only. An opaque value that uniquely identifies a version or
+   * generation of a resource. It can be used to confirm that the client
+   * and server agree on the ordering of a resource being written.
+   * 
+ * + * string etag = 10202 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); +} diff --git a/java-maintenance/proto-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/SummarizeMaintenancesRequest.java b/java-maintenance/proto-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/SummarizeMaintenancesRequest.java new file mode 100644 index 000000000000..ccb67732344e --- /dev/null +++ b/java-maintenance/proto-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/SummarizeMaintenancesRequest.java @@ -0,0 +1,1450 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/maintenance/api/v1/maintenance_service.proto + +// Protobuf Java Version: 3.25.8 +package com.google.cloud.maintenance.api.v1; + +/** + * + * + *
+ * Request message for SummarizeMaintenances custom method.
+ * 
+ * + * Protobuf type {@code google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest} + */ +public final class SummarizeMaintenancesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest) + SummarizeMaintenancesRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use SummarizeMaintenancesRequest.newBuilder() to construct. + private SummarizeMaintenancesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SummarizeMaintenancesRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SummarizeMaintenancesRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_SummarizeMaintenancesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_SummarizeMaintenancesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest.class, + com.google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 10006; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
+   * Required. The parent of the resource maintenance.
+   * eg. `projects/123/locations/*`
+   * 
+ * + * + * string parent = 10006 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The parent of the resource maintenance.
+   * eg. `projects/123/locations/*`
+   * 
+ * + * + * string parent = 10006 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 10505; + private int pageSize_ = 0; + + /** + * + * + *
+   * The maximum number of resource maintenances to send per page. The default
+   * page size is 20 and the maximum is 1000.
+   * 
+ * + * int32 page_size = 10505; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 10506; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + + /** + * + * + *
+   * The page token: If the next_page_token from a previous response
+   * is provided, this request will send the subsequent page.
+   * 
+ * + * string page_token = 10506; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * The page token: If the next_page_token from a previous response
+   * is provided, this request will send the subsequent page.
+   * 
+ * + * string page_token = 10506; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 10507; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + + /** + * + * + *
+   * Filter the list as specified in https://google.aip.dev/160.
+   * Supported fields include:
+   * - `state`
+   * - `resource.location`
+   * - `resource.resourceName`
+   * - `resource.type`
+   * - `maintenance.maintenanceName`
+   * - `maintenanceStartTime`
+   * - `maintenanceCompleteTime`
+   * Examples:
+   * - `state="SCHEDULED"`
+   * - `resource.location="us-central1-c"`
+   * - `resource.resourceName=~"*/instance-20241212-211259"`
+   * - `maintenanceStartTime>"2000-10-11T20:44:51Z"`
+   * - `state="SCHEDULED" OR resource.type="compute.googleapis.com/Instance"`
+   * - `maintenance.maitenanceName="eb3b709c-9ca1-5472-9fb6-800a3849eda1" AND
+   * maintenanceCompleteTime>"2000-10-11T20:44:51Z"`
+   * 
+ * + * string filter = 10507; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + + /** + * + * + *
+   * Filter the list as specified in https://google.aip.dev/160.
+   * Supported fields include:
+   * - `state`
+   * - `resource.location`
+   * - `resource.resourceName`
+   * - `resource.type`
+   * - `maintenance.maintenanceName`
+   * - `maintenanceStartTime`
+   * - `maintenanceCompleteTime`
+   * Examples:
+   * - `state="SCHEDULED"`
+   * - `resource.location="us-central1-c"`
+   * - `resource.resourceName=~"*/instance-20241212-211259"`
+   * - `maintenanceStartTime>"2000-10-11T20:44:51Z"`
+   * - `state="SCHEDULED" OR resource.type="compute.googleapis.com/Instance"`
+   * - `maintenance.maitenanceName="eb3b709c-9ca1-5472-9fb6-800a3849eda1" AND
+   * maintenanceCompleteTime>"2000-10-11T20:44:51Z"`
+   * 
+ * + * string filter = 10507; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 10508; + + @SuppressWarnings("serial") + private volatile java.lang.Object orderBy_ = ""; + + /** + * + * + *
+   * Order results as specified in https://google.aip.dev/132.
+   * 
+ * + * string order_by = 10508; + * + * @return The orderBy. + */ + @java.lang.Override + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } + } + + /** + * + * + *
+   * Order results as specified in https://google.aip.dev/132.
+   * 
+ * + * string order_by = 10508; + * + * @return The bytes for orderBy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10006, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(10505, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10506, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10507, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10508, orderBy_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10006, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(10505, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10506, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10507, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10508, orderBy_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest)) { + return super.equals(obj); + } + com.google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest other = + (com.google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getOrderBy().equals(other.getOrderBy())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for SummarizeMaintenances custom method.
+   * 
+ * + * Protobuf type {@code google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest) + com.google.cloud.maintenance.api.v1.SummarizeMaintenancesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_SummarizeMaintenancesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_SummarizeMaintenancesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest.class, + com.google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest.Builder.class); + } + + // Construct using com.google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_SummarizeMaintenancesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest + getDefaultInstanceForType() { + return com.google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest build() { + com.google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest buildPartial() { + com.google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest result = + new com.google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.filter_ = filter_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.orderBy_ = orderBy_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest) { + return mergeFrom((com.google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest other) { + if (other + == com.google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + bitField0_ |= 0x00000010; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 80050: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 80050 + case 84040: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 84040 + case 84050: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 84050 + case 84058: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 84058 + case 84066: + { + orderBy_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 84066 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + + /** + * + * + *
+     * Required. The parent of the resource maintenance.
+     * eg. `projects/123/locations/*`
+     * 
+ * + * + * string parent = 10006 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The parent of the resource maintenance.
+     * eg. `projects/123/locations/*`
+     * 
+ * + * + * string parent = 10006 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The parent of the resource maintenance.
+     * eg. `projects/123/locations/*`
+     * 
+ * + * + * string parent = 10006 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The parent of the resource maintenance.
+     * eg. `projects/123/locations/*`
+     * 
+ * + * + * string parent = 10006 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The parent of the resource maintenance.
+     * eg. `projects/123/locations/*`
+     * 
+ * + * + * string parent = 10006 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + + /** + * + * + *
+     * The maximum number of resource maintenances to send per page. The default
+     * page size is 20 and the maximum is 1000.
+     * 
+ * + * int32 page_size = 10505; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + /** + * + * + *
+     * The maximum number of resource maintenances to send per page. The default
+     * page size is 20 and the maximum is 1000.
+     * 
+ * + * int32 page_size = 10505; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The maximum number of resource maintenances to send per page. The default
+     * page size is 20 and the maximum is 1000.
+     * 
+ * + * int32 page_size = 10505; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
+     * The page token: If the next_page_token from a previous response
+     * is provided, this request will send the subsequent page.
+     * 
+ * + * string page_token = 10506; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The page token: If the next_page_token from a previous response
+     * is provided, this request will send the subsequent page.
+     * 
+ * + * string page_token = 10506; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The page token: If the next_page_token from a previous response
+     * is provided, this request will send the subsequent page.
+     * 
+ * + * string page_token = 10506; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The page token: If the next_page_token from a previous response
+     * is provided, this request will send the subsequent page.
+     * 
+ * + * string page_token = 10506; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * The page token: If the next_page_token from a previous response
+     * is provided, this request will send the subsequent page.
+     * 
+ * + * string page_token = 10506; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + + /** + * + * + *
+     * Filter the list as specified in https://google.aip.dev/160.
+     * Supported fields include:
+     * - `state`
+     * - `resource.location`
+     * - `resource.resourceName`
+     * - `resource.type`
+     * - `maintenance.maintenanceName`
+     * - `maintenanceStartTime`
+     * - `maintenanceCompleteTime`
+     * Examples:
+     * - `state="SCHEDULED"`
+     * - `resource.location="us-central1-c"`
+     * - `resource.resourceName=~"*/instance-20241212-211259"`
+     * - `maintenanceStartTime>"2000-10-11T20:44:51Z"`
+     * - `state="SCHEDULED" OR resource.type="compute.googleapis.com/Instance"`
+     * - `maintenance.maitenanceName="eb3b709c-9ca1-5472-9fb6-800a3849eda1" AND
+     * maintenanceCompleteTime>"2000-10-11T20:44:51Z"`
+     * 
+ * + * string filter = 10507; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Filter the list as specified in https://google.aip.dev/160.
+     * Supported fields include:
+     * - `state`
+     * - `resource.location`
+     * - `resource.resourceName`
+     * - `resource.type`
+     * - `maintenance.maintenanceName`
+     * - `maintenanceStartTime`
+     * - `maintenanceCompleteTime`
+     * Examples:
+     * - `state="SCHEDULED"`
+     * - `resource.location="us-central1-c"`
+     * - `resource.resourceName=~"*/instance-20241212-211259"`
+     * - `maintenanceStartTime>"2000-10-11T20:44:51Z"`
+     * - `state="SCHEDULED" OR resource.type="compute.googleapis.com/Instance"`
+     * - `maintenance.maitenanceName="eb3b709c-9ca1-5472-9fb6-800a3849eda1" AND
+     * maintenanceCompleteTime>"2000-10-11T20:44:51Z"`
+     * 
+ * + * string filter = 10507; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Filter the list as specified in https://google.aip.dev/160.
+     * Supported fields include:
+     * - `state`
+     * - `resource.location`
+     * - `resource.resourceName`
+     * - `resource.type`
+     * - `maintenance.maintenanceName`
+     * - `maintenanceStartTime`
+     * - `maintenanceCompleteTime`
+     * Examples:
+     * - `state="SCHEDULED"`
+     * - `resource.location="us-central1-c"`
+     * - `resource.resourceName=~"*/instance-20241212-211259"`
+     * - `maintenanceStartTime>"2000-10-11T20:44:51Z"`
+     * - `state="SCHEDULED" OR resource.type="compute.googleapis.com/Instance"`
+     * - `maintenance.maitenanceName="eb3b709c-9ca1-5472-9fb6-800a3849eda1" AND
+     * maintenanceCompleteTime>"2000-10-11T20:44:51Z"`
+     * 
+ * + * string filter = 10507; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Filter the list as specified in https://google.aip.dev/160.
+     * Supported fields include:
+     * - `state`
+     * - `resource.location`
+     * - `resource.resourceName`
+     * - `resource.type`
+     * - `maintenance.maintenanceName`
+     * - `maintenanceStartTime`
+     * - `maintenanceCompleteTime`
+     * Examples:
+     * - `state="SCHEDULED"`
+     * - `resource.location="us-central1-c"`
+     * - `resource.resourceName=~"*/instance-20241212-211259"`
+     * - `maintenanceStartTime>"2000-10-11T20:44:51Z"`
+     * - `state="SCHEDULED" OR resource.type="compute.googleapis.com/Instance"`
+     * - `maintenance.maitenanceName="eb3b709c-9ca1-5472-9fb6-800a3849eda1" AND
+     * maintenanceCompleteTime>"2000-10-11T20:44:51Z"`
+     * 
+ * + * string filter = 10507; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * Filter the list as specified in https://google.aip.dev/160.
+     * Supported fields include:
+     * - `state`
+     * - `resource.location`
+     * - `resource.resourceName`
+     * - `resource.type`
+     * - `maintenance.maintenanceName`
+     * - `maintenanceStartTime`
+     * - `maintenanceCompleteTime`
+     * Examples:
+     * - `state="SCHEDULED"`
+     * - `resource.location="us-central1-c"`
+     * - `resource.resourceName=~"*/instance-20241212-211259"`
+     * - `maintenanceStartTime>"2000-10-11T20:44:51Z"`
+     * - `state="SCHEDULED" OR resource.type="compute.googleapis.com/Instance"`
+     * - `maintenance.maitenanceName="eb3b709c-9ca1-5472-9fb6-800a3849eda1" AND
+     * maintenanceCompleteTime>"2000-10-11T20:44:51Z"`
+     * 
+ * + * string filter = 10507; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + filter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + + /** + * + * + *
+     * Order results as specified in https://google.aip.dev/132.
+     * 
+ * + * string order_by = 10508; + * + * @return The orderBy. + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Order results as specified in https://google.aip.dev/132.
+     * 
+ * + * string order_by = 10508; + * + * @return The bytes for orderBy. + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Order results as specified in https://google.aip.dev/132.
+     * 
+ * + * string order_by = 10508; + * + * @param value The orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + orderBy_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Order results as specified in https://google.aip.dev/132.
+     * 
+ * + * string order_by = 10508; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + orderBy_ = getDefaultInstance().getOrderBy(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + + /** + * + * + *
+     * Order results as specified in https://google.aip.dev/132.
+     * 
+ * + * string order_by = 10508; + * + * @param value The bytes for orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + orderBy_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest) + private static final com.google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest(); + } + + public static com.google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SummarizeMaintenancesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maintenance/proto-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/SummarizeMaintenancesRequestOrBuilder.java b/java-maintenance/proto-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/SummarizeMaintenancesRequestOrBuilder.java new file mode 100644 index 000000000000..aecf749a7644 --- /dev/null +++ b/java-maintenance/proto-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/SummarizeMaintenancesRequestOrBuilder.java @@ -0,0 +1,184 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/maintenance/api/v1/maintenance_service.proto + +// Protobuf Java Version: 3.25.8 +package com.google.cloud.maintenance.api.v1; + +public interface SummarizeMaintenancesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent of the resource maintenance.
+   * eg. `projects/123/locations/*`
+   * 
+ * + * + * string parent = 10006 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
+   * Required. The parent of the resource maintenance.
+   * eg. `projects/123/locations/*`
+   * 
+ * + * + * string parent = 10006 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The maximum number of resource maintenances to send per page. The default
+   * page size is 20 and the maximum is 1000.
+   * 
+ * + * int32 page_size = 10505; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * The page token: If the next_page_token from a previous response
+   * is provided, this request will send the subsequent page.
+   * 
+ * + * string page_token = 10506; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
+   * The page token: If the next_page_token from a previous response
+   * is provided, this request will send the subsequent page.
+   * 
+ * + * string page_token = 10506; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Filter the list as specified in https://google.aip.dev/160.
+   * Supported fields include:
+   * - `state`
+   * - `resource.location`
+   * - `resource.resourceName`
+   * - `resource.type`
+   * - `maintenance.maintenanceName`
+   * - `maintenanceStartTime`
+   * - `maintenanceCompleteTime`
+   * Examples:
+   * - `state="SCHEDULED"`
+   * - `resource.location="us-central1-c"`
+   * - `resource.resourceName=~"*/instance-20241212-211259"`
+   * - `maintenanceStartTime>"2000-10-11T20:44:51Z"`
+   * - `state="SCHEDULED" OR resource.type="compute.googleapis.com/Instance"`
+   * - `maintenance.maitenanceName="eb3b709c-9ca1-5472-9fb6-800a3849eda1" AND
+   * maintenanceCompleteTime>"2000-10-11T20:44:51Z"`
+   * 
+ * + * string filter = 10507; + * + * @return The filter. + */ + java.lang.String getFilter(); + + /** + * + * + *
+   * Filter the list as specified in https://google.aip.dev/160.
+   * Supported fields include:
+   * - `state`
+   * - `resource.location`
+   * - `resource.resourceName`
+   * - `resource.type`
+   * - `maintenance.maintenanceName`
+   * - `maintenanceStartTime`
+   * - `maintenanceCompleteTime`
+   * Examples:
+   * - `state="SCHEDULED"`
+   * - `resource.location="us-central1-c"`
+   * - `resource.resourceName=~"*/instance-20241212-211259"`
+   * - `maintenanceStartTime>"2000-10-11T20:44:51Z"`
+   * - `state="SCHEDULED" OR resource.type="compute.googleapis.com/Instance"`
+   * - `maintenance.maitenanceName="eb3b709c-9ca1-5472-9fb6-800a3849eda1" AND
+   * maintenanceCompleteTime>"2000-10-11T20:44:51Z"`
+   * 
+ * + * string filter = 10507; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Order results as specified in https://google.aip.dev/132.
+   * 
+ * + * string order_by = 10508; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + + /** + * + * + *
+   * Order results as specified in https://google.aip.dev/132.
+   * 
+ * + * string order_by = 10508; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); +} diff --git a/java-maintenance/proto-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/SummarizeMaintenancesResponse.java b/java-maintenance/proto-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/SummarizeMaintenancesResponse.java new file mode 100644 index 000000000000..d02beccff35d --- /dev/null +++ b/java-maintenance/proto-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/SummarizeMaintenancesResponse.java @@ -0,0 +1,1508 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/maintenance/api/v1/maintenance_service.proto + +// Protobuf Java Version: 3.25.8 +package com.google.cloud.maintenance.api.v1; + +/** + * + * + *
+ * Request message for SummarizeMaintenances custom method.
+ * 
+ * + * Protobuf type {@code google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse} + */ +public final class SummarizeMaintenancesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse) + SummarizeMaintenancesResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use SummarizeMaintenancesResponse.newBuilder() to construct. + private SummarizeMaintenancesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SummarizeMaintenancesResponse() { + maintenances_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SummarizeMaintenancesResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_SummarizeMaintenancesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_SummarizeMaintenancesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse.class, + com.google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse.Builder.class); + } + + public static final int MAINTENANCES_FIELD_NUMBER = 10509; + + @SuppressWarnings("serial") + private java.util.List maintenances_; + + /** + * + * + *
+   * The resulting summaries.
+   * 
+ * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary maintenances = 10509; + */ + @java.lang.Override + public java.util.List + getMaintenancesList() { + return maintenances_; + } + + /** + * + * + *
+   * The resulting summaries.
+   * 
+ * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary maintenances = 10509; + */ + @java.lang.Override + public java.util.List + getMaintenancesOrBuilderList() { + return maintenances_; + } + + /** + * + * + *
+   * The resulting summaries.
+   * 
+ * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary maintenances = 10509; + */ + @java.lang.Override + public int getMaintenancesCount() { + return maintenances_.size(); + } + + /** + * + * + *
+   * The resulting summaries.
+   * 
+ * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary maintenances = 10509; + */ + @java.lang.Override + public com.google.cloud.maintenance.api.v1.MaintenanceSummary getMaintenances(int index) { + return maintenances_.get(index); + } + + /** + * + * + *
+   * The resulting summaries.
+   * 
+ * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary maintenances = 10509; + */ + @java.lang.Override + public com.google.cloud.maintenance.api.v1.MaintenanceSummaryOrBuilder getMaintenancesOrBuilder( + int index) { + return maintenances_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 10510; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+   * If present, the next page token can be provided to a subsequent
+   * SummarizeMaintenances call to list the next page.
+   * If empty, there are no more pages.
+   * 
+ * + * string next_page_token = 10510; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * If present, the next page token can be provided to a subsequent
+   * SummarizeMaintenances call to list the next page.
+   * If empty, there are no more pages.
+   * 
+ * + * string next_page_token = 10510; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int UNREACHABLE_FIELD_NUMBER = 10511; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList unreachable_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+   * Unordered list. Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 10511 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_; + } + + /** + * + * + *
+   * Unordered list. Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 10511 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + + /** + * + * + *
+   * Unordered list. Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 10511 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + + /** + * + * + *
+   * Unordered list. Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 10511 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < maintenances_.size(); i++) { + output.writeMessage(10509, maintenances_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10510, nextPageToken_); + } + for (int i = 0; i < unreachable_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10511, unreachable_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < maintenances_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10509, maintenances_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10510, nextPageToken_); + } + { + int dataSize = 0; + for (int i = 0; i < unreachable_.size(); i++) { + dataSize += computeStringSizeNoTag(unreachable_.getRaw(i)); + } + size += dataSize; + size += 3 * getUnreachableList().size(); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse)) { + return super.equals(obj); + } + com.google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse other = + (com.google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse) obj; + + if (!getMaintenancesList().equals(other.getMaintenancesList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnreachableList().equals(other.getUnreachableList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getMaintenancesCount() > 0) { + hash = (37 * hash) + MAINTENANCES_FIELD_NUMBER; + hash = (53 * hash) + getMaintenancesList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + if (getUnreachableCount() > 0) { + hash = (37 * hash) + UNREACHABLE_FIELD_NUMBER; + hash = (53 * hash) + getUnreachableList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for SummarizeMaintenances custom method.
+   * 
+ * + * Protobuf type {@code google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse) + com.google.cloud.maintenance.api.v1.SummarizeMaintenancesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_SummarizeMaintenancesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_SummarizeMaintenancesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse.class, + com.google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse.Builder.class); + } + + // Construct using + // com.google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (maintenancesBuilder_ == null) { + maintenances_ = java.util.Collections.emptyList(); + } else { + maintenances_ = null; + maintenancesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.maintenance.api.v1.UMMServiceProto + .internal_static_google_cloud_maintenance_api_v1_SummarizeMaintenancesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse + getDefaultInstanceForType() { + return com.google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse build() { + com.google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse buildPartial() { + com.google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse result = + new com.google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse result) { + if (maintenancesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + maintenances_ = java.util.Collections.unmodifiableList(maintenances_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.maintenances_ = maintenances_; + } else { + result.maintenances_ = maintenancesBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + unreachable_.makeImmutable(); + result.unreachable_ = unreachable_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse) { + return mergeFrom((com.google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse other) { + if (other + == com.google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse.getDefaultInstance()) + return this; + if (maintenancesBuilder_ == null) { + if (!other.maintenances_.isEmpty()) { + if (maintenances_.isEmpty()) { + maintenances_ = other.maintenances_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureMaintenancesIsMutable(); + maintenances_.addAll(other.maintenances_); + } + onChanged(); + } + } else { + if (!other.maintenances_.isEmpty()) { + if (maintenancesBuilder_.isEmpty()) { + maintenancesBuilder_.dispose(); + maintenancesBuilder_ = null; + maintenances_ = other.maintenances_; + bitField0_ = (bitField0_ & ~0x00000001); + maintenancesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getMaintenancesFieldBuilder() + : null; + } else { + maintenancesBuilder_.addAllMessages(other.maintenances_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.unreachable_.isEmpty()) { + if (unreachable_.isEmpty()) { + unreachable_ = other.unreachable_; + bitField0_ |= 0x00000004; + } else { + ensureUnreachableIsMutable(); + unreachable_.addAll(other.unreachable_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 84074: + { + com.google.cloud.maintenance.api.v1.MaintenanceSummary m = + input.readMessage( + com.google.cloud.maintenance.api.v1.MaintenanceSummary.parser(), + extensionRegistry); + if (maintenancesBuilder_ == null) { + ensureMaintenancesIsMutable(); + maintenances_.add(m); + } else { + maintenancesBuilder_.addMessage(m); + } + break; + } // case 84074 + case 84082: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 84082 + case 84090: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureUnreachableIsMutable(); + unreachable_.add(s); + break; + } // case 84090 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List maintenances_ = + java.util.Collections.emptyList(); + + private void ensureMaintenancesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + maintenances_ = + new java.util.ArrayList( + maintenances_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.maintenance.api.v1.MaintenanceSummary, + com.google.cloud.maintenance.api.v1.MaintenanceSummary.Builder, + com.google.cloud.maintenance.api.v1.MaintenanceSummaryOrBuilder> + maintenancesBuilder_; + + /** + * + * + *
+     * The resulting summaries.
+     * 
+ * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary maintenances = 10509; + * + */ + public java.util.List + getMaintenancesList() { + if (maintenancesBuilder_ == null) { + return java.util.Collections.unmodifiableList(maintenances_); + } else { + return maintenancesBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * The resulting summaries.
+     * 
+ * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary maintenances = 10509; + * + */ + public int getMaintenancesCount() { + if (maintenancesBuilder_ == null) { + return maintenances_.size(); + } else { + return maintenancesBuilder_.getCount(); + } + } + + /** + * + * + *
+     * The resulting summaries.
+     * 
+ * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary maintenances = 10509; + * + */ + public com.google.cloud.maintenance.api.v1.MaintenanceSummary getMaintenances(int index) { + if (maintenancesBuilder_ == null) { + return maintenances_.get(index); + } else { + return maintenancesBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * The resulting summaries.
+     * 
+ * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary maintenances = 10509; + * + */ + public Builder setMaintenances( + int index, com.google.cloud.maintenance.api.v1.MaintenanceSummary value) { + if (maintenancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMaintenancesIsMutable(); + maintenances_.set(index, value); + onChanged(); + } else { + maintenancesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The resulting summaries.
+     * 
+ * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary maintenances = 10509; + * + */ + public Builder setMaintenances( + int index, com.google.cloud.maintenance.api.v1.MaintenanceSummary.Builder builderForValue) { + if (maintenancesBuilder_ == null) { + ensureMaintenancesIsMutable(); + maintenances_.set(index, builderForValue.build()); + onChanged(); + } else { + maintenancesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The resulting summaries.
+     * 
+ * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary maintenances = 10509; + * + */ + public Builder addMaintenances(com.google.cloud.maintenance.api.v1.MaintenanceSummary value) { + if (maintenancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMaintenancesIsMutable(); + maintenances_.add(value); + onChanged(); + } else { + maintenancesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * The resulting summaries.
+     * 
+ * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary maintenances = 10509; + * + */ + public Builder addMaintenances( + int index, com.google.cloud.maintenance.api.v1.MaintenanceSummary value) { + if (maintenancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMaintenancesIsMutable(); + maintenances_.add(index, value); + onChanged(); + } else { + maintenancesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The resulting summaries.
+     * 
+ * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary maintenances = 10509; + * + */ + public Builder addMaintenances( + com.google.cloud.maintenance.api.v1.MaintenanceSummary.Builder builderForValue) { + if (maintenancesBuilder_ == null) { + ensureMaintenancesIsMutable(); + maintenances_.add(builderForValue.build()); + onChanged(); + } else { + maintenancesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The resulting summaries.
+     * 
+ * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary maintenances = 10509; + * + */ + public Builder addMaintenances( + int index, com.google.cloud.maintenance.api.v1.MaintenanceSummary.Builder builderForValue) { + if (maintenancesBuilder_ == null) { + ensureMaintenancesIsMutable(); + maintenances_.add(index, builderForValue.build()); + onChanged(); + } else { + maintenancesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The resulting summaries.
+     * 
+ * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary maintenances = 10509; + * + */ + public Builder addAllMaintenances( + java.lang.Iterable + values) { + if (maintenancesBuilder_ == null) { + ensureMaintenancesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, maintenances_); + onChanged(); + } else { + maintenancesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * The resulting summaries.
+     * 
+ * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary maintenances = 10509; + * + */ + public Builder clearMaintenances() { + if (maintenancesBuilder_ == null) { + maintenances_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + maintenancesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * The resulting summaries.
+     * 
+ * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary maintenances = 10509; + * + */ + public Builder removeMaintenances(int index) { + if (maintenancesBuilder_ == null) { + ensureMaintenancesIsMutable(); + maintenances_.remove(index); + onChanged(); + } else { + maintenancesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * The resulting summaries.
+     * 
+ * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary maintenances = 10509; + * + */ + public com.google.cloud.maintenance.api.v1.MaintenanceSummary.Builder getMaintenancesBuilder( + int index) { + return getMaintenancesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * The resulting summaries.
+     * 
+ * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary maintenances = 10509; + * + */ + public com.google.cloud.maintenance.api.v1.MaintenanceSummaryOrBuilder getMaintenancesOrBuilder( + int index) { + if (maintenancesBuilder_ == null) { + return maintenances_.get(index); + } else { + return maintenancesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * The resulting summaries.
+     * 
+ * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary maintenances = 10509; + * + */ + public java.util.List + getMaintenancesOrBuilderList() { + if (maintenancesBuilder_ != null) { + return maintenancesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(maintenances_); + } + } + + /** + * + * + *
+     * The resulting summaries.
+     * 
+ * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary maintenances = 10509; + * + */ + public com.google.cloud.maintenance.api.v1.MaintenanceSummary.Builder addMaintenancesBuilder() { + return getMaintenancesFieldBuilder() + .addBuilder(com.google.cloud.maintenance.api.v1.MaintenanceSummary.getDefaultInstance()); + } + + /** + * + * + *
+     * The resulting summaries.
+     * 
+ * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary maintenances = 10509; + * + */ + public com.google.cloud.maintenance.api.v1.MaintenanceSummary.Builder addMaintenancesBuilder( + int index) { + return getMaintenancesFieldBuilder() + .addBuilder( + index, com.google.cloud.maintenance.api.v1.MaintenanceSummary.getDefaultInstance()); + } + + /** + * + * + *
+     * The resulting summaries.
+     * 
+ * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary maintenances = 10509; + * + */ + public java.util.List + getMaintenancesBuilderList() { + return getMaintenancesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.maintenance.api.v1.MaintenanceSummary, + com.google.cloud.maintenance.api.v1.MaintenanceSummary.Builder, + com.google.cloud.maintenance.api.v1.MaintenanceSummaryOrBuilder> + getMaintenancesFieldBuilder() { + if (maintenancesBuilder_ == null) { + maintenancesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.maintenance.api.v1.MaintenanceSummary, + com.google.cloud.maintenance.api.v1.MaintenanceSummary.Builder, + com.google.cloud.maintenance.api.v1.MaintenanceSummaryOrBuilder>( + maintenances_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + maintenances_ = null; + } + return maintenancesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+     * If present, the next page token can be provided to a subsequent
+     * SummarizeMaintenances call to list the next page.
+     * If empty, there are no more pages.
+     * 
+ * + * string next_page_token = 10510; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * If present, the next page token can be provided to a subsequent
+     * SummarizeMaintenances call to list the next page.
+     * If empty, there are no more pages.
+     * 
+ * + * string next_page_token = 10510; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * If present, the next page token can be provided to a subsequent
+     * SummarizeMaintenances call to list the next page.
+     * If empty, there are no more pages.
+     * 
+ * + * string next_page_token = 10510; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * If present, the next page token can be provided to a subsequent
+     * SummarizeMaintenances call to list the next page.
+     * If empty, there are no more pages.
+     * 
+ * + * string next_page_token = 10510; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * If present, the next page token can be provided to a subsequent
+     * SummarizeMaintenances call to list the next page.
+     * If empty, there are no more pages.
+     * 
+ * + * string next_page_token = 10510; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList unreachable_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureUnreachableIsMutable() { + if (!unreachable_.isModifiable()) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(unreachable_); + } + bitField0_ |= 0x00000004; + } + + /** + * + * + *
+     * Unordered list. Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 10511 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + unreachable_.makeImmutable(); + return unreachable_; + } + + /** + * + * + *
+     * Unordered list. Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 10511 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + + /** + * + * + *
+     * Unordered list. Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 10511 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + + /** + * + * + *
+     * Unordered list. Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 10511 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + + /** + * + * + *
+     * Unordered list. Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 10511 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * + * @param index The index to set the value at. + * @param value The unreachable to set. + * @return This builder for chaining. + */ + public Builder setUnreachable(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.set(index, value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Unordered list. Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 10511 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * + * @param value The unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachable(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Unordered list. Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 10511 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * + * @param values The unreachable to add. + * @return This builder for chaining. + */ + public Builder addAllUnreachable(java.lang.Iterable values) { + ensureUnreachableIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, unreachable_); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Unordered list. Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 10511 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * + * @return This builder for chaining. + */ + public Builder clearUnreachable() { + unreachable_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + ; + onChanged(); + return this; + } + + /** + * + * + *
+     * Unordered list. Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 10511 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * + * @param value The bytes of the unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachableBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureUnreachableIsMutable(); + unreachable_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse) + private static final com.google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse(); + } + + public static com.google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SummarizeMaintenancesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maintenance/proto-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/SummarizeMaintenancesResponseOrBuilder.java b/java-maintenance/proto-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/SummarizeMaintenancesResponseOrBuilder.java new file mode 100644 index 000000000000..d041fd16329f --- /dev/null +++ b/java-maintenance/proto-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/SummarizeMaintenancesResponseOrBuilder.java @@ -0,0 +1,171 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/maintenance/api/v1/maintenance_service.proto + +// Protobuf Java Version: 3.25.8 +package com.google.cloud.maintenance.api.v1; + +public interface SummarizeMaintenancesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The resulting summaries.
+   * 
+ * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary maintenances = 10509; + */ + java.util.List getMaintenancesList(); + + /** + * + * + *
+   * The resulting summaries.
+   * 
+ * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary maintenances = 10509; + */ + com.google.cloud.maintenance.api.v1.MaintenanceSummary getMaintenances(int index); + + /** + * + * + *
+   * The resulting summaries.
+   * 
+ * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary maintenances = 10509; + */ + int getMaintenancesCount(); + + /** + * + * + *
+   * The resulting summaries.
+   * 
+ * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary maintenances = 10509; + */ + java.util.List + getMaintenancesOrBuilderList(); + + /** + * + * + *
+   * The resulting summaries.
+   * 
+ * + * repeated .google.cloud.maintenance.api.v1.MaintenanceSummary maintenances = 10509; + */ + com.google.cloud.maintenance.api.v1.MaintenanceSummaryOrBuilder getMaintenancesOrBuilder( + int index); + + /** + * + * + *
+   * If present, the next page token can be provided to a subsequent
+   * SummarizeMaintenances call to list the next page.
+   * If empty, there are no more pages.
+   * 
+ * + * string next_page_token = 10510; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
+   * If present, the next page token can be provided to a subsequent
+   * SummarizeMaintenances call to list the next page.
+   * If empty, there are no more pages.
+   * 
+ * + * string next_page_token = 10510; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * Unordered list. Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 10511 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * + * @return A list containing the unreachable. + */ + java.util.List getUnreachableList(); + + /** + * + * + *
+   * Unordered list. Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 10511 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * + * @return The count of unreachable. + */ + int getUnreachableCount(); + + /** + * + * + *
+   * Unordered list. Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 10511 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + java.lang.String getUnreachable(int index); + + /** + * + * + *
+   * Unordered list. Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 10511 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + com.google.protobuf.ByteString getUnreachableBytes(int index); +} diff --git a/java-maintenance/proto-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/UMMServiceProto.java b/java-maintenance/proto-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/UMMServiceProto.java new file mode 100644 index 000000000000..ab74d75837fa --- /dev/null +++ b/java-maintenance/proto-google-cloud-maintenance-v1/src/main/java/com/google/cloud/maintenance/api/v1/UMMServiceProto.java @@ -0,0 +1,426 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/maintenance/api/v1/maintenance_service.proto + +// Protobuf Java Version: 3.25.8 +package com.google.cloud.maintenance.api.v1; + +public final class UMMServiceProto { + private UMMServiceProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_maintenance_api_v1_SummarizeMaintenancesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_maintenance_api_v1_SummarizeMaintenancesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_maintenance_api_v1_SummarizeMaintenancesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_maintenance_api_v1_SummarizeMaintenancesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_maintenance_api_v1_MaintenanceSummary_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_maintenance_api_v1_MaintenanceSummary_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_maintenance_api_v1_MaintenanceSummary_Stats_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_maintenance_api_v1_MaintenanceSummary_Stats_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_maintenance_api_v1_MaintenanceSummary_Aggregate_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_maintenance_api_v1_MaintenanceSummary_Aggregate_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_maintenance_api_v1_ResourceMaintenance_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_maintenance_api_v1_ResourceMaintenance_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_maintenance_api_v1_ResourceMaintenance_Resource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_maintenance_api_v1_ResourceMaintenance_Resource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_maintenance_api_v1_ResourceMaintenance_Maintenance_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_maintenance_api_v1_ResourceMaintenance_Maintenance_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_maintenance_api_v1_ResourceMaintenance_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_maintenance_api_v1_ResourceMaintenance_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_maintenance_api_v1_ResourceMaintenance_AnnotationsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_maintenance_api_v1_ResourceMaintenance_AnnotationsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_maintenance_api_v1_MaintenanceControl_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_maintenance_api_v1_MaintenanceControl_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_maintenance_api_v1_ListResourceMaintenancesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_maintenance_api_v1_ListResourceMaintenancesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_maintenance_api_v1_ListResourceMaintenancesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_maintenance_api_v1_ListResourceMaintenancesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_maintenance_api_v1_GetResourceMaintenanceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_maintenance_api_v1_GetResourceMaintenanceRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n" + + "9google/cloud/maintenance/api/v1/maintenance_service.proto\022\037google.cloud.mainte" + + "nance.api.v1\032\034google/api/annotations.pro" + + "to\032\027google/api/client.proto\032\037google/api/" + + "field_behavior.proto\032\033google/api/field_i" + + "nfo.proto\032\031google/api/resource.proto\032\037google/protobuf/timestamp.proto\"\264\001\n" + + "\034SummarizeMaintenancesRequest\022G\n" + + "\006parent\030\226N \001(\tB" + + "6\340A\002\372A0\022.maintenance.googleapis.com/ResourceMaintenance\022\022\n" + + "\tpage_size\030\211R \001(\005\022\023\n\n" + + "page_token\030\212R \001(\t\022\017\n" + + "\006filter\030\213R \001(\t\022\021\n" + + "\010order_by\030\214R \001(\t\"\240\001\n" + + "\035SummarizeMaintenancesResponse\022J\n" + + "\014maintenances\030\215R \003(\01323.google.c" + + "loud.maintenance.api.v1.MaintenanceSummary\022\030\n" + + "\017next_page_token\030\216R \001(\t\022\031\n" + + "\013unreachable\030\217R \003(\tB\003\340A\006\"\226\006\n" + + "\022MaintenanceSummary\022\035\n" + + "\020maintenance_name\030\001 \001(\tB\003\340A\003\022\022\n" + + "\005title\030\002 \001(\tB\003\340A\003\022\030\n" + + "\013description\030\003 \001(\tB\003\340A\003\022K\n" + + "\010category\030\r" + + " \001(\01624.google.cloud.maintenance.api.v1.MaintenanceCategoryB\003\340A\003\022I\n" + + " maintenance_scheduled_start_time\030\006" + + " \001(\0132\032.google.protobuf.TimestampB\003\340A\003\022G\n" + + "\036maintenance_scheduled_end_time\030\007" + + " \001(\0132\032.google.protobuf.TimestampB\003\340A\003\022?\n" + + "\026maintenance_start_time\030\010" + + " \001(\0132\032.google.protobuf.TimestampB\003\340A\003\022=\n" + + "\024maintenance_end_time\030\t" + + " \001(\0132\032.google.protobuf.TimestampB\003\340A\003\022\036\n" + + "\021user_controllable\030\n" + + " \001(\010B\003\340A\003\022J\n" + + "\010controls\030\016 \003(\01323" + + ".google.cloud.maintenance.api.v1.MaintenanceControlB\003\340A\003\022M\n" + + "\005stats\030\014 \003(\01329.google" + + ".cloud.maintenance.api.v1.MaintenanceSummary.StatsB\003\340A\003\032l\n" + + "\005Stats\022\020\n" + + "\010group_by\030\001 \001(\t\022Q\n\n" + + "aggregates\030\002 \003(\0132=.google.cloud.ma" + + "intenance.api.v1.MaintenanceSummary.Aggregate\032)\n" + + "\tAggregate\022\r\n" + + "\005group\030\001 \001(\t\022\r\n" + + "\005count\030\002 \001(\003\"\254\r\n" + + "\023ResourceMaintenance\022\021\n" + + "\004name\030\001 \001(\tB\003\340A\010\022T\n" + + "\010resource\030\002 \001(\0132=.google.c" + + "loud.maintenance.api.v1.ResourceMaintenance.ResourceB\003\340A\003\022Z\n" + + "\013maintenance\030\003 \001(\0132@" + + ".google.cloud.maintenance.api.v1.ResourceMaintenance.MaintenanceB\003\340A\003\022N\n" + + "\005state\030\004" + + " \001(\0162:.google.cloud.maintenance.api.v1.ResourceMaintenance.StateB\003\340A\003\0224\n" + + "\013create_time\030\005 \001(\0132\032.google.protobuf.TimestampB\003\340A\003\0224\n" + + "\013update_time\030\006 \001(\0132\032.google.protobuf.TimestampB\003\340A\003\022?\n" + + "\026maintenance_start_time\030\007" + + " \001(\0132\032.google.protobuf.TimestampB\003\340A\003\022=\n" + + "\024maintenance_end_time\030\010" + + " \001(\0132\032.google.protobuf.TimestampB\003\340A\003\022@\n" + + "\027maintenance_cancel_time\030\t" + + " \001(\0132\032.google.protobuf.TimestampB\003\340A\003\022I\n" + + " maintenance_scheduled_start_time\030\n" + + " \001(\0132\032.google.protobuf.TimestampB\003\340A\003\022G\n" + + "\036maintenance_scheduled_end_time\030\013" + + " \001(\0132\032.google.protobuf.TimestampB\003\340A\003\022\036\n" + + "\021user_controllable\030\014 \001(\010B\003\340A\003\022J\n" + + "\010controls\030\r" + + " \003(\01323.google.cloud.maintenance.api.v1.MaintenanceControlB\003\340A\003\022V\n" + + "\006labels\030\241Q" + + " \003(\0132@.google.cloud.maintenance.api.v1.ResourceMaintenance.LabelsEntryB\003\340A\001\022`\n" + + "\013annotations\030\242Q \003(\0132E.google.cloud.mainten" + + "ance.api.v1.ResourceMaintenance.AnnotationsEntryB\003\340A\001\022\031\n" + + "\003uid\030\331O \001(\tB\013\340A\003\342\214\317\327\010\002\010\001\022\022\n" + + "\004etag\030\332O \001(\tB\003\340A\003\032P\n" + + "\010Resource\022\032\n\r" + + "resource_name\030\001 \001(\tB\003\340A\003\022\025\n" + + "\010location\030\002 \001(\tB\003\340A\003\022\021\n" + + "\004type\030\003 \001(\tB\003\340A\003\032\242\001\n" + + "\013Maintenance\022\030\n" + + "\020maintenance_name\030\001 \001(\t\022\022\n" + + "\005title\030\002 \001(\tB\003\340A\003\022\030\n" + + "\013description\030\003 \001(\tB\003\340A\003\022K\n" + + "\010category\030\004" + + " \001(\01624.google.cloud.maintenance.api.v1.MaintenanceCategoryB\003\340A\003\032-\n" + + "\013LabelsEntry\022\013\n" + + "\003key\030\001 \001(\t\022\r\n" + + "\005value\030\002 \001(\t:\0028\001\0322\n" + + "\020AnnotationsEntry\022\013\n" + + "\003key\030\001 \001(\t\022\r\n" + + "\005value\030\002 \001(\t:\0028\001\"X\n" + + "\005State\022\025\n" + + "\021STATE_UNSPECIFIED\020\000\022\r" + + "\n" + + "\tSCHEDULED\020\001\022\013\n" + + "\007RUNNING\020\002\022\r\n" + + "\tCANCELLED\020\003\022\r\n" + + "\tSUCCEEDED\020\004:\264\001\352A\260\001\n" + + ".maintenance.googleapis.com/ResourceMaintenance\022Sproject" + + "s/{project}/locations/{location}/resourceMaintenances/{resource_maintenance}*\024re" + + "sourceMaintenances2\023resourceMaintenance\"\336\001\n" + + "\022MaintenanceControl\022L\n" + + "\007control\030\001 \001(\0162" + + ";.google.cloud.maintenance.api.v1.MaintenanceControl.Control\022\021\n" + + "\tis_custom\030\002 \001(\010\022\025\n\r" + + "documentation\030\003 \001(\t\"P\n" + + "\007Control\022\027\n" + + "\023CONTROL_UNSPECIFIED\020\000\022\t\n" + + "\005APPLY\020\001\022\021\n\r" + + "MANAGE_POLICY\020\002\022\016\n\n" + + "RESCHEDULE\020\003\"\267\001\n" + + "\037ListResourceMaintenancesRequest\022G\n" + + "\006parent\030\226N \001(\tB6\340" + + "A\002\372A0\022.maintenance.googleapis.com/ResourceMaintenance\022\022\n" + + "\tpage_size\030\211R \001(\005\022\023\n\n" + + "page_token\030\212R \001(\t\022\017\n" + + "\006filter\030\213R \001(\t\022\021\n" + + "\010order_by\030\214R \001(\t\"\250\001\n" + + " ListResourceMaintenancesResponse\022T\n" + + "\025resource_maintenances\030\215R \003(\0132" + + "4.google.cloud.maintenance.api.v1.ResourceMaintenance\022\030\n" + + "\017next_page_token\030\216R \001(\t\022\024\n" + + "\013unreachable\030\217R \003(\t\"f\n" + + "\035GetResourceMaintenanceRequest\022E\n" + + "\004name\030\221N \001(\tB6\340A\002\372A0\n" + + ".maintenance.googleapis.com/ResourceMaintenance*c\n" + + "\023MaintenanceCategory\022$\n" + + " MAINTENANCE_CATEGORY_UNSPECIFIED\020\000\022\022\n" + + "\016INFRASTRUCTURE\020\001\022\022\n" + + "\016SERVICE_UPDATE\020\0032\222\006\n" + + "\013Maintenance\022\353\001\n" + + "\025SummarizeMaintenances\022=.google.cloud.maintenance.api.v1.SummarizeMaintena" + + "ncesRequest\032>.google.cloud.maintenance.a" + + "pi.v1.SummarizeMaintenancesResponse\"S\332A\006" + + "parent\202\323\344\223\002D\022B/v1/{parent=projects/*/loc" + + "ations/*}/resourceMaintenances:summarize\022\352\001\n" + + "\030ListResourceMaintenances\022@.google.cloud.maintenance.api.v1.ListResourceMain" + + "tenancesRequest\032A.google.cloud.maintenance.api.v1.ListResourceMaintenancesRespon" + + "se\"I\332A\006parent\202\323\344\223\002:\0228/v1/{parent=project" + + "s/*/locations/*}/resourceMaintenances\022\327\001\n" + + "\026GetResourceMaintenance\022>.google.cloud.maintenance.api.v1.GetResourceMaintenanc" + + "eRequest\0324.google.cloud.maintenance.api." + + "v1.ResourceMaintenance\"G\332A\004name\202\323\344\223\002:\0228/" + + "v1/{name=projects/*/locations/*/resource" + + "Maintenances/*}\032N\312A\032maintenance.googleap" + + "is.com\322A.https://www.googleapis.com/auth/cloud-platformBo\n" + + "#com.google.cloud.maintenance.api.v1B\017UMMServiceProtoP\001Z5cloud" + + ".google.com/go/maintenance/api/apiv1/apipb;apipbb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.FieldInfoProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_maintenance_api_v1_SummarizeMaintenancesRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_maintenance_api_v1_SummarizeMaintenancesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_maintenance_api_v1_SummarizeMaintenancesRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", "OrderBy", + }); + internal_static_google_cloud_maintenance_api_v1_SummarizeMaintenancesResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_maintenance_api_v1_SummarizeMaintenancesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_maintenance_api_v1_SummarizeMaintenancesResponse_descriptor, + new java.lang.String[] { + "Maintenances", "NextPageToken", "Unreachable", + }); + internal_static_google_cloud_maintenance_api_v1_MaintenanceSummary_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_maintenance_api_v1_MaintenanceSummary_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_maintenance_api_v1_MaintenanceSummary_descriptor, + new java.lang.String[] { + "MaintenanceName", + "Title", + "Description", + "Category", + "MaintenanceScheduledStartTime", + "MaintenanceScheduledEndTime", + "MaintenanceStartTime", + "MaintenanceEndTime", + "UserControllable", + "Controls", + "Stats", + }); + internal_static_google_cloud_maintenance_api_v1_MaintenanceSummary_Stats_descriptor = + internal_static_google_cloud_maintenance_api_v1_MaintenanceSummary_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_maintenance_api_v1_MaintenanceSummary_Stats_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_maintenance_api_v1_MaintenanceSummary_Stats_descriptor, + new java.lang.String[] { + "GroupBy", "Aggregates", + }); + internal_static_google_cloud_maintenance_api_v1_MaintenanceSummary_Aggregate_descriptor = + internal_static_google_cloud_maintenance_api_v1_MaintenanceSummary_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_maintenance_api_v1_MaintenanceSummary_Aggregate_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_maintenance_api_v1_MaintenanceSummary_Aggregate_descriptor, + new java.lang.String[] { + "Group", "Count", + }); + internal_static_google_cloud_maintenance_api_v1_ResourceMaintenance_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_maintenance_api_v1_ResourceMaintenance_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_maintenance_api_v1_ResourceMaintenance_descriptor, + new java.lang.String[] { + "Name", + "Resource", + "Maintenance", + "State", + "CreateTime", + "UpdateTime", + "MaintenanceStartTime", + "MaintenanceEndTime", + "MaintenanceCancelTime", + "MaintenanceScheduledStartTime", + "MaintenanceScheduledEndTime", + "UserControllable", + "Controls", + "Labels", + "Annotations", + "Uid", + "Etag", + }); + internal_static_google_cloud_maintenance_api_v1_ResourceMaintenance_Resource_descriptor = + internal_static_google_cloud_maintenance_api_v1_ResourceMaintenance_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_maintenance_api_v1_ResourceMaintenance_Resource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_maintenance_api_v1_ResourceMaintenance_Resource_descriptor, + new java.lang.String[] { + "ResourceName", "Location", "Type", + }); + internal_static_google_cloud_maintenance_api_v1_ResourceMaintenance_Maintenance_descriptor = + internal_static_google_cloud_maintenance_api_v1_ResourceMaintenance_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_maintenance_api_v1_ResourceMaintenance_Maintenance_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_maintenance_api_v1_ResourceMaintenance_Maintenance_descriptor, + new java.lang.String[] { + "MaintenanceName", "Title", "Description", "Category", + }); + internal_static_google_cloud_maintenance_api_v1_ResourceMaintenance_LabelsEntry_descriptor = + internal_static_google_cloud_maintenance_api_v1_ResourceMaintenance_descriptor + .getNestedTypes() + .get(2); + internal_static_google_cloud_maintenance_api_v1_ResourceMaintenance_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_maintenance_api_v1_ResourceMaintenance_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_maintenance_api_v1_ResourceMaintenance_AnnotationsEntry_descriptor = + internal_static_google_cloud_maintenance_api_v1_ResourceMaintenance_descriptor + .getNestedTypes() + .get(3); + internal_static_google_cloud_maintenance_api_v1_ResourceMaintenance_AnnotationsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_maintenance_api_v1_ResourceMaintenance_AnnotationsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_maintenance_api_v1_MaintenanceControl_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_maintenance_api_v1_MaintenanceControl_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_maintenance_api_v1_MaintenanceControl_descriptor, + new java.lang.String[] { + "Control", "IsCustom", "Documentation", + }); + internal_static_google_cloud_maintenance_api_v1_ListResourceMaintenancesRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_maintenance_api_v1_ListResourceMaintenancesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_maintenance_api_v1_ListResourceMaintenancesRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", "OrderBy", + }); + internal_static_google_cloud_maintenance_api_v1_ListResourceMaintenancesResponse_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_maintenance_api_v1_ListResourceMaintenancesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_maintenance_api_v1_ListResourceMaintenancesResponse_descriptor, + new java.lang.String[] { + "ResourceMaintenances", "NextPageToken", "Unreachable", + }); + internal_static_google_cloud_maintenance_api_v1_GetResourceMaintenanceRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_maintenance_api_v1_GetResourceMaintenanceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_maintenance_api_v1_GetResourceMaintenanceRequest_descriptor, + new java.lang.String[] { + "Name", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.FieldInfoProto.fieldInfo); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.FieldInfoProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-maintenance/proto-google-cloud-maintenance-v1/src/main/proto/google/cloud/maintenance/api/v1/maintenance_service.proto b/java-maintenance/proto-google-cloud-maintenance-v1/src/main/proto/google/cloud/maintenance/api/v1/maintenance_service.proto new file mode 100644 index 000000000000..690876d81e9c --- /dev/null +++ b/java-maintenance/proto-google-cloud-maintenance-v1/src/main/proto/google/cloud/maintenance/api/v1/maintenance_service.proto @@ -0,0 +1,445 @@ +// Copyright 2025 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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.maintenance.api.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/field_info.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/maintenance/api/apiv1/apipb;apipb"; +option java_multiple_files = true; +option java_outer_classname = "UMMServiceProto"; +option java_package = "com.google.cloud.maintenance.api.v1"; + +// Unified Maintenance service +service Maintenance { + option (google.api.default_host) = "maintenance.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Retrieves the statistics of a specific maintenance. + rpc SummarizeMaintenances(SummarizeMaintenancesRequest) + returns (SummarizeMaintenancesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/resourceMaintenances:summarize" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieve a collection of resource maintenances. + rpc ListResourceMaintenances(ListResourceMaintenancesRequest) + returns (ListResourceMaintenancesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/resourceMaintenances" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieve a single resource maintenance. + rpc GetResourceMaintenance(GetResourceMaintenanceRequest) + returns (ResourceMaintenance) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/resourceMaintenances/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// The Category of the maintenance. +enum MaintenanceCategory { + // Unspecified category. + MAINTENANCE_CATEGORY_UNSPECIFIED = 0; + + // Infrastructure maintenance events are times that Google Cloud performs + // regular maintenance on network equipment e.g. Google Cloud Interconnect + // These events are usually scheduled in advance and we provide + // notification, when possible, so that users can plan for the + // infrastructure maintenance event and prevent downtime. Infrastructure + // maintenance events don't have a set interval between occurrences, but + // generally occur several times a year. + INFRASTRUCTURE = 1; + + // Updates that can include bug fixes, changes, or new features that are + // backward compatible with existing versions (including patches). + // Some SPs allow users to control the scheduling of these maintenance + // events using maintenance windows and/or deny maintenance features. + SERVICE_UPDATE = 3; +} + +// Request message for SummarizeMaintenances custom method. +message SummarizeMaintenancesRequest { + // Required. The parent of the resource maintenance. + // eg. `projects/123/locations/*` + string parent = 10006 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "maintenance.googleapis.com/ResourceMaintenance" + } + ]; + + // The maximum number of resource maintenances to send per page. The default + // page size is 20 and the maximum is 1000. + int32 page_size = 10505; + + // The page token: If the next_page_token from a previous response + // is provided, this request will send the subsequent page. + string page_token = 10506; + + // Filter the list as specified in https://google.aip.dev/160. + // Supported fields include: + // - `state` + // - `resource.location` + // - `resource.resourceName` + // - `resource.type` + // - `maintenance.maintenanceName` + // - `maintenanceStartTime` + // - `maintenanceCompleteTime` + // Examples: + // - `state="SCHEDULED"` + // - `resource.location="us-central1-c"` + // - `resource.resourceName=~"*/instance-20241212-211259"` + // - `maintenanceStartTime>"2000-10-11T20:44:51Z"` + // - `state="SCHEDULED" OR resource.type="compute.googleapis.com/Instance"` + // - `maintenance.maitenanceName="eb3b709c-9ca1-5472-9fb6-800a3849eda1" AND + // maintenanceCompleteTime>"2000-10-11T20:44:51Z"` + string filter = 10507; + + // Order results as specified in https://google.aip.dev/132. + string order_by = 10508; +} + +// Request message for SummarizeMaintenances custom method. +message SummarizeMaintenancesResponse { + // The resulting summaries. + repeated MaintenanceSummary maintenances = 10509; + + // If present, the next page token can be provided to a subsequent + // SummarizeMaintenances call to list the next page. + // If empty, there are no more pages. + string next_page_token = 10510; + + // Unordered list. Locations that could not be reached. + repeated string unreachable = 10511 + [(google.api.field_behavior) = UNORDERED_LIST]; +} + +// MaintenanceSummary contains maintenance statistics calculated based on +// ResourceMaintenances within the scope: project and location. +message MaintenanceSummary { + // Stats indicates the type of aggregate and the corresponding aggregates. + message Stats { + // groupBy specifies the type of aggregate. + // For example a group_by might be `"state"` + string group_by = 1; + + // Aggregates is a list pairs. For example, if the + // group_by is `"state"` a possible tuple in the aggregates list could be + // "SCHEDULED" : `11`, + repeated Aggregate aggregates = 2; + } + + // Aggregate is a pair. + message Aggregate { + // Specifies what specific value of the group_by the count represents. For + // example if group_by is `"state"` its corresponding group could be + // `"SCHEDULED"`. + string group = 1; + + // The count of the group. + int64 count = 2; + } + + // Output only. The name of the maintenance. + string maintenance_name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The title of the maintenance. + string title = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The description of the maintenance. + string description = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The category of the maintenance event. + MaintenanceCategory category = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Scheduled start time of the maintenance. The maintenance will + // start at `maintenanceScheduledStartTime` or later, with best effort to + // finish before `maintenanceScheduledEndTime`. + google.protobuf.Timestamp maintenance_scheduled_start_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. An estimated (best effort, not guaranteed) end time of the + // scheduled maintenance. + google.protobuf.Timestamp maintenance_scheduled_end_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Actual date when the maintenance started. Field present only + // after the state changed to `RUNNING`. + google.protobuf.Timestamp maintenance_start_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Actual date when the maintenance successfully completed. Field + // present only after the state changed to `SUCCEEDED`. + google.protobuf.Timestamp maintenance_end_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Indicates whether the user has some control over that + // maintenance, either proactively before maintenance was scheduled with + // maintenance policy or with reactive controls after it was scheduled (see + // controls field). + bool user_controllable = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Control available for that Maintenance (might not be available + // for every resource that maintenance is applied to). + repeated MaintenanceControl controls = 14 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Stats is a field of ResourceMaintenance used to aggregate the + // stats. + repeated Stats stats = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// ResourceMaintenance is a resource that represents a maintenance operation +// on a resource. +message ResourceMaintenance { + option (google.api.resource) = { + type: "maintenance.googleapis.com/ResourceMaintenance" + pattern: "projects/{project}/locations/{location}/resourceMaintenances/{resource_maintenance}" + plural: "resourceMaintenances" + singular: "resourceMaintenance" + }; + + // Resource contains information about the resource affected by maintenance. + message Resource { + // Output only. Name is the reference to the consumer resource affected by + // the maintenance. Available values can be found here: + // https://cloud.google.com/asset-inventory/docs/asset-names + string resource_name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The location of the resource. + // Format: + // `us-central1` + string location = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The type of the resource. + // Available values can be found here: + // https://cloud.google.com/asset-inventory/docs/asset-types#supported_resource_types + // Please note that not all the resource types will have their maintenances + // reported. + string type = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Maintenance is the maintenance details of a resource's maintenance. + message Maintenance { + // Maintenance is the name of the corresponding maintenance resource + // following the standard naming scheme: `"{maintenance-id}"` + string maintenance_name = 1; + + // Output only. The title of the maintenance. + string title = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The description of the maintenance. + string description = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The category of the maintenance. + MaintenanceCategory category = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // State is the state of a resource maintenance. + enum State { + // Unspecified state. + STATE_UNSPECIFIED = 0; + + // Scheduled for a particular window. For disruptive maintenance it should + // respect maintenance policy, i.e. its available windows, exclusions and + // notification period. + SCHEDULED = 1; + + // Maintenance is ongoing. + RUNNING = 2; + + // No longer planned, typically when other maintenance (e.g. upgrade to + // newer version) already happened, or the user skipped the maintenance. + CANCELLED = 3; + + // Successfully completed. + SUCCEEDED = 4; + } + + // Identifier. The name of the resource_maintenance resource. + // Format: + // `"projects/{project}/locations/{location}/resourceMaintenance/{resource-maintenance-id}"` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Output only. The resource spec of the resource maintenance. + Resource resource = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The details of the maintenance. + Maintenance maintenance = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The state of the resource maintenance. + State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The create time of the resource maintenance. + google.protobuf.Timestamp create_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The update time of the resource maintenance. + google.protobuf.Timestamp update_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the resource maintenance has started. + google.protobuf.Timestamp maintenance_start_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the resource maintenance has completed. + google.protobuf.Timestamp maintenance_end_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the resource maintenance was cancelled. + google.protobuf.Timestamp maintenance_cancel_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the maintenance on the resource was scheduled to + // start. + google.protobuf.Timestamp maintenance_scheduled_start_time = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the maintenance on the resource was scheduled to + // end. + google.protobuf.Timestamp maintenance_scheduled_end_time = 11 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Indicates whether the user has some control over that + // maintenance, either proactively before maintenance was scheduled with + // maintenance policy or with reactive controls after it was scheduled (see + // controls field) + bool user_controllable = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The controls of the maintenance. + repeated MaintenanceControl controls = 13 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The labels on the resource, which can be used for categorization. + // similar to Kubernetes resource labels. + map labels = 10401 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Annotations is an unstructured key-value map stored with a + // resource that may be set by external tools to store and retrieve arbitrary + // metadata. They are not queryable and should be preserved when modifying + // objects. + // + // More info: https://kubernetes.io/docs/user-guide/annotations + map annotations = 10402 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The unique identifier of the resource. UID is unique in the + // time and space for this resource within the scope of the service. It is + // typically generated by the server on successful creation of a resource + // and must not be changed. UID is used to uniquely identify resources + // with resource name reuses. This should be a UUID4. + string uid = 10201 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // Output only. An opaque value that uniquely identifies a version or + // generation of a resource. It can be used to confirm that the client + // and server agree on the ordering of a resource being written. + string etag = 10202 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The control of the maintenance. +message MaintenanceControl { + // Sets the type of control supported. comment (as in logs). + enum Control { + // Unspecified control. + CONTROL_UNSPECIFIED = 0; + + // Apply control. + APPLY = 1; + + // Manage policy control. + MANAGE_POLICY = 2; + + // Reschedule control. + RESCHEDULE = 3; + } + + // The control of the resource maintenance. + Control control = 1; + + // Indicates whether the control is available only in Service Producer API + // (not through Unified Maintenance). + bool is_custom = 2; + + // Link to Service Producer documentation about maintenance control. Provided + // only when `isCustom` is `true`. + string documentation = 3; +} + +// The request structure for the ListResourceMaintenances method. +message ListResourceMaintenancesRequest { + // Required. The parent of the resource maintenance. + string parent = 10006 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "maintenance.googleapis.com/ResourceMaintenance" + } + ]; + + // The maximum number of resource maintenances to send per page. + int32 page_size = 10505; + + // The page token: If the next_page_token from a previous response + // is provided, this request will send the subsequent page. + string page_token = 10506; + + // Filter the list as specified in https://google.aip.dev/160. + string filter = 10507; + + // Order results as specified in https://google.aip.dev/132. + string order_by = 10508; +} + +// The response structure for the ListResourceMaintenances method. +message ListResourceMaintenancesResponse { + // The resulting resource maintenances. + repeated ResourceMaintenance resource_maintenances = 10509; + + // If present, the next page token can be provided to a subsequent + // ListResourceMaintenances call to list the next page. + // If empty, there are no more pages. + string next_page_token = 10510; + + // Locations that could not be reached. + repeated string unreachable = 10511; +} + +// The request structure for the GetResourceMaintenance method. +message GetResourceMaintenanceRequest { + // Required. The resource name of the resource within a service. + string name = 10001 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "maintenance.googleapis.com/ResourceMaintenance" + } + ]; +} diff --git a/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/create/SyncCreateSetCredentialsProvider.java b/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..c92ace711c5a --- /dev/null +++ b/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,44 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.maintenance.api.v1.samples; + +// [START maintenance_v1_generated_Maintenance_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.maintenance.api.v1.MaintenanceClient; +import com.google.cloud.maintenance.api.v1.MaintenanceSettings; +import com.google.cloud.maintenance.api.v1.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // 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 + MaintenanceSettings maintenanceSettings = + MaintenanceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + MaintenanceClient maintenanceClient = MaintenanceClient.create(maintenanceSettings); + } +} +// [END maintenance_v1_generated_Maintenance_Create_SetCredentialsProvider_sync] diff --git a/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/create/SyncCreateSetEndpoint.java b/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..9b3dc3e3ff78 --- /dev/null +++ b/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/create/SyncCreateSetEndpoint.java @@ -0,0 +1,41 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.maintenance.api.v1.samples; + +// [START maintenance_v1_generated_Maintenance_Create_SetEndpoint_sync] +import com.google.cloud.maintenance.api.v1.MaintenanceClient; +import com.google.cloud.maintenance.api.v1.MaintenanceSettings; +import com.google.cloud.maintenance.api.v1.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // 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 + MaintenanceSettings maintenanceSettings = + MaintenanceSettings.newBuilder().setEndpoint(myEndpoint).build(); + MaintenanceClient maintenanceClient = MaintenanceClient.create(maintenanceSettings); + } +} +// [END maintenance_v1_generated_Maintenance_Create_SetEndpoint_sync] diff --git a/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/create/SyncCreateUseHttpJsonTransport.java b/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/create/SyncCreateUseHttpJsonTransport.java new file mode 100644 index 000000000000..e9a0c5adb9e2 --- /dev/null +++ b/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/create/SyncCreateUseHttpJsonTransport.java @@ -0,0 +1,39 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.maintenance.api.v1.samples; + +// [START maintenance_v1_generated_Maintenance_Create_UseHttpJsonTransport_sync] +import com.google.cloud.maintenance.api.v1.MaintenanceClient; +import com.google.cloud.maintenance.api.v1.MaintenanceSettings; + +public class SyncCreateUseHttpJsonTransport { + + public static void main(String[] args) throws Exception { + syncCreateUseHttpJsonTransport(); + } + + public static void syncCreateUseHttpJsonTransport() throws Exception { + // 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 + MaintenanceSettings maintenanceSettings = MaintenanceSettings.newHttpJsonBuilder().build(); + MaintenanceClient maintenanceClient = MaintenanceClient.create(maintenanceSettings); + } +} +// [END maintenance_v1_generated_Maintenance_Create_UseHttpJsonTransport_sync] diff --git a/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/getlocation/AsyncGetLocation.java b/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/getlocation/AsyncGetLocation.java new file mode 100644 index 000000000000..6bec5dd6b1c7 --- /dev/null +++ b/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/getlocation/AsyncGetLocation.java @@ -0,0 +1,45 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.maintenance.api.v1.samples; + +// [START maintenance_v1_generated_Maintenance_GetLocation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; +import com.google.cloud.maintenance.api.v1.MaintenanceClient; + +public class AsyncGetLocation { + + public static void main(String[] args) throws Exception { + asyncGetLocation(); + } + + public static void asyncGetLocation() throws Exception { + // 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 (MaintenanceClient maintenanceClient = MaintenanceClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + ApiFuture future = maintenanceClient.getLocationCallable().futureCall(request); + // Do something. + Location response = future.get(); + } + } +} +// [END maintenance_v1_generated_Maintenance_GetLocation_async] diff --git a/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/getlocation/SyncGetLocation.java b/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/getlocation/SyncGetLocation.java new file mode 100644 index 000000000000..e29045987a7d --- /dev/null +++ b/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/getlocation/SyncGetLocation.java @@ -0,0 +1,42 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.maintenance.api.v1.samples; + +// [START maintenance_v1_generated_Maintenance_GetLocation_sync] +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; +import com.google.cloud.maintenance.api.v1.MaintenanceClient; + +public class SyncGetLocation { + + public static void main(String[] args) throws Exception { + syncGetLocation(); + } + + public static void syncGetLocation() throws Exception { + // 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 (MaintenanceClient maintenanceClient = MaintenanceClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + Location response = maintenanceClient.getLocation(request); + } + } +} +// [END maintenance_v1_generated_Maintenance_GetLocation_sync] diff --git a/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/getresourcemaintenance/AsyncGetResourceMaintenance.java b/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/getresourcemaintenance/AsyncGetResourceMaintenance.java new file mode 100644 index 000000000000..371ce0678f27 --- /dev/null +++ b/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/getresourcemaintenance/AsyncGetResourceMaintenance.java @@ -0,0 +1,52 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.maintenance.api.v1.samples; + +// [START maintenance_v1_generated_Maintenance_GetResourceMaintenance_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest; +import com.google.cloud.maintenance.api.v1.MaintenanceClient; +import com.google.cloud.maintenance.api.v1.ResourceMaintenance; +import com.google.cloud.maintenance.api.v1.ResourceMaintenanceName; + +public class AsyncGetResourceMaintenance { + + public static void main(String[] args) throws Exception { + asyncGetResourceMaintenance(); + } + + public static void asyncGetResourceMaintenance() throws Exception { + // 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 (MaintenanceClient maintenanceClient = MaintenanceClient.create()) { + GetResourceMaintenanceRequest request = + GetResourceMaintenanceRequest.newBuilder() + .setName( + ResourceMaintenanceName.of("[PROJECT]", "[LOCATION]", "[RESOURCE_MAINTENANCE]") + .toString()) + .build(); + ApiFuture future = + maintenanceClient.getResourceMaintenanceCallable().futureCall(request); + // Do something. + ResourceMaintenance response = future.get(); + } + } +} +// [END maintenance_v1_generated_Maintenance_GetResourceMaintenance_async] diff --git a/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/getresourcemaintenance/SyncGetResourceMaintenance.java b/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/getresourcemaintenance/SyncGetResourceMaintenance.java new file mode 100644 index 000000000000..77f289d67e32 --- /dev/null +++ b/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/getresourcemaintenance/SyncGetResourceMaintenance.java @@ -0,0 +1,48 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.maintenance.api.v1.samples; + +// [START maintenance_v1_generated_Maintenance_GetResourceMaintenance_sync] +import com.google.cloud.maintenance.api.v1.GetResourceMaintenanceRequest; +import com.google.cloud.maintenance.api.v1.MaintenanceClient; +import com.google.cloud.maintenance.api.v1.ResourceMaintenance; +import com.google.cloud.maintenance.api.v1.ResourceMaintenanceName; + +public class SyncGetResourceMaintenance { + + public static void main(String[] args) throws Exception { + syncGetResourceMaintenance(); + } + + public static void syncGetResourceMaintenance() throws Exception { + // 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 (MaintenanceClient maintenanceClient = MaintenanceClient.create()) { + GetResourceMaintenanceRequest request = + GetResourceMaintenanceRequest.newBuilder() + .setName( + ResourceMaintenanceName.of("[PROJECT]", "[LOCATION]", "[RESOURCE_MAINTENANCE]") + .toString()) + .build(); + ResourceMaintenance response = maintenanceClient.getResourceMaintenance(request); + } + } +} +// [END maintenance_v1_generated_Maintenance_GetResourceMaintenance_sync] diff --git a/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/getresourcemaintenance/SyncGetResourceMaintenanceResourcemaintenancename.java b/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/getresourcemaintenance/SyncGetResourceMaintenanceResourcemaintenancename.java new file mode 100644 index 000000000000..65d4eb19727e --- /dev/null +++ b/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/getresourcemaintenance/SyncGetResourceMaintenanceResourcemaintenancename.java @@ -0,0 +1,43 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.maintenance.api.v1.samples; + +// [START maintenance_v1_generated_Maintenance_GetResourceMaintenance_Resourcemaintenancename_sync] +import com.google.cloud.maintenance.api.v1.MaintenanceClient; +import com.google.cloud.maintenance.api.v1.ResourceMaintenance; +import com.google.cloud.maintenance.api.v1.ResourceMaintenanceName; + +public class SyncGetResourceMaintenanceResourcemaintenancename { + + public static void main(String[] args) throws Exception { + syncGetResourceMaintenanceResourcemaintenancename(); + } + + public static void syncGetResourceMaintenanceResourcemaintenancename() throws Exception { + // 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 (MaintenanceClient maintenanceClient = MaintenanceClient.create()) { + ResourceMaintenanceName name = + ResourceMaintenanceName.of("[PROJECT]", "[LOCATION]", "[RESOURCE_MAINTENANCE]"); + ResourceMaintenance response = maintenanceClient.getResourceMaintenance(name); + } + } +} +// [END maintenance_v1_generated_Maintenance_GetResourceMaintenance_Resourcemaintenancename_sync] diff --git a/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/getresourcemaintenance/SyncGetResourceMaintenanceString.java b/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/getresourcemaintenance/SyncGetResourceMaintenanceString.java new file mode 100644 index 000000000000..8932db248dc3 --- /dev/null +++ b/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/getresourcemaintenance/SyncGetResourceMaintenanceString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.maintenance.api.v1.samples; + +// [START maintenance_v1_generated_Maintenance_GetResourceMaintenance_String_sync] +import com.google.cloud.maintenance.api.v1.MaintenanceClient; +import com.google.cloud.maintenance.api.v1.ResourceMaintenance; +import com.google.cloud.maintenance.api.v1.ResourceMaintenanceName; + +public class SyncGetResourceMaintenanceString { + + public static void main(String[] args) throws Exception { + syncGetResourceMaintenanceString(); + } + + public static void syncGetResourceMaintenanceString() throws Exception { + // 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 (MaintenanceClient maintenanceClient = MaintenanceClient.create()) { + String name = + ResourceMaintenanceName.of("[PROJECT]", "[LOCATION]", "[RESOURCE_MAINTENANCE]") + .toString(); + ResourceMaintenance response = maintenanceClient.getResourceMaintenance(name); + } + } +} +// [END maintenance_v1_generated_Maintenance_GetResourceMaintenance_String_sync] diff --git a/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/listlocations/AsyncListLocations.java b/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/listlocations/AsyncListLocations.java new file mode 100644 index 000000000000..8863521ebd40 --- /dev/null +++ b/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/listlocations/AsyncListLocations.java @@ -0,0 +1,54 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.maintenance.api.v1.samples; + +// [START maintenance_v1_generated_Maintenance_ListLocations_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.cloud.maintenance.api.v1.MaintenanceClient; + +public class AsyncListLocations { + + public static void main(String[] args) throws Exception { + asyncListLocations(); + } + + public static void asyncListLocations() throws Exception { + // 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 (MaintenanceClient maintenanceClient = MaintenanceClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + maintenanceClient.listLocationsPagedCallable().futureCall(request); + // Do something. + for (Location element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END maintenance_v1_generated_Maintenance_ListLocations_async] diff --git a/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/listlocations/AsyncListLocationsPaged.java b/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/listlocations/AsyncListLocationsPaged.java new file mode 100644 index 000000000000..ae5eca58f5f6 --- /dev/null +++ b/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/listlocations/AsyncListLocationsPaged.java @@ -0,0 +1,61 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.maintenance.api.v1.samples; + +// [START maintenance_v1_generated_Maintenance_ListLocations_Paged_async] +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.maintenance.api.v1.MaintenanceClient; +import com.google.common.base.Strings; + +public class AsyncListLocationsPaged { + + public static void main(String[] args) throws Exception { + asyncListLocationsPaged(); + } + + public static void asyncListLocationsPaged() throws Exception { + // 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 (MaintenanceClient maintenanceClient = MaintenanceClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListLocationsResponse response = maintenanceClient.listLocationsCallable().call(request); + for (Location element : response.getLocationsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END maintenance_v1_generated_Maintenance_ListLocations_Paged_async] diff --git a/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/listlocations/SyncListLocations.java b/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/listlocations/SyncListLocations.java new file mode 100644 index 000000000000..6daa0fc9d71c --- /dev/null +++ b/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/listlocations/SyncListLocations.java @@ -0,0 +1,50 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.maintenance.api.v1.samples; + +// [START maintenance_v1_generated_Maintenance_ListLocations_sync] +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.cloud.maintenance.api.v1.MaintenanceClient; + +public class SyncListLocations { + + public static void main(String[] args) throws Exception { + syncListLocations(); + } + + public static void syncListLocations() throws Exception { + // 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 (MaintenanceClient maintenanceClient = MaintenanceClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Location element : maintenanceClient.listLocations(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END maintenance_v1_generated_Maintenance_ListLocations_sync] diff --git a/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/listresourcemaintenances/AsyncListResourceMaintenances.java b/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/listresourcemaintenances/AsyncListResourceMaintenances.java new file mode 100644 index 000000000000..16ccc65f1e11 --- /dev/null +++ b/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/listresourcemaintenances/AsyncListResourceMaintenances.java @@ -0,0 +1,56 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.maintenance.api.v1.samples; + +// [START maintenance_v1_generated_Maintenance_ListResourceMaintenances_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest; +import com.google.cloud.maintenance.api.v1.LocationName; +import com.google.cloud.maintenance.api.v1.MaintenanceClient; +import com.google.cloud.maintenance.api.v1.ResourceMaintenance; + +public class AsyncListResourceMaintenances { + + public static void main(String[] args) throws Exception { + asyncListResourceMaintenances(); + } + + public static void asyncListResourceMaintenances() throws Exception { + // 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 (MaintenanceClient maintenanceClient = MaintenanceClient.create()) { + ListResourceMaintenancesRequest request = + ListResourceMaintenancesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + ApiFuture future = + maintenanceClient.listResourceMaintenancesPagedCallable().futureCall(request); + // Do something. + for (ResourceMaintenance element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END maintenance_v1_generated_Maintenance_ListResourceMaintenances_async] diff --git a/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/listresourcemaintenances/AsyncListResourceMaintenancesPaged.java b/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/listresourcemaintenances/AsyncListResourceMaintenancesPaged.java new file mode 100644 index 000000000000..12cf4716ab2d --- /dev/null +++ b/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/listresourcemaintenances/AsyncListResourceMaintenancesPaged.java @@ -0,0 +1,64 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.maintenance.api.v1.samples; + +// [START maintenance_v1_generated_Maintenance_ListResourceMaintenances_Paged_async] +import com.google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest; +import com.google.cloud.maintenance.api.v1.ListResourceMaintenancesResponse; +import com.google.cloud.maintenance.api.v1.LocationName; +import com.google.cloud.maintenance.api.v1.MaintenanceClient; +import com.google.cloud.maintenance.api.v1.ResourceMaintenance; +import com.google.common.base.Strings; + +public class AsyncListResourceMaintenancesPaged { + + public static void main(String[] args) throws Exception { + asyncListResourceMaintenancesPaged(); + } + + public static void asyncListResourceMaintenancesPaged() throws Exception { + // 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 (MaintenanceClient maintenanceClient = MaintenanceClient.create()) { + ListResourceMaintenancesRequest request = + ListResourceMaintenancesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + while (true) { + ListResourceMaintenancesResponse response = + maintenanceClient.listResourceMaintenancesCallable().call(request); + for (ResourceMaintenance element : response.getResourceMaintenancesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END maintenance_v1_generated_Maintenance_ListResourceMaintenances_Paged_async] diff --git a/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/listresourcemaintenances/SyncListResourceMaintenances.java b/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/listresourcemaintenances/SyncListResourceMaintenances.java new file mode 100644 index 000000000000..3a28f123e4bd --- /dev/null +++ b/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/listresourcemaintenances/SyncListResourceMaintenances.java @@ -0,0 +1,53 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.maintenance.api.v1.samples; + +// [START maintenance_v1_generated_Maintenance_ListResourceMaintenances_sync] +import com.google.cloud.maintenance.api.v1.ListResourceMaintenancesRequest; +import com.google.cloud.maintenance.api.v1.LocationName; +import com.google.cloud.maintenance.api.v1.MaintenanceClient; +import com.google.cloud.maintenance.api.v1.ResourceMaintenance; + +public class SyncListResourceMaintenances { + + public static void main(String[] args) throws Exception { + syncListResourceMaintenances(); + } + + public static void syncListResourceMaintenances() throws Exception { + // 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 (MaintenanceClient maintenanceClient = MaintenanceClient.create()) { + ListResourceMaintenancesRequest request = + ListResourceMaintenancesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + for (ResourceMaintenance element : + maintenanceClient.listResourceMaintenances(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END maintenance_v1_generated_Maintenance_ListResourceMaintenances_sync] diff --git a/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/listresourcemaintenances/SyncListResourceMaintenancesLocationname.java b/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/listresourcemaintenances/SyncListResourceMaintenancesLocationname.java new file mode 100644 index 000000000000..bf74e98851b2 --- /dev/null +++ b/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/listresourcemaintenances/SyncListResourceMaintenancesLocationname.java @@ -0,0 +1,45 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.maintenance.api.v1.samples; + +// [START maintenance_v1_generated_Maintenance_ListResourceMaintenances_Locationname_sync] +import com.google.cloud.maintenance.api.v1.LocationName; +import com.google.cloud.maintenance.api.v1.MaintenanceClient; +import com.google.cloud.maintenance.api.v1.ResourceMaintenance; + +public class SyncListResourceMaintenancesLocationname { + + public static void main(String[] args) throws Exception { + syncListResourceMaintenancesLocationname(); + } + + public static void syncListResourceMaintenancesLocationname() throws Exception { + // 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 (MaintenanceClient maintenanceClient = MaintenanceClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + for (ResourceMaintenance element : + maintenanceClient.listResourceMaintenances(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END maintenance_v1_generated_Maintenance_ListResourceMaintenances_Locationname_sync] diff --git a/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/listresourcemaintenances/SyncListResourceMaintenancesString.java b/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/listresourcemaintenances/SyncListResourceMaintenancesString.java new file mode 100644 index 000000000000..4ee9bfcb3ffe --- /dev/null +++ b/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/listresourcemaintenances/SyncListResourceMaintenancesString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.maintenance.api.v1.samples; + +// [START maintenance_v1_generated_Maintenance_ListResourceMaintenances_String_sync] +import com.google.cloud.maintenance.api.v1.LocationName; +import com.google.cloud.maintenance.api.v1.MaintenanceClient; +import com.google.cloud.maintenance.api.v1.ResourceMaintenance; + +public class SyncListResourceMaintenancesString { + + public static void main(String[] args) throws Exception { + syncListResourceMaintenancesString(); + } + + public static void syncListResourceMaintenancesString() throws Exception { + // 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 (MaintenanceClient maintenanceClient = MaintenanceClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + for (ResourceMaintenance element : + maintenanceClient.listResourceMaintenances(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END maintenance_v1_generated_Maintenance_ListResourceMaintenances_String_sync] diff --git a/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/summarizemaintenances/AsyncSummarizeMaintenances.java b/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/summarizemaintenances/AsyncSummarizeMaintenances.java new file mode 100644 index 000000000000..9dda8e241e99 --- /dev/null +++ b/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/summarizemaintenances/AsyncSummarizeMaintenances.java @@ -0,0 +1,56 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.maintenance.api.v1.samples; + +// [START maintenance_v1_generated_Maintenance_SummarizeMaintenances_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.maintenance.api.v1.LocationName; +import com.google.cloud.maintenance.api.v1.MaintenanceClient; +import com.google.cloud.maintenance.api.v1.MaintenanceSummary; +import com.google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest; + +public class AsyncSummarizeMaintenances { + + public static void main(String[] args) throws Exception { + asyncSummarizeMaintenances(); + } + + public static void asyncSummarizeMaintenances() throws Exception { + // 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 (MaintenanceClient maintenanceClient = MaintenanceClient.create()) { + SummarizeMaintenancesRequest request = + SummarizeMaintenancesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + ApiFuture future = + maintenanceClient.summarizeMaintenancesPagedCallable().futureCall(request); + // Do something. + for (MaintenanceSummary element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END maintenance_v1_generated_Maintenance_SummarizeMaintenances_async] diff --git a/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/summarizemaintenances/AsyncSummarizeMaintenancesPaged.java b/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/summarizemaintenances/AsyncSummarizeMaintenancesPaged.java new file mode 100644 index 000000000000..57369967b508 --- /dev/null +++ b/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/summarizemaintenances/AsyncSummarizeMaintenancesPaged.java @@ -0,0 +1,64 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.maintenance.api.v1.samples; + +// [START maintenance_v1_generated_Maintenance_SummarizeMaintenances_Paged_async] +import com.google.cloud.maintenance.api.v1.LocationName; +import com.google.cloud.maintenance.api.v1.MaintenanceClient; +import com.google.cloud.maintenance.api.v1.MaintenanceSummary; +import com.google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest; +import com.google.cloud.maintenance.api.v1.SummarizeMaintenancesResponse; +import com.google.common.base.Strings; + +public class AsyncSummarizeMaintenancesPaged { + + public static void main(String[] args) throws Exception { + asyncSummarizeMaintenancesPaged(); + } + + public static void asyncSummarizeMaintenancesPaged() throws Exception { + // 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 (MaintenanceClient maintenanceClient = MaintenanceClient.create()) { + SummarizeMaintenancesRequest request = + SummarizeMaintenancesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + while (true) { + SummarizeMaintenancesResponse response = + maintenanceClient.summarizeMaintenancesCallable().call(request); + for (MaintenanceSummary element : response.getMaintenancesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END maintenance_v1_generated_Maintenance_SummarizeMaintenances_Paged_async] diff --git a/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/summarizemaintenances/SyncSummarizeMaintenances.java b/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/summarizemaintenances/SyncSummarizeMaintenances.java new file mode 100644 index 000000000000..dbbc3e5c87e6 --- /dev/null +++ b/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/summarizemaintenances/SyncSummarizeMaintenances.java @@ -0,0 +1,53 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.maintenance.api.v1.samples; + +// [START maintenance_v1_generated_Maintenance_SummarizeMaintenances_sync] +import com.google.cloud.maintenance.api.v1.LocationName; +import com.google.cloud.maintenance.api.v1.MaintenanceClient; +import com.google.cloud.maintenance.api.v1.MaintenanceSummary; +import com.google.cloud.maintenance.api.v1.SummarizeMaintenancesRequest; + +public class SyncSummarizeMaintenances { + + public static void main(String[] args) throws Exception { + syncSummarizeMaintenances(); + } + + public static void syncSummarizeMaintenances() throws Exception { + // 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 (MaintenanceClient maintenanceClient = MaintenanceClient.create()) { + SummarizeMaintenancesRequest request = + SummarizeMaintenancesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + for (MaintenanceSummary element : + maintenanceClient.summarizeMaintenances(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END maintenance_v1_generated_Maintenance_SummarizeMaintenances_sync] diff --git a/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/summarizemaintenances/SyncSummarizeMaintenancesLocationname.java b/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/summarizemaintenances/SyncSummarizeMaintenancesLocationname.java new file mode 100644 index 000000000000..932319f82a5c --- /dev/null +++ b/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/summarizemaintenances/SyncSummarizeMaintenancesLocationname.java @@ -0,0 +1,45 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.maintenance.api.v1.samples; + +// [START maintenance_v1_generated_Maintenance_SummarizeMaintenances_Locationname_sync] +import com.google.cloud.maintenance.api.v1.LocationName; +import com.google.cloud.maintenance.api.v1.MaintenanceClient; +import com.google.cloud.maintenance.api.v1.MaintenanceSummary; + +public class SyncSummarizeMaintenancesLocationname { + + public static void main(String[] args) throws Exception { + syncSummarizeMaintenancesLocationname(); + } + + public static void syncSummarizeMaintenancesLocationname() throws Exception { + // 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 (MaintenanceClient maintenanceClient = MaintenanceClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + for (MaintenanceSummary element : + maintenanceClient.summarizeMaintenances(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END maintenance_v1_generated_Maintenance_SummarizeMaintenances_Locationname_sync] diff --git a/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/summarizemaintenances/SyncSummarizeMaintenancesString.java b/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/summarizemaintenances/SyncSummarizeMaintenancesString.java new file mode 100644 index 000000000000..fc30206126e6 --- /dev/null +++ b/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenance/summarizemaintenances/SyncSummarizeMaintenancesString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.maintenance.api.v1.samples; + +// [START maintenance_v1_generated_Maintenance_SummarizeMaintenances_String_sync] +import com.google.cloud.maintenance.api.v1.LocationName; +import com.google.cloud.maintenance.api.v1.MaintenanceClient; +import com.google.cloud.maintenance.api.v1.MaintenanceSummary; + +public class SyncSummarizeMaintenancesString { + + public static void main(String[] args) throws Exception { + syncSummarizeMaintenancesString(); + } + + public static void syncSummarizeMaintenancesString() throws Exception { + // 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 (MaintenanceClient maintenanceClient = MaintenanceClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + for (MaintenanceSummary element : + maintenanceClient.summarizeMaintenances(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END maintenance_v1_generated_Maintenance_SummarizeMaintenances_String_sync] diff --git a/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenancesettings/getresourcemaintenance/SyncGetResourceMaintenance.java b/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenancesettings/getresourcemaintenance/SyncGetResourceMaintenance.java new file mode 100644 index 000000000000..8422d33d1b1c --- /dev/null +++ b/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/maintenancesettings/getresourcemaintenance/SyncGetResourceMaintenance.java @@ -0,0 +1,55 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.maintenance.api.v1.samples; + +// [START maintenance_v1_generated_MaintenanceSettings_GetResourceMaintenance_sync] +import com.google.cloud.maintenance.api.v1.MaintenanceSettings; +import java.time.Duration; + +public class SyncGetResourceMaintenance { + + public static void main(String[] args) throws Exception { + syncGetResourceMaintenance(); + } + + public static void syncGetResourceMaintenance() throws Exception { + // 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 + MaintenanceSettings.Builder maintenanceSettingsBuilder = MaintenanceSettings.newBuilder(); + maintenanceSettingsBuilder + .getResourceMaintenanceSettings() + .setRetrySettings( + maintenanceSettingsBuilder + .getResourceMaintenanceSettings() + .getRetrySettings() + .toBuilder() + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) + .build()); + MaintenanceSettings maintenanceSettings = maintenanceSettingsBuilder.build(); + } +} +// [END maintenance_v1_generated_MaintenanceSettings_GetResourceMaintenance_sync] diff --git a/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/stub/maintenancestubsettings/getresourcemaintenance/SyncGetResourceMaintenance.java b/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/stub/maintenancestubsettings/getresourcemaintenance/SyncGetResourceMaintenance.java new file mode 100644 index 000000000000..b83318d856fe --- /dev/null +++ b/java-maintenance/samples/snippets/generated/com/google/cloud/maintenance/api/v1/stub/maintenancestubsettings/getresourcemaintenance/SyncGetResourceMaintenance.java @@ -0,0 +1,56 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.maintenance.api.v1.stub.samples; + +// [START maintenance_v1_generated_MaintenanceStubSettings_GetResourceMaintenance_sync] +import com.google.cloud.maintenance.api.v1.stub.MaintenanceStubSettings; +import java.time.Duration; + +public class SyncGetResourceMaintenance { + + public static void main(String[] args) throws Exception { + syncGetResourceMaintenance(); + } + + public static void syncGetResourceMaintenance() throws Exception { + // 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 + MaintenanceStubSettings.Builder maintenanceSettingsBuilder = + MaintenanceStubSettings.newBuilder(); + maintenanceSettingsBuilder + .getResourceMaintenanceSettings() + .setRetrySettings( + maintenanceSettingsBuilder + .getResourceMaintenanceSettings() + .getRetrySettings() + .toBuilder() + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) + .build()); + MaintenanceStubSettings maintenanceSettings = maintenanceSettingsBuilder.build(); + } +} +// [END maintenance_v1_generated_MaintenanceStubSettings_GetResourceMaintenance_sync] diff --git a/versions.txt b/versions.txt index 6e808fd45f7d..54315c658ce1 100644 --- a/versions.txt +++ b/versions.txt @@ -929,6 +929,8 @@ grpc-google-cloud-databasecenter-v1beta:0.1.0:0.2.0-SNAPSHOT google-cloud-hypercomputecluster:0.0.0:0.0.1-SNAPSHOT proto-google-cloud-hypercomputecluster-v1beta:0.0.0:0.0.1-SNAPSHOT grpc-google-cloud-hypercomputecluster-v1beta:0.0.0:0.0.1-SNAPSHOT +proto-google-cloud-maintenance-v1:0.14.0:0.15.0-SNAPSHOT +grpc-google-cloud-maintenance-v1:0.14.0:0.15.0-SNAPSHOT google-cloud-gkerecommender:0.0.0:0.0.1-SNAPSHOT proto-google-cloud-gkerecommender-v1:0.0.0:0.0.1-SNAPSHOT grpc-google-cloud-gkerecommender-v1:0.0.0:0.0.1-SNAPSHOT