diff --git a/.github/workflows/generate_new_client.yaml b/.github/workflows/generate_new_client.yaml index d263b7b5a90e..b7a359bff757 100644 --- a/.github/workflows/generate_new_client.yaml +++ b/.github/workflows/generate_new_client.yaml @@ -114,8 +114,8 @@ jobs: - name: Push to branch and create PR run: | set -x - [ -z "`git config user.email`" ] && git config --global user.email "${USERNAME:-script}@google.com" - [ -z "`git config user.name`" ] && git config --global user.name "${USERNAME:-script}" + [ -z "`git config user.email`" ] && git config --global user.email "cloud-java-bot@google.com" + [ -z "`git config user.name`" ] && git config --global user.name "cloud-java-bot" # create and push to branch in origin # random_id allows multiple runs of this workflow @@ -125,7 +125,7 @@ jobs: git add --all commit_message="feat: [${API_SHORTNAME}] new module for ${API_SHORTNAME}" git commit -m "${commit_message}" - git remote add monorepo https://${{ github.actor }}:${{ github.token }}@github.com/${{ github.repository }}.git + git remote add monorepo https://cloud-java-bot:${GH_TOKEN}@github.com/${{ github.repository }}.git git fetch -q --unshallow monorepo git push -f monorepo "${branch_name}" diff --git a/gapic-libraries-bom/pom.xml b/gapic-libraries-bom/pom.xml index e467b1a52c98..66b6c2cc4ccb 100644 --- a/gapic-libraries-bom/pom.xml +++ b/gapic-libraries-bom/pom.xml @@ -959,6 +959,13 @@ pom import + + com.google.cloud + google-cloud-servicehealth-bom + 0.0.1-SNAPSHOT + pom + import + com.google.cloud google-cloud-service-management-bom diff --git a/java-servicehealth/.OwlBot.yaml b/java-servicehealth/.OwlBot.yaml new file mode 100644 index 000000000000..6e6b51e795da --- /dev/null +++ b/java-servicehealth/.OwlBot.yaml @@ -0,0 +1,36 @@ +# Copyright 2022 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. + + +deep-remove-regex: +- "/java-servicehealth/grpc-google-.*/src" +- "/java-servicehealth/proto-google-.*/src" +- "/java-servicehealth/google-.*/src" +- "/java-servicehealth/samples/snippets/generated" + +deep-preserve-regex: +- "/java-servicehealth/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java" + +deep-copy-regex: +- source: "/google/cloud/servicehealth/(v.*)/.*-java/proto-google-.*/src" + dest: "/owl-bot-staging/java-servicehealth/$1/proto-google-cloud-servicehealth-$1/src" +- source: "/google/cloud/servicehealth/(v.*)/.*-java/grpc-google-.*/src" + dest: "/owl-bot-staging/java-servicehealth/$1/grpc-google-cloud-servicehealth-$1/src" +- source: "/google/cloud/servicehealth/(v.*)/.*-java/gapic-google-.*/src" + dest: "/owl-bot-staging/java-servicehealth/$1/google-cloud-servicehealth/src" +- source: "/google/cloud/servicehealth/(v.*)/.*-java/samples/snippets/generated" + dest: "/owl-bot-staging/java-servicehealth/$1/samples/snippets/generated" + + +api-name: servicehealth \ No newline at end of file diff --git a/java-servicehealth/.repo-metadata.json b/java-servicehealth/.repo-metadata.json new file mode 100644 index 000000000000..dbfb19b26461 --- /dev/null +++ b/java-servicehealth/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "api_shortname": "servicehealth", + "name_pretty": "Service Health API", + "product_documentation": "https://cloud.google.com/service-health/docs/overview", + "api_description": "Personalized Service Health helps you gain visibility into disruptive events impacting Google Cloud products.", + "client_documentation": "https://cloud.google.com/java/docs/reference/google-cloud-servicehealth/latest/overview", + "release_level": "preview", + "transport": "both", + "language": "java", + "repo": "googleapis/java-servicehealth", + "repo_short": "java-servicehealth", + "distribution_name": "com.google.cloud:google-cloud-servicehealth", + "api_id": "servicehealth.googleapis.com", + "library_type": "GAPIC_AUTO", + "requires_billing": true, + "rpc_documentation": "https://cloud.google.com/service-health/docs/reference/rpc" +} \ No newline at end of file diff --git a/java-servicehealth/README.md b/java-servicehealth/README.md new file mode 100644 index 000000000000..c073be202ea8 --- /dev/null +++ b/java-servicehealth/README.md @@ -0,0 +1,225 @@ +# Google Service Health API Client for Java + +Java idiomatic client for [Service Health API][product-docs]. + +[![Maven][maven-version-image]][maven-version-link] +![Stability][stability-image] + +- [Product Documentation][product-docs] +- [Client Library Documentation][javadocs] + +> Note: This client is a work-in-progress, and may occasionally +> make backwards-incompatible changes. + + +## Quickstart + + +If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: + +```xml + + + + com.google.cloud + libraries-bom + 26.30.0 + pom + import + + + + + + + com.google.cloud + google-cloud-servicehealth + +``` + +If you are using Maven without the BOM, add this to your dependencies: + + + +```xml + + com.google.cloud + google-cloud-servicehealth + 0.0.0 + +``` + +If you are using Gradle without BOM, add this to your dependencies: + +```Groovy +implementation 'com.google.cloud:google-cloud-servicehealth:0.0.0' +``` + +If you are using SBT, add this to your dependencies: + +```Scala +libraryDependencies += "com.google.cloud" % "google-cloud-servicehealth" % "0.0.0" +``` + + +## Authentication + +See the [Authentication][authentication] section in the base directory's README. + +## Authorization + +The client application making API calls must be granted [authorization scopes][auth-scopes] required for the desired Service Health API APIs, and the authenticated principal must have the [IAM role(s)][predefined-iam-roles] required to access GCP resources using the Service Health API API calls. + +## Getting Started + +### Prerequisites + +You will need a [Google Cloud Platform Console][developer-console] project with the Service Health API [API enabled][enable-api]. +You will need to [enable billing][enable-billing] to use Google Service Health API. +[Follow these instructions][create-project] to get your project set up. You will also need to set up the local development environment by +[installing the Google Cloud Command Line Interface][cloud-cli] and running the following commands in command line: +`gcloud auth login` and `gcloud config set project [YOUR PROJECT ID]`. + +### Installation and setup + +You'll need to obtain the `google-cloud-servicehealth` library. See the [Quickstart](#quickstart) section +to add `google-cloud-servicehealth` as a dependency in your code. + +## About Service Health API + + +[Service Health API][product-docs] Personalized Service Health helps you gain visibility into disruptive events impacting Google Cloud products. + +See the [Service Health API client library docs][javadocs] to learn how to +use this Service Health API Client Library. + + + + + + +## Troubleshooting + +To get help, follow the instructions in the [shared Troubleshooting document][troubleshooting]. + +## Transport + +Service Health API uses both gRPC and HTTP/JSON for the transport layer. + +## Supported Java Versions + +Java 8 or above is required for using this client. + +Google's Java client libraries, +[Google Cloud Client Libraries][cloudlibs] +and +[Google Cloud API Libraries][apilibs], +follow the +[Oracle Java SE support roadmap][oracle] +(see the Oracle Java SE Product Releases section). + +### For new development + +In general, new feature development occurs with support for the lowest Java +LTS version covered by Oracle's Premier Support (which typically lasts 5 years +from initial General Availability). If the minimum required JVM for a given +library is changed, it is accompanied by a [semver][semver] major release. + +Java 11 and (in September 2021) Java 17 are the best choices for new +development. + +### Keeping production systems current + +Google tests its client libraries with all current LTS versions covered by +Oracle's Extended Support (which typically lasts 8 years from initial +General Availability). + +#### Legacy support + +Google's client libraries support legacy versions of Java runtimes with long +term stable libraries that don't receive feature updates on a best efforts basis +as it may not be possible to backport all patches. + +Google provides updates on a best efforts basis to apps that continue to use +Java 7, though apps might need to upgrade to current versions of the library +that supports their JVM. + +#### Where to find specific information + +The latest versions and the supported Java versions are identified on +the individual GitHub repository `github.com/GoogleAPIs/java-SERVICENAME` +and on [google-cloud-java][g-c-j]. + +## Versioning + + +This library follows [Semantic Versioning](http://semver.org/). + + +It is currently in major version zero (``0.y.z``), which means that anything may change at any time +and the public API should not be considered stable. + + +## Contributing + + +Contributions to this library are always welcome and highly encouraged. + +See [CONTRIBUTING][contributing] for more information how to get started. + +Please note that this project is released with a Contributor Code of Conduct. By participating in +this project you agree to abide by its terms. See [Code of Conduct][code-of-conduct] for more +information. + + +## License + +Apache 2.0 - See [LICENSE][license] for more information. + +## CI Status + +Java Version | Status +------------ | ------ +Java 8 | [![Kokoro CI][kokoro-badge-image-2]][kokoro-badge-link-2] +Java 8 OSX | [![Kokoro CI][kokoro-badge-image-3]][kokoro-badge-link-3] +Java 8 Windows | [![Kokoro CI][kokoro-badge-image-4]][kokoro-badge-link-4] +Java 11 | [![Kokoro CI][kokoro-badge-image-5]][kokoro-badge-link-5] + +Java is a registered trademark of Oracle and/or its affiliates. + +[product-docs]: https://cloud.google.com/service-health/docs/overview +[javadocs]: https://cloud.google.com/java/docs/reference/google-cloud-servicehealth/latest/overview +[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-servicehealth/java7.svg +[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-servicehealth/java7.html +[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-servicehealth/java8.svg +[kokoro-badge-link-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-servicehealth/java8.html +[kokoro-badge-image-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-servicehealth/java8-osx.svg +[kokoro-badge-link-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-servicehealth/java8-osx.html +[kokoro-badge-image-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-servicehealth/java8-win.svg +[kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-servicehealth/java8-win.html +[kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-servicehealth/java11.svg +[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-servicehealth/java11.html +[stability-image]: https://img.shields.io/badge/stability-preview-yellow +[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-servicehealth.svg +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-servicehealth/0.0.0 +[authentication]: https://github.com/googleapis/google-cloud-java#authentication +[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes +[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles +[iam-policy]: https://cloud.google.com/iam/docs/overview#cloud-iam-policy +[developer-console]: https://console.developers.google.com/ +[create-project]: https://cloud.google.com/resource-manager/docs/creating-managing-projects +[cloud-cli]: https://cloud.google.com/cli +[troubleshooting]: https://github.com/googleapis/google-cloud-java/blob/main/TROUBLESHOOTING.md +[contributing]: https://github.com/googleapis/java-servicehealth/blob/main/CONTRIBUTING.md +[code-of-conduct]: https://github.com/googleapis/java-servicehealth/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct +[license]: https://github.com/googleapis/java-servicehealth/blob/main/LICENSE +[enable-billing]: https://cloud.google.com/apis/docs/getting-started#enabling_billing +[enable-api]: https://console.cloud.google.com/flows/enableapi?apiid=servicehealth.googleapis.com +[libraries-bom]: https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google-Cloud-Platform-Libraries-BOM +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png + +[semver]: https://semver.org/ +[cloudlibs]: https://cloud.google.com/apis/docs/client-libraries-explained +[apilibs]: https://cloud.google.com/apis/docs/client-libraries-explained#google_api_client_libraries +[oracle]: https://www.oracle.com/java/technologies/java-se-support-roadmap.html +[g-c-j]: http://github.com/googleapis/google-cloud-java diff --git a/java-servicehealth/google-cloud-servicehealth-bom/pom.xml b/java-servicehealth/google-cloud-servicehealth-bom/pom.xml new file mode 100644 index 000000000000..daa83602c6ed --- /dev/null +++ b/java-servicehealth/google-cloud-servicehealth-bom/pom.xml @@ -0,0 +1,44 @@ + + + 4.0.0 + com.google.cloud + google-cloud-servicehealth-bom + 0.0.1-SNAPSHOT + pom + + + com.google.cloud + google-cloud-pom-parent + 1.28.0-SNAPSHOT + ../../google-cloud-pom-parent/pom.xml + + + Google Service Health API BOM + + BOM for Service Health API + + + + true + + + + + + com.google.cloud + google-cloud-servicehealth + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-servicehealth-v1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-servicehealth-v1 + 0.0.1-SNAPSHOT + + + + diff --git a/java-servicehealth/google-cloud-servicehealth/pom.xml b/java-servicehealth/google-cloud-servicehealth/pom.xml new file mode 100644 index 000000000000..3f2807adf708 --- /dev/null +++ b/java-servicehealth/google-cloud-servicehealth/pom.xml @@ -0,0 +1,113 @@ + + + 4.0.0 + com.google.cloud + google-cloud-servicehealth + 0.0.1-SNAPSHOT + jar + Google Service Health API + Service Health API Personalized Service Health helps you gain visibility into disruptive events impacting Google Cloud products. + + com.google.cloud + google-cloud-servicehealth-parent + 0.0.1-SNAPSHOT + + + google-cloud-servicehealth + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.api + api-common + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + + com.google.api.grpc + proto-google-cloud-servicehealth-v1 + + + com.google.guava + guava + + + com.google.api + gax + + + com.google.api + gax-grpc + + + com.google.api + gax-httpjson + + + com.google.api.grpc + grpc-google-common-protos + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.api.grpc + grpc-google-iam-v1 + + + org.threeten + threetenbp + + + + + junit + junit + test + + + + com.google.api.grpc + grpc-google-cloud-servicehealth-v1 + test + + + + com.google.api + gax + testlib + test + + + com.google.api + gax-grpc + testlib + test + + + com.google.api + gax-httpjson + testlib + test + + + diff --git a/java-servicehealth/google-cloud-servicehealth/src/main/java/com/google/cloud/servicehealth/v1/ServiceHealthClient.java b/java-servicehealth/google-cloud-servicehealth/src/main/java/com/google/cloud/servicehealth/v1/ServiceHealthClient.java new file mode 100644 index 000000000000..a31f30e2c10b --- /dev/null +++ b/java-servicehealth/google-cloud-servicehealth/src/main/java/com/google/cloud/servicehealth/v1/ServiceHealthClient.java @@ -0,0 +1,1749 @@ +/* + * Copyright 2023 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.servicehealth.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.servicehealth.v1.stub.ServiceHealthStub; +import com.google.cloud.servicehealth.v1.stub.ServiceHealthStubSettings; +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: Request service health events relevant to your Google Cloud project. + * + *

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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) {
+ *   EventName name = EventName.of("[PROJECT]", "[LOCATION]", "[EVENT]");
+ *   Event response = serviceHealthClient.getEvent(name);
+ * }
+ * }
+ * + *

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

ListEvents

Lists events under a given project and location.

+ *

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

+ *
    + *
  • listEvents(ListEventsRequest request) + *

+ *

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

+ *
    + *
  • listEvents(LocationName parent) + *

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

+ *
    + *
  • listEventsPagedCallable() + *

  • listEventsCallable() + *

+ *

GetEvent

Retrieves a resource containing information about an event.

+ *

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

+ *
    + *
  • getEvent(GetEventRequest request) + *

+ *

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

+ *
    + *
  • getEvent(EventName name) + *

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

+ *
    + *
  • getEventCallable() + *

+ *

ListOrganizationEvents

Lists organization events under a given organization and location.

+ *

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

+ *
    + *
  • listOrganizationEvents(ListOrganizationEventsRequest request) + *

+ *

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

+ *
    + *
  • listOrganizationEvents(OrganizationLocationName parent) + *

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

+ *
    + *
  • listOrganizationEventsPagedCallable() + *

  • listOrganizationEventsCallable() + *

+ *

GetOrganizationEvent

Retrieves a resource containing information about an event affecting an organization .

+ *

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

+ *
    + *
  • getOrganizationEvent(GetOrganizationEventRequest request) + *

+ *

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

+ *
    + *
  • getOrganizationEvent(OrganizationEventName name) + *

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

+ *
    + *
  • getOrganizationEventCallable() + *

+ *

ListOrganizationImpacts

Lists assets impacted by organization events under a given organization and location.

+ *

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

+ *
    + *
  • listOrganizationImpacts(ListOrganizationImpactsRequest request) + *

+ *

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

+ *
    + *
  • listOrganizationImpacts(OrganizationLocationName parent) + *

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

+ *
    + *
  • listOrganizationImpactsPagedCallable() + *

  • listOrganizationImpactsCallable() + *

+ *

GetOrganizationImpact

Retrieves a resource containing information about impact to an asset under an organization affected by a service health event.

+ *

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

+ *
    + *
  • getOrganizationImpact(GetOrganizationImpactRequest request) + *

+ *

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

+ *
    + *
  • getOrganizationImpact(OrganizationImpactName name) + *

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

+ *
    + *
  • getOrganizationImpactCallable() + *

+ *

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 ServiceHealthSettings 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
+ * ServiceHealthSettings serviceHealthSettings =
+ *     ServiceHealthSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * ServiceHealthClient serviceHealthClient = ServiceHealthClient.create(serviceHealthSettings);
+ * }
+ * + *

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
+ * ServiceHealthSettings serviceHealthSettings =
+ *     ServiceHealthSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * ServiceHealthClient serviceHealthClient = ServiceHealthClient.create(serviceHealthSettings);
+ * }
+ * + *

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
+ * ServiceHealthSettings serviceHealthSettings =
+ *     ServiceHealthSettings.newHttpJsonBuilder().build();
+ * ServiceHealthClient serviceHealthClient = ServiceHealthClient.create(serviceHealthSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class ServiceHealthClient implements BackgroundResource { + private final ServiceHealthSettings settings; + private final ServiceHealthStub stub; + + /** Constructs an instance of ServiceHealthClient with default settings. */ + public static final ServiceHealthClient create() throws IOException { + return create(ServiceHealthSettings.newBuilder().build()); + } + + /** + * Constructs an instance of ServiceHealthClient, 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 ServiceHealthClient create(ServiceHealthSettings settings) + throws IOException { + return new ServiceHealthClient(settings); + } + + /** + * Constructs an instance of ServiceHealthClient, using the given stub for making calls. This is + * for advanced usage - prefer using create(ServiceHealthSettings). + */ + public static final ServiceHealthClient create(ServiceHealthStub stub) { + return new ServiceHealthClient(stub); + } + + /** + * Constructs an instance of ServiceHealthClient, 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 ServiceHealthClient(ServiceHealthSettings settings) throws IOException { + this.settings = settings; + this.stub = ((ServiceHealthStubSettings) settings.getStubSettings()).createStub(); + } + + protected ServiceHealthClient(ServiceHealthStub stub) { + this.settings = null; + this.stub = stub; + } + + public final ServiceHealthSettings getSettings() { + return settings; + } + + public ServiceHealthStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists events under a given project and 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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Event element : serviceHealthClient.listEvents(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent value using the form + * `projects/{project_id}/locations/{location}/events`. + *

`project_id` - ID of the project for which to list service health events. `location` - + * The location to get the service health events from. To retrieve service health events of + * category = INCIDENT, use `location` = `global`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListEventsPagedResponse listEvents(LocationName parent) { + ListEventsRequest request = + ListEventsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + return listEvents(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists events under a given project and 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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   for (Event element : serviceHealthClient.listEvents(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent value using the form + * `projects/{project_id}/locations/{location}/events`. + *

`project_id` - ID of the project for which to list service health events. `location` - + * The location to get the service health events from. To retrieve service health events of + * category = INCIDENT, use `location` = `global`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListEventsPagedResponse listEvents(String parent) { + ListEventsRequest request = ListEventsRequest.newBuilder().setParent(parent).build(); + return listEvents(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists events under a given project and 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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) {
+   *   ListEventsRequest request =
+   *       ListEventsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setView(EventView.forNumber(0))
+   *           .build();
+   *   for (Event element : serviceHealthClient.listEvents(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 ListEventsPagedResponse listEvents(ListEventsRequest request) { + return listEventsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists events under a given project and 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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) {
+   *   ListEventsRequest request =
+   *       ListEventsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setView(EventView.forNumber(0))
+   *           .build();
+   *   ApiFuture future = serviceHealthClient.listEventsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Event element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listEventsPagedCallable() { + return stub.listEventsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists events under a given project and 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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) {
+   *   ListEventsRequest request =
+   *       ListEventsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setView(EventView.forNumber(0))
+   *           .build();
+   *   while (true) {
+   *     ListEventsResponse response = serviceHealthClient.listEventsCallable().call(request);
+   *     for (Event element : response.getEventsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listEventsCallable() { + return stub.listEventsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a resource containing information about an event. + * + *

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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) {
+   *   EventName name = EventName.of("[PROJECT]", "[LOCATION]", "[EVENT]");
+   *   Event response = serviceHealthClient.getEvent(name);
+   * }
+   * }
+ * + * @param name Required. Unique name of the event in this scope including project and location + * using the form `projects/{project_id}/locations/{location}/events/{event_id}`. + *

`project_id` - Project ID of the project that contains the event. <br> `location` + * - The location to get the service health events from. <br> `event_id` - Event ID to + * retrieve. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Event getEvent(EventName name) { + GetEventRequest request = + GetEventRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getEvent(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a resource containing information about an event. + * + *

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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) {
+   *   String name = EventName.of("[PROJECT]", "[LOCATION]", "[EVENT]").toString();
+   *   Event response = serviceHealthClient.getEvent(name);
+   * }
+   * }
+ * + * @param name Required. Unique name of the event in this scope including project and location + * using the form `projects/{project_id}/locations/{location}/events/{event_id}`. + *

`project_id` - Project ID of the project that contains the event. <br> `location` + * - The location to get the service health events from. <br> `event_id` - Event ID to + * retrieve. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Event getEvent(String name) { + GetEventRequest request = GetEventRequest.newBuilder().setName(name).build(); + return getEvent(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a resource containing information about an event. + * + *

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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) {
+   *   GetEventRequest request =
+   *       GetEventRequest.newBuilder()
+   *           .setName(EventName.of("[PROJECT]", "[LOCATION]", "[EVENT]").toString())
+   *           .build();
+   *   Event response = serviceHealthClient.getEvent(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 Event getEvent(GetEventRequest request) { + return getEventCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a resource containing information about an event. + * + *

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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) {
+   *   GetEventRequest request =
+   *       GetEventRequest.newBuilder()
+   *           .setName(EventName.of("[PROJECT]", "[LOCATION]", "[EVENT]").toString())
+   *           .build();
+   *   ApiFuture future = serviceHealthClient.getEventCallable().futureCall(request);
+   *   // Do something.
+   *   Event response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getEventCallable() { + return stub.getEventCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists organization events under a given organization and 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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) {
+   *   OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]");
+   *   for (OrganizationEvent element :
+   *       serviceHealthClient.listOrganizationEvents(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent value using the form + * `organizations/{organization_id}/locations/{location}/organizationEvents`. + *

`organization_id` - ID (number) of the project that contains the event. To get your + * `organization_id`, see [Getting your organization resource + * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).<br> + * `location` - The location to get the service health events from. To retrieve service health + * events of category = INCIDENT, use `location` = `global`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListOrganizationEventsPagedResponse listOrganizationEvents( + OrganizationLocationName parent) { + ListOrganizationEventsRequest request = + ListOrganizationEventsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listOrganizationEvents(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists organization events under a given organization and 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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) {
+   *   String parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString();
+   *   for (OrganizationEvent element :
+   *       serviceHealthClient.listOrganizationEvents(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent value using the form + * `organizations/{organization_id}/locations/{location}/organizationEvents`. + *

`organization_id` - ID (number) of the project that contains the event. To get your + * `organization_id`, see [Getting your organization resource + * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).<br> + * `location` - The location to get the service health events from. To retrieve service health + * events of category = INCIDENT, use `location` = `global`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListOrganizationEventsPagedResponse listOrganizationEvents(String parent) { + ListOrganizationEventsRequest request = + ListOrganizationEventsRequest.newBuilder().setParent(parent).build(); + return listOrganizationEvents(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists organization events under a given organization and 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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) {
+   *   ListOrganizationEventsRequest request =
+   *       ListOrganizationEventsRequest.newBuilder()
+   *           .setParent(OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setView(OrganizationEventView.forNumber(0))
+   *           .build();
+   *   for (OrganizationEvent element :
+   *       serviceHealthClient.listOrganizationEvents(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 ListOrganizationEventsPagedResponse listOrganizationEvents( + ListOrganizationEventsRequest request) { + return listOrganizationEventsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists organization events under a given organization and 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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) {
+   *   ListOrganizationEventsRequest request =
+   *       ListOrganizationEventsRequest.newBuilder()
+   *           .setParent(OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setView(OrganizationEventView.forNumber(0))
+   *           .build();
+   *   ApiFuture future =
+   *       serviceHealthClient.listOrganizationEventsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (OrganizationEvent element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listOrganizationEventsPagedCallable() { + return stub.listOrganizationEventsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists organization events under a given organization and 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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) {
+   *   ListOrganizationEventsRequest request =
+   *       ListOrganizationEventsRequest.newBuilder()
+   *           .setParent(OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setView(OrganizationEventView.forNumber(0))
+   *           .build();
+   *   while (true) {
+   *     ListOrganizationEventsResponse response =
+   *         serviceHealthClient.listOrganizationEventsCallable().call(request);
+   *     for (OrganizationEvent element : response.getOrganizationEventsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listOrganizationEventsCallable() { + return stub.listOrganizationEventsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a resource containing information about an event affecting an organization . + * + *

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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) {
+   *   OrganizationEventName name =
+   *       OrganizationEventName.of("[ORGANIZATION]", "[LOCATION]", "[EVENT]");
+   *   OrganizationEvent response = serviceHealthClient.getOrganizationEvent(name);
+   * }
+   * }
+ * + * @param name Required. Unique name of the event in this scope including organization and event + * ID using the form + * `organizations/{organization_id}/locations/locations/global/organizationEvents/{event_id}`. + *

`organization_id` - ID (number) of the project that contains the event. To get your + * `organization_id`, see [Getting your organization resource + * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).<br> + * `event_id` - Organization event ID to retrieve. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OrganizationEvent getOrganizationEvent(OrganizationEventName name) { + GetOrganizationEventRequest request = + GetOrganizationEventRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getOrganizationEvent(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a resource containing information about an event affecting an organization . + * + *

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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) {
+   *   String name = OrganizationEventName.of("[ORGANIZATION]", "[LOCATION]", "[EVENT]").toString();
+   *   OrganizationEvent response = serviceHealthClient.getOrganizationEvent(name);
+   * }
+   * }
+ * + * @param name Required. Unique name of the event in this scope including organization and event + * ID using the form + * `organizations/{organization_id}/locations/locations/global/organizationEvents/{event_id}`. + *

`organization_id` - ID (number) of the project that contains the event. To get your + * `organization_id`, see [Getting your organization resource + * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).<br> + * `event_id` - Organization event ID to retrieve. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OrganizationEvent getOrganizationEvent(String name) { + GetOrganizationEventRequest request = + GetOrganizationEventRequest.newBuilder().setName(name).build(); + return getOrganizationEvent(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a resource containing information about an event affecting an organization . + * + *

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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) {
+   *   GetOrganizationEventRequest request =
+   *       GetOrganizationEventRequest.newBuilder()
+   *           .setName(
+   *               OrganizationEventName.of("[ORGANIZATION]", "[LOCATION]", "[EVENT]").toString())
+   *           .build();
+   *   OrganizationEvent response = serviceHealthClient.getOrganizationEvent(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 OrganizationEvent getOrganizationEvent(GetOrganizationEventRequest request) { + return getOrganizationEventCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a resource containing information about an event affecting an organization . + * + *

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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) {
+   *   GetOrganizationEventRequest request =
+   *       GetOrganizationEventRequest.newBuilder()
+   *           .setName(
+   *               OrganizationEventName.of("[ORGANIZATION]", "[LOCATION]", "[EVENT]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       serviceHealthClient.getOrganizationEventCallable().futureCall(request);
+   *   // Do something.
+   *   OrganizationEvent response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + getOrganizationEventCallable() { + return stub.getOrganizationEventCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists assets impacted by organization events under a given organization and 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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) {
+   *   OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]");
+   *   for (OrganizationImpact element :
+   *       serviceHealthClient.listOrganizationImpacts(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent value using the form + * `organizations/{organization_id}/locations/{location}/organizationImpacts`. + *

`organization_id` - ID (number) of the project that contains the event. To get your + * `organization_id`, see [Getting your organization resource + * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListOrganizationImpactsPagedResponse listOrganizationImpacts( + OrganizationLocationName parent) { + ListOrganizationImpactsRequest request = + ListOrganizationImpactsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listOrganizationImpacts(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists assets impacted by organization events under a given organization and 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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) {
+   *   String parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString();
+   *   for (OrganizationImpact element :
+   *       serviceHealthClient.listOrganizationImpacts(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent value using the form + * `organizations/{organization_id}/locations/{location}/organizationImpacts`. + *

`organization_id` - ID (number) of the project that contains the event. To get your + * `organization_id`, see [Getting your organization resource + * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListOrganizationImpactsPagedResponse listOrganizationImpacts(String parent) { + ListOrganizationImpactsRequest request = + ListOrganizationImpactsRequest.newBuilder().setParent(parent).build(); + return listOrganizationImpacts(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists assets impacted by organization events under a given organization and 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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) {
+   *   ListOrganizationImpactsRequest request =
+   *       ListOrganizationImpactsRequest.newBuilder()
+   *           .setParent(OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   for (OrganizationImpact element :
+   *       serviceHealthClient.listOrganizationImpacts(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 ListOrganizationImpactsPagedResponse listOrganizationImpacts( + ListOrganizationImpactsRequest request) { + return listOrganizationImpactsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists assets impacted by organization events under a given organization and 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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) {
+   *   ListOrganizationImpactsRequest request =
+   *       ListOrganizationImpactsRequest.newBuilder()
+   *           .setParent(OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   ApiFuture future =
+   *       serviceHealthClient.listOrganizationImpactsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (OrganizationImpact element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listOrganizationImpactsPagedCallable() { + return stub.listOrganizationImpactsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists assets impacted by organization events under a given organization and 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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) {
+   *   ListOrganizationImpactsRequest request =
+   *       ListOrganizationImpactsRequest.newBuilder()
+   *           .setParent(OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   while (true) {
+   *     ListOrganizationImpactsResponse response =
+   *         serviceHealthClient.listOrganizationImpactsCallable().call(request);
+   *     for (OrganizationImpact element : response.getOrganizationImpactsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listOrganizationImpactsCallable() { + return stub.listOrganizationImpactsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a resource containing information about impact to an asset under an organization + * affected by a service health event. + * + *

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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) {
+   *   OrganizationImpactName name =
+   *       OrganizationImpactName.of("[ORGANIZATION]", "[LOCATION]", "[ORGANIZATION_IMPACT]");
+   *   OrganizationImpact response = serviceHealthClient.getOrganizationImpact(name);
+   * }
+   * }
+ * + * @param name Required. Name of the resource using the form + * `organizations/{organization_id}/locations/global/organizationImpacts/{organization_impact_id}`. + *

`organization_id` - ID (number) of the organization that contains the event. To get your + * `organization_id`, see [Getting your organization resource + * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).<br> + * `organization_impact_id` - ID of the [OrganizationImpact + * resource](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OrganizationImpact getOrganizationImpact(OrganizationImpactName name) { + GetOrganizationImpactRequest request = + GetOrganizationImpactRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getOrganizationImpact(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a resource containing information about impact to an asset under an organization + * affected by a service health event. + * + *

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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) {
+   *   String name =
+   *       OrganizationImpactName.of("[ORGANIZATION]", "[LOCATION]", "[ORGANIZATION_IMPACT]")
+   *           .toString();
+   *   OrganizationImpact response = serviceHealthClient.getOrganizationImpact(name);
+   * }
+   * }
+ * + * @param name Required. Name of the resource using the form + * `organizations/{organization_id}/locations/global/organizationImpacts/{organization_impact_id}`. + *

`organization_id` - ID (number) of the organization that contains the event. To get your + * `organization_id`, see [Getting your organization resource + * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).<br> + * `organization_impact_id` - ID of the [OrganizationImpact + * resource](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OrganizationImpact getOrganizationImpact(String name) { + GetOrganizationImpactRequest request = + GetOrganizationImpactRequest.newBuilder().setName(name).build(); + return getOrganizationImpact(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a resource containing information about impact to an asset under an organization + * affected by a service health event. + * + *

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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) {
+   *   GetOrganizationImpactRequest request =
+   *       GetOrganizationImpactRequest.newBuilder()
+   *           .setName(
+   *               OrganizationImpactName.of("[ORGANIZATION]", "[LOCATION]", "[ORGANIZATION_IMPACT]")
+   *                   .toString())
+   *           .build();
+   *   OrganizationImpact response = serviceHealthClient.getOrganizationImpact(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 OrganizationImpact getOrganizationImpact(GetOrganizationImpactRequest request) { + return getOrganizationImpactCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a resource containing information about impact to an asset under an organization + * affected by a service health event. + * + *

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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) {
+   *   GetOrganizationImpactRequest request =
+   *       GetOrganizationImpactRequest.newBuilder()
+   *           .setName(
+   *               OrganizationImpactName.of("[ORGANIZATION]", "[LOCATION]", "[ORGANIZATION_IMPACT]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       serviceHealthClient.getOrganizationImpactCallable().futureCall(request);
+   *   // Do something.
+   *   OrganizationImpact response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + getOrganizationImpactCallable() { + return stub.getOrganizationImpactCallable(); + } + + // 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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Location element : serviceHealthClient.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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       serviceHealthClient.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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListLocationsResponse response = serviceHealthClient.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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   Location response = serviceHealthClient.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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   ApiFuture future = serviceHealthClient.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 ListEventsPagedResponse + extends AbstractPagedListResponse< + ListEventsRequest, + ListEventsResponse, + Event, + ListEventsPage, + ListEventsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListEventsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, input -> new ListEventsPagedResponse(input), MoreExecutors.directExecutor()); + } + + private ListEventsPagedResponse(ListEventsPage page) { + super(page, ListEventsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListEventsPage + extends AbstractPage { + + private ListEventsPage( + PageContext context, + ListEventsResponse response) { + super(context, response); + } + + private static ListEventsPage createEmptyPage() { + return new ListEventsPage(null, null); + } + + @Override + protected ListEventsPage createPage( + PageContext context, + ListEventsResponse response) { + return new ListEventsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListEventsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListEventsRequest, + ListEventsResponse, + Event, + ListEventsPage, + ListEventsFixedSizeCollection> { + + private ListEventsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListEventsFixedSizeCollection createEmptyCollection() { + return new ListEventsFixedSizeCollection(null, 0); + } + + @Override + protected ListEventsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListEventsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListOrganizationEventsPagedResponse + extends AbstractPagedListResponse< + ListOrganizationEventsRequest, + ListOrganizationEventsResponse, + OrganizationEvent, + ListOrganizationEventsPage, + ListOrganizationEventsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext< + ListOrganizationEventsRequest, ListOrganizationEventsResponse, OrganizationEvent> + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListOrganizationEventsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListOrganizationEventsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListOrganizationEventsPagedResponse(ListOrganizationEventsPage page) { + super(page, ListOrganizationEventsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListOrganizationEventsPage + extends AbstractPage< + ListOrganizationEventsRequest, + ListOrganizationEventsResponse, + OrganizationEvent, + ListOrganizationEventsPage> { + + private ListOrganizationEventsPage( + PageContext< + ListOrganizationEventsRequest, ListOrganizationEventsResponse, OrganizationEvent> + context, + ListOrganizationEventsResponse response) { + super(context, response); + } + + private static ListOrganizationEventsPage createEmptyPage() { + return new ListOrganizationEventsPage(null, null); + } + + @Override + protected ListOrganizationEventsPage createPage( + PageContext< + ListOrganizationEventsRequest, ListOrganizationEventsResponse, OrganizationEvent> + context, + ListOrganizationEventsResponse response) { + return new ListOrganizationEventsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext< + ListOrganizationEventsRequest, ListOrganizationEventsResponse, OrganizationEvent> + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListOrganizationEventsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListOrganizationEventsRequest, + ListOrganizationEventsResponse, + OrganizationEvent, + ListOrganizationEventsPage, + ListOrganizationEventsFixedSizeCollection> { + + private ListOrganizationEventsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListOrganizationEventsFixedSizeCollection createEmptyCollection() { + return new ListOrganizationEventsFixedSizeCollection(null, 0); + } + + @Override + protected ListOrganizationEventsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListOrganizationEventsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListOrganizationImpactsPagedResponse + extends AbstractPagedListResponse< + ListOrganizationImpactsRequest, + ListOrganizationImpactsResponse, + OrganizationImpact, + ListOrganizationImpactsPage, + ListOrganizationImpactsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext< + ListOrganizationImpactsRequest, ListOrganizationImpactsResponse, OrganizationImpact> + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListOrganizationImpactsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListOrganizationImpactsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListOrganizationImpactsPagedResponse(ListOrganizationImpactsPage page) { + super(page, ListOrganizationImpactsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListOrganizationImpactsPage + extends AbstractPage< + ListOrganizationImpactsRequest, + ListOrganizationImpactsResponse, + OrganizationImpact, + ListOrganizationImpactsPage> { + + private ListOrganizationImpactsPage( + PageContext< + ListOrganizationImpactsRequest, ListOrganizationImpactsResponse, OrganizationImpact> + context, + ListOrganizationImpactsResponse response) { + super(context, response); + } + + private static ListOrganizationImpactsPage createEmptyPage() { + return new ListOrganizationImpactsPage(null, null); + } + + @Override + protected ListOrganizationImpactsPage createPage( + PageContext< + ListOrganizationImpactsRequest, ListOrganizationImpactsResponse, OrganizationImpact> + context, + ListOrganizationImpactsResponse response) { + return new ListOrganizationImpactsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext< + ListOrganizationImpactsRequest, ListOrganizationImpactsResponse, OrganizationImpact> + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListOrganizationImpactsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListOrganizationImpactsRequest, + ListOrganizationImpactsResponse, + OrganizationImpact, + ListOrganizationImpactsPage, + ListOrganizationImpactsFixedSizeCollection> { + + private ListOrganizationImpactsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListOrganizationImpactsFixedSizeCollection createEmptyCollection() { + return new ListOrganizationImpactsFixedSizeCollection(null, 0); + } + + @Override + protected ListOrganizationImpactsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListOrganizationImpactsFixedSizeCollection(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-servicehealth/google-cloud-servicehealth/src/main/java/com/google/cloud/servicehealth/v1/ServiceHealthSettings.java b/java-servicehealth/google-cloud-servicehealth/src/main/java/com/google/cloud/servicehealth/v1/ServiceHealthSettings.java new file mode 100644 index 000000000000..5b78a639bf53 --- /dev/null +++ b/java-servicehealth/google-cloud-servicehealth/src/main/java/com/google/cloud/servicehealth/v1/ServiceHealthSettings.java @@ -0,0 +1,309 @@ +/* + * Copyright 2023 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.servicehealth.v1; + +import static com.google.cloud.servicehealth.v1.ServiceHealthClient.ListEventsPagedResponse; +import static com.google.cloud.servicehealth.v1.ServiceHealthClient.ListLocationsPagedResponse; +import static com.google.cloud.servicehealth.v1.ServiceHealthClient.ListOrganizationEventsPagedResponse; +import static com.google.cloud.servicehealth.v1.ServiceHealthClient.ListOrganizationImpactsPagedResponse; + +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.servicehealth.v1.stub.ServiceHealthStubSettings; +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 ServiceHealthClient}. + * + *

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

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

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

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

{@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
+ * ServiceHealthSettings.Builder serviceHealthSettingsBuilder = ServiceHealthSettings.newBuilder();
+ * serviceHealthSettingsBuilder
+ *     .getEventSettings()
+ *     .setRetrySettings(
+ *         serviceHealthSettingsBuilder
+ *             .getEventSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * ServiceHealthSettings serviceHealthSettings = serviceHealthSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class ServiceHealthSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to listEvents. */ + public PagedCallSettings + listEventsSettings() { + return ((ServiceHealthStubSettings) getStubSettings()).listEventsSettings(); + } + + /** Returns the object with the settings used for calls to getEvent. */ + public UnaryCallSettings getEventSettings() { + return ((ServiceHealthStubSettings) getStubSettings()).getEventSettings(); + } + + /** Returns the object with the settings used for calls to listOrganizationEvents. */ + public PagedCallSettings< + ListOrganizationEventsRequest, + ListOrganizationEventsResponse, + ListOrganizationEventsPagedResponse> + listOrganizationEventsSettings() { + return ((ServiceHealthStubSettings) getStubSettings()).listOrganizationEventsSettings(); + } + + /** Returns the object with the settings used for calls to getOrganizationEvent. */ + public UnaryCallSettings + getOrganizationEventSettings() { + return ((ServiceHealthStubSettings) getStubSettings()).getOrganizationEventSettings(); + } + + /** Returns the object with the settings used for calls to listOrganizationImpacts. */ + public PagedCallSettings< + ListOrganizationImpactsRequest, + ListOrganizationImpactsResponse, + ListOrganizationImpactsPagedResponse> + listOrganizationImpactsSettings() { + return ((ServiceHealthStubSettings) getStubSettings()).listOrganizationImpactsSettings(); + } + + /** Returns the object with the settings used for calls to getOrganizationImpact. */ + public UnaryCallSettings + getOrganizationImpactSettings() { + return ((ServiceHealthStubSettings) getStubSettings()).getOrganizationImpactSettings(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((ServiceHealthStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((ServiceHealthStubSettings) getStubSettings()).getLocationSettings(); + } + + public static final ServiceHealthSettings create(ServiceHealthStubSettings stub) + throws IOException { + return new ServiceHealthSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return ServiceHealthStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return ServiceHealthStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return ServiceHealthStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return ServiceHealthStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return ServiceHealthStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return ServiceHealthStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return ServiceHealthStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ServiceHealthStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + @BetaApi + 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 ServiceHealthSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for ServiceHealthSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(ServiceHealthStubSettings.newBuilder(clientContext)); + } + + protected Builder(ServiceHealthSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(ServiceHealthStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(ServiceHealthStubSettings.newBuilder()); + } + + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(ServiceHealthStubSettings.newHttpJsonBuilder()); + } + + public ServiceHealthStubSettings.Builder getStubSettingsBuilder() { + return ((ServiceHealthStubSettings.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 listEvents. */ + public PagedCallSettings.Builder + listEventsSettings() { + return getStubSettingsBuilder().listEventsSettings(); + } + + /** Returns the builder for the settings used for calls to getEvent. */ + public UnaryCallSettings.Builder getEventSettings() { + return getStubSettingsBuilder().getEventSettings(); + } + + /** Returns the builder for the settings used for calls to listOrganizationEvents. */ + public PagedCallSettings.Builder< + ListOrganizationEventsRequest, + ListOrganizationEventsResponse, + ListOrganizationEventsPagedResponse> + listOrganizationEventsSettings() { + return getStubSettingsBuilder().listOrganizationEventsSettings(); + } + + /** Returns the builder for the settings used for calls to getOrganizationEvent. */ + public UnaryCallSettings.Builder + getOrganizationEventSettings() { + return getStubSettingsBuilder().getOrganizationEventSettings(); + } + + /** Returns the builder for the settings used for calls to listOrganizationImpacts. */ + public PagedCallSettings.Builder< + ListOrganizationImpactsRequest, + ListOrganizationImpactsResponse, + ListOrganizationImpactsPagedResponse> + listOrganizationImpactsSettings() { + return getStubSettingsBuilder().listOrganizationImpactsSettings(); + } + + /** Returns the builder for the settings used for calls to getOrganizationImpact. */ + public UnaryCallSettings.Builder + getOrganizationImpactSettings() { + return getStubSettingsBuilder().getOrganizationImpactSettings(); + } + + /** 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 ServiceHealthSettings build() throws IOException { + return new ServiceHealthSettings(this); + } + } +} diff --git a/java-servicehealth/google-cloud-servicehealth/src/main/java/com/google/cloud/servicehealth/v1/gapic_metadata.json b/java-servicehealth/google-cloud-servicehealth/src/main/java/com/google/cloud/servicehealth/v1/gapic_metadata.json new file mode 100644 index 000000000000..09925a92919a --- /dev/null +++ b/java-servicehealth/google-cloud-servicehealth/src/main/java/com/google/cloud/servicehealth/v1/gapic_metadata.json @@ -0,0 +1,42 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.cloud.servicehealth.v1", + "libraryPackage": "com.google.cloud.servicehealth.v1", + "services": { + "ServiceHealth": { + "clients": { + "grpc": { + "libraryClient": "ServiceHealthClient", + "rpcs": { + "GetEvent": { + "methods": ["getEvent", "getEvent", "getEvent", "getEventCallable"] + }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, + "GetOrganizationEvent": { + "methods": ["getOrganizationEvent", "getOrganizationEvent", "getOrganizationEvent", "getOrganizationEventCallable"] + }, + "GetOrganizationImpact": { + "methods": ["getOrganizationImpact", "getOrganizationImpact", "getOrganizationImpact", "getOrganizationImpactCallable"] + }, + "ListEvents": { + "methods": ["listEvents", "listEvents", "listEvents", "listEventsPagedCallable", "listEventsCallable"] + }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, + "ListOrganizationEvents": { + "methods": ["listOrganizationEvents", "listOrganizationEvents", "listOrganizationEvents", "listOrganizationEventsPagedCallable", "listOrganizationEventsCallable"] + }, + "ListOrganizationImpacts": { + "methods": ["listOrganizationImpacts", "listOrganizationImpacts", "listOrganizationImpacts", "listOrganizationImpactsPagedCallable", "listOrganizationImpactsCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/java-servicehealth/google-cloud-servicehealth/src/main/java/com/google/cloud/servicehealth/v1/package-info.java b/java-servicehealth/google-cloud-servicehealth/src/main/java/com/google/cloud/servicehealth/v1/package-info.java new file mode 100644 index 000000000000..371384901a74 --- /dev/null +++ b/java-servicehealth/google-cloud-servicehealth/src/main/java/com/google/cloud/servicehealth/v1/package-info.java @@ -0,0 +1,43 @@ +/* + * Copyright 2023 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 Service Health API + * + *

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

======================= ServiceHealthClient ======================= + * + *

Service Description: Request service health events relevant to your Google Cloud project. + * + *

Sample for ServiceHealthClient: + * + *

{@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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) {
+ *   EventName name = EventName.of("[PROJECT]", "[LOCATION]", "[EVENT]");
+ *   Event response = serviceHealthClient.getEvent(name);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.cloud.servicehealth.v1; + +import javax.annotation.Generated; diff --git a/java-servicehealth/google-cloud-servicehealth/src/main/java/com/google/cloud/servicehealth/v1/stub/GrpcServiceHealthCallableFactory.java b/java-servicehealth/google-cloud-servicehealth/src/main/java/com/google/cloud/servicehealth/v1/stub/GrpcServiceHealthCallableFactory.java new file mode 100644 index 000000000000..51440d288fe4 --- /dev/null +++ b/java-servicehealth/google-cloud-servicehealth/src/main/java/com/google/cloud/servicehealth/v1/stub/GrpcServiceHealthCallableFactory.java @@ -0,0 +1,113 @@ +/* + * Copyright 2023 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.servicehealth.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 ServiceHealth service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcServiceHealthCallableFactory 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-servicehealth/google-cloud-servicehealth/src/main/java/com/google/cloud/servicehealth/v1/stub/GrpcServiceHealthStub.java b/java-servicehealth/google-cloud-servicehealth/src/main/java/com/google/cloud/servicehealth/v1/stub/GrpcServiceHealthStub.java new file mode 100644 index 000000000000..955472ba6b92 --- /dev/null +++ b/java-servicehealth/google-cloud-servicehealth/src/main/java/com/google/cloud/servicehealth/v1/stub/GrpcServiceHealthStub.java @@ -0,0 +1,455 @@ +/* + * Copyright 2023 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.servicehealth.v1.stub; + +import static com.google.cloud.servicehealth.v1.ServiceHealthClient.ListEventsPagedResponse; +import static com.google.cloud.servicehealth.v1.ServiceHealthClient.ListLocationsPagedResponse; +import static com.google.cloud.servicehealth.v1.ServiceHealthClient.ListOrganizationEventsPagedResponse; +import static com.google.cloud.servicehealth.v1.ServiceHealthClient.ListOrganizationImpactsPagedResponse; + +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.servicehealth.v1.Event; +import com.google.cloud.servicehealth.v1.GetEventRequest; +import com.google.cloud.servicehealth.v1.GetOrganizationEventRequest; +import com.google.cloud.servicehealth.v1.GetOrganizationImpactRequest; +import com.google.cloud.servicehealth.v1.ListEventsRequest; +import com.google.cloud.servicehealth.v1.ListEventsResponse; +import com.google.cloud.servicehealth.v1.ListOrganizationEventsRequest; +import com.google.cloud.servicehealth.v1.ListOrganizationEventsResponse; +import com.google.cloud.servicehealth.v1.ListOrganizationImpactsRequest; +import com.google.cloud.servicehealth.v1.ListOrganizationImpactsResponse; +import com.google.cloud.servicehealth.v1.OrganizationEvent; +import com.google.cloud.servicehealth.v1.OrganizationImpact; +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 ServiceHealth service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcServiceHealthStub extends ServiceHealthStub { + private static final MethodDescriptor + listEventsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.servicehealth.v1.ServiceHealth/ListEvents") + .setRequestMarshaller(ProtoUtils.marshaller(ListEventsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ListEventsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getEventMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.servicehealth.v1.ServiceHealth/GetEvent") + .setRequestMarshaller(ProtoUtils.marshaller(GetEventRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Event.getDefaultInstance())) + .build(); + + private static final MethodDescriptor< + ListOrganizationEventsRequest, ListOrganizationEventsResponse> + listOrganizationEventsMethodDescriptor = + MethodDescriptor + .newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.servicehealth.v1.ServiceHealth/ListOrganizationEvents") + .setRequestMarshaller( + ProtoUtils.marshaller(ListOrganizationEventsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListOrganizationEventsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getOrganizationEventMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.servicehealth.v1.ServiceHealth/GetOrganizationEvent") + .setRequestMarshaller( + ProtoUtils.marshaller(GetOrganizationEventRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(OrganizationEvent.getDefaultInstance())) + .build(); + + private static final MethodDescriptor< + ListOrganizationImpactsRequest, ListOrganizationImpactsResponse> + listOrganizationImpactsMethodDescriptor = + MethodDescriptor + .newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.servicehealth.v1.ServiceHealth/ListOrganizationImpacts") + .setRequestMarshaller( + ProtoUtils.marshaller(ListOrganizationImpactsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListOrganizationImpactsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getOrganizationImpactMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.servicehealth.v1.ServiceHealth/GetOrganizationImpact") + .setRequestMarshaller( + ProtoUtils.marshaller(GetOrganizationImpactRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(OrganizationImpact.getDefaultInstance())) + .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())) + .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())) + .build(); + + private final UnaryCallable listEventsCallable; + private final UnaryCallable listEventsPagedCallable; + private final UnaryCallable getEventCallable; + private final UnaryCallable + listOrganizationEventsCallable; + private final UnaryCallable + listOrganizationEventsPagedCallable; + private final UnaryCallable + getOrganizationEventCallable; + private final UnaryCallable + listOrganizationImpactsCallable; + private final UnaryCallable + listOrganizationImpactsPagedCallable; + private final UnaryCallable + getOrganizationImpactCallable; + 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 GrpcServiceHealthStub create(ServiceHealthStubSettings settings) + throws IOException { + return new GrpcServiceHealthStub(settings, ClientContext.create(settings)); + } + + public static final GrpcServiceHealthStub create(ClientContext clientContext) throws IOException { + return new GrpcServiceHealthStub(ServiceHealthStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcServiceHealthStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcServiceHealthStub( + ServiceHealthStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcServiceHealthStub, 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 GrpcServiceHealthStub(ServiceHealthStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcServiceHealthCallableFactory()); + } + + /** + * Constructs an instance of GrpcServiceHealthStub, 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 GrpcServiceHealthStub( + ServiceHealthStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings listEventsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listEventsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings getEventTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getEventMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + listOrganizationEventsTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(listOrganizationEventsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings + getOrganizationEventTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getOrganizationEventMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + listOrganizationImpactsTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(listOrganizationImpactsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings + getOrganizationImpactTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getOrganizationImpactMethodDescriptor) + .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.listEventsCallable = + callableFactory.createUnaryCallable( + listEventsTransportSettings, settings.listEventsSettings(), clientContext); + this.listEventsPagedCallable = + callableFactory.createPagedCallable( + listEventsTransportSettings, settings.listEventsSettings(), clientContext); + this.getEventCallable = + callableFactory.createUnaryCallable( + getEventTransportSettings, settings.getEventSettings(), clientContext); + this.listOrganizationEventsCallable = + callableFactory.createUnaryCallable( + listOrganizationEventsTransportSettings, + settings.listOrganizationEventsSettings(), + clientContext); + this.listOrganizationEventsPagedCallable = + callableFactory.createPagedCallable( + listOrganizationEventsTransportSettings, + settings.listOrganizationEventsSettings(), + clientContext); + this.getOrganizationEventCallable = + callableFactory.createUnaryCallable( + getOrganizationEventTransportSettings, + settings.getOrganizationEventSettings(), + clientContext); + this.listOrganizationImpactsCallable = + callableFactory.createUnaryCallable( + listOrganizationImpactsTransportSettings, + settings.listOrganizationImpactsSettings(), + clientContext); + this.listOrganizationImpactsPagedCallable = + callableFactory.createPagedCallable( + listOrganizationImpactsTransportSettings, + settings.listOrganizationImpactsSettings(), + clientContext); + this.getOrganizationImpactCallable = + callableFactory.createUnaryCallable( + getOrganizationImpactTransportSettings, + settings.getOrganizationImpactSettings(), + 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 listEventsCallable() { + return listEventsCallable; + } + + @Override + public UnaryCallable listEventsPagedCallable() { + return listEventsPagedCallable; + } + + @Override + public UnaryCallable getEventCallable() { + return getEventCallable; + } + + @Override + public UnaryCallable + listOrganizationEventsCallable() { + return listOrganizationEventsCallable; + } + + @Override + public UnaryCallable + listOrganizationEventsPagedCallable() { + return listOrganizationEventsPagedCallable; + } + + @Override + public UnaryCallable + getOrganizationEventCallable() { + return getOrganizationEventCallable; + } + + @Override + public UnaryCallable + listOrganizationImpactsCallable() { + return listOrganizationImpactsCallable; + } + + @Override + public UnaryCallable + listOrganizationImpactsPagedCallable() { + return listOrganizationImpactsPagedCallable; + } + + @Override + public UnaryCallable + getOrganizationImpactCallable() { + return getOrganizationImpactCallable; + } + + @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-servicehealth/google-cloud-servicehealth/src/main/java/com/google/cloud/servicehealth/v1/stub/HttpJsonServiceHealthCallableFactory.java b/java-servicehealth/google-cloud-servicehealth/src/main/java/com/google/cloud/servicehealth/v1/stub/HttpJsonServiceHealthCallableFactory.java new file mode 100644 index 000000000000..280ad9a541a5 --- /dev/null +++ b/java-servicehealth/google-cloud-servicehealth/src/main/java/com/google/cloud/servicehealth/v1/stub/HttpJsonServiceHealthCallableFactory.java @@ -0,0 +1,105 @@ +/* + * Copyright 2023 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.servicehealth.v1.stub; + +import com.google.api.core.BetaApi; +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 ServiceHealth service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonServiceHealthCallableFactory + 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); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @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-servicehealth/google-cloud-servicehealth/src/main/java/com/google/cloud/servicehealth/v1/stub/HttpJsonServiceHealthStub.java b/java-servicehealth/google-cloud-servicehealth/src/main/java/com/google/cloud/servicehealth/v1/stub/HttpJsonServiceHealthStub.java new file mode 100644 index 000000000000..8df67ecb7588 --- /dev/null +++ b/java-servicehealth/google-cloud-servicehealth/src/main/java/com/google/cloud/servicehealth/v1/stub/HttpJsonServiceHealthStub.java @@ -0,0 +1,689 @@ +/* + * Copyright 2023 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.servicehealth.v1.stub; + +import static com.google.cloud.servicehealth.v1.ServiceHealthClient.ListEventsPagedResponse; +import static com.google.cloud.servicehealth.v1.ServiceHealthClient.ListLocationsPagedResponse; +import static com.google.cloud.servicehealth.v1.ServiceHealthClient.ListOrganizationEventsPagedResponse; +import static com.google.cloud.servicehealth.v1.ServiceHealthClient.ListOrganizationImpactsPagedResponse; + +import com.google.api.core.BetaApi; +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.servicehealth.v1.Event; +import com.google.cloud.servicehealth.v1.GetEventRequest; +import com.google.cloud.servicehealth.v1.GetOrganizationEventRequest; +import com.google.cloud.servicehealth.v1.GetOrganizationImpactRequest; +import com.google.cloud.servicehealth.v1.ListEventsRequest; +import com.google.cloud.servicehealth.v1.ListEventsResponse; +import com.google.cloud.servicehealth.v1.ListOrganizationEventsRequest; +import com.google.cloud.servicehealth.v1.ListOrganizationEventsResponse; +import com.google.cloud.servicehealth.v1.ListOrganizationImpactsRequest; +import com.google.cloud.servicehealth.v1.ListOrganizationImpactsResponse; +import com.google.cloud.servicehealth.v1.OrganizationEvent; +import com.google.cloud.servicehealth.v1.OrganizationImpact; +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 ServiceHealth service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonServiceHealthStub extends ServiceHealthStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + listEventsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.servicehealth.v1.ServiceHealth/ListEvents") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/events", + 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, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "view", request.getViewValue()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListEventsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getEventMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.servicehealth.v1.ServiceHealth/GetEvent") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/events/*}", + 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(Event.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + ListOrganizationEventsRequest, ListOrganizationEventsResponse> + listOrganizationEventsMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName( + "google.cloud.servicehealth.v1.ServiceHealth/ListOrganizationEvents") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=organizations/*/locations/*}/organizationEvents", + 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, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "view", request.getViewValue()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListOrganizationEventsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getOrganizationEventMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.servicehealth.v1.ServiceHealth/GetOrganizationEvent") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=organizations/*/locations/*/organizationEvents/*}", + 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(OrganizationEvent.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + ListOrganizationImpactsRequest, ListOrganizationImpactsResponse> + listOrganizationImpactsMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName( + "google.cloud.servicehealth.v1.ServiceHealth/ListOrganizationImpacts") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=organizations/*/locations/*}/organizationImpacts", + 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, "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(ListOrganizationImpactsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getOrganizationImpactMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.servicehealth.v1.ServiceHealth/GetOrganizationImpact") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=organizations/*/locations/*/organizationImpacts/*}", + 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(OrganizationImpact.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 listEventsCallable; + private final UnaryCallable listEventsPagedCallable; + private final UnaryCallable getEventCallable; + private final UnaryCallable + listOrganizationEventsCallable; + private final UnaryCallable + listOrganizationEventsPagedCallable; + private final UnaryCallable + getOrganizationEventCallable; + private final UnaryCallable + listOrganizationImpactsCallable; + private final UnaryCallable + listOrganizationImpactsPagedCallable; + private final UnaryCallable + getOrganizationImpactCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonServiceHealthStub create(ServiceHealthStubSettings settings) + throws IOException { + return new HttpJsonServiceHealthStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonServiceHealthStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonServiceHealthStub( + ServiceHealthStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonServiceHealthStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonServiceHealthStub( + ServiceHealthStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonServiceHealthStub, 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 HttpJsonServiceHealthStub( + ServiceHealthStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonServiceHealthCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonServiceHealthStub, 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 HttpJsonServiceHealthStub( + ServiceHealthStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings listEventsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listEventsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getEventTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getEventMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listOrganizationEventsTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(listOrganizationEventsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + getOrganizationEventTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getOrganizationEventMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listOrganizationImpactsTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(listOrganizationImpactsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + getOrganizationImpactTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getOrganizationImpactMethodDescriptor) + .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.listEventsCallable = + callableFactory.createUnaryCallable( + listEventsTransportSettings, settings.listEventsSettings(), clientContext); + this.listEventsPagedCallable = + callableFactory.createPagedCallable( + listEventsTransportSettings, settings.listEventsSettings(), clientContext); + this.getEventCallable = + callableFactory.createUnaryCallable( + getEventTransportSettings, settings.getEventSettings(), clientContext); + this.listOrganizationEventsCallable = + callableFactory.createUnaryCallable( + listOrganizationEventsTransportSettings, + settings.listOrganizationEventsSettings(), + clientContext); + this.listOrganizationEventsPagedCallable = + callableFactory.createPagedCallable( + listOrganizationEventsTransportSettings, + settings.listOrganizationEventsSettings(), + clientContext); + this.getOrganizationEventCallable = + callableFactory.createUnaryCallable( + getOrganizationEventTransportSettings, + settings.getOrganizationEventSettings(), + clientContext); + this.listOrganizationImpactsCallable = + callableFactory.createUnaryCallable( + listOrganizationImpactsTransportSettings, + settings.listOrganizationImpactsSettings(), + clientContext); + this.listOrganizationImpactsPagedCallable = + callableFactory.createPagedCallable( + listOrganizationImpactsTransportSettings, + settings.listOrganizationImpactsSettings(), + clientContext); + this.getOrganizationImpactCallable = + callableFactory.createUnaryCallable( + getOrganizationImpactTransportSettings, + settings.getOrganizationImpactSettings(), + 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(listEventsMethodDescriptor); + methodDescriptors.add(getEventMethodDescriptor); + methodDescriptors.add(listOrganizationEventsMethodDescriptor); + methodDescriptors.add(getOrganizationEventMethodDescriptor); + methodDescriptors.add(listOrganizationImpactsMethodDescriptor); + methodDescriptors.add(getOrganizationImpactMethodDescriptor); + methodDescriptors.add(listLocationsMethodDescriptor); + methodDescriptors.add(getLocationMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable listEventsCallable() { + return listEventsCallable; + } + + @Override + public UnaryCallable listEventsPagedCallable() { + return listEventsPagedCallable; + } + + @Override + public UnaryCallable getEventCallable() { + return getEventCallable; + } + + @Override + public UnaryCallable + listOrganizationEventsCallable() { + return listOrganizationEventsCallable; + } + + @Override + public UnaryCallable + listOrganizationEventsPagedCallable() { + return listOrganizationEventsPagedCallable; + } + + @Override + public UnaryCallable + getOrganizationEventCallable() { + return getOrganizationEventCallable; + } + + @Override + public UnaryCallable + listOrganizationImpactsCallable() { + return listOrganizationImpactsCallable; + } + + @Override + public UnaryCallable + listOrganizationImpactsPagedCallable() { + return listOrganizationImpactsPagedCallable; + } + + @Override + public UnaryCallable + getOrganizationImpactCallable() { + return getOrganizationImpactCallable; + } + + @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-servicehealth/google-cloud-servicehealth/src/main/java/com/google/cloud/servicehealth/v1/stub/ServiceHealthStub.java b/java-servicehealth/google-cloud-servicehealth/src/main/java/com/google/cloud/servicehealth/v1/stub/ServiceHealthStub.java new file mode 100644 index 000000000000..0265aadb0e8d --- /dev/null +++ b/java-servicehealth/google-cloud-servicehealth/src/main/java/com/google/cloud/servicehealth/v1/stub/ServiceHealthStub.java @@ -0,0 +1,112 @@ +/* + * Copyright 2023 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.servicehealth.v1.stub; + +import static com.google.cloud.servicehealth.v1.ServiceHealthClient.ListEventsPagedResponse; +import static com.google.cloud.servicehealth.v1.ServiceHealthClient.ListLocationsPagedResponse; +import static com.google.cloud.servicehealth.v1.ServiceHealthClient.ListOrganizationEventsPagedResponse; +import static com.google.cloud.servicehealth.v1.ServiceHealthClient.ListOrganizationImpactsPagedResponse; + +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.servicehealth.v1.Event; +import com.google.cloud.servicehealth.v1.GetEventRequest; +import com.google.cloud.servicehealth.v1.GetOrganizationEventRequest; +import com.google.cloud.servicehealth.v1.GetOrganizationImpactRequest; +import com.google.cloud.servicehealth.v1.ListEventsRequest; +import com.google.cloud.servicehealth.v1.ListEventsResponse; +import com.google.cloud.servicehealth.v1.ListOrganizationEventsRequest; +import com.google.cloud.servicehealth.v1.ListOrganizationEventsResponse; +import com.google.cloud.servicehealth.v1.ListOrganizationImpactsRequest; +import com.google.cloud.servicehealth.v1.ListOrganizationImpactsResponse; +import com.google.cloud.servicehealth.v1.OrganizationEvent; +import com.google.cloud.servicehealth.v1.OrganizationImpact; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the ServiceHealth service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class ServiceHealthStub implements BackgroundResource { + + public UnaryCallable listEventsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listEventsPagedCallable()"); + } + + public UnaryCallable listEventsCallable() { + throw new UnsupportedOperationException("Not implemented: listEventsCallable()"); + } + + public UnaryCallable getEventCallable() { + throw new UnsupportedOperationException("Not implemented: getEventCallable()"); + } + + public UnaryCallable + listOrganizationEventsPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listOrganizationEventsPagedCallable()"); + } + + public UnaryCallable + listOrganizationEventsCallable() { + throw new UnsupportedOperationException("Not implemented: listOrganizationEventsCallable()"); + } + + public UnaryCallable + getOrganizationEventCallable() { + throw new UnsupportedOperationException("Not implemented: getOrganizationEventCallable()"); + } + + public UnaryCallable + listOrganizationImpactsPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listOrganizationImpactsPagedCallable()"); + } + + public UnaryCallable + listOrganizationImpactsCallable() { + throw new UnsupportedOperationException("Not implemented: listOrganizationImpactsCallable()"); + } + + public UnaryCallable + getOrganizationImpactCallable() { + throw new UnsupportedOperationException("Not implemented: getOrganizationImpactCallable()"); + } + + 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-servicehealth/google-cloud-servicehealth/src/main/java/com/google/cloud/servicehealth/v1/stub/ServiceHealthStubSettings.java b/java-servicehealth/google-cloud-servicehealth/src/main/java/com/google/cloud/servicehealth/v1/stub/ServiceHealthStubSettings.java new file mode 100644 index 000000000000..004faf55e5bb --- /dev/null +++ b/java-servicehealth/google-cloud-servicehealth/src/main/java/com/google/cloud/servicehealth/v1/stub/ServiceHealthStubSettings.java @@ -0,0 +1,848 @@ +/* + * Copyright 2023 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.servicehealth.v1.stub; + +import static com.google.cloud.servicehealth.v1.ServiceHealthClient.ListEventsPagedResponse; +import static com.google.cloud.servicehealth.v1.ServiceHealthClient.ListLocationsPagedResponse; +import static com.google.cloud.servicehealth.v1.ServiceHealthClient.ListOrganizationEventsPagedResponse; +import static com.google.cloud.servicehealth.v1.ServiceHealthClient.ListOrganizationImpactsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +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.servicehealth.v1.Event; +import com.google.cloud.servicehealth.v1.GetEventRequest; +import com.google.cloud.servicehealth.v1.GetOrganizationEventRequest; +import com.google.cloud.servicehealth.v1.GetOrganizationImpactRequest; +import com.google.cloud.servicehealth.v1.ListEventsRequest; +import com.google.cloud.servicehealth.v1.ListEventsResponse; +import com.google.cloud.servicehealth.v1.ListOrganizationEventsRequest; +import com.google.cloud.servicehealth.v1.ListOrganizationEventsResponse; +import com.google.cloud.servicehealth.v1.ListOrganizationImpactsRequest; +import com.google.cloud.servicehealth.v1.ListOrganizationImpactsResponse; +import com.google.cloud.servicehealth.v1.OrganizationEvent; +import com.google.cloud.servicehealth.v1.OrganizationImpact; +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; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link ServiceHealthStub}. + * + *

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

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

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

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

{@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
+ * ServiceHealthStubSettings.Builder serviceHealthSettingsBuilder =
+ *     ServiceHealthStubSettings.newBuilder();
+ * serviceHealthSettingsBuilder
+ *     .getEventSettings()
+ *     .setRetrySettings(
+ *         serviceHealthSettingsBuilder
+ *             .getEventSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * ServiceHealthStubSettings serviceHealthSettings = serviceHealthSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class ServiceHealthStubSettings 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 + listEventsSettings; + private final UnaryCallSettings getEventSettings; + private final PagedCallSettings< + ListOrganizationEventsRequest, + ListOrganizationEventsResponse, + ListOrganizationEventsPagedResponse> + listOrganizationEventsSettings; + private final UnaryCallSettings + getOrganizationEventSettings; + private final PagedCallSettings< + ListOrganizationImpactsRequest, + ListOrganizationImpactsResponse, + ListOrganizationImpactsPagedResponse> + listOrganizationImpactsSettings; + private final UnaryCallSettings + getOrganizationImpactSettings; + private final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; + + private static final PagedListDescriptor + LIST_EVENTS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListEventsRequest injectToken(ListEventsRequest payload, String token) { + return ListEventsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListEventsRequest injectPageSize(ListEventsRequest payload, int pageSize) { + return ListEventsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListEventsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListEventsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListEventsResponse payload) { + return payload.getEventsList() == null + ? ImmutableList.of() + : payload.getEventsList(); + } + }; + + private static final PagedListDescriptor< + ListOrganizationEventsRequest, ListOrganizationEventsResponse, OrganizationEvent> + LIST_ORGANIZATION_EVENTS_PAGE_STR_DESC = + new PagedListDescriptor< + ListOrganizationEventsRequest, ListOrganizationEventsResponse, OrganizationEvent>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListOrganizationEventsRequest injectToken( + ListOrganizationEventsRequest payload, String token) { + return ListOrganizationEventsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListOrganizationEventsRequest injectPageSize( + ListOrganizationEventsRequest payload, int pageSize) { + return ListOrganizationEventsRequest.newBuilder(payload) + .setPageSize(pageSize) + .build(); + } + + @Override + public Integer extractPageSize(ListOrganizationEventsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListOrganizationEventsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + ListOrganizationEventsResponse payload) { + return payload.getOrganizationEventsList() == null + ? ImmutableList.of() + : payload.getOrganizationEventsList(); + } + }; + + private static final PagedListDescriptor< + ListOrganizationImpactsRequest, ListOrganizationImpactsResponse, OrganizationImpact> + LIST_ORGANIZATION_IMPACTS_PAGE_STR_DESC = + new PagedListDescriptor< + ListOrganizationImpactsRequest, + ListOrganizationImpactsResponse, + OrganizationImpact>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListOrganizationImpactsRequest injectToken( + ListOrganizationImpactsRequest payload, String token) { + return ListOrganizationImpactsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListOrganizationImpactsRequest injectPageSize( + ListOrganizationImpactsRequest payload, int pageSize) { + return ListOrganizationImpactsRequest.newBuilder(payload) + .setPageSize(pageSize) + .build(); + } + + @Override + public Integer extractPageSize(ListOrganizationImpactsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListOrganizationImpactsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + ListOrganizationImpactsResponse payload) { + return payload.getOrganizationImpactsList() == null + ? ImmutableList.of() + : payload.getOrganizationImpactsList(); + } + }; + + 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() == null + ? ImmutableList.of() + : payload.getLocationsList(); + } + }; + + private static final PagedListResponseFactory< + ListEventsRequest, ListEventsResponse, ListEventsPagedResponse> + LIST_EVENTS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListEventsRequest, ListEventsResponse, ListEventsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListEventsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_EVENTS_PAGE_STR_DESC, request, context); + return ListEventsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListOrganizationEventsRequest, + ListOrganizationEventsResponse, + ListOrganizationEventsPagedResponse> + LIST_ORGANIZATION_EVENTS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListOrganizationEventsRequest, + ListOrganizationEventsResponse, + ListOrganizationEventsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable + callable, + ListOrganizationEventsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + ListOrganizationEventsRequest, + ListOrganizationEventsResponse, + OrganizationEvent> + pageContext = + PageContext.create( + callable, LIST_ORGANIZATION_EVENTS_PAGE_STR_DESC, request, context); + return ListOrganizationEventsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListOrganizationImpactsRequest, + ListOrganizationImpactsResponse, + ListOrganizationImpactsPagedResponse> + LIST_ORGANIZATION_IMPACTS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListOrganizationImpactsRequest, + ListOrganizationImpactsResponse, + ListOrganizationImpactsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable + callable, + ListOrganizationImpactsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + ListOrganizationImpactsRequest, + ListOrganizationImpactsResponse, + OrganizationImpact> + pageContext = + PageContext.create( + callable, LIST_ORGANIZATION_IMPACTS_PAGE_STR_DESC, request, context); + return ListOrganizationImpactsPagedResponse.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 listEvents. */ + public PagedCallSettings + listEventsSettings() { + return listEventsSettings; + } + + /** Returns the object with the settings used for calls to getEvent. */ + public UnaryCallSettings getEventSettings() { + return getEventSettings; + } + + /** Returns the object with the settings used for calls to listOrganizationEvents. */ + public PagedCallSettings< + ListOrganizationEventsRequest, + ListOrganizationEventsResponse, + ListOrganizationEventsPagedResponse> + listOrganizationEventsSettings() { + return listOrganizationEventsSettings; + } + + /** Returns the object with the settings used for calls to getOrganizationEvent. */ + public UnaryCallSettings + getOrganizationEventSettings() { + return getOrganizationEventSettings; + } + + /** Returns the object with the settings used for calls to listOrganizationImpacts. */ + public PagedCallSettings< + ListOrganizationImpactsRequest, + ListOrganizationImpactsResponse, + ListOrganizationImpactsPagedResponse> + listOrganizationImpactsSettings() { + return listOrganizationImpactsSettings; + } + + /** Returns the object with the settings used for calls to getOrganizationImpact. */ + public UnaryCallSettings + getOrganizationImpactSettings() { + return getOrganizationImpactSettings; + } + + /** 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 ServiceHealthStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcServiceHealthStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonServiceHealthStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "servicehealth"; + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "servicehealth.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "servicehealth.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(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(ServiceHealthStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(ServiceHealthStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ServiceHealthStubSettings.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 ServiceHealthStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listEventsSettings = settingsBuilder.listEventsSettings().build(); + getEventSettings = settingsBuilder.getEventSettings().build(); + listOrganizationEventsSettings = settingsBuilder.listOrganizationEventsSettings().build(); + getOrganizationEventSettings = settingsBuilder.getOrganizationEventSettings().build(); + listOrganizationImpactsSettings = settingsBuilder.listOrganizationImpactsSettings().build(); + getOrganizationImpactSettings = settingsBuilder.getOrganizationImpactSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); + } + + /** Builder for ServiceHealthStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final PagedCallSettings.Builder< + ListEventsRequest, ListEventsResponse, ListEventsPagedResponse> + listEventsSettings; + private final UnaryCallSettings.Builder getEventSettings; + private final PagedCallSettings.Builder< + ListOrganizationEventsRequest, + ListOrganizationEventsResponse, + ListOrganizationEventsPagedResponse> + listOrganizationEventsSettings; + private final UnaryCallSettings.Builder + getOrganizationEventSettings; + private final PagedCallSettings.Builder< + ListOrganizationImpactsRequest, + ListOrganizationImpactsResponse, + ListOrganizationImpactsPagedResponse> + listOrganizationImpactsSettings; + private final UnaryCallSettings.Builder + getOrganizationImpactSettings; + 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( + "retry_policy_1_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + 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() + .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(10000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_1_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(10000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + 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); + + listEventsSettings = PagedCallSettings.newBuilder(LIST_EVENTS_PAGE_STR_FACT); + getEventSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listOrganizationEventsSettings = + PagedCallSettings.newBuilder(LIST_ORGANIZATION_EVENTS_PAGE_STR_FACT); + getOrganizationEventSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listOrganizationImpactsSettings = + PagedCallSettings.newBuilder(LIST_ORGANIZATION_IMPACTS_PAGE_STR_FACT); + getOrganizationImpactSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listEventsSettings, + getEventSettings, + listOrganizationEventsSettings, + getOrganizationEventSettings, + listOrganizationImpactsSettings, + getOrganizationImpactSettings, + listLocationsSettings, + getLocationSettings); + initDefaults(this); + } + + protected Builder(ServiceHealthStubSettings settings) { + super(settings); + + listEventsSettings = settings.listEventsSettings.toBuilder(); + getEventSettings = settings.getEventSettings.toBuilder(); + listOrganizationEventsSettings = settings.listOrganizationEventsSettings.toBuilder(); + getOrganizationEventSettings = settings.getOrganizationEventSettings.toBuilder(); + listOrganizationImpactsSettings = settings.listOrganizationImpactsSettings.toBuilder(); + getOrganizationImpactSettings = settings.getOrganizationImpactSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listEventsSettings, + getEventSettings, + listOrganizationEventsSettings, + getOrganizationEventSettings, + listOrganizationImpactsSettings, + getOrganizationImpactSettings, + 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 + .listEventsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .getEventSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listOrganizationEventsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .getOrganizationEventSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listOrganizationImpactsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .getOrganizationImpactSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_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 listEvents. */ + public PagedCallSettings.Builder + listEventsSettings() { + return listEventsSettings; + } + + /** Returns the builder for the settings used for calls to getEvent. */ + public UnaryCallSettings.Builder getEventSettings() { + return getEventSettings; + } + + /** Returns the builder for the settings used for calls to listOrganizationEvents. */ + public PagedCallSettings.Builder< + ListOrganizationEventsRequest, + ListOrganizationEventsResponse, + ListOrganizationEventsPagedResponse> + listOrganizationEventsSettings() { + return listOrganizationEventsSettings; + } + + /** Returns the builder for the settings used for calls to getOrganizationEvent. */ + public UnaryCallSettings.Builder + getOrganizationEventSettings() { + return getOrganizationEventSettings; + } + + /** Returns the builder for the settings used for calls to listOrganizationImpacts. */ + public PagedCallSettings.Builder< + ListOrganizationImpactsRequest, + ListOrganizationImpactsResponse, + ListOrganizationImpactsPagedResponse> + listOrganizationImpactsSettings() { + return listOrganizationImpactsSettings; + } + + /** Returns the builder for the settings used for calls to getOrganizationImpact. */ + public UnaryCallSettings.Builder + getOrganizationImpactSettings() { + return getOrganizationImpactSettings; + } + + /** 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; + } + + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + + @Override + public ServiceHealthStubSettings build() throws IOException { + return new ServiceHealthStubSettings(this); + } + } +} diff --git a/java-servicehealth/google-cloud-servicehealth/src/main/resources/META-INF/native-image/com.google.cloud.servicehealth.v1/reflect-config.json b/java-servicehealth/google-cloud-servicehealth/src/main/resources/META-INF/native-image/com.google.cloud.servicehealth.v1/reflect-config.json new file mode 100644 index 000000000000..e7b6fef5a53d --- /dev/null +++ b/java-servicehealth/google-cloud-servicehealth/src/main/resources/META-INF/native-image/com.google.cloud.servicehealth.v1/reflect-config.json @@ -0,0 +1,1505 @@ +[ + { + "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.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.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.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.servicehealth.v1.Asset", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.servicehealth.v1.Asset$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.servicehealth.v1.Event", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.servicehealth.v1.Event$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.servicehealth.v1.Event$DetailedCategory", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.servicehealth.v1.Event$DetailedState", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.servicehealth.v1.Event$EventCategory", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.servicehealth.v1.Event$Relevance", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.servicehealth.v1.Event$State", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.servicehealth.v1.EventImpact", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.servicehealth.v1.EventImpact$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.servicehealth.v1.EventUpdate", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.servicehealth.v1.EventUpdate$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.servicehealth.v1.EventView", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.servicehealth.v1.GetEventRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.servicehealth.v1.GetEventRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.servicehealth.v1.GetOrganizationEventRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.servicehealth.v1.GetOrganizationEventRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.servicehealth.v1.GetOrganizationImpactRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.servicehealth.v1.GetOrganizationImpactRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.servicehealth.v1.ListEventsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.servicehealth.v1.ListEventsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.servicehealth.v1.ListEventsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.servicehealth.v1.ListEventsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.servicehealth.v1.ListOrganizationEventsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.servicehealth.v1.ListOrganizationEventsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.servicehealth.v1.ListOrganizationEventsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.servicehealth.v1.ListOrganizationEventsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.servicehealth.v1.ListOrganizationImpactsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.servicehealth.v1.ListOrganizationImpactsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.servicehealth.v1.ListOrganizationImpactsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.servicehealth.v1.ListOrganizationImpactsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.servicehealth.v1.Location", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.servicehealth.v1.Location$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.servicehealth.v1.OrganizationEvent", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.servicehealth.v1.OrganizationEvent$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.servicehealth.v1.OrganizationEvent$DetailedCategory", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.servicehealth.v1.OrganizationEvent$DetailedState", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.servicehealth.v1.OrganizationEvent$EventCategory", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.servicehealth.v1.OrganizationEvent$State", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.servicehealth.v1.OrganizationEventView", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.servicehealth.v1.OrganizationImpact", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.servicehealth.v1.OrganizationImpact$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.servicehealth.v1.Product", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.servicehealth.v1.Product$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$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$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$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-servicehealth/google-cloud-servicehealth/src/test/java/com/google/cloud/servicehealth/v1/MockLocations.java b/java-servicehealth/google-cloud-servicehealth/src/test/java/com/google/cloud/servicehealth/v1/MockLocations.java new file mode 100644 index 000000000000..af78dd33830c --- /dev/null +++ b/java-servicehealth/google-cloud-servicehealth/src/test/java/com/google/cloud/servicehealth/v1/MockLocations.java @@ -0,0 +1,59 @@ +/* + * Copyright 2023 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.servicehealth.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-servicehealth/google-cloud-servicehealth/src/test/java/com/google/cloud/servicehealth/v1/MockLocationsImpl.java b/java-servicehealth/google-cloud-servicehealth/src/test/java/com/google/cloud/servicehealth/v1/MockLocationsImpl.java new file mode 100644 index 000000000000..174bde6e38d0 --- /dev/null +++ b/java-servicehealth/google-cloud-servicehealth/src/test/java/com/google/cloud/servicehealth/v1/MockLocationsImpl.java @@ -0,0 +1,105 @@ +/* + * Copyright 2023 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.servicehealth.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-servicehealth/google-cloud-servicehealth/src/test/java/com/google/cloud/servicehealth/v1/MockServiceHealth.java b/java-servicehealth/google-cloud-servicehealth/src/test/java/com/google/cloud/servicehealth/v1/MockServiceHealth.java new file mode 100644 index 000000000000..e2a11eb31091 --- /dev/null +++ b/java-servicehealth/google-cloud-servicehealth/src/test/java/com/google/cloud/servicehealth/v1/MockServiceHealth.java @@ -0,0 +1,59 @@ +/* + * Copyright 2023 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.servicehealth.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 MockServiceHealth implements MockGrpcService { + private final MockServiceHealthImpl serviceImpl; + + public MockServiceHealth() { + serviceImpl = new MockServiceHealthImpl(); + } + + @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-servicehealth/google-cloud-servicehealth/src/test/java/com/google/cloud/servicehealth/v1/MockServiceHealthImpl.java b/java-servicehealth/google-cloud-servicehealth/src/test/java/com/google/cloud/servicehealth/v1/MockServiceHealthImpl.java new file mode 100644 index 000000000000..870ba99df79f --- /dev/null +++ b/java-servicehealth/google-cloud-servicehealth/src/test/java/com/google/cloud/servicehealth/v1/MockServiceHealthImpl.java @@ -0,0 +1,187 @@ +/* + * Copyright 2023 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.servicehealth.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.servicehealth.v1.ServiceHealthGrpc.ServiceHealthImplBase; +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 MockServiceHealthImpl extends ServiceHealthImplBase { + private List requests; + private Queue responses; + + public MockServiceHealthImpl() { + 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 listEvents( + ListEventsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListEventsResponse) { + requests.add(request); + responseObserver.onNext(((ListEventsResponse) 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 ListEvents, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListEventsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getEvent(GetEventRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Event) { + requests.add(request); + responseObserver.onNext(((Event) 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 GetEvent, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Event.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listOrganizationEvents( + ListOrganizationEventsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListOrganizationEventsResponse) { + requests.add(request); + responseObserver.onNext(((ListOrganizationEventsResponse) 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 ListOrganizationEvents, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListOrganizationEventsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getOrganizationEvent( + GetOrganizationEventRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof OrganizationEvent) { + requests.add(request); + responseObserver.onNext(((OrganizationEvent) 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 GetOrganizationEvent, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + OrganizationEvent.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listOrganizationImpacts( + ListOrganizationImpactsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListOrganizationImpactsResponse) { + requests.add(request); + responseObserver.onNext(((ListOrganizationImpactsResponse) 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 ListOrganizationImpacts, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListOrganizationImpactsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getOrganizationImpact( + GetOrganizationImpactRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof OrganizationImpact) { + requests.add(request); + responseObserver.onNext(((OrganizationImpact) 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 GetOrganizationImpact, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + OrganizationImpact.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-servicehealth/google-cloud-servicehealth/src/test/java/com/google/cloud/servicehealth/v1/ServiceHealthClientHttpJsonTest.java b/java-servicehealth/google-cloud-servicehealth/src/test/java/com/google/cloud/servicehealth/v1/ServiceHealthClientHttpJsonTest.java new file mode 100644 index 000000000000..1dd0f89da8eb --- /dev/null +++ b/java-servicehealth/google-cloud-servicehealth/src/test/java/com/google/cloud/servicehealth/v1/ServiceHealthClientHttpJsonTest.java @@ -0,0 +1,822 @@ +/* + * Copyright 2023 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.servicehealth.v1; + +import static com.google.cloud.servicehealth.v1.ServiceHealthClient.ListEventsPagedResponse; +import static com.google.cloud.servicehealth.v1.ServiceHealthClient.ListLocationsPagedResponse; +import static com.google.cloud.servicehealth.v1.ServiceHealthClient.ListOrganizationEventsPagedResponse; +import static com.google.cloud.servicehealth.v1.ServiceHealthClient.ListOrganizationImpactsPagedResponse; + +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.servicehealth.v1.stub.HttpJsonServiceHealthStub; +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 ServiceHealthClientHttpJsonTest { + private static MockHttpService mockService; + private static ServiceHealthClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonServiceHealthStub.getMethodDescriptors(), + ServiceHealthSettings.getDefaultEndpoint()); + ServiceHealthSettings settings = + ServiceHealthSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + ServiceHealthSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ServiceHealthClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void listEventsTest() throws Exception { + Event responsesElement = Event.newBuilder().build(); + ListEventsResponse expectedResponse = + ListEventsResponse.newBuilder() + .setNextPageToken("") + .addAllEvents(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListEventsPagedResponse pagedListResponse = client.listEvents(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getEventsList().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 listEventsExceptionTest() 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.listEvents(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listEventsTest2() throws Exception { + Event responsesElement = Event.newBuilder().build(); + ListEventsResponse expectedResponse = + ListEventsResponse.newBuilder() + .setNextPageToken("") + .addAllEvents(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListEventsPagedResponse pagedListResponse = client.listEvents(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getEventsList().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 listEventsExceptionTest2() 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.listEvents(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getEventTest() throws Exception { + Event expectedResponse = + Event.newBuilder() + .setName(EventName.of("[PROJECT]", "[LOCATION]", "[EVENT]").toString()) + .setTitle("title110371416") + .setDescription("description-1724546052") + .addAllEventImpacts(new ArrayList()) + .addAllUpdates(new ArrayList()) + .setParentEvent("parentEvent991253520") + .setUpdateTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setNextUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + EventName name = EventName.of("[PROJECT]", "[LOCATION]", "[EVENT]"); + + Event actualResponse = client.getEvent(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 getEventExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + EventName name = EventName.of("[PROJECT]", "[LOCATION]", "[EVENT]"); + client.getEvent(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getEventTest2() throws Exception { + Event expectedResponse = + Event.newBuilder() + .setName(EventName.of("[PROJECT]", "[LOCATION]", "[EVENT]").toString()) + .setTitle("title110371416") + .setDescription("description-1724546052") + .addAllEventImpacts(new ArrayList()) + .addAllUpdates(new ArrayList()) + .setParentEvent("parentEvent991253520") + .setUpdateTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setNextUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-4441/locations/location-4441/events/event-4441"; + + Event actualResponse = client.getEvent(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 getEventExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-4441/locations/location-4441/events/event-4441"; + client.getEvent(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listOrganizationEventsTest() throws Exception { + OrganizationEvent responsesElement = OrganizationEvent.newBuilder().build(); + ListOrganizationEventsResponse expectedResponse = + ListOrganizationEventsResponse.newBuilder() + .setNextPageToken("") + .addAllOrganizationEvents(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]"); + + ListOrganizationEventsPagedResponse pagedListResponse = client.listOrganizationEvents(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getOrganizationEventsList().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 listOrganizationEventsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]"); + client.listOrganizationEvents(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listOrganizationEventsTest2() throws Exception { + OrganizationEvent responsesElement = OrganizationEvent.newBuilder().build(); + ListOrganizationEventsResponse expectedResponse = + ListOrganizationEventsResponse.newBuilder() + .setNextPageToken("") + .addAllOrganizationEvents(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "organizations/organization-9365/locations/location-9365"; + + ListOrganizationEventsPagedResponse pagedListResponse = client.listOrganizationEvents(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getOrganizationEventsList().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 listOrganizationEventsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "organizations/organization-9365/locations/location-9365"; + client.listOrganizationEvents(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getOrganizationEventTest() throws Exception { + OrganizationEvent expectedResponse = + OrganizationEvent.newBuilder() + .setName(OrganizationEventName.of("[ORGANIZATION]", "[LOCATION]", "[EVENT]").toString()) + .setTitle("title110371416") + .setDescription("description-1724546052") + .addAllEventImpacts(new ArrayList()) + .addAllUpdates(new ArrayList()) + .setParentEvent("parentEvent991253520") + .setUpdateTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setNextUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + OrganizationEventName name = + OrganizationEventName.of("[ORGANIZATION]", "[LOCATION]", "[EVENT]"); + + OrganizationEvent actualResponse = client.getOrganizationEvent(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 getOrganizationEventExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + OrganizationEventName name = + OrganizationEventName.of("[ORGANIZATION]", "[LOCATION]", "[EVENT]"); + client.getOrganizationEvent(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getOrganizationEventTest2() throws Exception { + OrganizationEvent expectedResponse = + OrganizationEvent.newBuilder() + .setName(OrganizationEventName.of("[ORGANIZATION]", "[LOCATION]", "[EVENT]").toString()) + .setTitle("title110371416") + .setDescription("description-1724546052") + .addAllEventImpacts(new ArrayList()) + .addAllUpdates(new ArrayList()) + .setParentEvent("parentEvent991253520") + .setUpdateTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setNextUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = + "organizations/organization-4436/locations/location-4436/organizationEvents/organizationEvent-4436"; + + OrganizationEvent actualResponse = client.getOrganizationEvent(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 getOrganizationEventExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "organizations/organization-4436/locations/location-4436/organizationEvents/organizationEvent-4436"; + client.getOrganizationEvent(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listOrganizationImpactsTest() throws Exception { + OrganizationImpact responsesElement = OrganizationImpact.newBuilder().build(); + ListOrganizationImpactsResponse expectedResponse = + ListOrganizationImpactsResponse.newBuilder() + .setNextPageToken("") + .addAllOrganizationImpacts(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]"); + + ListOrganizationImpactsPagedResponse pagedListResponse = client.listOrganizationImpacts(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getOrganizationImpactsList().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 listOrganizationImpactsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]"); + client.listOrganizationImpacts(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listOrganizationImpactsTest2() throws Exception { + OrganizationImpact responsesElement = OrganizationImpact.newBuilder().build(); + ListOrganizationImpactsResponse expectedResponse = + ListOrganizationImpactsResponse.newBuilder() + .setNextPageToken("") + .addAllOrganizationImpacts(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "organizations/organization-9365/locations/location-9365"; + + ListOrganizationImpactsPagedResponse pagedListResponse = client.listOrganizationImpacts(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getOrganizationImpactsList().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 listOrganizationImpactsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "organizations/organization-9365/locations/location-9365"; + client.listOrganizationImpacts(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getOrganizationImpactTest() throws Exception { + OrganizationImpact expectedResponse = + OrganizationImpact.newBuilder() + .setName( + OrganizationImpactName.of("[ORGANIZATION]", "[LOCATION]", "[ORGANIZATION_IMPACT]") + .toString()) + .addAllEvents(new ArrayList()) + .setAsset(Asset.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + OrganizationImpactName name = + OrganizationImpactName.of("[ORGANIZATION]", "[LOCATION]", "[ORGANIZATION_IMPACT]"); + + OrganizationImpact actualResponse = client.getOrganizationImpact(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 getOrganizationImpactExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + OrganizationImpactName name = + OrganizationImpactName.of("[ORGANIZATION]", "[LOCATION]", "[ORGANIZATION_IMPACT]"); + client.getOrganizationImpact(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getOrganizationImpactTest2() throws Exception { + OrganizationImpact expectedResponse = + OrganizationImpact.newBuilder() + .setName( + OrganizationImpactName.of("[ORGANIZATION]", "[LOCATION]", "[ORGANIZATION_IMPACT]") + .toString()) + .addAllEvents(new ArrayList()) + .setAsset(Asset.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = + "organizations/organization-5360/locations/location-5360/organizationImpacts/organizationImpact-5360"; + + OrganizationImpact actualResponse = client.getOrganizationImpact(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 getOrganizationImpactExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "organizations/organization-5360/locations/location-5360/organizationImpacts/organizationImpact-5360"; + client.getOrganizationImpact(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-servicehealth/google-cloud-servicehealth/src/test/java/com/google/cloud/servicehealth/v1/ServiceHealthClientTest.java b/java-servicehealth/google-cloud-servicehealth/src/test/java/com/google/cloud/servicehealth/v1/ServiceHealthClientTest.java new file mode 100644 index 000000000000..8e69baffa81c --- /dev/null +++ b/java-servicehealth/google-cloud-servicehealth/src/test/java/com/google/cloud/servicehealth/v1/ServiceHealthClientTest.java @@ -0,0 +1,745 @@ +/* + * Copyright 2023 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.servicehealth.v1; + +import static com.google.cloud.servicehealth.v1.ServiceHealthClient.ListEventsPagedResponse; +import static com.google.cloud.servicehealth.v1.ServiceHealthClient.ListLocationsPagedResponse; +import static com.google.cloud.servicehealth.v1.ServiceHealthClient.ListOrganizationEventsPagedResponse; +import static com.google.cloud.servicehealth.v1.ServiceHealthClient.ListOrganizationImpactsPagedResponse; + +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 ServiceHealthClientTest { + private static MockLocations mockLocations; + private static MockServiceHealth mockServiceHealth; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private ServiceHealthClient client; + + @BeforeClass + public static void startStaticServer() { + mockServiceHealth = new MockServiceHealth(); + mockLocations = new MockLocations(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockServiceHealth, mockLocations)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + ServiceHealthSettings settings = + ServiceHealthSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ServiceHealthClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void listEventsTest() throws Exception { + Event responsesElement = Event.newBuilder().build(); + ListEventsResponse expectedResponse = + ListEventsResponse.newBuilder() + .setNextPageToken("") + .addAllEvents(Arrays.asList(responsesElement)) + .build(); + mockServiceHealth.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListEventsPagedResponse pagedListResponse = client.listEvents(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getEventsList().get(0), resources.get(0)); + + List actualRequests = mockServiceHealth.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListEventsRequest actualRequest = ((ListEventsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listEventsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockServiceHealth.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listEvents(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listEventsTest2() throws Exception { + Event responsesElement = Event.newBuilder().build(); + ListEventsResponse expectedResponse = + ListEventsResponse.newBuilder() + .setNextPageToken("") + .addAllEvents(Arrays.asList(responsesElement)) + .build(); + mockServiceHealth.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListEventsPagedResponse pagedListResponse = client.listEvents(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getEventsList().get(0), resources.get(0)); + + List actualRequests = mockServiceHealth.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListEventsRequest actualRequest = ((ListEventsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listEventsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockServiceHealth.addException(exception); + + try { + String parent = "parent-995424086"; + client.listEvents(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getEventTest() throws Exception { + Event expectedResponse = + Event.newBuilder() + .setName(EventName.of("[PROJECT]", "[LOCATION]", "[EVENT]").toString()) + .setTitle("title110371416") + .setDescription("description-1724546052") + .addAllEventImpacts(new ArrayList()) + .addAllUpdates(new ArrayList()) + .setParentEvent("parentEvent991253520") + .setUpdateTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setNextUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockServiceHealth.addResponse(expectedResponse); + + EventName name = EventName.of("[PROJECT]", "[LOCATION]", "[EVENT]"); + + Event actualResponse = client.getEvent(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockServiceHealth.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetEventRequest actualRequest = ((GetEventRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getEventExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockServiceHealth.addException(exception); + + try { + EventName name = EventName.of("[PROJECT]", "[LOCATION]", "[EVENT]"); + client.getEvent(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getEventTest2() throws Exception { + Event expectedResponse = + Event.newBuilder() + .setName(EventName.of("[PROJECT]", "[LOCATION]", "[EVENT]").toString()) + .setTitle("title110371416") + .setDescription("description-1724546052") + .addAllEventImpacts(new ArrayList()) + .addAllUpdates(new ArrayList()) + .setParentEvent("parentEvent991253520") + .setUpdateTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setNextUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockServiceHealth.addResponse(expectedResponse); + + String name = "name3373707"; + + Event actualResponse = client.getEvent(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockServiceHealth.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetEventRequest actualRequest = ((GetEventRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getEventExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockServiceHealth.addException(exception); + + try { + String name = "name3373707"; + client.getEvent(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listOrganizationEventsTest() throws Exception { + OrganizationEvent responsesElement = OrganizationEvent.newBuilder().build(); + ListOrganizationEventsResponse expectedResponse = + ListOrganizationEventsResponse.newBuilder() + .setNextPageToken("") + .addAllOrganizationEvents(Arrays.asList(responsesElement)) + .build(); + mockServiceHealth.addResponse(expectedResponse); + + OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]"); + + ListOrganizationEventsPagedResponse pagedListResponse = client.listOrganizationEvents(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getOrganizationEventsList().get(0), resources.get(0)); + + List actualRequests = mockServiceHealth.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListOrganizationEventsRequest actualRequest = + ((ListOrganizationEventsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listOrganizationEventsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockServiceHealth.addException(exception); + + try { + OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]"); + client.listOrganizationEvents(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listOrganizationEventsTest2() throws Exception { + OrganizationEvent responsesElement = OrganizationEvent.newBuilder().build(); + ListOrganizationEventsResponse expectedResponse = + ListOrganizationEventsResponse.newBuilder() + .setNextPageToken("") + .addAllOrganizationEvents(Arrays.asList(responsesElement)) + .build(); + mockServiceHealth.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListOrganizationEventsPagedResponse pagedListResponse = client.listOrganizationEvents(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getOrganizationEventsList().get(0), resources.get(0)); + + List actualRequests = mockServiceHealth.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListOrganizationEventsRequest actualRequest = + ((ListOrganizationEventsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listOrganizationEventsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockServiceHealth.addException(exception); + + try { + String parent = "parent-995424086"; + client.listOrganizationEvents(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getOrganizationEventTest() throws Exception { + OrganizationEvent expectedResponse = + OrganizationEvent.newBuilder() + .setName(OrganizationEventName.of("[ORGANIZATION]", "[LOCATION]", "[EVENT]").toString()) + .setTitle("title110371416") + .setDescription("description-1724546052") + .addAllEventImpacts(new ArrayList()) + .addAllUpdates(new ArrayList()) + .setParentEvent("parentEvent991253520") + .setUpdateTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setNextUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockServiceHealth.addResponse(expectedResponse); + + OrganizationEventName name = + OrganizationEventName.of("[ORGANIZATION]", "[LOCATION]", "[EVENT]"); + + OrganizationEvent actualResponse = client.getOrganizationEvent(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockServiceHealth.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetOrganizationEventRequest actualRequest = + ((GetOrganizationEventRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getOrganizationEventExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockServiceHealth.addException(exception); + + try { + OrganizationEventName name = + OrganizationEventName.of("[ORGANIZATION]", "[LOCATION]", "[EVENT]"); + client.getOrganizationEvent(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getOrganizationEventTest2() throws Exception { + OrganizationEvent expectedResponse = + OrganizationEvent.newBuilder() + .setName(OrganizationEventName.of("[ORGANIZATION]", "[LOCATION]", "[EVENT]").toString()) + .setTitle("title110371416") + .setDescription("description-1724546052") + .addAllEventImpacts(new ArrayList()) + .addAllUpdates(new ArrayList()) + .setParentEvent("parentEvent991253520") + .setUpdateTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setNextUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockServiceHealth.addResponse(expectedResponse); + + String name = "name3373707"; + + OrganizationEvent actualResponse = client.getOrganizationEvent(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockServiceHealth.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetOrganizationEventRequest actualRequest = + ((GetOrganizationEventRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getOrganizationEventExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockServiceHealth.addException(exception); + + try { + String name = "name3373707"; + client.getOrganizationEvent(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listOrganizationImpactsTest() throws Exception { + OrganizationImpact responsesElement = OrganizationImpact.newBuilder().build(); + ListOrganizationImpactsResponse expectedResponse = + ListOrganizationImpactsResponse.newBuilder() + .setNextPageToken("") + .addAllOrganizationImpacts(Arrays.asList(responsesElement)) + .build(); + mockServiceHealth.addResponse(expectedResponse); + + OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]"); + + ListOrganizationImpactsPagedResponse pagedListResponse = client.listOrganizationImpacts(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getOrganizationImpactsList().get(0), resources.get(0)); + + List actualRequests = mockServiceHealth.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListOrganizationImpactsRequest actualRequest = + ((ListOrganizationImpactsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listOrganizationImpactsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockServiceHealth.addException(exception); + + try { + OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]"); + client.listOrganizationImpacts(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listOrganizationImpactsTest2() throws Exception { + OrganizationImpact responsesElement = OrganizationImpact.newBuilder().build(); + ListOrganizationImpactsResponse expectedResponse = + ListOrganizationImpactsResponse.newBuilder() + .setNextPageToken("") + .addAllOrganizationImpacts(Arrays.asList(responsesElement)) + .build(); + mockServiceHealth.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListOrganizationImpactsPagedResponse pagedListResponse = client.listOrganizationImpacts(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getOrganizationImpactsList().get(0), resources.get(0)); + + List actualRequests = mockServiceHealth.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListOrganizationImpactsRequest actualRequest = + ((ListOrganizationImpactsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listOrganizationImpactsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockServiceHealth.addException(exception); + + try { + String parent = "parent-995424086"; + client.listOrganizationImpacts(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getOrganizationImpactTest() throws Exception { + OrganizationImpact expectedResponse = + OrganizationImpact.newBuilder() + .setName( + OrganizationImpactName.of("[ORGANIZATION]", "[LOCATION]", "[ORGANIZATION_IMPACT]") + .toString()) + .addAllEvents(new ArrayList()) + .setAsset(Asset.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockServiceHealth.addResponse(expectedResponse); + + OrganizationImpactName name = + OrganizationImpactName.of("[ORGANIZATION]", "[LOCATION]", "[ORGANIZATION_IMPACT]"); + + OrganizationImpact actualResponse = client.getOrganizationImpact(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockServiceHealth.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetOrganizationImpactRequest actualRequest = + ((GetOrganizationImpactRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getOrganizationImpactExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockServiceHealth.addException(exception); + + try { + OrganizationImpactName name = + OrganizationImpactName.of("[ORGANIZATION]", "[LOCATION]", "[ORGANIZATION_IMPACT]"); + client.getOrganizationImpact(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getOrganizationImpactTest2() throws Exception { + OrganizationImpact expectedResponse = + OrganizationImpact.newBuilder() + .setName( + OrganizationImpactName.of("[ORGANIZATION]", "[LOCATION]", "[ORGANIZATION_IMPACT]") + .toString()) + .addAllEvents(new ArrayList()) + .setAsset(Asset.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockServiceHealth.addResponse(expectedResponse); + + String name = "name3373707"; + + OrganizationImpact actualResponse = client.getOrganizationImpact(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockServiceHealth.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetOrganizationImpactRequest actualRequest = + ((GetOrganizationImpactRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getOrganizationImpactExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockServiceHealth.addException(exception); + + try { + String name = "name3373707"; + client.getOrganizationImpact(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-servicehealth/grpc-google-cloud-servicehealth-v1/pom.xml b/java-servicehealth/grpc-google-cloud-servicehealth-v1/pom.xml new file mode 100644 index 000000000000..b99a38c7fb0c --- /dev/null +++ b/java-servicehealth/grpc-google-cloud-servicehealth-v1/pom.xml @@ -0,0 +1,45 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-servicehealth-v1 + 0.0.1-SNAPSHOT + grpc-google-cloud-servicehealth-v1 + GRPC library for google-cloud-servicehealth + + com.google.cloud + google-cloud-servicehealth-parent + 0.0.1-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-servicehealth-v1 + + + com.google.guava + guava + + + \ No newline at end of file diff --git a/java-servicehealth/grpc-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/ServiceHealthGrpc.java b/java-servicehealth/grpc-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/ServiceHealthGrpc.java new file mode 100644 index 000000000000..0b9b6972bc34 --- /dev/null +++ b/java-servicehealth/grpc-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/ServiceHealthGrpc.java @@ -0,0 +1,1005 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.servicehealth.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Request service health events relevant to your Google Cloud project.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/servicehealth/v1/event_service.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class ServiceHealthGrpc { + + private ServiceHealthGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.cloud.servicehealth.v1.ServiceHealth"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.servicehealth.v1.ListEventsRequest, + com.google.cloud.servicehealth.v1.ListEventsResponse> + getListEventsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListEvents", + requestType = com.google.cloud.servicehealth.v1.ListEventsRequest.class, + responseType = com.google.cloud.servicehealth.v1.ListEventsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.servicehealth.v1.ListEventsRequest, + com.google.cloud.servicehealth.v1.ListEventsResponse> + getListEventsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.servicehealth.v1.ListEventsRequest, + com.google.cloud.servicehealth.v1.ListEventsResponse> + getListEventsMethod; + if ((getListEventsMethod = ServiceHealthGrpc.getListEventsMethod) == null) { + synchronized (ServiceHealthGrpc.class) { + if ((getListEventsMethod = ServiceHealthGrpc.getListEventsMethod) == null) { + ServiceHealthGrpc.getListEventsMethod = + getListEventsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListEvents")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.servicehealth.v1.ListEventsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.servicehealth.v1.ListEventsResponse + .getDefaultInstance())) + .setSchemaDescriptor(new ServiceHealthMethodDescriptorSupplier("ListEvents")) + .build(); + } + } + } + return getListEventsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.servicehealth.v1.GetEventRequest, + com.google.cloud.servicehealth.v1.Event> + getGetEventMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetEvent", + requestType = com.google.cloud.servicehealth.v1.GetEventRequest.class, + responseType = com.google.cloud.servicehealth.v1.Event.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.servicehealth.v1.GetEventRequest, + com.google.cloud.servicehealth.v1.Event> + getGetEventMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.servicehealth.v1.GetEventRequest, + com.google.cloud.servicehealth.v1.Event> + getGetEventMethod; + if ((getGetEventMethod = ServiceHealthGrpc.getGetEventMethod) == null) { + synchronized (ServiceHealthGrpc.class) { + if ((getGetEventMethod = ServiceHealthGrpc.getGetEventMethod) == null) { + ServiceHealthGrpc.getGetEventMethod = + getGetEventMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetEvent")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.servicehealth.v1.GetEventRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.servicehealth.v1.Event.getDefaultInstance())) + .setSchemaDescriptor(new ServiceHealthMethodDescriptorSupplier("GetEvent")) + .build(); + } + } + } + return getGetEventMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.servicehealth.v1.ListOrganizationEventsRequest, + com.google.cloud.servicehealth.v1.ListOrganizationEventsResponse> + getListOrganizationEventsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListOrganizationEvents", + requestType = com.google.cloud.servicehealth.v1.ListOrganizationEventsRequest.class, + responseType = com.google.cloud.servicehealth.v1.ListOrganizationEventsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.servicehealth.v1.ListOrganizationEventsRequest, + com.google.cloud.servicehealth.v1.ListOrganizationEventsResponse> + getListOrganizationEventsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.servicehealth.v1.ListOrganizationEventsRequest, + com.google.cloud.servicehealth.v1.ListOrganizationEventsResponse> + getListOrganizationEventsMethod; + if ((getListOrganizationEventsMethod = ServiceHealthGrpc.getListOrganizationEventsMethod) + == null) { + synchronized (ServiceHealthGrpc.class) { + if ((getListOrganizationEventsMethod = ServiceHealthGrpc.getListOrganizationEventsMethod) + == null) { + ServiceHealthGrpc.getListOrganizationEventsMethod = + getListOrganizationEventsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ListOrganizationEvents")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.servicehealth.v1.ListOrganizationEventsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.servicehealth.v1.ListOrganizationEventsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new ServiceHealthMethodDescriptorSupplier("ListOrganizationEvents")) + .build(); + } + } + } + return getListOrganizationEventsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.servicehealth.v1.GetOrganizationEventRequest, + com.google.cloud.servicehealth.v1.OrganizationEvent> + getGetOrganizationEventMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetOrganizationEvent", + requestType = com.google.cloud.servicehealth.v1.GetOrganizationEventRequest.class, + responseType = com.google.cloud.servicehealth.v1.OrganizationEvent.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.servicehealth.v1.GetOrganizationEventRequest, + com.google.cloud.servicehealth.v1.OrganizationEvent> + getGetOrganizationEventMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.servicehealth.v1.GetOrganizationEventRequest, + com.google.cloud.servicehealth.v1.OrganizationEvent> + getGetOrganizationEventMethod; + if ((getGetOrganizationEventMethod = ServiceHealthGrpc.getGetOrganizationEventMethod) == null) { + synchronized (ServiceHealthGrpc.class) { + if ((getGetOrganizationEventMethod = ServiceHealthGrpc.getGetOrganizationEventMethod) + == null) { + ServiceHealthGrpc.getGetOrganizationEventMethod = + getGetOrganizationEventMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "GetOrganizationEvent")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.servicehealth.v1.GetOrganizationEventRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.servicehealth.v1.OrganizationEvent + .getDefaultInstance())) + .setSchemaDescriptor( + new ServiceHealthMethodDescriptorSupplier("GetOrganizationEvent")) + .build(); + } + } + } + return getGetOrganizationEventMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.servicehealth.v1.ListOrganizationImpactsRequest, + com.google.cloud.servicehealth.v1.ListOrganizationImpactsResponse> + getListOrganizationImpactsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListOrganizationImpacts", + requestType = com.google.cloud.servicehealth.v1.ListOrganizationImpactsRequest.class, + responseType = com.google.cloud.servicehealth.v1.ListOrganizationImpactsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.servicehealth.v1.ListOrganizationImpactsRequest, + com.google.cloud.servicehealth.v1.ListOrganizationImpactsResponse> + getListOrganizationImpactsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.servicehealth.v1.ListOrganizationImpactsRequest, + com.google.cloud.servicehealth.v1.ListOrganizationImpactsResponse> + getListOrganizationImpactsMethod; + if ((getListOrganizationImpactsMethod = ServiceHealthGrpc.getListOrganizationImpactsMethod) + == null) { + synchronized (ServiceHealthGrpc.class) { + if ((getListOrganizationImpactsMethod = ServiceHealthGrpc.getListOrganizationImpactsMethod) + == null) { + ServiceHealthGrpc.getListOrganizationImpactsMethod = + getListOrganizationImpactsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ListOrganizationImpacts")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.servicehealth.v1.ListOrganizationImpactsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.servicehealth.v1.ListOrganizationImpactsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new ServiceHealthMethodDescriptorSupplier("ListOrganizationImpacts")) + .build(); + } + } + } + return getListOrganizationImpactsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.servicehealth.v1.GetOrganizationImpactRequest, + com.google.cloud.servicehealth.v1.OrganizationImpact> + getGetOrganizationImpactMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetOrganizationImpact", + requestType = com.google.cloud.servicehealth.v1.GetOrganizationImpactRequest.class, + responseType = com.google.cloud.servicehealth.v1.OrganizationImpact.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.servicehealth.v1.GetOrganizationImpactRequest, + com.google.cloud.servicehealth.v1.OrganizationImpact> + getGetOrganizationImpactMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.servicehealth.v1.GetOrganizationImpactRequest, + com.google.cloud.servicehealth.v1.OrganizationImpact> + getGetOrganizationImpactMethod; + if ((getGetOrganizationImpactMethod = ServiceHealthGrpc.getGetOrganizationImpactMethod) + == null) { + synchronized (ServiceHealthGrpc.class) { + if ((getGetOrganizationImpactMethod = ServiceHealthGrpc.getGetOrganizationImpactMethod) + == null) { + ServiceHealthGrpc.getGetOrganizationImpactMethod = + getGetOrganizationImpactMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "GetOrganizationImpact")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.servicehealth.v1.GetOrganizationImpactRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.servicehealth.v1.OrganizationImpact + .getDefaultInstance())) + .setSchemaDescriptor( + new ServiceHealthMethodDescriptorSupplier("GetOrganizationImpact")) + .build(); + } + } + } + return getGetOrganizationImpactMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static ServiceHealthStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ServiceHealthStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ServiceHealthStub(channel, callOptions); + } + }; + return ServiceHealthStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static ServiceHealthBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ServiceHealthBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ServiceHealthBlockingStub(channel, callOptions); + } + }; + return ServiceHealthBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static ServiceHealthFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ServiceHealthFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ServiceHealthFutureStub(channel, callOptions); + } + }; + return ServiceHealthFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Request service health events relevant to your Google Cloud project.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Lists events under a given project and location.
+     * 
+ */ + default void listEvents( + com.google.cloud.servicehealth.v1.ListEventsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListEventsMethod(), responseObserver); + } + + /** + * + * + *
+     * Retrieves a resource containing information about an event.
+     * 
+ */ + default void getEvent( + com.google.cloud.servicehealth.v1.GetEventRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetEventMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists organization events under a given organization and location.
+     * 
+ */ + default void listOrganizationEvents( + com.google.cloud.servicehealth.v1.ListOrganizationEventsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.servicehealth.v1.ListOrganizationEventsResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListOrganizationEventsMethod(), responseObserver); + } + + /** + * + * + *
+     * Retrieves a resource containing information about an event affecting an
+     * organization .
+     * 
+ */ + default void getOrganizationEvent( + com.google.cloud.servicehealth.v1.GetOrganizationEventRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetOrganizationEventMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists assets impacted by organization events under a given organization and
+     * location.
+     * 
+ */ + default void listOrganizationImpacts( + com.google.cloud.servicehealth.v1.ListOrganizationImpactsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.servicehealth.v1.ListOrganizationImpactsResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListOrganizationImpactsMethod(), responseObserver); + } + + /** + * + * + *
+     * Retrieves a resource containing information about impact to an asset under
+     * an organization affected by a service health event.
+     * 
+ */ + default void getOrganizationImpact( + com.google.cloud.servicehealth.v1.GetOrganizationImpactRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetOrganizationImpactMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service ServiceHealth. + * + *
+   * Request service health events relevant to your Google Cloud project.
+   * 
+ */ + public abstract static class ServiceHealthImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return ServiceHealthGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service ServiceHealth. + * + *
+   * Request service health events relevant to your Google Cloud project.
+   * 
+ */ + public static final class ServiceHealthStub + extends io.grpc.stub.AbstractAsyncStub { + private ServiceHealthStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ServiceHealthStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ServiceHealthStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists events under a given project and location.
+     * 
+ */ + public void listEvents( + com.google.cloud.servicehealth.v1.ListEventsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListEventsMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Retrieves a resource containing information about an event.
+     * 
+ */ + public void getEvent( + com.google.cloud.servicehealth.v1.GetEventRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetEventMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Lists organization events under a given organization and location.
+     * 
+ */ + public void listOrganizationEvents( + com.google.cloud.servicehealth.v1.ListOrganizationEventsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.servicehealth.v1.ListOrganizationEventsResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListOrganizationEventsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Retrieves a resource containing information about an event affecting an
+     * organization .
+     * 
+ */ + public void getOrganizationEvent( + com.google.cloud.servicehealth.v1.GetOrganizationEventRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetOrganizationEventMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists assets impacted by organization events under a given organization and
+     * location.
+     * 
+ */ + public void listOrganizationImpacts( + com.google.cloud.servicehealth.v1.ListOrganizationImpactsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.servicehealth.v1.ListOrganizationImpactsResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListOrganizationImpactsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Retrieves a resource containing information about impact to an asset under
+     * an organization affected by a service health event.
+     * 
+ */ + public void getOrganizationImpact( + com.google.cloud.servicehealth.v1.GetOrganizationImpactRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetOrganizationImpactMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service ServiceHealth. + * + *
+   * Request service health events relevant to your Google Cloud project.
+   * 
+ */ + public static final class ServiceHealthBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private ServiceHealthBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ServiceHealthBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ServiceHealthBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists events under a given project and location.
+     * 
+ */ + public com.google.cloud.servicehealth.v1.ListEventsResponse listEvents( + com.google.cloud.servicehealth.v1.ListEventsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListEventsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves a resource containing information about an event.
+     * 
+ */ + public com.google.cloud.servicehealth.v1.Event getEvent( + com.google.cloud.servicehealth.v1.GetEventRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetEventMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists organization events under a given organization and location.
+     * 
+ */ + public com.google.cloud.servicehealth.v1.ListOrganizationEventsResponse listOrganizationEvents( + com.google.cloud.servicehealth.v1.ListOrganizationEventsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListOrganizationEventsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves a resource containing information about an event affecting an
+     * organization .
+     * 
+ */ + public com.google.cloud.servicehealth.v1.OrganizationEvent getOrganizationEvent( + com.google.cloud.servicehealth.v1.GetOrganizationEventRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetOrganizationEventMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists assets impacted by organization events under a given organization and
+     * location.
+     * 
+ */ + public com.google.cloud.servicehealth.v1.ListOrganizationImpactsResponse + listOrganizationImpacts( + com.google.cloud.servicehealth.v1.ListOrganizationImpactsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListOrganizationImpactsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves a resource containing information about impact to an asset under
+     * an organization affected by a service health event.
+     * 
+ */ + public com.google.cloud.servicehealth.v1.OrganizationImpact getOrganizationImpact( + com.google.cloud.servicehealth.v1.GetOrganizationImpactRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetOrganizationImpactMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service ServiceHealth. + * + *
+   * Request service health events relevant to your Google Cloud project.
+   * 
+ */ + public static final class ServiceHealthFutureStub + extends io.grpc.stub.AbstractFutureStub { + private ServiceHealthFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ServiceHealthFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ServiceHealthFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists events under a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.servicehealth.v1.ListEventsResponse> + listEvents(com.google.cloud.servicehealth.v1.ListEventsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListEventsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Retrieves a resource containing information about an event.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.servicehealth.v1.Event> + getEvent(com.google.cloud.servicehealth.v1.GetEventRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetEventMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists organization events under a given organization and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.servicehealth.v1.ListOrganizationEventsResponse> + listOrganizationEvents( + com.google.cloud.servicehealth.v1.ListOrganizationEventsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListOrganizationEventsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Retrieves a resource containing information about an event affecting an
+     * organization .
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.servicehealth.v1.OrganizationEvent> + getOrganizationEvent( + com.google.cloud.servicehealth.v1.GetOrganizationEventRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetOrganizationEventMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists assets impacted by organization events under a given organization and
+     * location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.servicehealth.v1.ListOrganizationImpactsResponse> + listOrganizationImpacts( + com.google.cloud.servicehealth.v1.ListOrganizationImpactsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListOrganizationImpactsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Retrieves a resource containing information about impact to an asset under
+     * an organization affected by a service health event.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.servicehealth.v1.OrganizationImpact> + getOrganizationImpact( + com.google.cloud.servicehealth.v1.GetOrganizationImpactRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetOrganizationImpactMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_EVENTS = 0; + private static final int METHODID_GET_EVENT = 1; + private static final int METHODID_LIST_ORGANIZATION_EVENTS = 2; + private static final int METHODID_GET_ORGANIZATION_EVENT = 3; + private static final int METHODID_LIST_ORGANIZATION_IMPACTS = 4; + private static final int METHODID_GET_ORGANIZATION_IMPACT = 5; + + 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_LIST_EVENTS: + serviceImpl.listEvents( + (com.google.cloud.servicehealth.v1.ListEventsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_EVENT: + serviceImpl.getEvent( + (com.google.cloud.servicehealth.v1.GetEventRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_ORGANIZATION_EVENTS: + serviceImpl.listOrganizationEvents( + (com.google.cloud.servicehealth.v1.ListOrganizationEventsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.servicehealth.v1.ListOrganizationEventsResponse>) + responseObserver); + break; + case METHODID_GET_ORGANIZATION_EVENT: + serviceImpl.getOrganizationEvent( + (com.google.cloud.servicehealth.v1.GetOrganizationEventRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_ORGANIZATION_IMPACTS: + serviceImpl.listOrganizationImpacts( + (com.google.cloud.servicehealth.v1.ListOrganizationImpactsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.servicehealth.v1.ListOrganizationImpactsResponse>) + responseObserver); + break; + case METHODID_GET_ORGANIZATION_IMPACT: + serviceImpl.getOrganizationImpact( + (com.google.cloud.servicehealth.v1.GetOrganizationImpactRequest) 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( + getListEventsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.servicehealth.v1.ListEventsRequest, + com.google.cloud.servicehealth.v1.ListEventsResponse>( + service, METHODID_LIST_EVENTS))) + .addMethod( + getGetEventMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.servicehealth.v1.GetEventRequest, + com.google.cloud.servicehealth.v1.Event>(service, METHODID_GET_EVENT))) + .addMethod( + getListOrganizationEventsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.servicehealth.v1.ListOrganizationEventsRequest, + com.google.cloud.servicehealth.v1.ListOrganizationEventsResponse>( + service, METHODID_LIST_ORGANIZATION_EVENTS))) + .addMethod( + getGetOrganizationEventMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.servicehealth.v1.GetOrganizationEventRequest, + com.google.cloud.servicehealth.v1.OrganizationEvent>( + service, METHODID_GET_ORGANIZATION_EVENT))) + .addMethod( + getListOrganizationImpactsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.servicehealth.v1.ListOrganizationImpactsRequest, + com.google.cloud.servicehealth.v1.ListOrganizationImpactsResponse>( + service, METHODID_LIST_ORGANIZATION_IMPACTS))) + .addMethod( + getGetOrganizationImpactMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.servicehealth.v1.GetOrganizationImpactRequest, + com.google.cloud.servicehealth.v1.OrganizationImpact>( + service, METHODID_GET_ORGANIZATION_IMPACT))) + .build(); + } + + private abstract static class ServiceHealthBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + ServiceHealthBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.servicehealth.v1.EventServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("ServiceHealth"); + } + } + + private static final class ServiceHealthFileDescriptorSupplier + extends ServiceHealthBaseDescriptorSupplier { + ServiceHealthFileDescriptorSupplier() {} + } + + private static final class ServiceHealthMethodDescriptorSupplier + extends ServiceHealthBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + ServiceHealthMethodDescriptorSupplier(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 (ServiceHealthGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new ServiceHealthFileDescriptorSupplier()) + .addMethod(getListEventsMethod()) + .addMethod(getGetEventMethod()) + .addMethod(getListOrganizationEventsMethod()) + .addMethod(getGetOrganizationEventMethod()) + .addMethod(getListOrganizationImpactsMethod()) + .addMethod(getGetOrganizationImpactMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-servicehealth/owlbot.py b/java-servicehealth/owlbot.py new file mode 100644 index 000000000000..03c0f6686d3f --- /dev/null +++ b/java-servicehealth/owlbot.py @@ -0,0 +1,36 @@ +# Copyright 2021 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. + +import synthtool as s +from synthtool.languages import java + + +for library in s.get_staging_dirs(): + # put any special-case replacements here + s.move(library) + +s.remove_staging_dirs() +java.common_templates(monorepo=True, excludes=[ + ".github/*", + ".kokoro/*", + "samples/*", + "CODE_OF_CONDUCT.md", + "CONTRIBUTING.md", + "LICENSE", + "SECURITY.md", + "java.header", + "license-checks.xml", + "renovate.json", + ".gitignore" +]) \ No newline at end of file diff --git a/java-servicehealth/pom.xml b/java-servicehealth/pom.xml new file mode 100644 index 000000000000..8df64b4ebea7 --- /dev/null +++ b/java-servicehealth/pom.xml @@ -0,0 +1,54 @@ + + + 4.0.0 + com.google.cloud + google-cloud-servicehealth-parent + pom + 0.0.1-SNAPSHOT + Google Service Health API Parent + + Java idiomatic client for Google Cloud Platform services. + + + + com.google.cloud + google-cloud-jar-parent + 1.28.0-SNAPSHOT + ../google-cloud-jar-parent/pom.xml + + + + UTF-8 + UTF-8 + github + google-cloud-servicehealth-parent + + + + + + com.google.cloud + google-cloud-servicehealth + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-servicehealth-v1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-servicehealth-v1 + 0.0.1-SNAPSHOT + + + + + + google-cloud-servicehealth + grpc-google-cloud-servicehealth-v1 + proto-google-cloud-servicehealth-v1 + google-cloud-servicehealth-bom + + + diff --git a/java-servicehealth/proto-google-cloud-servicehealth-v1/clirr-ignored-differences.xml b/java-servicehealth/proto-google-cloud-servicehealth-v1/clirr-ignored-differences.xml new file mode 100644 index 000000000000..d2d430f27f8f --- /dev/null +++ b/java-servicehealth/proto-google-cloud-servicehealth-v1/clirr-ignored-differences.xml @@ -0,0 +1,19 @@ + + + + + 7012 + com/google/cloud/servicehealth/v1/*OrBuilder + * get*(*) + + + 7012 + com/google/cloud/servicehealth/v1/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/cloud/servicehealth/v1/*OrBuilder + boolean has*(*) + + diff --git a/java-servicehealth/proto-google-cloud-servicehealth-v1/pom.xml b/java-servicehealth/proto-google-cloud-servicehealth-v1/pom.xml new file mode 100644 index 000000000000..8f0931e8cad4 --- /dev/null +++ b/java-servicehealth/proto-google-cloud-servicehealth-v1/pom.xml @@ -0,0 +1,37 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-servicehealth-v1 + 0.0.1-SNAPSHOT + proto-google-cloud-servicehealth-v1 + Proto library for google-cloud-servicehealth + + com.google.cloud + google-cloud-servicehealth-parent + 0.0.1-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-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/Asset.java b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/Asset.java new file mode 100644 index 000000000000..51b971a3a894 --- /dev/null +++ b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/Asset.java @@ -0,0 +1,825 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/servicehealth/v1/event_resources.proto + +package com.google.cloud.servicehealth.v1; + +/** + * + * + *
+ * Represents the asset impacted by the events.
+ * 
+ * + * Protobuf type {@code google.cloud.servicehealth.v1.Asset} + */ +public final class Asset extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicehealth.v1.Asset) + AssetOrBuilder { + private static final long serialVersionUID = 0L; + // Use Asset.newBuilder() to construct. + private Asset(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Asset() { + assetName_ = ""; + assetType_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Asset(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_Asset_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_Asset_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicehealth.v1.Asset.class, + com.google.cloud.servicehealth.v1.Asset.Builder.class); + } + + public static final int ASSET_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object assetName_ = ""; + /** + * + * + *
+   * Output only. Full name of the resource as defined in
+   * [Resource
+   * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name).
+   * 
+ * + * string asset_name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The assetName. + */ + @java.lang.Override + public java.lang.String getAssetName() { + java.lang.Object ref = assetName_; + 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(); + assetName_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Full name of the resource as defined in
+   * [Resource
+   * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name).
+   * 
+ * + * string asset_name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for assetName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAssetNameBytes() { + java.lang.Object ref = assetName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + assetName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ASSET_TYPE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object assetType_ = ""; + /** + * + * + *
+   * Output only. Type of the asset. Example:
+   * `"cloudresourcemanager.googleapis.com/Project"`
+   * 
+ * + * string asset_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The assetType. + */ + @java.lang.Override + public java.lang.String getAssetType() { + java.lang.Object ref = assetType_; + 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(); + assetType_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Type of the asset. Example:
+   * `"cloudresourcemanager.googleapis.com/Project"`
+   * 
+ * + * string asset_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for assetType. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAssetTypeBytes() { + java.lang.Object ref = assetType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + assetType_ = 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(assetName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, assetName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(assetType_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, assetType_); + } + 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(assetName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, assetName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(assetType_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, assetType_); + } + 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.servicehealth.v1.Asset)) { + return super.equals(obj); + } + com.google.cloud.servicehealth.v1.Asset other = (com.google.cloud.servicehealth.v1.Asset) obj; + + if (!getAssetName().equals(other.getAssetName())) return false; + if (!getAssetType().equals(other.getAssetType())) 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) + ASSET_NAME_FIELD_NUMBER; + hash = (53 * hash) + getAssetName().hashCode(); + hash = (37 * hash) + ASSET_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getAssetType().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.servicehealth.v1.Asset parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicehealth.v1.Asset 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.servicehealth.v1.Asset parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicehealth.v1.Asset 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.servicehealth.v1.Asset parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicehealth.v1.Asset parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.servicehealth.v1.Asset parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicehealth.v1.Asset 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.servicehealth.v1.Asset parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicehealth.v1.Asset 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.servicehealth.v1.Asset parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicehealth.v1.Asset 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.servicehealth.v1.Asset 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; + } + /** + * + * + *
+   * Represents the asset impacted by the events.
+   * 
+ * + * Protobuf type {@code google.cloud.servicehealth.v1.Asset} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicehealth.v1.Asset) + com.google.cloud.servicehealth.v1.AssetOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_Asset_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_Asset_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicehealth.v1.Asset.class, + com.google.cloud.servicehealth.v1.Asset.Builder.class); + } + + // Construct using com.google.cloud.servicehealth.v1.Asset.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + assetName_ = ""; + assetType_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_Asset_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicehealth.v1.Asset getDefaultInstanceForType() { + return com.google.cloud.servicehealth.v1.Asset.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicehealth.v1.Asset build() { + com.google.cloud.servicehealth.v1.Asset result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicehealth.v1.Asset buildPartial() { + com.google.cloud.servicehealth.v1.Asset result = + new com.google.cloud.servicehealth.v1.Asset(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.servicehealth.v1.Asset result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.assetName_ = assetName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.assetType_ = assetType_; + } + } + + @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.servicehealth.v1.Asset) { + return mergeFrom((com.google.cloud.servicehealth.v1.Asset) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.servicehealth.v1.Asset other) { + if (other == com.google.cloud.servicehealth.v1.Asset.getDefaultInstance()) return this; + if (!other.getAssetName().isEmpty()) { + assetName_ = other.assetName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getAssetType().isEmpty()) { + assetType_ = other.assetType_; + bitField0_ |= 0x00000002; + 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: + { + assetName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + assetType_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + 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 assetName_ = ""; + /** + * + * + *
+     * Output only. Full name of the resource as defined in
+     * [Resource
+     * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name).
+     * 
+ * + * string asset_name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The assetName. + */ + public java.lang.String getAssetName() { + java.lang.Object ref = assetName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + assetName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Full name of the resource as defined in
+     * [Resource
+     * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name).
+     * 
+ * + * string asset_name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for assetName. + */ + public com.google.protobuf.ByteString getAssetNameBytes() { + java.lang.Object ref = assetName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + assetName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Full name of the resource as defined in
+     * [Resource
+     * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name).
+     * 
+ * + * string asset_name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The assetName to set. + * @return This builder for chaining. + */ + public Builder setAssetName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + assetName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Full name of the resource as defined in
+     * [Resource
+     * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name).
+     * 
+ * + * string asset_name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearAssetName() { + assetName_ = getDefaultInstance().getAssetName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Full name of the resource as defined in
+     * [Resource
+     * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name).
+     * 
+ * + * string asset_name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for assetName to set. + * @return This builder for chaining. + */ + public Builder setAssetNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + assetName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object assetType_ = ""; + /** + * + * + *
+     * Output only. Type of the asset. Example:
+     * `"cloudresourcemanager.googleapis.com/Project"`
+     * 
+ * + * string asset_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The assetType. + */ + public java.lang.String getAssetType() { + java.lang.Object ref = assetType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + assetType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Type of the asset. Example:
+     * `"cloudresourcemanager.googleapis.com/Project"`
+     * 
+ * + * string asset_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for assetType. + */ + public com.google.protobuf.ByteString getAssetTypeBytes() { + java.lang.Object ref = assetType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + assetType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Type of the asset. Example:
+     * `"cloudresourcemanager.googleapis.com/Project"`
+     * 
+ * + * string asset_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The assetType to set. + * @return This builder for chaining. + */ + public Builder setAssetType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + assetType_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Type of the asset. Example:
+     * `"cloudresourcemanager.googleapis.com/Project"`
+     * 
+ * + * string asset_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearAssetType() { + assetType_ = getDefaultInstance().getAssetType(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Type of the asset. Example:
+     * `"cloudresourcemanager.googleapis.com/Project"`
+     * 
+ * + * string asset_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for assetType to set. + * @return This builder for chaining. + */ + public Builder setAssetTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + assetType_ = value; + bitField0_ |= 0x00000002; + 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.servicehealth.v1.Asset) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicehealth.v1.Asset) + private static final com.google.cloud.servicehealth.v1.Asset DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicehealth.v1.Asset(); + } + + public static com.google.cloud.servicehealth.v1.Asset getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Asset 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.servicehealth.v1.Asset getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/AssetOrBuilder.java b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/AssetOrBuilder.java new file mode 100644 index 000000000000..1d2d72277d50 --- /dev/null +++ b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/AssetOrBuilder.java @@ -0,0 +1,81 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/servicehealth/v1/event_resources.proto + +package com.google.cloud.servicehealth.v1; + +public interface AssetOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicehealth.v1.Asset) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Full name of the resource as defined in
+   * [Resource
+   * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name).
+   * 
+ * + * string asset_name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The assetName. + */ + java.lang.String getAssetName(); + /** + * + * + *
+   * Output only. Full name of the resource as defined in
+   * [Resource
+   * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name).
+   * 
+ * + * string asset_name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for assetName. + */ + com.google.protobuf.ByteString getAssetNameBytes(); + + /** + * + * + *
+   * Output only. Type of the asset. Example:
+   * `"cloudresourcemanager.googleapis.com/Project"`
+   * 
+ * + * string asset_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The assetType. + */ + java.lang.String getAssetType(); + /** + * + * + *
+   * Output only. Type of the asset. Example:
+   * `"cloudresourcemanager.googleapis.com/Project"`
+   * 
+ * + * string asset_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for assetType. + */ + com.google.protobuf.ByteString getAssetTypeBytes(); +} diff --git a/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/Event.java b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/Event.java new file mode 100644 index 000000000000..6fa31c0d4ad9 --- /dev/null +++ b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/Event.java @@ -0,0 +1,5159 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/servicehealth/v1/event_resources.proto + +package com.google.cloud.servicehealth.v1; + +/** + * + * + *
+ * Represents service health events that may affect Google Cloud products.
+ * Event resource is a read-only view and does not allow any modifications. All
+ * fields are output only.
+ * 
+ * + * Protobuf type {@code google.cloud.servicehealth.v1.Event} + */ +public final class Event extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicehealth.v1.Event) + EventOrBuilder { + private static final long serialVersionUID = 0L; + // Use Event.newBuilder() to construct. + private Event(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Event() { + name_ = ""; + title_ = ""; + description_ = ""; + category_ = 0; + detailedCategory_ = 0; + state_ = 0; + detailedState_ = 0; + eventImpacts_ = java.util.Collections.emptyList(); + relevance_ = 0; + updates_ = java.util.Collections.emptyList(); + parentEvent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Event(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_Event_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_Event_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicehealth.v1.Event.class, + com.google.cloud.servicehealth.v1.Event.Builder.class); + } + + /** + * + * + *
+   * The category of the event. This enum lists all possible categories of
+   * event.
+   * 
+ * + * Protobuf enum {@code google.cloud.servicehealth.v1.Event.EventCategory} + */ + public enum EventCategory implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified category.
+     * 
+ * + * EVENT_CATEGORY_UNSPECIFIED = 0; + */ + EVENT_CATEGORY_UNSPECIFIED(0), + /** + * + * + *
+     * Event category for service outage or degradation.
+     * 
+ * + * INCIDENT = 2; + */ + INCIDENT(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified category.
+     * 
+ * + * EVENT_CATEGORY_UNSPECIFIED = 0; + */ + public static final int EVENT_CATEGORY_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Event category for service outage or degradation.
+     * 
+ * + * INCIDENT = 2; + */ + public static final int INCIDENT_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static EventCategory 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 EventCategory forNumber(int value) { + switch (value) { + case 0: + return EVENT_CATEGORY_UNSPECIFIED; + case 2: + return INCIDENT; + 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 EventCategory findValueByNumber(int number) { + return EventCategory.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.servicehealth.v1.Event.getDescriptor().getEnumTypes().get(0); + } + + private static final EventCategory[] VALUES = values(); + + public static EventCategory 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 EventCategory(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.servicehealth.v1.Event.EventCategory) + } + + /** + * + * + *
+   * The detailed category of an event. Contains all possible states for all
+   * event categories.
+   * 
+ * + * Protobuf enum {@code google.cloud.servicehealth.v1.Event.DetailedCategory} + */ + public enum DetailedCategory implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified detailed category.
+     * 
+ * + * DETAILED_CATEGORY_UNSPECIFIED = 0; + */ + DETAILED_CATEGORY_UNSPECIFIED(0), + /** + * + * + *
+     * Indicates an event with category INCIDENT has a confirmed impact to at
+     * least one Google Cloud product.
+     * 
+ * + * CONFIRMED_INCIDENT = 1; + */ + CONFIRMED_INCIDENT(1), + /** + * + * + *
+     * Indicates an event with category INCIDENT is under investigation to
+     * determine if it has a confirmed impact on any Google Cloud products.
+     * 
+ * + * EMERGING_INCIDENT = 2; + */ + EMERGING_INCIDENT(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified detailed category.
+     * 
+ * + * DETAILED_CATEGORY_UNSPECIFIED = 0; + */ + public static final int DETAILED_CATEGORY_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Indicates an event with category INCIDENT has a confirmed impact to at
+     * least one Google Cloud product.
+     * 
+ * + * CONFIRMED_INCIDENT = 1; + */ + public static final int CONFIRMED_INCIDENT_VALUE = 1; + /** + * + * + *
+     * Indicates an event with category INCIDENT is under investigation to
+     * determine if it has a confirmed impact on any Google Cloud products.
+     * 
+ * + * EMERGING_INCIDENT = 2; + */ + public static final int EMERGING_INCIDENT_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static DetailedCategory 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 DetailedCategory forNumber(int value) { + switch (value) { + case 0: + return DETAILED_CATEGORY_UNSPECIFIED; + case 1: + return CONFIRMED_INCIDENT; + case 2: + return EMERGING_INCIDENT; + 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 DetailedCategory findValueByNumber(int number) { + return DetailedCategory.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.servicehealth.v1.Event.getDescriptor().getEnumTypes().get(1); + } + + private static final DetailedCategory[] VALUES = values(); + + public static DetailedCategory 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 DetailedCategory(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.servicehealth.v1.Event.DetailedCategory) + } + + /** + * + * + *
+   * The state of the event. This enum lists all possible states of event.
+   * 
+ * + * Protobuf enum {@code google.cloud.servicehealth.v1.Event.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified state.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * Event is actively affecting a Google Cloud product and will continue to
+     * receive updates.
+     * 
+ * + * ACTIVE = 1; + */ + ACTIVE(1), + /** + * + * + *
+     * Event is no longer affecting the Google Cloud product or has been merged
+     * with another event.
+     * 
+ * + * CLOSED = 2; + */ + CLOSED(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified state.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Event is actively affecting a Google Cloud product and will continue to
+     * receive updates.
+     * 
+ * + * ACTIVE = 1; + */ + public static final int ACTIVE_VALUE = 1; + /** + * + * + *
+     * Event is no longer affecting the Google Cloud product or has been merged
+     * with another event.
+     * 
+ * + * CLOSED = 2; + */ + public static final int CLOSED_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static 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 ACTIVE; + case 2: + return CLOSED; + 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.servicehealth.v1.Event.getDescriptor().getEnumTypes().get(2); + } + + 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.servicehealth.v1.Event.State) + } + + /** + * + * + *
+   * The detailed state of the incident. This enum lists all possible detailed
+   * states of an incident.
+   * 
+ * + * Protobuf enum {@code google.cloud.servicehealth.v1.Event.DetailedState} + */ + public enum DetailedState implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified detail state.
+     * 
+ * + * DETAILED_STATE_UNSPECIFIED = 0; + */ + DETAILED_STATE_UNSPECIFIED(0), + /** + * + * + *
+     * Google engineers are actively investigating the event to determine the
+     * impact.
+     * 
+ * + * EMERGING = 1; + */ + EMERGING(1), + /** + * + * + *
+     * The incident is confirmed and impacting at least one Google Cloud
+     * product. Ongoing status updates will be provided until it is resolved.
+     * 
+ * + * CONFIRMED = 2; + */ + CONFIRMED(2), + /** + * + * + *
+     * The incident is no longer affecting any Google Cloud product, and there
+     * will be no further updates.
+     * 
+ * + * RESOLVED = 3; + */ + RESOLVED(3), + /** + * + * + *
+     * The incident was merged into a parent incident. All further updates will
+     * be published to the parent only. The `parent_event` field contains the
+     * name of the parent.
+     * 
+ * + * MERGED = 4; + */ + MERGED(4), + /** + * + * + *
+     * The incident was automatically closed because the issues couldn’t be
+     * confirmed or is no longer impacting Google Cloud Products and/or
+     * Locations.
+     * 
+ * + * AUTO_CLOSED = 9; + */ + AUTO_CLOSED(9), + /** + * + * + *
+     * The incident was verified as non-impactful. No further action required.
+     * 
+ * + * FALSE_POSITIVE = 10; + */ + FALSE_POSITIVE(10), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified detail state.
+     * 
+ * + * DETAILED_STATE_UNSPECIFIED = 0; + */ + public static final int DETAILED_STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Google engineers are actively investigating the event to determine the
+     * impact.
+     * 
+ * + * EMERGING = 1; + */ + public static final int EMERGING_VALUE = 1; + /** + * + * + *
+     * The incident is confirmed and impacting at least one Google Cloud
+     * product. Ongoing status updates will be provided until it is resolved.
+     * 
+ * + * CONFIRMED = 2; + */ + public static final int CONFIRMED_VALUE = 2; + /** + * + * + *
+     * The incident is no longer affecting any Google Cloud product, and there
+     * will be no further updates.
+     * 
+ * + * RESOLVED = 3; + */ + public static final int RESOLVED_VALUE = 3; + /** + * + * + *
+     * The incident was merged into a parent incident. All further updates will
+     * be published to the parent only. The `parent_event` field contains the
+     * name of the parent.
+     * 
+ * + * MERGED = 4; + */ + public static final int MERGED_VALUE = 4; + /** + * + * + *
+     * The incident was automatically closed because the issues couldn’t be
+     * confirmed or is no longer impacting Google Cloud Products and/or
+     * Locations.
+     * 
+ * + * AUTO_CLOSED = 9; + */ + public static final int AUTO_CLOSED_VALUE = 9; + /** + * + * + *
+     * The incident was verified as non-impactful. No further action required.
+     * 
+ * + * FALSE_POSITIVE = 10; + */ + public static final int FALSE_POSITIVE_VALUE = 10; + + 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 DetailedState 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 DetailedState forNumber(int value) { + switch (value) { + case 0: + return DETAILED_STATE_UNSPECIFIED; + case 1: + return EMERGING; + case 2: + return CONFIRMED; + case 3: + return RESOLVED; + case 4: + return MERGED; + case 9: + return AUTO_CLOSED; + case 10: + return FALSE_POSITIVE; + 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 DetailedState findValueByNumber(int number) { + return DetailedState.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.servicehealth.v1.Event.getDescriptor().getEnumTypes().get(3); + } + + private static final DetailedState[] VALUES = values(); + + public static DetailedState 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 DetailedState(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.servicehealth.v1.Event.DetailedState) + } + + /** + * + * + *
+   * Communicates why a given incident is deemed relevant in the context of a
+   * given project. This enum lists all possible detailed states of relevance.
+   * 
+ * + * Protobuf enum {@code google.cloud.servicehealth.v1.Event.Relevance} + */ + public enum Relevance implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified relevance.
+     * 
+ * + * RELEVANCE_UNSPECIFIED = 0; + */ + RELEVANCE_UNSPECIFIED(0), + /** + * + * + *
+     * The relevance of the incident to the project is unknown.
+     * 
+ * + * UNKNOWN = 2; + */ + UNKNOWN(2), + /** + * + * + *
+     * The incident does not impact the project.
+     * 
+ * + * NOT_IMPACTED = 6; + */ + NOT_IMPACTED(6), + /** + * + * + *
+     * The incident is associated with a Google Cloud product your project uses,
+     * but the incident may not be impacting your project. For example, the
+     * incident may be impacting a Google Cloud product that your project uses,
+     * but in a location that your project does not use.
+     * 
+ * + * PARTIALLY_RELATED = 7; + */ + PARTIALLY_RELATED(7), + /** + * + * + *
+     * The incident has a direct connection with your project and impacts a
+     * Google Cloud product in a location your project uses.
+     * 
+ * + * RELATED = 8; + */ + RELATED(8), + /** + * + * + *
+     * The incident is verified to be impacting your project.
+     * 
+ * + * IMPACTED = 9; + */ + IMPACTED(9), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified relevance.
+     * 
+ * + * RELEVANCE_UNSPECIFIED = 0; + */ + public static final int RELEVANCE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The relevance of the incident to the project is unknown.
+     * 
+ * + * UNKNOWN = 2; + */ + public static final int UNKNOWN_VALUE = 2; + /** + * + * + *
+     * The incident does not impact the project.
+     * 
+ * + * NOT_IMPACTED = 6; + */ + public static final int NOT_IMPACTED_VALUE = 6; + /** + * + * + *
+     * The incident is associated with a Google Cloud product your project uses,
+     * but the incident may not be impacting your project. For example, the
+     * incident may be impacting a Google Cloud product that your project uses,
+     * but in a location that your project does not use.
+     * 
+ * + * PARTIALLY_RELATED = 7; + */ + public static final int PARTIALLY_RELATED_VALUE = 7; + /** + * + * + *
+     * The incident has a direct connection with your project and impacts a
+     * Google Cloud product in a location your project uses.
+     * 
+ * + * RELATED = 8; + */ + public static final int RELATED_VALUE = 8; + /** + * + * + *
+     * The incident is verified to be impacting your project.
+     * 
+ * + * IMPACTED = 9; + */ + public static final int IMPACTED_VALUE = 9; + + 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 Relevance 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 Relevance forNumber(int value) { + switch (value) { + case 0: + return RELEVANCE_UNSPECIFIED; + case 2: + return UNKNOWN; + case 6: + return NOT_IMPACTED; + case 7: + return PARTIALLY_RELATED; + case 8: + return RELATED; + case 9: + return IMPACTED; + 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 Relevance findValueByNumber(int number) { + return Relevance.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.servicehealth.v1.Event.getDescriptor().getEnumTypes().get(4); + } + + private static final Relevance[] VALUES = values(); + + public static Relevance 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 Relevance(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.servicehealth.v1.Event.Relevance) + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Output only. Identifier. Name of the event. Unique name of the event in
+   * this scope including project and location using the form
+   * `projects/{project_id}/locations/{location}/events/{event_id}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.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; + } + } + /** + * + * + *
+   * Output only. Identifier. Name of the event. Unique name of the event in
+   * this scope including project and location using the form
+   * `projects/{project_id}/locations/{location}/events/{event_id}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.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 TITLE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object title_ = ""; + /** + * + * + *
+   * Output only. Brief description for the event.
+   * 
+ * + * 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. Brief description for the event.
+   * 
+ * + * 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. Free-form, human-readable description.
+   * 
+ * + * 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. Free-form, human-readable description.
+   * 
+ * + * 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 event.
+   * 
+ * + * + * .google.cloud.servicehealth.v1.Event.EventCategory 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 event.
+   * 
+ * + * + * .google.cloud.servicehealth.v1.Event.EventCategory category = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The category. + */ + @java.lang.Override + public com.google.cloud.servicehealth.v1.Event.EventCategory getCategory() { + com.google.cloud.servicehealth.v1.Event.EventCategory result = + com.google.cloud.servicehealth.v1.Event.EventCategory.forNumber(category_); + return result == null + ? com.google.cloud.servicehealth.v1.Event.EventCategory.UNRECOGNIZED + : result; + } + + public static final int DETAILED_CATEGORY_FIELD_NUMBER = 21; + private int detailedCategory_ = 0; + /** + * + * + *
+   * Output only. The detailed category of the event.
+   * 
+ * + * + * .google.cloud.servicehealth.v1.Event.DetailedCategory detailed_category = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for detailedCategory. + */ + @java.lang.Override + public int getDetailedCategoryValue() { + return detailedCategory_; + } + /** + * + * + *
+   * Output only. The detailed category of the event.
+   * 
+ * + * + * .google.cloud.servicehealth.v1.Event.DetailedCategory detailed_category = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The detailedCategory. + */ + @java.lang.Override + public com.google.cloud.servicehealth.v1.Event.DetailedCategory getDetailedCategory() { + com.google.cloud.servicehealth.v1.Event.DetailedCategory result = + com.google.cloud.servicehealth.v1.Event.DetailedCategory.forNumber(detailedCategory_); + return result == null + ? com.google.cloud.servicehealth.v1.Event.DetailedCategory.UNRECOGNIZED + : result; + } + + public static final int STATE_FIELD_NUMBER = 5; + private int state_ = 0; + /** + * + * + *
+   * Output only. The current state of the event.
+   * 
+ * + * + * .google.cloud.servicehealth.v1.Event.State state = 5 [(.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 current state of the event.
+   * 
+ * + * + * .google.cloud.servicehealth.v1.Event.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.servicehealth.v1.Event.State getState() { + com.google.cloud.servicehealth.v1.Event.State result = + com.google.cloud.servicehealth.v1.Event.State.forNumber(state_); + return result == null ? com.google.cloud.servicehealth.v1.Event.State.UNRECOGNIZED : result; + } + + public static final int DETAILED_STATE_FIELD_NUMBER = 19; + private int detailedState_ = 0; + /** + * + * + *
+   * Output only. The current detailed state of the incident.
+   * 
+ * + * + * .google.cloud.servicehealth.v1.Event.DetailedState detailed_state = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for detailedState. + */ + @java.lang.Override + public int getDetailedStateValue() { + return detailedState_; + } + /** + * + * + *
+   * Output only. The current detailed state of the incident.
+   * 
+ * + * + * .google.cloud.servicehealth.v1.Event.DetailedState detailed_state = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The detailedState. + */ + @java.lang.Override + public com.google.cloud.servicehealth.v1.Event.DetailedState getDetailedState() { + com.google.cloud.servicehealth.v1.Event.DetailedState result = + com.google.cloud.servicehealth.v1.Event.DetailedState.forNumber(detailedState_); + return result == null + ? com.google.cloud.servicehealth.v1.Event.DetailedState.UNRECOGNIZED + : result; + } + + public static final int EVENT_IMPACTS_FIELD_NUMBER = 20; + + @SuppressWarnings("serial") + private java.util.List eventImpacts_; + /** + * + * + *
+   * Google Cloud products and locations impacted by the event.
+   * 
+ * + * repeated .google.cloud.servicehealth.v1.EventImpact event_impacts = 20; + */ + @java.lang.Override + public java.util.List getEventImpactsList() { + return eventImpacts_; + } + /** + * + * + *
+   * Google Cloud products and locations impacted by the event.
+   * 
+ * + * repeated .google.cloud.servicehealth.v1.EventImpact event_impacts = 20; + */ + @java.lang.Override + public java.util.List + getEventImpactsOrBuilderList() { + return eventImpacts_; + } + /** + * + * + *
+   * Google Cloud products and locations impacted by the event.
+   * 
+ * + * repeated .google.cloud.servicehealth.v1.EventImpact event_impacts = 20; + */ + @java.lang.Override + public int getEventImpactsCount() { + return eventImpacts_.size(); + } + /** + * + * + *
+   * Google Cloud products and locations impacted by the event.
+   * 
+ * + * repeated .google.cloud.servicehealth.v1.EventImpact event_impacts = 20; + */ + @java.lang.Override + public com.google.cloud.servicehealth.v1.EventImpact getEventImpacts(int index) { + return eventImpacts_.get(index); + } + /** + * + * + *
+   * Google Cloud products and locations impacted by the event.
+   * 
+ * + * repeated .google.cloud.servicehealth.v1.EventImpact event_impacts = 20; + */ + @java.lang.Override + public com.google.cloud.servicehealth.v1.EventImpactOrBuilder getEventImpactsOrBuilder( + int index) { + return eventImpacts_.get(index); + } + + public static final int RELEVANCE_FIELD_NUMBER = 8; + private int relevance_ = 0; + /** + * + * + *
+   * Output only. Communicates why a given event is deemed relevant in the
+   * context of a given project.
+   * 
+ * + * + * .google.cloud.servicehealth.v1.Event.Relevance relevance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for relevance. + */ + @java.lang.Override + public int getRelevanceValue() { + return relevance_; + } + /** + * + * + *
+   * Output only. Communicates why a given event is deemed relevant in the
+   * context of a given project.
+   * 
+ * + * + * .google.cloud.servicehealth.v1.Event.Relevance relevance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The relevance. + */ + @java.lang.Override + public com.google.cloud.servicehealth.v1.Event.Relevance getRelevance() { + com.google.cloud.servicehealth.v1.Event.Relevance result = + com.google.cloud.servicehealth.v1.Event.Relevance.forNumber(relevance_); + return result == null ? com.google.cloud.servicehealth.v1.Event.Relevance.UNRECOGNIZED : result; + } + + public static final int UPDATES_FIELD_NUMBER = 9; + + @SuppressWarnings("serial") + private java.util.List updates_; + /** + * + * + *
+   * Output only. Event updates are correspondence from Google.
+   * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventUpdate updates = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List getUpdatesList() { + return updates_; + } + /** + * + * + *
+   * Output only. Event updates are correspondence from Google.
+   * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventUpdate updates = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getUpdatesOrBuilderList() { + return updates_; + } + /** + * + * + *
+   * Output only. Event updates are correspondence from Google.
+   * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventUpdate updates = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getUpdatesCount() { + return updates_.size(); + } + /** + * + * + *
+   * Output only. Event updates are correspondence from Google.
+   * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventUpdate updates = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.servicehealth.v1.EventUpdate getUpdates(int index) { + return updates_.get(index); + } + /** + * + * + *
+   * Output only. Event updates are correspondence from Google.
+   * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventUpdate updates = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.servicehealth.v1.EventUpdateOrBuilder getUpdatesOrBuilder(int index) { + return updates_.get(index); + } + + public static final int PARENT_EVENT_FIELD_NUMBER = 10; + + @SuppressWarnings("serial") + private volatile java.lang.Object parentEvent_ = ""; + /** + * + * + *
+   * Output only. When `detailed_state`=`MERGED`, `parent_event` contains the
+   * name of the parent event. All further updates will be published to the
+   * parent event.
+   * 
+ * + * string parent_event = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The parentEvent. + */ + @java.lang.Override + public java.lang.String getParentEvent() { + java.lang.Object ref = parentEvent_; + 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(); + parentEvent_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. When `detailed_state`=`MERGED`, `parent_event` contains the
+   * name of the parent event. All further updates will be published to the
+   * parent event.
+   * 
+ * + * string parent_event = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for parentEvent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentEventBytes() { + java.lang.Object ref = parentEvent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parentEvent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 12; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. The time when the event was last modified.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Output only. The time when the event was last modified.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 12 [(.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 time when the event was last modified.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 12 [(.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 START_TIME_FIELD_NUMBER = 13; + private com.google.protobuf.Timestamp startTime_; + /** + * + * + *
+   * Output only. The start time of the event, if applicable.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the startTime field is set. + */ + @java.lang.Override + public boolean hasStartTime() { + return startTime_ != null; + } + /** + * + * + *
+   * Output only. The start time of the event, if applicable.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The startTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + /** + * + * + *
+   * Output only. The start time of the event, if applicable.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + public static final int END_TIME_FIELD_NUMBER = 14; + private com.google.protobuf.Timestamp endTime_; + /** + * + * + *
+   * Output only. The end time of the event, if applicable.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return endTime_ != null; + } + /** + * + * + *
+   * Output only. The end time of the event, if applicable.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + /** + * + * + *
+   * Output only. The end time of the event, if applicable.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + public static final int NEXT_UPDATE_TIME_FIELD_NUMBER = 15; + private com.google.protobuf.Timestamp nextUpdateTime_; + /** + * + * + *
+   * Output only. The time when the next update can be expected.
+   * 
+ * + * + * .google.protobuf.Timestamp next_update_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the nextUpdateTime field is set. + */ + @java.lang.Override + public boolean hasNextUpdateTime() { + return nextUpdateTime_ != null; + } + /** + * + * + *
+   * Output only. The time when the next update can be expected.
+   * 
+ * + * + * .google.protobuf.Timestamp next_update_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The nextUpdateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getNextUpdateTime() { + return nextUpdateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : nextUpdateTime_; + } + /** + * + * + *
+   * Output only. The time when the next update can be expected.
+   * 
+ * + * + * .google.protobuf.Timestamp next_update_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getNextUpdateTimeOrBuilder() { + return nextUpdateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : nextUpdateTime_; + } + + 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 (!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.servicehealth.v1.Event.EventCategory.EVENT_CATEGORY_UNSPECIFIED + .getNumber()) { + output.writeEnum(4, category_); + } + if (state_ != com.google.cloud.servicehealth.v1.Event.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(5, state_); + } + if (relevance_ + != com.google.cloud.servicehealth.v1.Event.Relevance.RELEVANCE_UNSPECIFIED.getNumber()) { + output.writeEnum(8, relevance_); + } + for (int i = 0; i < updates_.size(); i++) { + output.writeMessage(9, updates_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parentEvent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, parentEvent_); + } + if (updateTime_ != null) { + output.writeMessage(12, getUpdateTime()); + } + if (startTime_ != null) { + output.writeMessage(13, getStartTime()); + } + if (endTime_ != null) { + output.writeMessage(14, getEndTime()); + } + if (nextUpdateTime_ != null) { + output.writeMessage(15, getNextUpdateTime()); + } + if (detailedState_ + != com.google.cloud.servicehealth.v1.Event.DetailedState.DETAILED_STATE_UNSPECIFIED + .getNumber()) { + output.writeEnum(19, detailedState_); + } + for (int i = 0; i < eventImpacts_.size(); i++) { + output.writeMessage(20, eventImpacts_.get(i)); + } + if (detailedCategory_ + != com.google.cloud.servicehealth.v1.Event.DetailedCategory.DETAILED_CATEGORY_UNSPECIFIED + .getNumber()) { + output.writeEnum(21, detailedCategory_); + } + 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 (!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.servicehealth.v1.Event.EventCategory.EVENT_CATEGORY_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, category_); + } + if (state_ != com.google.cloud.servicehealth.v1.Event.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, state_); + } + if (relevance_ + != com.google.cloud.servicehealth.v1.Event.Relevance.RELEVANCE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(8, relevance_); + } + for (int i = 0; i < updates_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, updates_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parentEvent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, parentEvent_); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, getUpdateTime()); + } + if (startTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(13, getStartTime()); + } + if (endTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(14, getEndTime()); + } + if (nextUpdateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(15, getNextUpdateTime()); + } + if (detailedState_ + != com.google.cloud.servicehealth.v1.Event.DetailedState.DETAILED_STATE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(19, detailedState_); + } + for (int i = 0; i < eventImpacts_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(20, eventImpacts_.get(i)); + } + if (detailedCategory_ + != com.google.cloud.servicehealth.v1.Event.DetailedCategory.DETAILED_CATEGORY_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(21, detailedCategory_); + } + 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.servicehealth.v1.Event)) { + return super.equals(obj); + } + com.google.cloud.servicehealth.v1.Event other = (com.google.cloud.servicehealth.v1.Event) obj; + + if (!getName().equals(other.getName())) return false; + if (!getTitle().equals(other.getTitle())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (category_ != other.category_) return false; + if (detailedCategory_ != other.detailedCategory_) return false; + if (state_ != other.state_) return false; + if (detailedState_ != other.detailedState_) return false; + if (!getEventImpactsList().equals(other.getEventImpactsList())) return false; + if (relevance_ != other.relevance_) return false; + if (!getUpdatesList().equals(other.getUpdatesList())) return false; + if (!getParentEvent().equals(other.getParentEvent())) return false; + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (hasStartTime() != other.hasStartTime()) return false; + if (hasStartTime()) { + if (!getStartTime().equals(other.getStartTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (hasNextUpdateTime() != other.hasNextUpdateTime()) return false; + if (hasNextUpdateTime()) { + if (!getNextUpdateTime().equals(other.getNextUpdateTime())) 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 = (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 = (37 * hash) + DETAILED_CATEGORY_FIELD_NUMBER; + hash = (53 * hash) + detailedCategory_; + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + DETAILED_STATE_FIELD_NUMBER; + hash = (53 * hash) + detailedState_; + if (getEventImpactsCount() > 0) { + hash = (37 * hash) + EVENT_IMPACTS_FIELD_NUMBER; + hash = (53 * hash) + getEventImpactsList().hashCode(); + } + hash = (37 * hash) + RELEVANCE_FIELD_NUMBER; + hash = (53 * hash) + relevance_; + if (getUpdatesCount() > 0) { + hash = (37 * hash) + UPDATES_FIELD_NUMBER; + hash = (53 * hash) + getUpdatesList().hashCode(); + } + hash = (37 * hash) + PARENT_EVENT_FIELD_NUMBER; + hash = (53 * hash) + getParentEvent().hashCode(); + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + if (hasStartTime()) { + hash = (37 * hash) + START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStartTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + if (hasNextUpdateTime()) { + hash = (37 * hash) + NEXT_UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getNextUpdateTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.servicehealth.v1.Event parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicehealth.v1.Event 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.servicehealth.v1.Event parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicehealth.v1.Event 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.servicehealth.v1.Event parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicehealth.v1.Event parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.servicehealth.v1.Event parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicehealth.v1.Event 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.servicehealth.v1.Event parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicehealth.v1.Event 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.servicehealth.v1.Event parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicehealth.v1.Event 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.servicehealth.v1.Event 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; + } + /** + * + * + *
+   * Represents service health events that may affect Google Cloud products.
+   * Event resource is a read-only view and does not allow any modifications. All
+   * fields are output only.
+   * 
+ * + * Protobuf type {@code google.cloud.servicehealth.v1.Event} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicehealth.v1.Event) + com.google.cloud.servicehealth.v1.EventOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_Event_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_Event_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicehealth.v1.Event.class, + com.google.cloud.servicehealth.v1.Event.Builder.class); + } + + // Construct using com.google.cloud.servicehealth.v1.Event.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + title_ = ""; + description_ = ""; + category_ = 0; + detailedCategory_ = 0; + state_ = 0; + detailedState_ = 0; + if (eventImpactsBuilder_ == null) { + eventImpacts_ = java.util.Collections.emptyList(); + } else { + eventImpacts_ = null; + eventImpactsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000080); + relevance_ = 0; + if (updatesBuilder_ == null) { + updates_ = java.util.Collections.emptyList(); + } else { + updates_ = null; + updatesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000200); + parentEvent_ = ""; + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + nextUpdateTime_ = null; + if (nextUpdateTimeBuilder_ != null) { + nextUpdateTimeBuilder_.dispose(); + nextUpdateTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_Event_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicehealth.v1.Event getDefaultInstanceForType() { + return com.google.cloud.servicehealth.v1.Event.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicehealth.v1.Event build() { + com.google.cloud.servicehealth.v1.Event result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicehealth.v1.Event buildPartial() { + com.google.cloud.servicehealth.v1.Event result = + new com.google.cloud.servicehealth.v1.Event(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.servicehealth.v1.Event result) { + if (eventImpactsBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0)) { + eventImpacts_ = java.util.Collections.unmodifiableList(eventImpacts_); + bitField0_ = (bitField0_ & ~0x00000080); + } + result.eventImpacts_ = eventImpacts_; + } else { + result.eventImpacts_ = eventImpactsBuilder_.build(); + } + if (updatesBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0)) { + updates_ = java.util.Collections.unmodifiableList(updates_); + bitField0_ = (bitField0_ & ~0x00000200); + } + result.updates_ = updates_; + } else { + result.updates_ = updatesBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.servicehealth.v1.Event result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.title_ = title_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.description_ = description_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.category_ = category_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.detailedCategory_ = detailedCategory_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.state_ = state_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.detailedState_ = detailedState_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.relevance_ = relevance_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.parentEvent_ = parentEvent_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.startTime_ = startTimeBuilder_ == null ? startTime_ : startTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.endTime_ = endTimeBuilder_ == null ? endTime_ : endTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00004000) != 0)) { + result.nextUpdateTime_ = + nextUpdateTimeBuilder_ == null ? nextUpdateTime_ : nextUpdateTimeBuilder_.build(); + } + } + + @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.servicehealth.v1.Event) { + return mergeFrom((com.google.cloud.servicehealth.v1.Event) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.servicehealth.v1.Event other) { + if (other == com.google.cloud.servicehealth.v1.Event.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + 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.detailedCategory_ != 0) { + setDetailedCategoryValue(other.getDetailedCategoryValue()); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (other.detailedState_ != 0) { + setDetailedStateValue(other.getDetailedStateValue()); + } + if (eventImpactsBuilder_ == null) { + if (!other.eventImpacts_.isEmpty()) { + if (eventImpacts_.isEmpty()) { + eventImpacts_ = other.eventImpacts_; + bitField0_ = (bitField0_ & ~0x00000080); + } else { + ensureEventImpactsIsMutable(); + eventImpacts_.addAll(other.eventImpacts_); + } + onChanged(); + } + } else { + if (!other.eventImpacts_.isEmpty()) { + if (eventImpactsBuilder_.isEmpty()) { + eventImpactsBuilder_.dispose(); + eventImpactsBuilder_ = null; + eventImpacts_ = other.eventImpacts_; + bitField0_ = (bitField0_ & ~0x00000080); + eventImpactsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getEventImpactsFieldBuilder() + : null; + } else { + eventImpactsBuilder_.addAllMessages(other.eventImpacts_); + } + } + } + if (other.relevance_ != 0) { + setRelevanceValue(other.getRelevanceValue()); + } + if (updatesBuilder_ == null) { + if (!other.updates_.isEmpty()) { + if (updates_.isEmpty()) { + updates_ = other.updates_; + bitField0_ = (bitField0_ & ~0x00000200); + } else { + ensureUpdatesIsMutable(); + updates_.addAll(other.updates_); + } + onChanged(); + } + } else { + if (!other.updates_.isEmpty()) { + if (updatesBuilder_.isEmpty()) { + updatesBuilder_.dispose(); + updatesBuilder_ = null; + updates_ = other.updates_; + bitField0_ = (bitField0_ & ~0x00000200); + updatesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getUpdatesFieldBuilder() + : null; + } else { + updatesBuilder_.addAllMessages(other.updates_); + } + } + } + if (!other.getParentEvent().isEmpty()) { + parentEvent_ = other.parentEvent_; + bitField0_ |= 0x00000400; + onChanged(); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + if (other.hasNextUpdateTime()) { + mergeNextUpdateTime(other.getNextUpdateTime()); + } + 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: + { + 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 + case 40: + { + state_ = input.readEnum(); + bitField0_ |= 0x00000020; + break; + } // case 40 + case 64: + { + relevance_ = input.readEnum(); + bitField0_ |= 0x00000100; + break; + } // case 64 + case 74: + { + com.google.cloud.servicehealth.v1.EventUpdate m = + input.readMessage( + com.google.cloud.servicehealth.v1.EventUpdate.parser(), extensionRegistry); + if (updatesBuilder_ == null) { + ensureUpdatesIsMutable(); + updates_.add(m); + } else { + updatesBuilder_.addMessage(m); + } + break; + } // case 74 + case 82: + { + parentEvent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000400; + break; + } // case 82 + case 98: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000800; + break; + } // case 98 + case 106: + { + input.readMessage(getStartTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00001000; + break; + } // case 106 + case 114: + { + input.readMessage(getEndTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00002000; + break; + } // case 114 + case 122: + { + input.readMessage(getNextUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00004000; + break; + } // case 122 + case 152: + { + detailedState_ = input.readEnum(); + bitField0_ |= 0x00000040; + break; + } // case 152 + case 162: + { + com.google.cloud.servicehealth.v1.EventImpact m = + input.readMessage( + com.google.cloud.servicehealth.v1.EventImpact.parser(), extensionRegistry); + if (eventImpactsBuilder_ == null) { + ensureEventImpactsIsMutable(); + eventImpacts_.add(m); + } else { + eventImpactsBuilder_.addMessage(m); + } + break; + } // case 162 + case 168: + { + detailedCategory_ = input.readEnum(); + bitField0_ |= 0x00000010; + break; + } // case 168 + 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_ = ""; + /** + * + * + *
+     * Output only. Identifier. Name of the event. Unique name of the event in
+     * this scope including project and location using the form
+     * `projects/{project_id}/locations/{location}/events/{event_id}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.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; + } + } + /** + * + * + *
+     * Output only. Identifier. Name of the event. Unique name of the event in
+     * this scope including project and location using the form
+     * `projects/{project_id}/locations/{location}/events/{event_id}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.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; + } + } + /** + * + * + *
+     * Output only. Identifier. Name of the event. Unique name of the event in
+     * this scope including project and location using the form
+     * `projects/{project_id}/locations/{location}/events/{event_id}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.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; + } + /** + * + * + *
+     * Output only. Identifier. Name of the event. Unique name of the event in
+     * this scope including project and location using the form
+     * `projects/{project_id}/locations/{location}/events/{event_id}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Identifier. Name of the event. Unique name of the event in
+     * this scope including project and location using the form
+     * `projects/{project_id}/locations/{location}/events/{event_id}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.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 java.lang.Object title_ = ""; + /** + * + * + *
+     * Output only. Brief description for the event.
+     * 
+ * + * 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. Brief description for the event.
+     * 
+ * + * 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. Brief description for the event.
+     * 
+ * + * 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. Brief description for the event.
+     * 
+ * + * 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. Brief description for the event.
+     * 
+ * + * 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. Free-form, human-readable description.
+     * 
+ * + * 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. Free-form, human-readable description.
+     * 
+ * + * 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. Free-form, human-readable description.
+     * 
+ * + * 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. Free-form, human-readable description.
+     * 
+ * + * 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. Free-form, human-readable description.
+     * 
+ * + * 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 event.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.Event.EventCategory 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 event.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.Event.EventCategory 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 event.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.Event.EventCategory category = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The category. + */ + @java.lang.Override + public com.google.cloud.servicehealth.v1.Event.EventCategory getCategory() { + com.google.cloud.servicehealth.v1.Event.EventCategory result = + com.google.cloud.servicehealth.v1.Event.EventCategory.forNumber(category_); + return result == null + ? com.google.cloud.servicehealth.v1.Event.EventCategory.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. The category of the event.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.Event.EventCategory 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.servicehealth.v1.Event.EventCategory value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + category_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The category of the event.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.Event.EventCategory category = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearCategory() { + bitField0_ = (bitField0_ & ~0x00000008); + category_ = 0; + onChanged(); + return this; + } + + private int detailedCategory_ = 0; + /** + * + * + *
+     * Output only. The detailed category of the event.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.Event.DetailedCategory detailed_category = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for detailedCategory. + */ + @java.lang.Override + public int getDetailedCategoryValue() { + return detailedCategory_; + } + /** + * + * + *
+     * Output only. The detailed category of the event.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.Event.DetailedCategory detailed_category = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for detailedCategory to set. + * @return This builder for chaining. + */ + public Builder setDetailedCategoryValue(int value) { + detailedCategory_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The detailed category of the event.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.Event.DetailedCategory detailed_category = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The detailedCategory. + */ + @java.lang.Override + public com.google.cloud.servicehealth.v1.Event.DetailedCategory getDetailedCategory() { + com.google.cloud.servicehealth.v1.Event.DetailedCategory result = + com.google.cloud.servicehealth.v1.Event.DetailedCategory.forNumber(detailedCategory_); + return result == null + ? com.google.cloud.servicehealth.v1.Event.DetailedCategory.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. The detailed category of the event.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.Event.DetailedCategory detailed_category = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The detailedCategory to set. + * @return This builder for chaining. + */ + public Builder setDetailedCategory( + com.google.cloud.servicehealth.v1.Event.DetailedCategory value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + detailedCategory_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The detailed category of the event.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.Event.DetailedCategory detailed_category = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearDetailedCategory() { + bitField0_ = (bitField0_ & ~0x00000010); + detailedCategory_ = 0; + onChanged(); + return this; + } + + private int state_ = 0; + /** + * + * + *
+     * Output only. The current state of the event.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.Event.State state = 5 [(.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 current state of the event.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.Event.State state = 5 [(.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_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The current state of the event.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.Event.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.servicehealth.v1.Event.State getState() { + com.google.cloud.servicehealth.v1.Event.State result = + com.google.cloud.servicehealth.v1.Event.State.forNumber(state_); + return result == null ? com.google.cloud.servicehealth.v1.Event.State.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Output only. The current state of the event.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.Event.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.servicehealth.v1.Event.State value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The current state of the event.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.Event.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + bitField0_ = (bitField0_ & ~0x00000020); + state_ = 0; + onChanged(); + return this; + } + + private int detailedState_ = 0; + /** + * + * + *
+     * Output only. The current detailed state of the incident.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.Event.DetailedState detailed_state = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for detailedState. + */ + @java.lang.Override + public int getDetailedStateValue() { + return detailedState_; + } + /** + * + * + *
+     * Output only. The current detailed state of the incident.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.Event.DetailedState detailed_state = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for detailedState to set. + * @return This builder for chaining. + */ + public Builder setDetailedStateValue(int value) { + detailedState_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The current detailed state of the incident.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.Event.DetailedState detailed_state = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The detailedState. + */ + @java.lang.Override + public com.google.cloud.servicehealth.v1.Event.DetailedState getDetailedState() { + com.google.cloud.servicehealth.v1.Event.DetailedState result = + com.google.cloud.servicehealth.v1.Event.DetailedState.forNumber(detailedState_); + return result == null + ? com.google.cloud.servicehealth.v1.Event.DetailedState.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. The current detailed state of the incident.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.Event.DetailedState detailed_state = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The detailedState to set. + * @return This builder for chaining. + */ + public Builder setDetailedState(com.google.cloud.servicehealth.v1.Event.DetailedState value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000040; + detailedState_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The current detailed state of the incident.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.Event.DetailedState detailed_state = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearDetailedState() { + bitField0_ = (bitField0_ & ~0x00000040); + detailedState_ = 0; + onChanged(); + return this; + } + + private java.util.List eventImpacts_ = + java.util.Collections.emptyList(); + + private void ensureEventImpactsIsMutable() { + if (!((bitField0_ & 0x00000080) != 0)) { + eventImpacts_ = + new java.util.ArrayList(eventImpacts_); + bitField0_ |= 0x00000080; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.servicehealth.v1.EventImpact, + com.google.cloud.servicehealth.v1.EventImpact.Builder, + com.google.cloud.servicehealth.v1.EventImpactOrBuilder> + eventImpactsBuilder_; + + /** + * + * + *
+     * Google Cloud products and locations impacted by the event.
+     * 
+ * + * repeated .google.cloud.servicehealth.v1.EventImpact event_impacts = 20; + */ + public java.util.List getEventImpactsList() { + if (eventImpactsBuilder_ == null) { + return java.util.Collections.unmodifiableList(eventImpacts_); + } else { + return eventImpactsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Google Cloud products and locations impacted by the event.
+     * 
+ * + * repeated .google.cloud.servicehealth.v1.EventImpact event_impacts = 20; + */ + public int getEventImpactsCount() { + if (eventImpactsBuilder_ == null) { + return eventImpacts_.size(); + } else { + return eventImpactsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Google Cloud products and locations impacted by the event.
+     * 
+ * + * repeated .google.cloud.servicehealth.v1.EventImpact event_impacts = 20; + */ + public com.google.cloud.servicehealth.v1.EventImpact getEventImpacts(int index) { + if (eventImpactsBuilder_ == null) { + return eventImpacts_.get(index); + } else { + return eventImpactsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Google Cloud products and locations impacted by the event.
+     * 
+ * + * repeated .google.cloud.servicehealth.v1.EventImpact event_impacts = 20; + */ + public Builder setEventImpacts(int index, com.google.cloud.servicehealth.v1.EventImpact value) { + if (eventImpactsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEventImpactsIsMutable(); + eventImpacts_.set(index, value); + onChanged(); + } else { + eventImpactsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Google Cloud products and locations impacted by the event.
+     * 
+ * + * repeated .google.cloud.servicehealth.v1.EventImpact event_impacts = 20; + */ + public Builder setEventImpacts( + int index, com.google.cloud.servicehealth.v1.EventImpact.Builder builderForValue) { + if (eventImpactsBuilder_ == null) { + ensureEventImpactsIsMutable(); + eventImpacts_.set(index, builderForValue.build()); + onChanged(); + } else { + eventImpactsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Google Cloud products and locations impacted by the event.
+     * 
+ * + * repeated .google.cloud.servicehealth.v1.EventImpact event_impacts = 20; + */ + public Builder addEventImpacts(com.google.cloud.servicehealth.v1.EventImpact value) { + if (eventImpactsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEventImpactsIsMutable(); + eventImpacts_.add(value); + onChanged(); + } else { + eventImpactsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Google Cloud products and locations impacted by the event.
+     * 
+ * + * repeated .google.cloud.servicehealth.v1.EventImpact event_impacts = 20; + */ + public Builder addEventImpacts(int index, com.google.cloud.servicehealth.v1.EventImpact value) { + if (eventImpactsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEventImpactsIsMutable(); + eventImpacts_.add(index, value); + onChanged(); + } else { + eventImpactsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Google Cloud products and locations impacted by the event.
+     * 
+ * + * repeated .google.cloud.servicehealth.v1.EventImpact event_impacts = 20; + */ + public Builder addEventImpacts( + com.google.cloud.servicehealth.v1.EventImpact.Builder builderForValue) { + if (eventImpactsBuilder_ == null) { + ensureEventImpactsIsMutable(); + eventImpacts_.add(builderForValue.build()); + onChanged(); + } else { + eventImpactsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Google Cloud products and locations impacted by the event.
+     * 
+ * + * repeated .google.cloud.servicehealth.v1.EventImpact event_impacts = 20; + */ + public Builder addEventImpacts( + int index, com.google.cloud.servicehealth.v1.EventImpact.Builder builderForValue) { + if (eventImpactsBuilder_ == null) { + ensureEventImpactsIsMutable(); + eventImpacts_.add(index, builderForValue.build()); + onChanged(); + } else { + eventImpactsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Google Cloud products and locations impacted by the event.
+     * 
+ * + * repeated .google.cloud.servicehealth.v1.EventImpact event_impacts = 20; + */ + public Builder addAllEventImpacts( + java.lang.Iterable values) { + if (eventImpactsBuilder_ == null) { + ensureEventImpactsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, eventImpacts_); + onChanged(); + } else { + eventImpactsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Google Cloud products and locations impacted by the event.
+     * 
+ * + * repeated .google.cloud.servicehealth.v1.EventImpact event_impacts = 20; + */ + public Builder clearEventImpacts() { + if (eventImpactsBuilder_ == null) { + eventImpacts_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + } else { + eventImpactsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Google Cloud products and locations impacted by the event.
+     * 
+ * + * repeated .google.cloud.servicehealth.v1.EventImpact event_impacts = 20; + */ + public Builder removeEventImpacts(int index) { + if (eventImpactsBuilder_ == null) { + ensureEventImpactsIsMutable(); + eventImpacts_.remove(index); + onChanged(); + } else { + eventImpactsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Google Cloud products and locations impacted by the event.
+     * 
+ * + * repeated .google.cloud.servicehealth.v1.EventImpact event_impacts = 20; + */ + public com.google.cloud.servicehealth.v1.EventImpact.Builder getEventImpactsBuilder(int index) { + return getEventImpactsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Google Cloud products and locations impacted by the event.
+     * 
+ * + * repeated .google.cloud.servicehealth.v1.EventImpact event_impacts = 20; + */ + public com.google.cloud.servicehealth.v1.EventImpactOrBuilder getEventImpactsOrBuilder( + int index) { + if (eventImpactsBuilder_ == null) { + return eventImpacts_.get(index); + } else { + return eventImpactsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Google Cloud products and locations impacted by the event.
+     * 
+ * + * repeated .google.cloud.servicehealth.v1.EventImpact event_impacts = 20; + */ + public java.util.List + getEventImpactsOrBuilderList() { + if (eventImpactsBuilder_ != null) { + return eventImpactsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(eventImpacts_); + } + } + /** + * + * + *
+     * Google Cloud products and locations impacted by the event.
+     * 
+ * + * repeated .google.cloud.servicehealth.v1.EventImpact event_impacts = 20; + */ + public com.google.cloud.servicehealth.v1.EventImpact.Builder addEventImpactsBuilder() { + return getEventImpactsFieldBuilder() + .addBuilder(com.google.cloud.servicehealth.v1.EventImpact.getDefaultInstance()); + } + /** + * + * + *
+     * Google Cloud products and locations impacted by the event.
+     * 
+ * + * repeated .google.cloud.servicehealth.v1.EventImpact event_impacts = 20; + */ + public com.google.cloud.servicehealth.v1.EventImpact.Builder addEventImpactsBuilder(int index) { + return getEventImpactsFieldBuilder() + .addBuilder(index, com.google.cloud.servicehealth.v1.EventImpact.getDefaultInstance()); + } + /** + * + * + *
+     * Google Cloud products and locations impacted by the event.
+     * 
+ * + * repeated .google.cloud.servicehealth.v1.EventImpact event_impacts = 20; + */ + public java.util.List + getEventImpactsBuilderList() { + return getEventImpactsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.servicehealth.v1.EventImpact, + com.google.cloud.servicehealth.v1.EventImpact.Builder, + com.google.cloud.servicehealth.v1.EventImpactOrBuilder> + getEventImpactsFieldBuilder() { + if (eventImpactsBuilder_ == null) { + eventImpactsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.servicehealth.v1.EventImpact, + com.google.cloud.servicehealth.v1.EventImpact.Builder, + com.google.cloud.servicehealth.v1.EventImpactOrBuilder>( + eventImpacts_, ((bitField0_ & 0x00000080) != 0), getParentForChildren(), isClean()); + eventImpacts_ = null; + } + return eventImpactsBuilder_; + } + + private int relevance_ = 0; + /** + * + * + *
+     * Output only. Communicates why a given event is deemed relevant in the
+     * context of a given project.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.Event.Relevance relevance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for relevance. + */ + @java.lang.Override + public int getRelevanceValue() { + return relevance_; + } + /** + * + * + *
+     * Output only. Communicates why a given event is deemed relevant in the
+     * context of a given project.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.Event.Relevance relevance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for relevance to set. + * @return This builder for chaining. + */ + public Builder setRelevanceValue(int value) { + relevance_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Communicates why a given event is deemed relevant in the
+     * context of a given project.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.Event.Relevance relevance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The relevance. + */ + @java.lang.Override + public com.google.cloud.servicehealth.v1.Event.Relevance getRelevance() { + com.google.cloud.servicehealth.v1.Event.Relevance result = + com.google.cloud.servicehealth.v1.Event.Relevance.forNumber(relevance_); + return result == null + ? com.google.cloud.servicehealth.v1.Event.Relevance.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. Communicates why a given event is deemed relevant in the
+     * context of a given project.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.Event.Relevance relevance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The relevance to set. + * @return This builder for chaining. + */ + public Builder setRelevance(com.google.cloud.servicehealth.v1.Event.Relevance value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000100; + relevance_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Communicates why a given event is deemed relevant in the
+     * context of a given project.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.Event.Relevance relevance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearRelevance() { + bitField0_ = (bitField0_ & ~0x00000100); + relevance_ = 0; + onChanged(); + return this; + } + + private java.util.List updates_ = + java.util.Collections.emptyList(); + + private void ensureUpdatesIsMutable() { + if (!((bitField0_ & 0x00000200) != 0)) { + updates_ = new java.util.ArrayList(updates_); + bitField0_ |= 0x00000200; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.servicehealth.v1.EventUpdate, + com.google.cloud.servicehealth.v1.EventUpdate.Builder, + com.google.cloud.servicehealth.v1.EventUpdateOrBuilder> + updatesBuilder_; + + /** + * + * + *
+     * Output only. Event updates are correspondence from Google.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventUpdate updates = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getUpdatesList() { + if (updatesBuilder_ == null) { + return java.util.Collections.unmodifiableList(updates_); + } else { + return updatesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Output only. Event updates are correspondence from Google.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventUpdate updates = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getUpdatesCount() { + if (updatesBuilder_ == null) { + return updates_.size(); + } else { + return updatesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Output only. Event updates are correspondence from Google.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventUpdate updates = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.servicehealth.v1.EventUpdate getUpdates(int index) { + if (updatesBuilder_ == null) { + return updates_.get(index); + } else { + return updatesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Output only. Event updates are correspondence from Google.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventUpdate updates = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdates(int index, com.google.cloud.servicehealth.v1.EventUpdate value) { + if (updatesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureUpdatesIsMutable(); + updates_.set(index, value); + onChanged(); + } else { + updatesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. Event updates are correspondence from Google.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventUpdate updates = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdates( + int index, com.google.cloud.servicehealth.v1.EventUpdate.Builder builderForValue) { + if (updatesBuilder_ == null) { + ensureUpdatesIsMutable(); + updates_.set(index, builderForValue.build()); + onChanged(); + } else { + updatesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Event updates are correspondence from Google.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventUpdate updates = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addUpdates(com.google.cloud.servicehealth.v1.EventUpdate value) { + if (updatesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureUpdatesIsMutable(); + updates_.add(value); + onChanged(); + } else { + updatesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Output only. Event updates are correspondence from Google.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventUpdate updates = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addUpdates(int index, com.google.cloud.servicehealth.v1.EventUpdate value) { + if (updatesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureUpdatesIsMutable(); + updates_.add(index, value); + onChanged(); + } else { + updatesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. Event updates are correspondence from Google.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventUpdate updates = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addUpdates( + com.google.cloud.servicehealth.v1.EventUpdate.Builder builderForValue) { + if (updatesBuilder_ == null) { + ensureUpdatesIsMutable(); + updates_.add(builderForValue.build()); + onChanged(); + } else { + updatesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Event updates are correspondence from Google.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventUpdate updates = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addUpdates( + int index, com.google.cloud.servicehealth.v1.EventUpdate.Builder builderForValue) { + if (updatesBuilder_ == null) { + ensureUpdatesIsMutable(); + updates_.add(index, builderForValue.build()); + onChanged(); + } else { + updatesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Event updates are correspondence from Google.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventUpdate updates = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllUpdates( + java.lang.Iterable values) { + if (updatesBuilder_ == null) { + ensureUpdatesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, updates_); + onChanged(); + } else { + updatesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Output only. Event updates are correspondence from Google.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventUpdate updates = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdates() { + if (updatesBuilder_ == null) { + updates_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000200); + onChanged(); + } else { + updatesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. Event updates are correspondence from Google.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventUpdate updates = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeUpdates(int index) { + if (updatesBuilder_ == null) { + ensureUpdatesIsMutable(); + updates_.remove(index); + onChanged(); + } else { + updatesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Output only. Event updates are correspondence from Google.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventUpdate updates = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.servicehealth.v1.EventUpdate.Builder getUpdatesBuilder(int index) { + return getUpdatesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Output only. Event updates are correspondence from Google.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventUpdate updates = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.servicehealth.v1.EventUpdateOrBuilder getUpdatesOrBuilder(int index) { + if (updatesBuilder_ == null) { + return updates_.get(index); + } else { + return updatesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Output only. Event updates are correspondence from Google.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventUpdate updates = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getUpdatesOrBuilderList() { + if (updatesBuilder_ != null) { + return updatesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(updates_); + } + } + /** + * + * + *
+     * Output only. Event updates are correspondence from Google.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventUpdate updates = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.servicehealth.v1.EventUpdate.Builder addUpdatesBuilder() { + return getUpdatesFieldBuilder() + .addBuilder(com.google.cloud.servicehealth.v1.EventUpdate.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. Event updates are correspondence from Google.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventUpdate updates = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.servicehealth.v1.EventUpdate.Builder addUpdatesBuilder(int index) { + return getUpdatesFieldBuilder() + .addBuilder(index, com.google.cloud.servicehealth.v1.EventUpdate.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. Event updates are correspondence from Google.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventUpdate updates = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getUpdatesBuilderList() { + return getUpdatesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.servicehealth.v1.EventUpdate, + com.google.cloud.servicehealth.v1.EventUpdate.Builder, + com.google.cloud.servicehealth.v1.EventUpdateOrBuilder> + getUpdatesFieldBuilder() { + if (updatesBuilder_ == null) { + updatesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.servicehealth.v1.EventUpdate, + com.google.cloud.servicehealth.v1.EventUpdate.Builder, + com.google.cloud.servicehealth.v1.EventUpdateOrBuilder>( + updates_, ((bitField0_ & 0x00000200) != 0), getParentForChildren(), isClean()); + updates_ = null; + } + return updatesBuilder_; + } + + private java.lang.Object parentEvent_ = ""; + /** + * + * + *
+     * Output only. When `detailed_state`=`MERGED`, `parent_event` contains the
+     * name of the parent event. All further updates will be published to the
+     * parent event.
+     * 
+ * + * string parent_event = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The parentEvent. + */ + public java.lang.String getParentEvent() { + java.lang.Object ref = parentEvent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parentEvent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. When `detailed_state`=`MERGED`, `parent_event` contains the
+     * name of the parent event. All further updates will be published to the
+     * parent event.
+     * 
+ * + * string parent_event = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for parentEvent. + */ + public com.google.protobuf.ByteString getParentEventBytes() { + java.lang.Object ref = parentEvent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parentEvent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. When `detailed_state`=`MERGED`, `parent_event` contains the
+     * name of the parent event. All further updates will be published to the
+     * parent event.
+     * 
+ * + * string parent_event = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The parentEvent to set. + * @return This builder for chaining. + */ + public Builder setParentEvent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parentEvent_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. When `detailed_state`=`MERGED`, `parent_event` contains the
+     * name of the parent event. All further updates will be published to the
+     * parent event.
+     * 
+ * + * string parent_event = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearParentEvent() { + parentEvent_ = getDefaultInstance().getParentEvent(); + bitField0_ = (bitField0_ & ~0x00000400); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. When `detailed_state`=`MERGED`, `parent_event` contains the
+     * name of the parent event. All further updates will be published to the
+     * parent event.
+     * 
+ * + * string parent_event = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for parentEvent to set. + * @return This builder for chaining. + */ + public Builder setParentEventBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parentEvent_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + 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 time when the event was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000800) != 0); + } + /** + * + * + *
+     * Output only. The time when the event was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 12 [(.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 time when the event was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 12 [(.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_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time when the event was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 12 [(.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_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time when the event was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000800) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time when the event was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000800); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time when the event was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000800; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time when the event was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 12 [(.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 time when the event was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 12 [(.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 startTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + startTimeBuilder_; + /** + * + * + *
+     * Output only. The start time of the event, if applicable.
+     * 
+ * + * + * .google.protobuf.Timestamp start_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the startTime field is set. + */ + public boolean hasStartTime() { + return ((bitField0_ & 0x00001000) != 0); + } + /** + * + * + *
+     * Output only. The start time of the event, if applicable.
+     * 
+ * + * + * .google.protobuf.Timestamp start_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The startTime. + */ + public com.google.protobuf.Timestamp getStartTime() { + if (startTimeBuilder_ == null) { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } else { + return startTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The start time of the event, if applicable.
+     * 
+ * + * + * .google.protobuf.Timestamp start_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + } else { + startTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The start time of the event, if applicable.
+     * 
+ * + * + * .google.protobuf.Timestamp start_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The start time of the event, if applicable.
+     * 
+ * + * + * .google.protobuf.Timestamp start_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (((bitField0_ & 0x00001000) != 0) + && startTime_ != null + && startTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getStartTimeBuilder().mergeFrom(value); + } else { + startTime_ = value; + } + } else { + startTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The start time of the event, if applicable.
+     * 
+ * + * + * .google.protobuf.Timestamp start_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearStartTime() { + bitField0_ = (bitField0_ & ~0x00001000); + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The start time of the event, if applicable.
+     * 
+ * + * + * .google.protobuf.Timestamp start_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + bitField0_ |= 0x00001000; + onChanged(); + return getStartTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The start time of the event, if applicable.
+     * 
+ * + * + * .google.protobuf.Timestamp start_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + } + /** + * + * + *
+     * Output only. The start time of the event, if applicable.
+     * 
+ * + * + * .google.protobuf.Timestamp start_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + startTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getStartTime(), getParentForChildren(), isClean()); + startTime_ = null; + } + return startTimeBuilder_; + } + + private com.google.protobuf.Timestamp endTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + /** + * + * + *
+     * Output only. The end time of the event, if applicable.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return ((bitField0_ & 0x00002000) != 0); + } + /** + * + * + *
+     * Output only. The end time of the event, if applicable.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The end time of the event, if applicable.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + } else { + endTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The end time of the event, if applicable.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The end time of the event, if applicable.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (((bitField0_ & 0x00002000) != 0) + && endTime_ != null + && endTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEndTimeBuilder().mergeFrom(value); + } else { + endTime_ = value; + } + } else { + endTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The end time of the event, if applicable.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearEndTime() { + bitField0_ = (bitField0_ & ~0x00002000); + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The end time of the event, if applicable.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + bitField0_ |= 0x00002000; + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The end time of the event, if applicable.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + /** + * + * + *
+     * Output only. The end time of the event, if applicable.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + private com.google.protobuf.Timestamp nextUpdateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + nextUpdateTimeBuilder_; + /** + * + * + *
+     * Output only. The time when the next update can be expected.
+     * 
+ * + * + * .google.protobuf.Timestamp next_update_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the nextUpdateTime field is set. + */ + public boolean hasNextUpdateTime() { + return ((bitField0_ & 0x00004000) != 0); + } + /** + * + * + *
+     * Output only. The time when the next update can be expected.
+     * 
+ * + * + * .google.protobuf.Timestamp next_update_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The nextUpdateTime. + */ + public com.google.protobuf.Timestamp getNextUpdateTime() { + if (nextUpdateTimeBuilder_ == null) { + return nextUpdateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : nextUpdateTime_; + } else { + return nextUpdateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The time when the next update can be expected.
+     * 
+ * + * + * .google.protobuf.Timestamp next_update_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setNextUpdateTime(com.google.protobuf.Timestamp value) { + if (nextUpdateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + nextUpdateTime_ = value; + } else { + nextUpdateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time when the next update can be expected.
+     * 
+ * + * + * .google.protobuf.Timestamp next_update_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setNextUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (nextUpdateTimeBuilder_ == null) { + nextUpdateTime_ = builderForValue.build(); + } else { + nextUpdateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time when the next update can be expected.
+     * 
+ * + * + * .google.protobuf.Timestamp next_update_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeNextUpdateTime(com.google.protobuf.Timestamp value) { + if (nextUpdateTimeBuilder_ == null) { + if (((bitField0_ & 0x00004000) != 0) + && nextUpdateTime_ != null + && nextUpdateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getNextUpdateTimeBuilder().mergeFrom(value); + } else { + nextUpdateTime_ = value; + } + } else { + nextUpdateTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time when the next update can be expected.
+     * 
+ * + * + * .google.protobuf.Timestamp next_update_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearNextUpdateTime() { + bitField0_ = (bitField0_ & ~0x00004000); + nextUpdateTime_ = null; + if (nextUpdateTimeBuilder_ != null) { + nextUpdateTimeBuilder_.dispose(); + nextUpdateTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time when the next update can be expected.
+     * 
+ * + * + * .google.protobuf.Timestamp next_update_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getNextUpdateTimeBuilder() { + bitField0_ |= 0x00004000; + onChanged(); + return getNextUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time when the next update can be expected.
+     * 
+ * + * + * .google.protobuf.Timestamp next_update_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getNextUpdateTimeOrBuilder() { + if (nextUpdateTimeBuilder_ != null) { + return nextUpdateTimeBuilder_.getMessageOrBuilder(); + } else { + return nextUpdateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : nextUpdateTime_; + } + } + /** + * + * + *
+     * Output only. The time when the next update can be expected.
+     * 
+ * + * + * .google.protobuf.Timestamp next_update_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getNextUpdateTimeFieldBuilder() { + if (nextUpdateTimeBuilder_ == null) { + nextUpdateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getNextUpdateTime(), getParentForChildren(), isClean()); + nextUpdateTime_ = null; + } + return nextUpdateTimeBuilder_; + } + + @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.servicehealth.v1.Event) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicehealth.v1.Event) + private static final com.google.cloud.servicehealth.v1.Event DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicehealth.v1.Event(); + } + + public static com.google.cloud.servicehealth.v1.Event getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Event 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.servicehealth.v1.Event getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/EventImpact.java b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/EventImpact.java new file mode 100644 index 000000000000..f4efb404ee29 --- /dev/null +++ b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/EventImpact.java @@ -0,0 +1,968 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/servicehealth/v1/event_resources.proto + +package com.google.cloud.servicehealth.v1; + +/** + * + * + *
+ * Represents the Google Cloud products and locations impacted by the event.
+ * 
+ * + * Protobuf type {@code google.cloud.servicehealth.v1.EventImpact} + */ +public final class EventImpact extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicehealth.v1.EventImpact) + EventImpactOrBuilder { + private static final long serialVersionUID = 0L; + // Use EventImpact.newBuilder() to construct. + private EventImpact(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EventImpact() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EventImpact(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_EventImpact_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_EventImpact_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicehealth.v1.EventImpact.class, + com.google.cloud.servicehealth.v1.EventImpact.Builder.class); + } + + public static final int PRODUCT_FIELD_NUMBER = 1; + private com.google.cloud.servicehealth.v1.Product product_; + /** + * + * + *
+   * Google Cloud product impacted by the event.
+   * 
+ * + * .google.cloud.servicehealth.v1.Product product = 1; + * + * @return Whether the product field is set. + */ + @java.lang.Override + public boolean hasProduct() { + return product_ != null; + } + /** + * + * + *
+   * Google Cloud product impacted by the event.
+   * 
+ * + * .google.cloud.servicehealth.v1.Product product = 1; + * + * @return The product. + */ + @java.lang.Override + public com.google.cloud.servicehealth.v1.Product getProduct() { + return product_ == null + ? com.google.cloud.servicehealth.v1.Product.getDefaultInstance() + : product_; + } + /** + * + * + *
+   * Google Cloud product impacted by the event.
+   * 
+ * + * .google.cloud.servicehealth.v1.Product product = 1; + */ + @java.lang.Override + public com.google.cloud.servicehealth.v1.ProductOrBuilder getProductOrBuilder() { + return product_ == null + ? com.google.cloud.servicehealth.v1.Product.getDefaultInstance() + : product_; + } + + public static final int LOCATION_FIELD_NUMBER = 2; + private com.google.cloud.servicehealth.v1.Location location_; + /** + * + * + *
+   * Location impacted by the event.
+   * 
+ * + * .google.cloud.servicehealth.v1.Location location = 2; + * + * @return Whether the location field is set. + */ + @java.lang.Override + public boolean hasLocation() { + return location_ != null; + } + /** + * + * + *
+   * Location impacted by the event.
+   * 
+ * + * .google.cloud.servicehealth.v1.Location location = 2; + * + * @return The location. + */ + @java.lang.Override + public com.google.cloud.servicehealth.v1.Location getLocation() { + return location_ == null + ? com.google.cloud.servicehealth.v1.Location.getDefaultInstance() + : location_; + } + /** + * + * + *
+   * Location impacted by the event.
+   * 
+ * + * .google.cloud.servicehealth.v1.Location location = 2; + */ + @java.lang.Override + public com.google.cloud.servicehealth.v1.LocationOrBuilder getLocationOrBuilder() { + return location_ == null + ? com.google.cloud.servicehealth.v1.Location.getDefaultInstance() + : location_; + } + + 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 (product_ != null) { + output.writeMessage(1, getProduct()); + } + if (location_ != null) { + output.writeMessage(2, getLocation()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (product_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getProduct()); + } + if (location_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getLocation()); + } + 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.servicehealth.v1.EventImpact)) { + return super.equals(obj); + } + com.google.cloud.servicehealth.v1.EventImpact other = + (com.google.cloud.servicehealth.v1.EventImpact) obj; + + if (hasProduct() != other.hasProduct()) return false; + if (hasProduct()) { + if (!getProduct().equals(other.getProduct())) return false; + } + if (hasLocation() != other.hasLocation()) return false; + if (hasLocation()) { + if (!getLocation().equals(other.getLocation())) 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 (hasProduct()) { + hash = (37 * hash) + PRODUCT_FIELD_NUMBER; + hash = (53 * hash) + getProduct().hashCode(); + } + if (hasLocation()) { + hash = (37 * hash) + LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getLocation().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.servicehealth.v1.EventImpact parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicehealth.v1.EventImpact 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.servicehealth.v1.EventImpact parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicehealth.v1.EventImpact 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.servicehealth.v1.EventImpact parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicehealth.v1.EventImpact parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.servicehealth.v1.EventImpact parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicehealth.v1.EventImpact 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.servicehealth.v1.EventImpact parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicehealth.v1.EventImpact 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.servicehealth.v1.EventImpact parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicehealth.v1.EventImpact 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.servicehealth.v1.EventImpact 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; + } + /** + * + * + *
+   * Represents the Google Cloud products and locations impacted by the event.
+   * 
+ * + * Protobuf type {@code google.cloud.servicehealth.v1.EventImpact} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicehealth.v1.EventImpact) + com.google.cloud.servicehealth.v1.EventImpactOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_EventImpact_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_EventImpact_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicehealth.v1.EventImpact.class, + com.google.cloud.servicehealth.v1.EventImpact.Builder.class); + } + + // Construct using com.google.cloud.servicehealth.v1.EventImpact.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + product_ = null; + if (productBuilder_ != null) { + productBuilder_.dispose(); + productBuilder_ = null; + } + location_ = null; + if (locationBuilder_ != null) { + locationBuilder_.dispose(); + locationBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_EventImpact_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicehealth.v1.EventImpact getDefaultInstanceForType() { + return com.google.cloud.servicehealth.v1.EventImpact.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicehealth.v1.EventImpact build() { + com.google.cloud.servicehealth.v1.EventImpact result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicehealth.v1.EventImpact buildPartial() { + com.google.cloud.servicehealth.v1.EventImpact result = + new com.google.cloud.servicehealth.v1.EventImpact(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.servicehealth.v1.EventImpact result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.product_ = productBuilder_ == null ? product_ : productBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.location_ = locationBuilder_ == null ? location_ : locationBuilder_.build(); + } + } + + @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.servicehealth.v1.EventImpact) { + return mergeFrom((com.google.cloud.servicehealth.v1.EventImpact) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.servicehealth.v1.EventImpact other) { + if (other == com.google.cloud.servicehealth.v1.EventImpact.getDefaultInstance()) return this; + if (other.hasProduct()) { + mergeProduct(other.getProduct()); + } + if (other.hasLocation()) { + mergeLocation(other.getLocation()); + } + 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: + { + input.readMessage(getProductFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getLocationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + 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 com.google.cloud.servicehealth.v1.Product product_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.servicehealth.v1.Product, + com.google.cloud.servicehealth.v1.Product.Builder, + com.google.cloud.servicehealth.v1.ProductOrBuilder> + productBuilder_; + /** + * + * + *
+     * Google Cloud product impacted by the event.
+     * 
+ * + * .google.cloud.servicehealth.v1.Product product = 1; + * + * @return Whether the product field is set. + */ + public boolean hasProduct() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Google Cloud product impacted by the event.
+     * 
+ * + * .google.cloud.servicehealth.v1.Product product = 1; + * + * @return The product. + */ + public com.google.cloud.servicehealth.v1.Product getProduct() { + if (productBuilder_ == null) { + return product_ == null + ? com.google.cloud.servicehealth.v1.Product.getDefaultInstance() + : product_; + } else { + return productBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Google Cloud product impacted by the event.
+     * 
+ * + * .google.cloud.servicehealth.v1.Product product = 1; + */ + public Builder setProduct(com.google.cloud.servicehealth.v1.Product value) { + if (productBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + product_ = value; + } else { + productBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Google Cloud product impacted by the event.
+     * 
+ * + * .google.cloud.servicehealth.v1.Product product = 1; + */ + public Builder setProduct(com.google.cloud.servicehealth.v1.Product.Builder builderForValue) { + if (productBuilder_ == null) { + product_ = builderForValue.build(); + } else { + productBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Google Cloud product impacted by the event.
+     * 
+ * + * .google.cloud.servicehealth.v1.Product product = 1; + */ + public Builder mergeProduct(com.google.cloud.servicehealth.v1.Product value) { + if (productBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && product_ != null + && product_ != com.google.cloud.servicehealth.v1.Product.getDefaultInstance()) { + getProductBuilder().mergeFrom(value); + } else { + product_ = value; + } + } else { + productBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Google Cloud product impacted by the event.
+     * 
+ * + * .google.cloud.servicehealth.v1.Product product = 1; + */ + public Builder clearProduct() { + bitField0_ = (bitField0_ & ~0x00000001); + product_ = null; + if (productBuilder_ != null) { + productBuilder_.dispose(); + productBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Google Cloud product impacted by the event.
+     * 
+ * + * .google.cloud.servicehealth.v1.Product product = 1; + */ + public com.google.cloud.servicehealth.v1.Product.Builder getProductBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getProductFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Google Cloud product impacted by the event.
+     * 
+ * + * .google.cloud.servicehealth.v1.Product product = 1; + */ + public com.google.cloud.servicehealth.v1.ProductOrBuilder getProductOrBuilder() { + if (productBuilder_ != null) { + return productBuilder_.getMessageOrBuilder(); + } else { + return product_ == null + ? com.google.cloud.servicehealth.v1.Product.getDefaultInstance() + : product_; + } + } + /** + * + * + *
+     * Google Cloud product impacted by the event.
+     * 
+ * + * .google.cloud.servicehealth.v1.Product product = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.servicehealth.v1.Product, + com.google.cloud.servicehealth.v1.Product.Builder, + com.google.cloud.servicehealth.v1.ProductOrBuilder> + getProductFieldBuilder() { + if (productBuilder_ == null) { + productBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.servicehealth.v1.Product, + com.google.cloud.servicehealth.v1.Product.Builder, + com.google.cloud.servicehealth.v1.ProductOrBuilder>( + getProduct(), getParentForChildren(), isClean()); + product_ = null; + } + return productBuilder_; + } + + private com.google.cloud.servicehealth.v1.Location location_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.servicehealth.v1.Location, + com.google.cloud.servicehealth.v1.Location.Builder, + com.google.cloud.servicehealth.v1.LocationOrBuilder> + locationBuilder_; + /** + * + * + *
+     * Location impacted by the event.
+     * 
+ * + * .google.cloud.servicehealth.v1.Location location = 2; + * + * @return Whether the location field is set. + */ + public boolean hasLocation() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Location impacted by the event.
+     * 
+ * + * .google.cloud.servicehealth.v1.Location location = 2; + * + * @return The location. + */ + public com.google.cloud.servicehealth.v1.Location getLocation() { + if (locationBuilder_ == null) { + return location_ == null + ? com.google.cloud.servicehealth.v1.Location.getDefaultInstance() + : location_; + } else { + return locationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Location impacted by the event.
+     * 
+ * + * .google.cloud.servicehealth.v1.Location location = 2; + */ + public Builder setLocation(com.google.cloud.servicehealth.v1.Location value) { + if (locationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + location_ = value; + } else { + locationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Location impacted by the event.
+     * 
+ * + * .google.cloud.servicehealth.v1.Location location = 2; + */ + public Builder setLocation(com.google.cloud.servicehealth.v1.Location.Builder builderForValue) { + if (locationBuilder_ == null) { + location_ = builderForValue.build(); + } else { + locationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Location impacted by the event.
+     * 
+ * + * .google.cloud.servicehealth.v1.Location location = 2; + */ + public Builder mergeLocation(com.google.cloud.servicehealth.v1.Location value) { + if (locationBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && location_ != null + && location_ != com.google.cloud.servicehealth.v1.Location.getDefaultInstance()) { + getLocationBuilder().mergeFrom(value); + } else { + location_ = value; + } + } else { + locationBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Location impacted by the event.
+     * 
+ * + * .google.cloud.servicehealth.v1.Location location = 2; + */ + public Builder clearLocation() { + bitField0_ = (bitField0_ & ~0x00000002); + location_ = null; + if (locationBuilder_ != null) { + locationBuilder_.dispose(); + locationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Location impacted by the event.
+     * 
+ * + * .google.cloud.servicehealth.v1.Location location = 2; + */ + public com.google.cloud.servicehealth.v1.Location.Builder getLocationBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getLocationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Location impacted by the event.
+     * 
+ * + * .google.cloud.servicehealth.v1.Location location = 2; + */ + public com.google.cloud.servicehealth.v1.LocationOrBuilder getLocationOrBuilder() { + if (locationBuilder_ != null) { + return locationBuilder_.getMessageOrBuilder(); + } else { + return location_ == null + ? com.google.cloud.servicehealth.v1.Location.getDefaultInstance() + : location_; + } + } + /** + * + * + *
+     * Location impacted by the event.
+     * 
+ * + * .google.cloud.servicehealth.v1.Location location = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.servicehealth.v1.Location, + com.google.cloud.servicehealth.v1.Location.Builder, + com.google.cloud.servicehealth.v1.LocationOrBuilder> + getLocationFieldBuilder() { + if (locationBuilder_ == null) { + locationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.servicehealth.v1.Location, + com.google.cloud.servicehealth.v1.Location.Builder, + com.google.cloud.servicehealth.v1.LocationOrBuilder>( + getLocation(), getParentForChildren(), isClean()); + location_ = null; + } + return locationBuilder_; + } + + @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.servicehealth.v1.EventImpact) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicehealth.v1.EventImpact) + private static final com.google.cloud.servicehealth.v1.EventImpact DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicehealth.v1.EventImpact(); + } + + public static com.google.cloud.servicehealth.v1.EventImpact getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EventImpact 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.servicehealth.v1.EventImpact getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/EventImpactOrBuilder.java b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/EventImpactOrBuilder.java new file mode 100644 index 000000000000..82abc675bfc3 --- /dev/null +++ b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/EventImpactOrBuilder.java @@ -0,0 +1,95 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/servicehealth/v1/event_resources.proto + +package com.google.cloud.servicehealth.v1; + +public interface EventImpactOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicehealth.v1.EventImpact) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Google Cloud product impacted by the event.
+   * 
+ * + * .google.cloud.servicehealth.v1.Product product = 1; + * + * @return Whether the product field is set. + */ + boolean hasProduct(); + /** + * + * + *
+   * Google Cloud product impacted by the event.
+   * 
+ * + * .google.cloud.servicehealth.v1.Product product = 1; + * + * @return The product. + */ + com.google.cloud.servicehealth.v1.Product getProduct(); + /** + * + * + *
+   * Google Cloud product impacted by the event.
+   * 
+ * + * .google.cloud.servicehealth.v1.Product product = 1; + */ + com.google.cloud.servicehealth.v1.ProductOrBuilder getProductOrBuilder(); + + /** + * + * + *
+   * Location impacted by the event.
+   * 
+ * + * .google.cloud.servicehealth.v1.Location location = 2; + * + * @return Whether the location field is set. + */ + boolean hasLocation(); + /** + * + * + *
+   * Location impacted by the event.
+   * 
+ * + * .google.cloud.servicehealth.v1.Location location = 2; + * + * @return The location. + */ + com.google.cloud.servicehealth.v1.Location getLocation(); + /** + * + * + *
+   * Location impacted by the event.
+   * 
+ * + * .google.cloud.servicehealth.v1.Location location = 2; + */ + com.google.cloud.servicehealth.v1.LocationOrBuilder getLocationOrBuilder(); +} diff --git a/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/EventName.java b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/EventName.java new file mode 100644 index 000000000000..012a36a11b86 --- /dev/null +++ b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/EventName.java @@ -0,0 +1,223 @@ +/* + * Copyright 2023 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.servicehealth.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 EventName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_EVENT = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/events/{event}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String event; + + @Deprecated + protected EventName() { + project = null; + location = null; + event = null; + } + + private EventName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + event = Preconditions.checkNotNull(builder.getEvent()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getEvent() { + return event; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static EventName of(String project, String location, String event) { + return newBuilder().setProject(project).setLocation(location).setEvent(event).build(); + } + + public static String format(String project, String location, String event) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setEvent(event) + .build() + .toString(); + } + + public static EventName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_EVENT.validatedMatch( + formattedString, "EventName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("event")); + } + + 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 (EventName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_EVENT.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 (event != null) { + fieldMapBuilder.put("event", event); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_EVENT.instantiate( + "project", project, "location", location, "event", event); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + EventName that = ((EventName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.event, that.event); + } + 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(event); + return h; + } + + /** Builder for projects/{project}/locations/{location}/events/{event}. */ + public static class Builder { + private String project; + private String location; + private String event; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getEvent() { + return event; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setEvent(String event) { + this.event = event; + return this; + } + + private Builder(EventName eventName) { + this.project = eventName.project; + this.location = eventName.location; + this.event = eventName.event; + } + + public EventName build() { + return new EventName(this); + } + } +} diff --git a/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/EventOrBuilder.java b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/EventOrBuilder.java new file mode 100644 index 000000000000..14b2678c8934 --- /dev/null +++ b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/EventOrBuilder.java @@ -0,0 +1,553 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/servicehealth/v1/event_resources.proto + +package com.google.cloud.servicehealth.v1; + +public interface EventOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicehealth.v1.Event) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Identifier. Name of the event. Unique name of the event in
+   * this scope including project and location using the form
+   * `projects/{project_id}/locations/{location}/events/{event_id}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. Identifier. Name of the event. Unique name of the event in
+   * this scope including project and location using the form
+   * `projects/{project_id}/locations/{location}/events/{event_id}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. Brief description for the event.
+   * 
+ * + * string title = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The title. + */ + java.lang.String getTitle(); + /** + * + * + *
+   * Output only. Brief description for the event.
+   * 
+ * + * string title = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for title. + */ + com.google.protobuf.ByteString getTitleBytes(); + + /** + * + * + *
+   * Output only. Free-form, human-readable description.
+   * 
+ * + * string description = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * Output only. Free-form, human-readable description.
+   * 
+ * + * 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 event.
+   * 
+ * + * + * .google.cloud.servicehealth.v1.Event.EventCategory 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 event.
+   * 
+ * + * + * .google.cloud.servicehealth.v1.Event.EventCategory category = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The category. + */ + com.google.cloud.servicehealth.v1.Event.EventCategory getCategory(); + + /** + * + * + *
+   * Output only. The detailed category of the event.
+   * 
+ * + * + * .google.cloud.servicehealth.v1.Event.DetailedCategory detailed_category = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for detailedCategory. + */ + int getDetailedCategoryValue(); + /** + * + * + *
+   * Output only. The detailed category of the event.
+   * 
+ * + * + * .google.cloud.servicehealth.v1.Event.DetailedCategory detailed_category = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The detailedCategory. + */ + com.google.cloud.servicehealth.v1.Event.DetailedCategory getDetailedCategory(); + + /** + * + * + *
+   * Output only. The current state of the event.
+   * 
+ * + * + * .google.cloud.servicehealth.v1.Event.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Output only. The current state of the event.
+   * 
+ * + * + * .google.cloud.servicehealth.v1.Event.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.servicehealth.v1.Event.State getState(); + + /** + * + * + *
+   * Output only. The current detailed state of the incident.
+   * 
+ * + * + * .google.cloud.servicehealth.v1.Event.DetailedState detailed_state = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for detailedState. + */ + int getDetailedStateValue(); + /** + * + * + *
+   * Output only. The current detailed state of the incident.
+   * 
+ * + * + * .google.cloud.servicehealth.v1.Event.DetailedState detailed_state = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The detailedState. + */ + com.google.cloud.servicehealth.v1.Event.DetailedState getDetailedState(); + + /** + * + * + *
+   * Google Cloud products and locations impacted by the event.
+   * 
+ * + * repeated .google.cloud.servicehealth.v1.EventImpact event_impacts = 20; + */ + java.util.List getEventImpactsList(); + /** + * + * + *
+   * Google Cloud products and locations impacted by the event.
+   * 
+ * + * repeated .google.cloud.servicehealth.v1.EventImpact event_impacts = 20; + */ + com.google.cloud.servicehealth.v1.EventImpact getEventImpacts(int index); + /** + * + * + *
+   * Google Cloud products and locations impacted by the event.
+   * 
+ * + * repeated .google.cloud.servicehealth.v1.EventImpact event_impacts = 20; + */ + int getEventImpactsCount(); + /** + * + * + *
+   * Google Cloud products and locations impacted by the event.
+   * 
+ * + * repeated .google.cloud.servicehealth.v1.EventImpact event_impacts = 20; + */ + java.util.List + getEventImpactsOrBuilderList(); + /** + * + * + *
+   * Google Cloud products and locations impacted by the event.
+   * 
+ * + * repeated .google.cloud.servicehealth.v1.EventImpact event_impacts = 20; + */ + com.google.cloud.servicehealth.v1.EventImpactOrBuilder getEventImpactsOrBuilder(int index); + + /** + * + * + *
+   * Output only. Communicates why a given event is deemed relevant in the
+   * context of a given project.
+   * 
+ * + * + * .google.cloud.servicehealth.v1.Event.Relevance relevance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for relevance. + */ + int getRelevanceValue(); + /** + * + * + *
+   * Output only. Communicates why a given event is deemed relevant in the
+   * context of a given project.
+   * 
+ * + * + * .google.cloud.servicehealth.v1.Event.Relevance relevance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The relevance. + */ + com.google.cloud.servicehealth.v1.Event.Relevance getRelevance(); + + /** + * + * + *
+   * Output only. Event updates are correspondence from Google.
+   * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventUpdate updates = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getUpdatesList(); + /** + * + * + *
+   * Output only. Event updates are correspondence from Google.
+   * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventUpdate updates = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.servicehealth.v1.EventUpdate getUpdates(int index); + /** + * + * + *
+   * Output only. Event updates are correspondence from Google.
+   * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventUpdate updates = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getUpdatesCount(); + /** + * + * + *
+   * Output only. Event updates are correspondence from Google.
+   * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventUpdate updates = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getUpdatesOrBuilderList(); + /** + * + * + *
+   * Output only. Event updates are correspondence from Google.
+   * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventUpdate updates = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.servicehealth.v1.EventUpdateOrBuilder getUpdatesOrBuilder(int index); + + /** + * + * + *
+   * Output only. When `detailed_state`=`MERGED`, `parent_event` contains the
+   * name of the parent event. All further updates will be published to the
+   * parent event.
+   * 
+ * + * string parent_event = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The parentEvent. + */ + java.lang.String getParentEvent(); + /** + * + * + *
+   * Output only. When `detailed_state`=`MERGED`, `parent_event` contains the
+   * name of the parent event. All further updates will be published to the
+   * parent event.
+   * 
+ * + * string parent_event = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for parentEvent. + */ + com.google.protobuf.ByteString getParentEventBytes(); + + /** + * + * + *
+   * Output only. The time when the event was last modified.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. The time when the event was last modified.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. The time when the event was last modified.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The start time of the event, if applicable.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the startTime field is set. + */ + boolean hasStartTime(); + /** + * + * + *
+   * Output only. The start time of the event, if applicable.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The startTime. + */ + com.google.protobuf.Timestamp getStartTime(); + /** + * + * + *
+   * Output only. The start time of the event, if applicable.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The end time of the event, if applicable.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + /** + * + * + *
+   * Output only. The end time of the event, if applicable.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + /** + * + * + *
+   * Output only. The end time of the event, if applicable.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The time when the next update can be expected.
+   * 
+ * + * + * .google.protobuf.Timestamp next_update_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the nextUpdateTime field is set. + */ + boolean hasNextUpdateTime(); + /** + * + * + *
+   * Output only. The time when the next update can be expected.
+   * 
+ * + * + * .google.protobuf.Timestamp next_update_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The nextUpdateTime. + */ + com.google.protobuf.Timestamp getNextUpdateTime(); + /** + * + * + *
+   * Output only. The time when the next update can be expected.
+   * 
+ * + * + * .google.protobuf.Timestamp next_update_time = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getNextUpdateTimeOrBuilder(); +} diff --git a/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/EventResourcesProto.java b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/EventResourcesProto.java new file mode 100644 index 000000000000..56c53ace70c0 --- /dev/null +++ b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/EventResourcesProto.java @@ -0,0 +1,439 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/servicehealth/v1/event_resources.proto + +package com.google.cloud.servicehealth.v1; + +public final class EventResourcesProto { + private EventResourcesProto() {} + + 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_servicehealth_v1_Event_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicehealth_v1_Event_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_servicehealth_v1_OrganizationEvent_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicehealth_v1_OrganizationEvent_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_servicehealth_v1_EventUpdate_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicehealth_v1_EventUpdate_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_servicehealth_v1_Location_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicehealth_v1_Location_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_servicehealth_v1_Product_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicehealth_v1_Product_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_servicehealth_v1_EventImpact_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicehealth_v1_EventImpact_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_servicehealth_v1_OrganizationImpact_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicehealth_v1_OrganizationImpact_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_servicehealth_v1_Asset_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicehealth_v1_Asset_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_servicehealth_v1_ListEventsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicehealth_v1_ListEventsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_servicehealth_v1_ListEventsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicehealth_v1_ListEventsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_servicehealth_v1_GetEventRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicehealth_v1_GetEventRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_servicehealth_v1_ListOrganizationEventsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicehealth_v1_ListOrganizationEventsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_servicehealth_v1_ListOrganizationEventsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicehealth_v1_ListOrganizationEventsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_servicehealth_v1_GetOrganizationEventRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicehealth_v1_GetOrganizationEventRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_servicehealth_v1_ListOrganizationImpactsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicehealth_v1_ListOrganizationImpactsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_servicehealth_v1_ListOrganizationImpactsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicehealth_v1_ListOrganizationImpactsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_servicehealth_v1_GetOrganizationImpactRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicehealth_v1_GetOrganizationImpactRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n3google/cloud/servicehealth/v1/event_re" + + "sources.proto\022\035google.cloud.servicehealt" + + "h.v1\032\037google/api/field_behavior.proto\032\031g" + + "oogle/api/resource.proto\032\037google/protobu" + + "f/timestamp.proto\"\237\013\n\005Event\022\023\n\004name\030\001 \001(" + + "\tB\005\342A\002\003\010\022\023\n\005title\030\002 \001(\tB\004\342A\001\003\022\031\n\013descrip" + + "tion\030\003 \001(\tB\004\342A\001\003\022J\n\010category\030\004 \001(\01622.goo" + + "gle.cloud.servicehealth.v1.Event.EventCa" + + "tegoryB\004\342A\001\003\022V\n\021detailed_category\030\025 \001(\0162" + + "5.google.cloud.servicehealth.v1.Event.De" + + "tailedCategoryB\004\342A\001\003\022?\n\005state\030\005 \001(\0162*.go" + + "ogle.cloud.servicehealth.v1.Event.StateB" + + "\004\342A\001\003\022P\n\016detailed_state\030\023 \001(\01622.google.c" + + "loud.servicehealth.v1.Event.DetailedStat" + + "eB\004\342A\001\003\022A\n\revent_impacts\030\024 \003(\0132*.google." + + "cloud.servicehealth.v1.EventImpact\022G\n\tre" + + "levance\030\010 \001(\0162..google.cloud.serviceheal" + + "th.v1.Event.RelevanceB\004\342A\001\003\022A\n\007updates\030\t" + + " \003(\0132*.google.cloud.servicehealth.v1.Eve" + + "ntUpdateB\004\342A\001\003\022\032\n\014parent_event\030\n \001(\tB\004\342A" + + "\001\003\0225\n\013update_time\030\014 \001(\0132\032.google.protobu" + + "f.TimestampB\004\342A\001\003\0224\n\nstart_time\030\r \001(\0132\032." + + "google.protobuf.TimestampB\004\342A\001\003\0222\n\010end_t" + + "ime\030\016 \001(\0132\032.google.protobuf.TimestampB\004\342" + + "A\001\003\022:\n\020next_update_time\030\017 \001(\0132\032.google.p" + + "rotobuf.TimestampB\004\342A\001\003\"=\n\rEventCategory" + + "\022\036\n\032EVENT_CATEGORY_UNSPECIFIED\020\000\022\014\n\010INCI" + + "DENT\020\002\"d\n\020DetailedCategory\022!\n\035DETAILED_C" + + "ATEGORY_UNSPECIFIED\020\000\022\026\n\022CONFIRMED_INCID" + + "ENT\020\001\022\025\n\021EMERGING_INCIDENT\020\002\"6\n\005State\022\025\n" + + "\021STATE_UNSPECIFIED\020\000\022\n\n\006ACTIVE\020\001\022\n\n\006CLOS" + + "ED\020\002\"\213\001\n\rDetailedState\022\036\n\032DETAILED_STATE" + + "_UNSPECIFIED\020\000\022\014\n\010EMERGING\020\001\022\r\n\tCONFIRME" + + "D\020\002\022\014\n\010RESOLVED\020\003\022\n\n\006MERGED\020\004\022\017\n\013AUTO_CL" + + "OSED\020\t\022\022\n\016FALSE_POSITIVE\020\n\"w\n\tRelevance\022" + + "\031\n\025RELEVANCE_UNSPECIFIED\020\000\022\013\n\007UNKNOWN\020\002\022" + + "\020\n\014NOT_IMPACTED\020\006\022\025\n\021PARTIALLY_RELATED\020\007" + + "\022\013\n\007RELATED\020\010\022\014\n\010IMPACTED\020\t:n\352Ak\n\"servic" + + "ehealth.googleapis.com/Event\0226projects/{" + + "project}/locations/{location}/events/{ev" + + "ent}*\006events2\005event\"\333\n\n\021OrganizationEven" + + "t\022\023\n\004name\030\001 \001(\tB\005\342A\002\003\010\022\023\n\005title\030\002 \001(\tB\004\342" + + "A\001\003\022\031\n\013description\030\003 \001(\tB\004\342A\001\003\022V\n\010catego" + + "ry\030\004 \001(\0162>.google.cloud.servicehealth.v1" + + ".OrganizationEvent.EventCategoryB\004\342A\001\003\022b" + + "\n\021detailed_category\030\021 \001(\0162A.google.cloud" + + ".servicehealth.v1.OrganizationEvent.Deta" + + "iledCategoryB\004\342A\001\003\022K\n\005state\030\005 \001(\01626.goog" + + "le.cloud.servicehealth.v1.OrganizationEv" + + "ent.StateB\004\342A\001\003\022\\\n\016detailed_state\030\020 \001(\0162" + + ">.google.cloud.servicehealth.v1.Organiza" + + "tionEvent.DetailedStateB\004\342A\001\003\022G\n\revent_i" + + "mpacts\030\017 \003(\0132*.google.cloud.servicehealt" + + "h.v1.EventImpactB\004\342A\001\003\022A\n\007updates\030\010 \003(\0132" + + "*.google.cloud.servicehealth.v1.EventUpd" + + "ateB\004\342A\001\003\022\032\n\014parent_event\030\t \001(\tB\004\342A\001\003\0225\n" + + "\013update_time\030\013 \001(\0132\032.google.protobuf.Tim" + + "estampB\004\342A\001\003\0224\n\nstart_time\030\014 \001(\0132\032.googl" + + "e.protobuf.TimestampB\004\342A\001\003\0222\n\010end_time\030\r" + + " \001(\0132\032.google.protobuf.TimestampB\004\342A\001\003\022:" + + "\n\020next_update_time\030\016 \001(\0132\032.google.protob" + + "uf.TimestampB\004\342A\001\003\"=\n\rEventCategory\022\036\n\032E" + + "VENT_CATEGORY_UNSPECIFIED\020\000\022\014\n\010INCIDENT\020" + + "\002\"d\n\020DetailedCategory\022!\n\035DETAILED_CATEGO" + + "RY_UNSPECIFIED\020\000\022\026\n\022CONFIRMED_INCIDENT\020\001" + + "\022\025\n\021EMERGING_INCIDENT\020\002\"6\n\005State\022\025\n\021STAT" + + "E_UNSPECIFIED\020\000\022\n\n\006ACTIVE\020\001\022\n\n\006CLOSED\020\002\"" + + "\213\001\n\rDetailedState\022\036\n\032DETAILED_STATE_UNSP" + + "ECIFIED\020\000\022\014\n\010EMERGING\020\001\022\r\n\tCONFIRMED\020\002\022\014" + + "\n\010RESOLVED\020\003\022\n\n\006MERGED\020\004\022\017\n\013AUTO_CLOSED\020" + + "\t\022\022\n\016FALSE_POSITIVE\020\n:\251\001\352A\245\001\n.servicehea" + + "lth.googleapis.com/OrganizationEvent\022Lor" + + "ganizations/{organization}/locations/{lo" + + "cation}/organizationEvents/{event}*\022orga" + + "nizationEvents2\021organizationEvent\"\245\001\n\013Ev" + + "entUpdate\0225\n\013update_time\030\001 \001(\0132\032.google." + + "protobuf.TimestampB\004\342A\001\003\022\023\n\005title\030\002 \001(\tB" + + "\004\342A\001\003\022\031\n\013description\030\003 \001(\tB\004\342A\001\003\022\025\n\007symp" + + "tom\030\004 \001(\tB\004\342A\001\003\022\030\n\nworkaround\030\005 \001(\tB\004\342A\001" + + "\003\"!\n\010Location\022\025\n\rlocation_name\030\001 \001(\t\"\037\n\007" + + "Product\022\024\n\014product_name\030\001 \001(\t\"\201\001\n\013EventI" + + "mpact\0227\n\007product\030\001 \001(\0132&.google.cloud.se" + + "rvicehealth.v1.Product\0229\n\010location\030\002 \001(\013" + + "2\'.google.cloud.servicehealth.v1.Locatio" + + "n\"\226\003\n\022OrganizationImpact\022\023\n\004name\030\001 \001(\tB\005" + + "\342A\002\003\010\022;\n\006events\030\002 \003(\tB+\342A\001\003\372A$\n\"serviceh" + + "ealth.googleapis.com/Event\0229\n\005asset\030\003 \001(" + + "\0132$.google.cloud.servicehealth.v1.AssetB" + + "\004\342A\001\003\0225\n\013update_time\030\004 \001(\0132\032.google.prot" + + "obuf.TimestampB\004\342A\001\003:\273\001\352A\267\001\n/serviceheal" + + "th.googleapis.com/OrganizationImpact\022[or" + + "ganizations/{organization}/locations/{lo" + + "cation}/organizationImpacts/{organizatio" + + "n_impact}*\023organizationImpacts2\022organiza" + + "tionImpact\";\n\005Asset\022\030\n\nasset_name\030\001 \001(\tB" + + "\004\342A\001\003\022\030\n\nasset_type\030\002 \001(\tB\004\342A\001\003\"\327\001\n\021List" + + "EventsRequest\022;\n\006parent\030\001 \001(\tB+\342A\001\002\372A$\022\"" + + "servicehealth.googleapis.com/Event\022\027\n\tpa" + + "ge_size\030\002 \001(\005B\004\342A\001\001\022\030\n\npage_token\030\003 \001(\tB" + + "\004\342A\001\001\022\024\n\006filter\030\004 \001(\tB\004\342A\001\001\022<\n\004view\030\006 \001(" + + "\0162(.google.cloud.servicehealth.v1.EventV" + + "iewB\004\342A\001\001\"\212\001\n\022ListEventsResponse\022:\n\006even" + + "ts\030\001 \003(\0132$.google.cloud.servicehealth.v1" + + ".EventB\004\342A\001\003\022\035\n\017next_page_token\030\002 \001(\tB\004\342" + + "A\001\003\022\031\n\013unreachable\030\003 \003(\tB\004\342A\001\003\"L\n\017GetEve" + + "ntRequest\0229\n\004name\030\001 \001(\tB+\342A\001\002\372A$\n\"servic" + + "ehealth.googleapis.com/Event\"\373\001\n\035ListOrg" + + "anizationEventsRequest\022G\n\006parent\030\001 \001(\tB7" + + "\342A\001\002\372A0\022.servicehealth.googleapis.com/Or" + + "ganizationEvent\022\027\n\tpage_size\030\002 \001(\005B\004\342A\001\001" + + "\022\030\n\npage_token\030\003 \001(\tB\004\342A\001\001\022\024\n\006filter\030\004 \001" + + "(\tB\004\342A\001\001\022H\n\004view\030\006 \001(\01624.google.cloud.se" + + "rvicehealth.v1.OrganizationEventViewB\004\342A" + + "\001\001\"\257\001\n\036ListOrganizationEventsResponse\022S\n" + + "\023organization_events\030\001 \003(\01320.google.clou" + + "d.servicehealth.v1.OrganizationEventB\004\342A" + + "\001\003\022\035\n\017next_page_token\030\002 \001(\tB\004\342A\001\003\022\031\n\013unr" + + "eachable\030\003 \003(\tB\004\342A\001\003\"d\n\033GetOrganizationE" + + "ventRequest\022E\n\004name\030\001 \001(\tB7\342A\001\002\372A0\n.serv" + + "icehealth.googleapis.com/OrganizationEve" + + "nt\"\263\001\n\036ListOrganizationImpactsRequest\022H\n" + + "\006parent\030\001 \001(\tB8\342A\001\002\372A1\022/servicehealth.go" + + "ogleapis.com/OrganizationImpact\022\027\n\tpage_" + + "size\030\002 \001(\005B\004\342A\001\001\022\030\n\npage_token\030\003 \001(\tB\004\342A" + + "\001\001\022\024\n\006filter\030\004 \001(\tB\004\342A\001\001\"\262\001\n\037ListOrganiz" + + "ationImpactsResponse\022U\n\024organization_imp" + + "acts\030\001 \003(\01321.google.cloud.servicehealth." + + "v1.OrganizationImpactB\004\342A\001\003\022\035\n\017next_page" + + "_token\030\002 \001(\tB\004\342A\001\003\022\031\n\013unreachable\030\003 \003(\tB" + + "\004\342A\001\003\"f\n\034GetOrganizationImpactRequest\022F\n" + + "\004name\030\001 \001(\tB8\342A\001\002\372A1\n/servicehealth.goog" + + "leapis.com/OrganizationImpact*R\n\tEventVi" + + "ew\022\032\n\026EVENT_VIEW_UNSPECIFIED\020\000\022\024\n\020EVENT_" + + "VIEW_BASIC\020\001\022\023\n\017EVENT_VIEW_FULL\020\002*\205\001\n\025Or" + + "ganizationEventView\022\'\n#ORGANIZATION_EVEN" + + "T_VIEW_UNSPECIFIED\020\000\022!\n\035ORGANIZATION_EVE" + + "NT_VIEW_BASIC\020\001\022 \n\034ORGANIZATION_EVENT_VI" + + "EW_FULL\020\002B\317\002\n!com.google.cloud.servicehe" + + "alth.v1B\023EventResourcesProtoP\001ZGcloud.go" + + "ogle.com/go/servicehealth/apiv1/serviceh" + + "ealthpb;servicehealthpb\252\002\035Google.Cloud.S" + + "erviceHealth.V1\312\002\035Google\\Cloud\\ServiceHe" + + "alth\\V1\352\002 Google::Cloud::ServiceHealth::" + + "V1\352Af\n1servicehealth.googleapis.com/Orga" + + "nizationLocation\0221organizations/{organiz" + + "ation}/locations/{location}b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_servicehealth_v1_Event_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_servicehealth_v1_Event_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicehealth_v1_Event_descriptor, + new java.lang.String[] { + "Name", + "Title", + "Description", + "Category", + "DetailedCategory", + "State", + "DetailedState", + "EventImpacts", + "Relevance", + "Updates", + "ParentEvent", + "UpdateTime", + "StartTime", + "EndTime", + "NextUpdateTime", + }); + internal_static_google_cloud_servicehealth_v1_OrganizationEvent_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_servicehealth_v1_OrganizationEvent_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicehealth_v1_OrganizationEvent_descriptor, + new java.lang.String[] { + "Name", + "Title", + "Description", + "Category", + "DetailedCategory", + "State", + "DetailedState", + "EventImpacts", + "Updates", + "ParentEvent", + "UpdateTime", + "StartTime", + "EndTime", + "NextUpdateTime", + }); + internal_static_google_cloud_servicehealth_v1_EventUpdate_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_servicehealth_v1_EventUpdate_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicehealth_v1_EventUpdate_descriptor, + new java.lang.String[] { + "UpdateTime", "Title", "Description", "Symptom", "Workaround", + }); + internal_static_google_cloud_servicehealth_v1_Location_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_servicehealth_v1_Location_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicehealth_v1_Location_descriptor, + new java.lang.String[] { + "LocationName", + }); + internal_static_google_cloud_servicehealth_v1_Product_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_servicehealth_v1_Product_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicehealth_v1_Product_descriptor, + new java.lang.String[] { + "ProductName", + }); + internal_static_google_cloud_servicehealth_v1_EventImpact_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_servicehealth_v1_EventImpact_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicehealth_v1_EventImpact_descriptor, + new java.lang.String[] { + "Product", "Location", + }); + internal_static_google_cloud_servicehealth_v1_OrganizationImpact_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_servicehealth_v1_OrganizationImpact_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicehealth_v1_OrganizationImpact_descriptor, + new java.lang.String[] { + "Name", "Events", "Asset", "UpdateTime", + }); + internal_static_google_cloud_servicehealth_v1_Asset_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_servicehealth_v1_Asset_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicehealth_v1_Asset_descriptor, + new java.lang.String[] { + "AssetName", "AssetType", + }); + internal_static_google_cloud_servicehealth_v1_ListEventsRequest_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_servicehealth_v1_ListEventsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicehealth_v1_ListEventsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", "View", + }); + internal_static_google_cloud_servicehealth_v1_ListEventsResponse_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_servicehealth_v1_ListEventsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicehealth_v1_ListEventsResponse_descriptor, + new java.lang.String[] { + "Events", "NextPageToken", "Unreachable", + }); + internal_static_google_cloud_servicehealth_v1_GetEventRequest_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_servicehealth_v1_GetEventRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicehealth_v1_GetEventRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_servicehealth_v1_ListOrganizationEventsRequest_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_servicehealth_v1_ListOrganizationEventsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicehealth_v1_ListOrganizationEventsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", "View", + }); + internal_static_google_cloud_servicehealth_v1_ListOrganizationEventsResponse_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_cloud_servicehealth_v1_ListOrganizationEventsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicehealth_v1_ListOrganizationEventsResponse_descriptor, + new java.lang.String[] { + "OrganizationEvents", "NextPageToken", "Unreachable", + }); + internal_static_google_cloud_servicehealth_v1_GetOrganizationEventRequest_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_cloud_servicehealth_v1_GetOrganizationEventRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicehealth_v1_GetOrganizationEventRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_servicehealth_v1_ListOrganizationImpactsRequest_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_cloud_servicehealth_v1_ListOrganizationImpactsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicehealth_v1_ListOrganizationImpactsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", + }); + internal_static_google_cloud_servicehealth_v1_ListOrganizationImpactsResponse_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_cloud_servicehealth_v1_ListOrganizationImpactsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicehealth_v1_ListOrganizationImpactsResponse_descriptor, + new java.lang.String[] { + "OrganizationImpacts", "NextPageToken", "Unreachable", + }); + internal_static_google_cloud_servicehealth_v1_GetOrganizationImpactRequest_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_google_cloud_servicehealth_v1_GetOrganizationImpactRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicehealth_v1_GetOrganizationImpactRequest_descriptor, + new java.lang.String[] { + "Name", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceDefinition); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/EventServiceProto.java b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/EventServiceProto.java new file mode 100644 index 000000000000..bc16026d5553 --- /dev/null +++ b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/EventServiceProto.java @@ -0,0 +1,105 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/servicehealth/v1/event_service.proto + +package com.google.cloud.servicehealth.v1; + +public final class EventServiceProto { + private EventServiceProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n1google/cloud/servicehealth/v1/event_se" + + "rvice.proto\022\035google.cloud.servicehealth." + + "v1\032\034google/api/annotations.proto\032\027google" + + "/api/client.proto\0323google/cloud/serviceh" + + "ealth/v1/event_resources.proto2\252\n\n\rServi" + + "ceHealth\022\256\001\n\nListEvents\0220.google.cloud.s" + + "ervicehealth.v1.ListEventsRequest\0321.goog" + + "le.cloud.servicehealth.v1.ListEventsResp" + + "onse\";\332A\006parent\202\323\344\223\002,\022*/v1/{parent=proje" + + "cts/*/locations/*}/events\022\233\001\n\010GetEvent\022." + + ".google.cloud.servicehealth.v1.GetEventR" + + "equest\032$.google.cloud.servicehealth.v1.E" + + "vent\"9\332A\004name\202\323\344\223\002,\022*/v1/{name=projects/" + + "*/locations/*/events/*}\022\343\001\n\026ListOrganiza" + + "tionEvents\022<.google.cloud.servicehealth." + + "v1.ListOrganizationEventsRequest\032=.googl" + + "e.cloud.servicehealth.v1.ListOrganizatio" + + "nEventsResponse\"L\332A\006parent\202\323\344\223\002=\022;/v1/{p" + + "arent=organizations/*/locations/*}/organ" + + "izationEvents\022\320\001\n\024GetOrganizationEvent\022:" + + ".google.cloud.servicehealth.v1.GetOrgani" + + "zationEventRequest\0320.google.cloud.servic" + + "ehealth.v1.OrganizationEvent\"J\332A\004name\202\323\344" + + "\223\002=\022;/v1/{name=organizations/*/locations" + + "/*/organizationEvents/*}\022\347\001\n\027ListOrganiz" + + "ationImpacts\022=.google.cloud.servicehealt" + + "h.v1.ListOrganizationImpactsRequest\032>.go" + + "ogle.cloud.servicehealth.v1.ListOrganiza" + + "tionImpactsResponse\"M\332A\006parent\202\323\344\223\002>\022\022 + * Records an update made to the event. + * + * + * Protobuf type {@code google.cloud.servicehealth.v1.EventUpdate} + */ +public final class EventUpdate extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicehealth.v1.EventUpdate) + EventUpdateOrBuilder { + private static final long serialVersionUID = 0L; + // Use EventUpdate.newBuilder() to construct. + private EventUpdate(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EventUpdate() { + title_ = ""; + description_ = ""; + symptom_ = ""; + workaround_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EventUpdate(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_EventUpdate_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_EventUpdate_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicehealth.v1.EventUpdate.class, + com.google.cloud.servicehealth.v1.EventUpdate.Builder.class); + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. The time the update was posted.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Output only. The time the update was posted.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 1 [(.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 time the update was posted.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 1 [(.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 TITLE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object title_ = ""; + /** + * + * + *
+   * Output only. Brief title for the event.
+   * 
+ * + * 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. Brief title for the event.
+   * 
+ * + * 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. Free-form, human-readable description.
+   * 
+ * + * 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. Free-form, human-readable description.
+   * 
+ * + * 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 SYMPTOM_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object symptom_ = ""; + /** + * + * + *
+   * Output only. Symptoms of the event, if available.
+   * 
+ * + * string symptom = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The symptom. + */ + @java.lang.Override + public java.lang.String getSymptom() { + java.lang.Object ref = symptom_; + 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(); + symptom_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Symptoms of the event, if available.
+   * 
+ * + * string symptom = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for symptom. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSymptomBytes() { + java.lang.Object ref = symptom_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + symptom_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int WORKAROUND_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object workaround_ = ""; + /** + * + * + *
+   * Output only. Workaround steps to remediate the event impact, if available.
+   * 
+ * + * string workaround = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The workaround. + */ + @java.lang.Override + public java.lang.String getWorkaround() { + java.lang.Object ref = workaround_; + 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(); + workaround_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Workaround steps to remediate the event impact, if available.
+   * 
+ * + * string workaround = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for workaround. + */ + @java.lang.Override + public com.google.protobuf.ByteString getWorkaroundBytes() { + java.lang.Object ref = workaround_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + workaround_ = 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 (updateTime_ != null) { + output.writeMessage(1, getUpdateTime()); + } + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(symptom_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, symptom_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(workaround_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, workaround_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getUpdateTime()); + } + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(symptom_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, symptom_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(workaround_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, workaround_); + } + 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.servicehealth.v1.EventUpdate)) { + return super.equals(obj); + } + com.google.cloud.servicehealth.v1.EventUpdate other = + (com.google.cloud.servicehealth.v1.EventUpdate) obj; + + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (!getTitle().equals(other.getTitle())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (!getSymptom().equals(other.getSymptom())) return false; + if (!getWorkaround().equals(other.getWorkaround())) 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 (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().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) + SYMPTOM_FIELD_NUMBER; + hash = (53 * hash) + getSymptom().hashCode(); + hash = (37 * hash) + WORKAROUND_FIELD_NUMBER; + hash = (53 * hash) + getWorkaround().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.servicehealth.v1.EventUpdate parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicehealth.v1.EventUpdate 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.servicehealth.v1.EventUpdate parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicehealth.v1.EventUpdate 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.servicehealth.v1.EventUpdate parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicehealth.v1.EventUpdate parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.servicehealth.v1.EventUpdate parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicehealth.v1.EventUpdate 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.servicehealth.v1.EventUpdate parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicehealth.v1.EventUpdate 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.servicehealth.v1.EventUpdate parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicehealth.v1.EventUpdate 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.servicehealth.v1.EventUpdate 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; + } + /** + * + * + *
+   * Records an update made to the event.
+   * 
+ * + * Protobuf type {@code google.cloud.servicehealth.v1.EventUpdate} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicehealth.v1.EventUpdate) + com.google.cloud.servicehealth.v1.EventUpdateOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_EventUpdate_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_EventUpdate_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicehealth.v1.EventUpdate.class, + com.google.cloud.servicehealth.v1.EventUpdate.Builder.class); + } + + // Construct using com.google.cloud.servicehealth.v1.EventUpdate.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + title_ = ""; + description_ = ""; + symptom_ = ""; + workaround_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_EventUpdate_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicehealth.v1.EventUpdate getDefaultInstanceForType() { + return com.google.cloud.servicehealth.v1.EventUpdate.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicehealth.v1.EventUpdate build() { + com.google.cloud.servicehealth.v1.EventUpdate result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicehealth.v1.EventUpdate buildPartial() { + com.google.cloud.servicehealth.v1.EventUpdate result = + new com.google.cloud.servicehealth.v1.EventUpdate(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.servicehealth.v1.EventUpdate result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.title_ = title_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.description_ = description_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.symptom_ = symptom_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.workaround_ = workaround_; + } + } + + @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.servicehealth.v1.EventUpdate) { + return mergeFrom((com.google.cloud.servicehealth.v1.EventUpdate) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.servicehealth.v1.EventUpdate other) { + if (other == com.google.cloud.servicehealth.v1.EventUpdate.getDefaultInstance()) return this; + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (!other.getTitle().isEmpty()) { + title_ = other.title_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getSymptom().isEmpty()) { + symptom_ = other.symptom_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getWorkaround().isEmpty()) { + workaround_ = other.workaround_; + 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 10: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + 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 34: + { + symptom_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + workaround_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + 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 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 time the update was posted.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Output only. The time the update was posted.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 1 [(.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 time the update was posted.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 1 [(.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_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the update was posted.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 1 [(.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_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the update was posted.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the update was posted.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000001); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the update was posted.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time the update was posted.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 1 [(.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 time the update was posted.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 1 [(.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 java.lang.Object title_ = ""; + /** + * + * + *
+     * Output only. Brief title for the event.
+     * 
+ * + * 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. Brief title for the event.
+     * 
+ * + * 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. Brief title for the event.
+     * 
+ * + * 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. Brief title for the event.
+     * 
+ * + * 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. Brief title for the event.
+     * 
+ * + * 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. Free-form, human-readable description.
+     * 
+ * + * 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. Free-form, human-readable description.
+     * 
+ * + * 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. Free-form, human-readable description.
+     * 
+ * + * 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. Free-form, human-readable description.
+     * 
+ * + * 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. Free-form, human-readable description.
+     * 
+ * + * 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 java.lang.Object symptom_ = ""; + /** + * + * + *
+     * Output only. Symptoms of the event, if available.
+     * 
+ * + * string symptom = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The symptom. + */ + public java.lang.String getSymptom() { + java.lang.Object ref = symptom_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + symptom_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Symptoms of the event, if available.
+     * 
+ * + * string symptom = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for symptom. + */ + public com.google.protobuf.ByteString getSymptomBytes() { + java.lang.Object ref = symptom_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + symptom_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Symptoms of the event, if available.
+     * 
+ * + * string symptom = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The symptom to set. + * @return This builder for chaining. + */ + public Builder setSymptom(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + symptom_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Symptoms of the event, if available.
+     * 
+ * + * string symptom = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearSymptom() { + symptom_ = getDefaultInstance().getSymptom(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Symptoms of the event, if available.
+     * 
+ * + * string symptom = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for symptom to set. + * @return This builder for chaining. + */ + public Builder setSymptomBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + symptom_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object workaround_ = ""; + /** + * + * + *
+     * Output only. Workaround steps to remediate the event impact, if available.
+     * 
+ * + * string workaround = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The workaround. + */ + public java.lang.String getWorkaround() { + java.lang.Object ref = workaround_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + workaround_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Workaround steps to remediate the event impact, if available.
+     * 
+ * + * string workaround = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for workaround. + */ + public com.google.protobuf.ByteString getWorkaroundBytes() { + java.lang.Object ref = workaround_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + workaround_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Workaround steps to remediate the event impact, if available.
+     * 
+ * + * string workaround = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The workaround to set. + * @return This builder for chaining. + */ + public Builder setWorkaround(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + workaround_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Workaround steps to remediate the event impact, if available.
+     * 
+ * + * string workaround = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearWorkaround() { + workaround_ = getDefaultInstance().getWorkaround(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Workaround steps to remediate the event impact, if available.
+     * 
+ * + * string workaround = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for workaround to set. + * @return This builder for chaining. + */ + public Builder setWorkaroundBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + workaround_ = 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.servicehealth.v1.EventUpdate) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicehealth.v1.EventUpdate) + private static final com.google.cloud.servicehealth.v1.EventUpdate DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicehealth.v1.EventUpdate(); + } + + public static com.google.cloud.servicehealth.v1.EventUpdate getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EventUpdate 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.servicehealth.v1.EventUpdate getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/EventUpdateOrBuilder.java b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/EventUpdateOrBuilder.java new file mode 100644 index 000000000000..8617f1c5deb6 --- /dev/null +++ b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/EventUpdateOrBuilder.java @@ -0,0 +1,163 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/servicehealth/v1/event_resources.proto + +package com.google.cloud.servicehealth.v1; + +public interface EventUpdateOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicehealth.v1.EventUpdate) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The time the update was posted.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. The time the update was posted.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. The time the update was posted.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Brief title for the event.
+   * 
+ * + * string title = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The title. + */ + java.lang.String getTitle(); + /** + * + * + *
+   * Output only. Brief title for the event.
+   * 
+ * + * string title = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for title. + */ + com.google.protobuf.ByteString getTitleBytes(); + + /** + * + * + *
+   * Output only. Free-form, human-readable description.
+   * 
+ * + * string description = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * Output only. Free-form, human-readable description.
+   * 
+ * + * string description = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Output only. Symptoms of the event, if available.
+   * 
+ * + * string symptom = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The symptom. + */ + java.lang.String getSymptom(); + /** + * + * + *
+   * Output only. Symptoms of the event, if available.
+   * 
+ * + * string symptom = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for symptom. + */ + com.google.protobuf.ByteString getSymptomBytes(); + + /** + * + * + *
+   * Output only. Workaround steps to remediate the event impact, if available.
+   * 
+ * + * string workaround = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The workaround. + */ + java.lang.String getWorkaround(); + /** + * + * + *
+   * Output only. Workaround steps to remediate the event impact, if available.
+   * 
+ * + * string workaround = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for workaround. + */ + com.google.protobuf.ByteString getWorkaroundBytes(); +} diff --git a/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/EventView.java b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/EventView.java new file mode 100644 index 000000000000..1d546859c968 --- /dev/null +++ b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/EventView.java @@ -0,0 +1,181 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/servicehealth/v1/event_resources.proto + +package com.google.cloud.servicehealth.v1; + +/** + * + * + *
+ * The event fields to include in ListEvents API response. This enum lists all
+ * possible event views.
+ * 
+ * + * Protobuf enum {@code google.cloud.servicehealth.v1.EventView} + */ +public enum EventView implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Unspecified event view. Default to `EVENT_VIEW_BASIC`.
+   * 
+ * + * EVENT_VIEW_UNSPECIFIED = 0; + */ + EVENT_VIEW_UNSPECIFIED(0), + /** + * + * + *
+   * Includes all fields except `updates`. This view is the default for
+   * ListEvents API.
+   * 
+ * + * EVENT_VIEW_BASIC = 1; + */ + EVENT_VIEW_BASIC(1), + /** + * + * + *
+   * Includes all event fields.
+   * 
+ * + * EVENT_VIEW_FULL = 2; + */ + EVENT_VIEW_FULL(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * Unspecified event view. Default to `EVENT_VIEW_BASIC`.
+   * 
+ * + * EVENT_VIEW_UNSPECIFIED = 0; + */ + public static final int EVENT_VIEW_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * Includes all fields except `updates`. This view is the default for
+   * ListEvents API.
+   * 
+ * + * EVENT_VIEW_BASIC = 1; + */ + public static final int EVENT_VIEW_BASIC_VALUE = 1; + /** + * + * + *
+   * Includes all event fields.
+   * 
+ * + * EVENT_VIEW_FULL = 2; + */ + public static final int EVENT_VIEW_FULL_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static EventView 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 EventView forNumber(int value) { + switch (value) { + case 0: + return EVENT_VIEW_UNSPECIFIED; + case 1: + return EVENT_VIEW_BASIC; + case 2: + return EVENT_VIEW_FULL; + 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 EventView findValueByNumber(int number) { + return EventView.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.servicehealth.v1.EventResourcesProto.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final EventView[] VALUES = values(); + + public static EventView 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 EventView(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.servicehealth.v1.EventView) +} diff --git a/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/GetEventRequest.java b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/GetEventRequest.java new file mode 100644 index 000000000000..dfe9c74a9fa3 --- /dev/null +++ b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/GetEventRequest.java @@ -0,0 +1,680 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/servicehealth/v1/event_resources.proto + +package com.google.cloud.servicehealth.v1; + +/** + * + * + *
+ * Message for getting an event
+ * 
+ * + * Protobuf type {@code google.cloud.servicehealth.v1.GetEventRequest} + */ +public final class GetEventRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicehealth.v1.GetEventRequest) + GetEventRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetEventRequest.newBuilder() to construct. + private GetEventRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetEventRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetEventRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_GetEventRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_GetEventRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicehealth.v1.GetEventRequest.class, + com.google.cloud.servicehealth.v1.GetEventRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Unique name of the event in this scope including project
+   * and location using the form
+   * `projects/{project_id}/locations/{location}/events/{event_id}`.
+   *
+   * `project_id` - Project ID of the project that contains the event. <br>
+   * `location` - The location to get the service health events from. <br>
+   * `event_id` - Event ID to retrieve.
+   * 
+ * + * + * string name = 1 [(.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. Unique name of the event in this scope including project
+   * and location using the form
+   * `projects/{project_id}/locations/{location}/events/{event_id}`.
+   *
+   * `project_id` - Project ID of the project that contains the event. <br>
+   * `location` - The location to get the service health events from. <br>
+   * `event_id` - Event ID to retrieve.
+   * 
+ * + * + * string name = 1 [(.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, 1, 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(1, 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.servicehealth.v1.GetEventRequest)) { + return super.equals(obj); + } + com.google.cloud.servicehealth.v1.GetEventRequest other = + (com.google.cloud.servicehealth.v1.GetEventRequest) 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.servicehealth.v1.GetEventRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicehealth.v1.GetEventRequest 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.servicehealth.v1.GetEventRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicehealth.v1.GetEventRequest 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.servicehealth.v1.GetEventRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicehealth.v1.GetEventRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.servicehealth.v1.GetEventRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicehealth.v1.GetEventRequest 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.servicehealth.v1.GetEventRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicehealth.v1.GetEventRequest 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.servicehealth.v1.GetEventRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicehealth.v1.GetEventRequest 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.servicehealth.v1.GetEventRequest 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; + } + /** + * + * + *
+   * Message for getting an event
+   * 
+ * + * Protobuf type {@code google.cloud.servicehealth.v1.GetEventRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicehealth.v1.GetEventRequest) + com.google.cloud.servicehealth.v1.GetEventRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_GetEventRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_GetEventRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicehealth.v1.GetEventRequest.class, + com.google.cloud.servicehealth.v1.GetEventRequest.Builder.class); + } + + // Construct using com.google.cloud.servicehealth.v1.GetEventRequest.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.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_GetEventRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicehealth.v1.GetEventRequest getDefaultInstanceForType() { + return com.google.cloud.servicehealth.v1.GetEventRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicehealth.v1.GetEventRequest build() { + com.google.cloud.servicehealth.v1.GetEventRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicehealth.v1.GetEventRequest buildPartial() { + com.google.cloud.servicehealth.v1.GetEventRequest result = + new com.google.cloud.servicehealth.v1.GetEventRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.servicehealth.v1.GetEventRequest 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.servicehealth.v1.GetEventRequest) { + return mergeFrom((com.google.cloud.servicehealth.v1.GetEventRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.servicehealth.v1.GetEventRequest other) { + if (other == com.google.cloud.servicehealth.v1.GetEventRequest.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 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + 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. Unique name of the event in this scope including project
+     * and location using the form
+     * `projects/{project_id}/locations/{location}/events/{event_id}`.
+     *
+     * `project_id` - Project ID of the project that contains the event. <br>
+     * `location` - The location to get the service health events from. <br>
+     * `event_id` - Event ID to retrieve.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Unique name of the event in this scope including project
+     * and location using the form
+     * `projects/{project_id}/locations/{location}/events/{event_id}`.
+     *
+     * `project_id` - Project ID of the project that contains the event. <br>
+     * `location` - The location to get the service health events from. <br>
+     * `event_id` - Event ID to retrieve.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Unique name of the event in this scope including project
+     * and location using the form
+     * `projects/{project_id}/locations/{location}/events/{event_id}`.
+     *
+     * `project_id` - Project ID of the project that contains the event. <br>
+     * `location` - The location to get the service health events from. <br>
+     * `event_id` - Event ID to retrieve.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Unique name of the event in this scope including project
+     * and location using the form
+     * `projects/{project_id}/locations/{location}/events/{event_id}`.
+     *
+     * `project_id` - Project ID of the project that contains the event. <br>
+     * `location` - The location to get the service health events from. <br>
+     * `event_id` - Event ID to retrieve.
+     * 
+ * + * + * string name = 1 [(.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. Unique name of the event in this scope including project
+     * and location using the form
+     * `projects/{project_id}/locations/{location}/events/{event_id}`.
+     *
+     * `project_id` - Project ID of the project that contains the event. <br>
+     * `location` - The location to get the service health events from. <br>
+     * `event_id` - Event ID to retrieve.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + 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.servicehealth.v1.GetEventRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicehealth.v1.GetEventRequest) + private static final com.google.cloud.servicehealth.v1.GetEventRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicehealth.v1.GetEventRequest(); + } + + public static com.google.cloud.servicehealth.v1.GetEventRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetEventRequest 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.servicehealth.v1.GetEventRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/GetEventRequestOrBuilder.java b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/GetEventRequestOrBuilder.java new file mode 100644 index 000000000000..c183f7e3d783 --- /dev/null +++ b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/GetEventRequestOrBuilder.java @@ -0,0 +1,66 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/servicehealth/v1/event_resources.proto + +package com.google.cloud.servicehealth.v1; + +public interface GetEventRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicehealth.v1.GetEventRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Unique name of the event in this scope including project
+   * and location using the form
+   * `projects/{project_id}/locations/{location}/events/{event_id}`.
+   *
+   * `project_id` - Project ID of the project that contains the event. <br>
+   * `location` - The location to get the service health events from. <br>
+   * `event_id` - Event ID to retrieve.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Unique name of the event in this scope including project
+   * and location using the form
+   * `projects/{project_id}/locations/{location}/events/{event_id}`.
+   *
+   * `project_id` - Project ID of the project that contains the event. <br>
+   * `location` - The location to get the service health events from. <br>
+   * `event_id` - Event ID to retrieve.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/GetOrganizationEventRequest.java b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/GetOrganizationEventRequest.java new file mode 100644 index 000000000000..03c9ab15fe02 --- /dev/null +++ b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/GetOrganizationEventRequest.java @@ -0,0 +1,683 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/servicehealth/v1/event_resources.proto + +package com.google.cloud.servicehealth.v1; + +/** Protobuf type {@code google.cloud.servicehealth.v1.GetOrganizationEventRequest} */ +public final class GetOrganizationEventRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicehealth.v1.GetOrganizationEventRequest) + GetOrganizationEventRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetOrganizationEventRequest.newBuilder() to construct. + private GetOrganizationEventRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetOrganizationEventRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetOrganizationEventRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_GetOrganizationEventRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_GetOrganizationEventRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicehealth.v1.GetOrganizationEventRequest.class, + com.google.cloud.servicehealth.v1.GetOrganizationEventRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Unique name of the event in this scope including organization and
+   * event ID using the form
+   * `organizations/{organization_id}/locations/locations/global/organizationEvents/{event_id}`.
+   *
+   * `organization_id` - ID (number) of the project that contains the event. To
+   * get your `organization_id`, see
+   * [Getting your organization resource
+   * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).<br>
+   * `event_id` - Organization event ID to retrieve.
+   * 
+ * + * + * string name = 1 [(.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. Unique name of the event in this scope including organization and
+   * event ID using the form
+   * `organizations/{organization_id}/locations/locations/global/organizationEvents/{event_id}`.
+   *
+   * `organization_id` - ID (number) of the project that contains the event. To
+   * get your `organization_id`, see
+   * [Getting your organization resource
+   * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).<br>
+   * `event_id` - Organization event ID to retrieve.
+   * 
+ * + * + * string name = 1 [(.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, 1, 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(1, 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.servicehealth.v1.GetOrganizationEventRequest)) { + return super.equals(obj); + } + com.google.cloud.servicehealth.v1.GetOrganizationEventRequest other = + (com.google.cloud.servicehealth.v1.GetOrganizationEventRequest) 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.servicehealth.v1.GetOrganizationEventRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicehealth.v1.GetOrganizationEventRequest 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.servicehealth.v1.GetOrganizationEventRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicehealth.v1.GetOrganizationEventRequest 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.servicehealth.v1.GetOrganizationEventRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicehealth.v1.GetOrganizationEventRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.servicehealth.v1.GetOrganizationEventRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicehealth.v1.GetOrganizationEventRequest 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.servicehealth.v1.GetOrganizationEventRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicehealth.v1.GetOrganizationEventRequest 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.servicehealth.v1.GetOrganizationEventRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicehealth.v1.GetOrganizationEventRequest 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.servicehealth.v1.GetOrganizationEventRequest 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; + } + /** Protobuf type {@code google.cloud.servicehealth.v1.GetOrganizationEventRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicehealth.v1.GetOrganizationEventRequest) + com.google.cloud.servicehealth.v1.GetOrganizationEventRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_GetOrganizationEventRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_GetOrganizationEventRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicehealth.v1.GetOrganizationEventRequest.class, + com.google.cloud.servicehealth.v1.GetOrganizationEventRequest.Builder.class); + } + + // Construct using com.google.cloud.servicehealth.v1.GetOrganizationEventRequest.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.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_GetOrganizationEventRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicehealth.v1.GetOrganizationEventRequest + getDefaultInstanceForType() { + return com.google.cloud.servicehealth.v1.GetOrganizationEventRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicehealth.v1.GetOrganizationEventRequest build() { + com.google.cloud.servicehealth.v1.GetOrganizationEventRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicehealth.v1.GetOrganizationEventRequest buildPartial() { + com.google.cloud.servicehealth.v1.GetOrganizationEventRequest result = + new com.google.cloud.servicehealth.v1.GetOrganizationEventRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.servicehealth.v1.GetOrganizationEventRequest 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.servicehealth.v1.GetOrganizationEventRequest) { + return mergeFrom((com.google.cloud.servicehealth.v1.GetOrganizationEventRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.servicehealth.v1.GetOrganizationEventRequest other) { + if (other + == com.google.cloud.servicehealth.v1.GetOrganizationEventRequest.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 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + 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. Unique name of the event in this scope including organization and
+     * event ID using the form
+     * `organizations/{organization_id}/locations/locations/global/organizationEvents/{event_id}`.
+     *
+     * `organization_id` - ID (number) of the project that contains the event. To
+     * get your `organization_id`, see
+     * [Getting your organization resource
+     * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).<br>
+     * `event_id` - Organization event ID to retrieve.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Unique name of the event in this scope including organization and
+     * event ID using the form
+     * `organizations/{organization_id}/locations/locations/global/organizationEvents/{event_id}`.
+     *
+     * `organization_id` - ID (number) of the project that contains the event. To
+     * get your `organization_id`, see
+     * [Getting your organization resource
+     * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).<br>
+     * `event_id` - Organization event ID to retrieve.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Unique name of the event in this scope including organization and
+     * event ID using the form
+     * `organizations/{organization_id}/locations/locations/global/organizationEvents/{event_id}`.
+     *
+     * `organization_id` - ID (number) of the project that contains the event. To
+     * get your `organization_id`, see
+     * [Getting your organization resource
+     * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).<br>
+     * `event_id` - Organization event ID to retrieve.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Unique name of the event in this scope including organization and
+     * event ID using the form
+     * `organizations/{organization_id}/locations/locations/global/organizationEvents/{event_id}`.
+     *
+     * `organization_id` - ID (number) of the project that contains the event. To
+     * get your `organization_id`, see
+     * [Getting your organization resource
+     * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).<br>
+     * `event_id` - Organization event ID to retrieve.
+     * 
+ * + * + * string name = 1 [(.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. Unique name of the event in this scope including organization and
+     * event ID using the form
+     * `organizations/{organization_id}/locations/locations/global/organizationEvents/{event_id}`.
+     *
+     * `organization_id` - ID (number) of the project that contains the event. To
+     * get your `organization_id`, see
+     * [Getting your organization resource
+     * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).<br>
+     * `event_id` - Organization event ID to retrieve.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + 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.servicehealth.v1.GetOrganizationEventRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicehealth.v1.GetOrganizationEventRequest) + private static final com.google.cloud.servicehealth.v1.GetOrganizationEventRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicehealth.v1.GetOrganizationEventRequest(); + } + + public static com.google.cloud.servicehealth.v1.GetOrganizationEventRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetOrganizationEventRequest 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.servicehealth.v1.GetOrganizationEventRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/GetOrganizationEventRequestOrBuilder.java b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/GetOrganizationEventRequestOrBuilder.java new file mode 100644 index 000000000000..b841fd505da8 --- /dev/null +++ b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/GetOrganizationEventRequestOrBuilder.java @@ -0,0 +1,70 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/servicehealth/v1/event_resources.proto + +package com.google.cloud.servicehealth.v1; + +public interface GetOrganizationEventRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicehealth.v1.GetOrganizationEventRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Unique name of the event in this scope including organization and
+   * event ID using the form
+   * `organizations/{organization_id}/locations/locations/global/organizationEvents/{event_id}`.
+   *
+   * `organization_id` - ID (number) of the project that contains the event. To
+   * get your `organization_id`, see
+   * [Getting your organization resource
+   * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).<br>
+   * `event_id` - Organization event ID to retrieve.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Unique name of the event in this scope including organization and
+   * event ID using the form
+   * `organizations/{organization_id}/locations/locations/global/organizationEvents/{event_id}`.
+   *
+   * `organization_id` - ID (number) of the project that contains the event. To
+   * get your `organization_id`, see
+   * [Getting your organization resource
+   * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).<br>
+   * `event_id` - Organization event ID to retrieve.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/GetOrganizationImpactRequest.java b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/GetOrganizationImpactRequest.java new file mode 100644 index 000000000000..2754b31fd6b2 --- /dev/null +++ b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/GetOrganizationImpactRequest.java @@ -0,0 +1,685 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/servicehealth/v1/event_resources.proto + +package com.google.cloud.servicehealth.v1; + +/** Protobuf type {@code google.cloud.servicehealth.v1.GetOrganizationImpactRequest} */ +public final class GetOrganizationImpactRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicehealth.v1.GetOrganizationImpactRequest) + GetOrganizationImpactRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetOrganizationImpactRequest.newBuilder() to construct. + private GetOrganizationImpactRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetOrganizationImpactRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetOrganizationImpactRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_GetOrganizationImpactRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_GetOrganizationImpactRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicehealth.v1.GetOrganizationImpactRequest.class, + com.google.cloud.servicehealth.v1.GetOrganizationImpactRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Name of the resource using the form
+   * `organizations/{organization_id}/locations/global/organizationImpacts/{organization_impact_id}`.
+   *
+   * `organization_id` - ID (number) of the organization that contains the
+   * event. To get your `organization_id`, see
+   * [Getting your organization resource
+   * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).<br>
+   * `organization_impact_id` - ID of the [OrganizationImpact
+   * resource](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact).
+   * 
+ * + * + * string name = 1 [(.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. Name of the resource using the form
+   * `organizations/{organization_id}/locations/global/organizationImpacts/{organization_impact_id}`.
+   *
+   * `organization_id` - ID (number) of the organization that contains the
+   * event. To get your `organization_id`, see
+   * [Getting your organization resource
+   * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).<br>
+   * `organization_impact_id` - ID of the [OrganizationImpact
+   * resource](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact).
+   * 
+ * + * + * string name = 1 [(.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, 1, 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(1, 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.servicehealth.v1.GetOrganizationImpactRequest)) { + return super.equals(obj); + } + com.google.cloud.servicehealth.v1.GetOrganizationImpactRequest other = + (com.google.cloud.servicehealth.v1.GetOrganizationImpactRequest) 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.servicehealth.v1.GetOrganizationImpactRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicehealth.v1.GetOrganizationImpactRequest 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.servicehealth.v1.GetOrganizationImpactRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicehealth.v1.GetOrganizationImpactRequest 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.servicehealth.v1.GetOrganizationImpactRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicehealth.v1.GetOrganizationImpactRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.servicehealth.v1.GetOrganizationImpactRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicehealth.v1.GetOrganizationImpactRequest 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.servicehealth.v1.GetOrganizationImpactRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicehealth.v1.GetOrganizationImpactRequest 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.servicehealth.v1.GetOrganizationImpactRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicehealth.v1.GetOrganizationImpactRequest 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.servicehealth.v1.GetOrganizationImpactRequest 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; + } + /** Protobuf type {@code google.cloud.servicehealth.v1.GetOrganizationImpactRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicehealth.v1.GetOrganizationImpactRequest) + com.google.cloud.servicehealth.v1.GetOrganizationImpactRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_GetOrganizationImpactRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_GetOrganizationImpactRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicehealth.v1.GetOrganizationImpactRequest.class, + com.google.cloud.servicehealth.v1.GetOrganizationImpactRequest.Builder.class); + } + + // Construct using com.google.cloud.servicehealth.v1.GetOrganizationImpactRequest.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.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_GetOrganizationImpactRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicehealth.v1.GetOrganizationImpactRequest + getDefaultInstanceForType() { + return com.google.cloud.servicehealth.v1.GetOrganizationImpactRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicehealth.v1.GetOrganizationImpactRequest build() { + com.google.cloud.servicehealth.v1.GetOrganizationImpactRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicehealth.v1.GetOrganizationImpactRequest buildPartial() { + com.google.cloud.servicehealth.v1.GetOrganizationImpactRequest result = + new com.google.cloud.servicehealth.v1.GetOrganizationImpactRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.servicehealth.v1.GetOrganizationImpactRequest 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.servicehealth.v1.GetOrganizationImpactRequest) { + return mergeFrom((com.google.cloud.servicehealth.v1.GetOrganizationImpactRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.servicehealth.v1.GetOrganizationImpactRequest other) { + if (other + == com.google.cloud.servicehealth.v1.GetOrganizationImpactRequest.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 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + 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. Name of the resource using the form
+     * `organizations/{organization_id}/locations/global/organizationImpacts/{organization_impact_id}`.
+     *
+     * `organization_id` - ID (number) of the organization that contains the
+     * event. To get your `organization_id`, see
+     * [Getting your organization resource
+     * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).<br>
+     * `organization_impact_id` - ID of the [OrganizationImpact
+     * resource](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact).
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Name of the resource using the form
+     * `organizations/{organization_id}/locations/global/organizationImpacts/{organization_impact_id}`.
+     *
+     * `organization_id` - ID (number) of the organization that contains the
+     * event. To get your `organization_id`, see
+     * [Getting your organization resource
+     * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).<br>
+     * `organization_impact_id` - ID of the [OrganizationImpact
+     * resource](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact).
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Name of the resource using the form
+     * `organizations/{organization_id}/locations/global/organizationImpacts/{organization_impact_id}`.
+     *
+     * `organization_id` - ID (number) of the organization that contains the
+     * event. To get your `organization_id`, see
+     * [Getting your organization resource
+     * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).<br>
+     * `organization_impact_id` - ID of the [OrganizationImpact
+     * resource](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact).
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the resource using the form
+     * `organizations/{organization_id}/locations/global/organizationImpacts/{organization_impact_id}`.
+     *
+     * `organization_id` - ID (number) of the organization that contains the
+     * event. To get your `organization_id`, see
+     * [Getting your organization resource
+     * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).<br>
+     * `organization_impact_id` - ID of the [OrganizationImpact
+     * resource](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact).
+     * 
+ * + * + * string name = 1 [(.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. Name of the resource using the form
+     * `organizations/{organization_id}/locations/global/organizationImpacts/{organization_impact_id}`.
+     *
+     * `organization_id` - ID (number) of the organization that contains the
+     * event. To get your `organization_id`, see
+     * [Getting your organization resource
+     * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).<br>
+     * `organization_impact_id` - ID of the [OrganizationImpact
+     * resource](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact).
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + 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.servicehealth.v1.GetOrganizationImpactRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicehealth.v1.GetOrganizationImpactRequest) + private static final com.google.cloud.servicehealth.v1.GetOrganizationImpactRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicehealth.v1.GetOrganizationImpactRequest(); + } + + public static com.google.cloud.servicehealth.v1.GetOrganizationImpactRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetOrganizationImpactRequest 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.servicehealth.v1.GetOrganizationImpactRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/GetOrganizationImpactRequestOrBuilder.java b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/GetOrganizationImpactRequestOrBuilder.java new file mode 100644 index 000000000000..46b21f2ff830 --- /dev/null +++ b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/GetOrganizationImpactRequestOrBuilder.java @@ -0,0 +1,70 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/servicehealth/v1/event_resources.proto + +package com.google.cloud.servicehealth.v1; + +public interface GetOrganizationImpactRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicehealth.v1.GetOrganizationImpactRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the resource using the form
+   * `organizations/{organization_id}/locations/global/organizationImpacts/{organization_impact_id}`.
+   *
+   * `organization_id` - ID (number) of the organization that contains the
+   * event. To get your `organization_id`, see
+   * [Getting your organization resource
+   * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).<br>
+   * `organization_impact_id` - ID of the [OrganizationImpact
+   * resource](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact).
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the resource using the form
+   * `organizations/{organization_id}/locations/global/organizationImpacts/{organization_impact_id}`.
+   *
+   * `organization_id` - ID (number) of the organization that contains the
+   * event. To get your `organization_id`, see
+   * [Getting your organization resource
+   * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).<br>
+   * `organization_impact_id` - ID of the [OrganizationImpact
+   * resource](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact).
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/ListEventsRequest.java b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/ListEventsRequest.java new file mode 100644 index 000000000000..2b496bd056c2 --- /dev/null +++ b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/ListEventsRequest.java @@ -0,0 +1,1425 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/servicehealth/v1/event_resources.proto + +package com.google.cloud.servicehealth.v1; + +/** Protobuf type {@code google.cloud.servicehealth.v1.ListEventsRequest} */ +public final class ListEventsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicehealth.v1.ListEventsRequest) + ListEventsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListEventsRequest.newBuilder() to construct. + private ListEventsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListEventsRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + view_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListEventsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_ListEventsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_ListEventsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicehealth.v1.ListEventsRequest.class, + com.google.cloud.servicehealth.v1.ListEventsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. Parent value using the form
+   * `projects/{project_id}/locations/{location}/events`.
+   *
+   * `project_id` - ID of the project for which to list service health
+   * events.
+   * `location` - The location to get the service health events from.
+   * To retrieve service health events of category = INCIDENT, use `location` =
+   * `global`.
+   * 
+ * + * + * string parent = 1 [(.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. Parent value using the form
+   * `projects/{project_id}/locations/{location}/events`.
+   *
+   * `project_id` - ID of the project for which to list service health
+   * events.
+   * `location` - The location to get the service health events from.
+   * To retrieve service health events of category = INCIDENT, use `location` =
+   * `global`.
+   * 
+ * + * + * string parent = 1 [(.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 = 2; + private int pageSize_ = 0; + /** + * + * + *
+   * Optional. The maximum number of events that should be returned.  Acceptable
+   * values are 1 to 100, inclusive. (The default value is 10.) If more results
+   * are available, the service returns a next_page_token that you can use to
+   * get the next page of results in subsequent list requests. The service may
+   * return fewer events than the requested page_size.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   * Provide Page token returned by a previous `ListEvents` call to retrieve the
+   * next page of results. When paginating, all other parameters provided to
+   * `ListEvents` must match the call that provided the page token.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   * Provide Page token returned by a previous `ListEvents` call to retrieve the
+   * next page of results. When paginating, all other parameters provided to
+   * `ListEvents` must match the call that provided the page token.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + /** + * + * + *
+   * Optional. A filter expression that filters resources listed in the
+   * response. The expression takes the following forms: <br>
+   * *   field=value for `category` and `state`<br>
+   * *   field &lt;, >, &lt;=, or >= value for `update_time` <br>
+   * Examples: `category=INCIDENT`, `update_time>=2000-01-01T11:30:00-04:00`
+   * <br>
+   *
+   * Multiple filter queries are separated by spaces. Example:
+   * `category=INCIDENT state=ACTIVE`.
+   *
+   * By default, each expression is an AND expression. However, you can include
+   * AND and OR expressions explicitly.
+   *
+   * Filter is supported for the following fields: `category`, `state`,
+   * `update_time`
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. A filter expression that filters resources listed in the
+   * response. The expression takes the following forms: <br>
+   * *   field=value for `category` and `state`<br>
+   * *   field &lt;, >, &lt;=, or >= value for `update_time` <br>
+   * Examples: `category=INCIDENT`, `update_time>=2000-01-01T11:30:00-04:00`
+   * <br>
+   *
+   * Multiple filter queries are separated by spaces. Example:
+   * `category=INCIDENT state=ACTIVE`.
+   *
+   * By default, each expression is an AND expression. However, you can include
+   * AND and OR expressions explicitly.
+   *
+   * Filter is supported for the following fields: `category`, `state`,
+   * `update_time`
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 VIEW_FIELD_NUMBER = 6; + private int view_ = 0; + /** + * + * + *
+   * Optional. Event fields to include in response.
+   * 
+ * + * + * .google.cloud.servicehealth.v1.EventView view = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for view. + */ + @java.lang.Override + public int getViewValue() { + return view_; + } + /** + * + * + *
+   * Optional. Event fields to include in response.
+   * 
+ * + * + * .google.cloud.servicehealth.v1.EventView view = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The view. + */ + @java.lang.Override + public com.google.cloud.servicehealth.v1.EventView getView() { + com.google.cloud.servicehealth.v1.EventView result = + com.google.cloud.servicehealth.v1.EventView.forNumber(view_); + return result == null ? com.google.cloud.servicehealth.v1.EventView.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(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, filter_); + } + if (view_ != com.google.cloud.servicehealth.v1.EventView.EVENT_VIEW_UNSPECIFIED.getNumber()) { + output.writeEnum(6, view_); + } + 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(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, filter_); + } + if (view_ != com.google.cloud.servicehealth.v1.EventView.EVENT_VIEW_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(6, view_); + } + 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.servicehealth.v1.ListEventsRequest)) { + return super.equals(obj); + } + com.google.cloud.servicehealth.v1.ListEventsRequest other = + (com.google.cloud.servicehealth.v1.ListEventsRequest) 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 (view_ != other.view_) 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) + VIEW_FIELD_NUMBER; + hash = (53 * hash) + view_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.servicehealth.v1.ListEventsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicehealth.v1.ListEventsRequest 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.servicehealth.v1.ListEventsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicehealth.v1.ListEventsRequest 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.servicehealth.v1.ListEventsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicehealth.v1.ListEventsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.servicehealth.v1.ListEventsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicehealth.v1.ListEventsRequest 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.servicehealth.v1.ListEventsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicehealth.v1.ListEventsRequest 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.servicehealth.v1.ListEventsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicehealth.v1.ListEventsRequest 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.servicehealth.v1.ListEventsRequest 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; + } + /** Protobuf type {@code google.cloud.servicehealth.v1.ListEventsRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicehealth.v1.ListEventsRequest) + com.google.cloud.servicehealth.v1.ListEventsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_ListEventsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_ListEventsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicehealth.v1.ListEventsRequest.class, + com.google.cloud.servicehealth.v1.ListEventsRequest.Builder.class); + } + + // Construct using com.google.cloud.servicehealth.v1.ListEventsRequest.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_ = ""; + view_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_ListEventsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicehealth.v1.ListEventsRequest getDefaultInstanceForType() { + return com.google.cloud.servicehealth.v1.ListEventsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicehealth.v1.ListEventsRequest build() { + com.google.cloud.servicehealth.v1.ListEventsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicehealth.v1.ListEventsRequest buildPartial() { + com.google.cloud.servicehealth.v1.ListEventsRequest result = + new com.google.cloud.servicehealth.v1.ListEventsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.servicehealth.v1.ListEventsRequest 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.view_ = view_; + } + } + + @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.servicehealth.v1.ListEventsRequest) { + return mergeFrom((com.google.cloud.servicehealth.v1.ListEventsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.servicehealth.v1.ListEventsRequest other) { + if (other == com.google.cloud.servicehealth.v1.ListEventsRequest.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.view_ != 0) { + setViewValue(other.getViewValue()); + } + 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: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 48: + { + view_ = input.readEnum(); + bitField0_ |= 0x00000010; + break; + } // case 48 + 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. Parent value using the form
+     * `projects/{project_id}/locations/{location}/events`.
+     *
+     * `project_id` - ID of the project for which to list service health
+     * events.
+     * `location` - The location to get the service health events from.
+     * To retrieve service health events of category = INCIDENT, use `location` =
+     * `global`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Parent value using the form
+     * `projects/{project_id}/locations/{location}/events`.
+     *
+     * `project_id` - ID of the project for which to list service health
+     * events.
+     * `location` - The location to get the service health events from.
+     * To retrieve service health events of category = INCIDENT, use `location` =
+     * `global`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Parent value using the form
+     * `projects/{project_id}/locations/{location}/events`.
+     *
+     * `project_id` - ID of the project for which to list service health
+     * events.
+     * `location` - The location to get the service health events from.
+     * To retrieve service health events of category = INCIDENT, use `location` =
+     * `global`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Parent value using the form
+     * `projects/{project_id}/locations/{location}/events`.
+     *
+     * `project_id` - ID of the project for which to list service health
+     * events.
+     * `location` - The location to get the service health events from.
+     * To retrieve service health events of category = INCIDENT, use `location` =
+     * `global`.
+     * 
+ * + * + * string parent = 1 [(.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. Parent value using the form
+     * `projects/{project_id}/locations/{location}/events`.
+     *
+     * `project_id` - ID of the project for which to list service health
+     * events.
+     * `location` - The location to get the service health events from.
+     * To retrieve service health events of category = INCIDENT, use `location` =
+     * `global`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Optional. The maximum number of events that should be returned.  Acceptable
+     * values are 1 to 100, inclusive. (The default value is 10.) If more results
+     * are available, the service returns a next_page_token that you can use to
+     * get the next page of results in subsequent list requests. The service may
+     * return fewer events than the requested page_size.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Optional. The maximum number of events that should be returned.  Acceptable
+     * values are 1 to 100, inclusive. (The default value is 10.) If more results
+     * are available, the service returns a next_page_token that you can use to
+     * get the next page of results in subsequent list requests. The service may
+     * return fewer events than the requested page_size.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The maximum number of events that should be returned.  Acceptable
+     * values are 1 to 100, inclusive. (The default value is 10.) If more results
+     * are available, the service returns a next_page_token that you can use to
+     * get the next page of results in subsequent list requests. The service may
+     * return fewer events than the requested page_size.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     * Provide Page token returned by a previous `ListEvents` call to retrieve the
+     * next page of results. When paginating, all other parameters provided to
+     * `ListEvents` must match the call that provided the page token.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     * Provide Page token returned by a previous `ListEvents` call to retrieve the
+     * next page of results. When paginating, all other parameters provided to
+     * `ListEvents` must match the call that provided the page token.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     * Provide Page token returned by a previous `ListEvents` call to retrieve the
+     * next page of results. When paginating, all other parameters provided to
+     * `ListEvents` must match the call that provided the page token.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     * Provide Page token returned by a previous `ListEvents` call to retrieve the
+     * next page of results. When paginating, all other parameters provided to
+     * `ListEvents` must match the call that provided the page token.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     * Provide Page token returned by a previous `ListEvents` call to retrieve the
+     * next page of results. When paginating, all other parameters provided to
+     * `ListEvents` must match the call that provided the page token.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Optional. A filter expression that filters resources listed in the
+     * response. The expression takes the following forms: <br>
+     * *   field=value for `category` and `state`<br>
+     * *   field &lt;, >, &lt;=, or >= value for `update_time` <br>
+     * Examples: `category=INCIDENT`, `update_time>=2000-01-01T11:30:00-04:00`
+     * <br>
+     *
+     * Multiple filter queries are separated by spaces. Example:
+     * `category=INCIDENT state=ACTIVE`.
+     *
+     * By default, each expression is an AND expression. However, you can include
+     * AND and OR expressions explicitly.
+     *
+     * Filter is supported for the following fields: `category`, `state`,
+     * `update_time`
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. A filter expression that filters resources listed in the
+     * response. The expression takes the following forms: <br>
+     * *   field=value for `category` and `state`<br>
+     * *   field &lt;, >, &lt;=, or >= value for `update_time` <br>
+     * Examples: `category=INCIDENT`, `update_time>=2000-01-01T11:30:00-04:00`
+     * <br>
+     *
+     * Multiple filter queries are separated by spaces. Example:
+     * `category=INCIDENT state=ACTIVE`.
+     *
+     * By default, each expression is an AND expression. However, you can include
+     * AND and OR expressions explicitly.
+     *
+     * Filter is supported for the following fields: `category`, `state`,
+     * `update_time`
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. A filter expression that filters resources listed in the
+     * response. The expression takes the following forms: <br>
+     * *   field=value for `category` and `state`<br>
+     * *   field &lt;, >, &lt;=, or >= value for `update_time` <br>
+     * Examples: `category=INCIDENT`, `update_time>=2000-01-01T11:30:00-04:00`
+     * <br>
+     *
+     * Multiple filter queries are separated by spaces. Example:
+     * `category=INCIDENT state=ACTIVE`.
+     *
+     * By default, each expression is an AND expression. However, you can include
+     * AND and OR expressions explicitly.
+     *
+     * Filter is supported for the following fields: `category`, `state`,
+     * `update_time`
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + /** + * + * + *
+     * Optional. A filter expression that filters resources listed in the
+     * response. The expression takes the following forms: <br>
+     * *   field=value for `category` and `state`<br>
+     * *   field &lt;, >, &lt;=, or >= value for `update_time` <br>
+     * Examples: `category=INCIDENT`, `update_time>=2000-01-01T11:30:00-04:00`
+     * <br>
+     *
+     * Multiple filter queries are separated by spaces. Example:
+     * `category=INCIDENT state=ACTIVE`.
+     *
+     * By default, each expression is an AND expression. However, you can include
+     * AND and OR expressions explicitly.
+     *
+     * Filter is supported for the following fields: `category`, `state`,
+     * `update_time`
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A filter expression that filters resources listed in the
+     * response. The expression takes the following forms: <br>
+     * *   field=value for `category` and `state`<br>
+     * *   field &lt;, >, &lt;=, or >= value for `update_time` <br>
+     * Examples: `category=INCIDENT`, `update_time>=2000-01-01T11:30:00-04:00`
+     * <br>
+     *
+     * Multiple filter queries are separated by spaces. Example:
+     * `category=INCIDENT state=ACTIVE`.
+     *
+     * By default, each expression is an AND expression. However, you can include
+     * AND and OR expressions explicitly.
+     *
+     * Filter is supported for the following fields: `category`, `state`,
+     * `update_time`
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 int view_ = 0; + /** + * + * + *
+     * Optional. Event fields to include in response.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.EventView view = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for view. + */ + @java.lang.Override + public int getViewValue() { + return view_; + } + /** + * + * + *
+     * Optional. Event fields to include in response.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.EventView view = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for view to set. + * @return This builder for chaining. + */ + public Builder setViewValue(int value) { + view_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Event fields to include in response.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.EventView view = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The view. + */ + @java.lang.Override + public com.google.cloud.servicehealth.v1.EventView getView() { + com.google.cloud.servicehealth.v1.EventView result = + com.google.cloud.servicehealth.v1.EventView.forNumber(view_); + return result == null ? com.google.cloud.servicehealth.v1.EventView.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Optional. Event fields to include in response.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.EventView view = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The view to set. + * @return This builder for chaining. + */ + public Builder setView(com.google.cloud.servicehealth.v1.EventView value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + view_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Event fields to include in response.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.EventView view = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearView() { + bitField0_ = (bitField0_ & ~0x00000010); + view_ = 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.servicehealth.v1.ListEventsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicehealth.v1.ListEventsRequest) + private static final com.google.cloud.servicehealth.v1.ListEventsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicehealth.v1.ListEventsRequest(); + } + + public static com.google.cloud.servicehealth.v1.ListEventsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListEventsRequest 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.servicehealth.v1.ListEventsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/ListEventsRequestOrBuilder.java b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/ListEventsRequestOrBuilder.java new file mode 100644 index 000000000000..0c2425ead63e --- /dev/null +++ b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/ListEventsRequestOrBuilder.java @@ -0,0 +1,198 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/servicehealth/v1/event_resources.proto + +package com.google.cloud.servicehealth.v1; + +public interface ListEventsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicehealth.v1.ListEventsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Parent value using the form
+   * `projects/{project_id}/locations/{location}/events`.
+   *
+   * `project_id` - ID of the project for which to list service health
+   * events.
+   * `location` - The location to get the service health events from.
+   * To retrieve service health events of category = INCIDENT, use `location` =
+   * `global`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Parent value using the form
+   * `projects/{project_id}/locations/{location}/events`.
+   *
+   * `project_id` - ID of the project for which to list service health
+   * events.
+   * `location` - The location to get the service health events from.
+   * To retrieve service health events of category = INCIDENT, use `location` =
+   * `global`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. The maximum number of events that should be returned.  Acceptable
+   * values are 1 to 100, inclusive. (The default value is 10.) If more results
+   * are available, the service returns a next_page_token that you can use to
+   * get the next page of results in subsequent list requests. The service may
+   * return fewer events than the requested page_size.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   * Provide Page token returned by a previous `ListEvents` call to retrieve the
+   * next page of results. When paginating, all other parameters provided to
+   * `ListEvents` must match the call that provided the page token.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   * Provide Page token returned by a previous `ListEvents` call to retrieve the
+   * next page of results. When paginating, all other parameters provided to
+   * `ListEvents` must match the call that provided the page token.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. A filter expression that filters resources listed in the
+   * response. The expression takes the following forms: <br>
+   * *   field=value for `category` and `state`<br>
+   * *   field &lt;, >, &lt;=, or >= value for `update_time` <br>
+   * Examples: `category=INCIDENT`, `update_time>=2000-01-01T11:30:00-04:00`
+   * <br>
+   *
+   * Multiple filter queries are separated by spaces. Example:
+   * `category=INCIDENT state=ACTIVE`.
+   *
+   * By default, each expression is an AND expression. However, you can include
+   * AND and OR expressions explicitly.
+   *
+   * Filter is supported for the following fields: `category`, `state`,
+   * `update_time`
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Optional. A filter expression that filters resources listed in the
+   * response. The expression takes the following forms: <br>
+   * *   field=value for `category` and `state`<br>
+   * *   field &lt;, >, &lt;=, or >= value for `update_time` <br>
+   * Examples: `category=INCIDENT`, `update_time>=2000-01-01T11:30:00-04:00`
+   * <br>
+   *
+   * Multiple filter queries are separated by spaces. Example:
+   * `category=INCIDENT state=ACTIVE`.
+   *
+   * By default, each expression is an AND expression. However, you can include
+   * AND and OR expressions explicitly.
+   *
+   * Filter is supported for the following fields: `category`, `state`,
+   * `update_time`
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Optional. Event fields to include in response.
+   * 
+ * + * + * .google.cloud.servicehealth.v1.EventView view = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for view. + */ + int getViewValue(); + /** + * + * + *
+   * Optional. Event fields to include in response.
+   * 
+ * + * + * .google.cloud.servicehealth.v1.EventView view = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The view. + */ + com.google.cloud.servicehealth.v1.EventView getView(); +} diff --git a/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/ListEventsResponse.java b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/ListEventsResponse.java new file mode 100644 index 000000000000..4796c10674c2 --- /dev/null +++ b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/ListEventsResponse.java @@ -0,0 +1,1451 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/servicehealth/v1/event_resources.proto + +package com.google.cloud.servicehealth.v1; + +/** Protobuf type {@code google.cloud.servicehealth.v1.ListEventsResponse} */ +public final class ListEventsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicehealth.v1.ListEventsResponse) + ListEventsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListEventsResponse.newBuilder() to construct. + private ListEventsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListEventsResponse() { + events_ = 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 ListEventsResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_ListEventsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_ListEventsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicehealth.v1.ListEventsResponse.class, + com.google.cloud.servicehealth.v1.ListEventsResponse.Builder.class); + } + + public static final int EVENTS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List events_; + /** + * + * + *
+   * Output only. List of events.
+   * 
+ * + * + * repeated .google.cloud.servicehealth.v1.Event events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List getEventsList() { + return events_; + } + /** + * + * + *
+   * Output only. List of events.
+   * 
+ * + * + * repeated .google.cloud.servicehealth.v1.Event events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getEventsOrBuilderList() { + return events_; + } + /** + * + * + *
+   * Output only. List of events.
+   * 
+ * + * + * repeated .google.cloud.servicehealth.v1.Event events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getEventsCount() { + return events_.size(); + } + /** + * + * + *
+   * Output only. List of events.
+   * 
+ * + * + * repeated .google.cloud.servicehealth.v1.Event events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.servicehealth.v1.Event getEvents(int index) { + return events_.get(index); + } + /** + * + * + *
+   * Output only. List of events.
+   * 
+ * + * + * repeated .google.cloud.servicehealth.v1.Event events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.servicehealth.v1.EventOrBuilder getEventsOrBuilder(int index) { + return events_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * Output only. The continuation token, used to page through large result
+   * sets. Provide this value in a subsequent request as page_token to retrieve
+   * the next page.
+   *
+   * If this field is not present, there are no subsequent results.
+   * 
+ * + * string next_page_token = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+   * Output only. The continuation token, used to page through large result
+   * sets. Provide this value in a subsequent request as page_token to retrieve
+   * the next page.
+   *
+   * If this field is not present, there are no subsequent results.
+   * 
+ * + * string next_page_token = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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 = 3; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList unreachable_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * Output only. Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_; + } + /** + * + * + *
+   * Output only. Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+   * Output only. Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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); + } + /** + * + * + *
+   * Output only. Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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 < events_.size(); i++) { + output.writeMessage(1, events_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + for (int i = 0; i < unreachable_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, 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 < events_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, events_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + { + int dataSize = 0; + for (int i = 0; i < unreachable_.size(); i++) { + dataSize += computeStringSizeNoTag(unreachable_.getRaw(i)); + } + size += dataSize; + size += 1 * 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.servicehealth.v1.ListEventsResponse)) { + return super.equals(obj); + } + com.google.cloud.servicehealth.v1.ListEventsResponse other = + (com.google.cloud.servicehealth.v1.ListEventsResponse) obj; + + if (!getEventsList().equals(other.getEventsList())) 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 (getEventsCount() > 0) { + hash = (37 * hash) + EVENTS_FIELD_NUMBER; + hash = (53 * hash) + getEventsList().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.servicehealth.v1.ListEventsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicehealth.v1.ListEventsResponse 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.servicehealth.v1.ListEventsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicehealth.v1.ListEventsResponse 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.servicehealth.v1.ListEventsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicehealth.v1.ListEventsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.servicehealth.v1.ListEventsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicehealth.v1.ListEventsResponse 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.servicehealth.v1.ListEventsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicehealth.v1.ListEventsResponse 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.servicehealth.v1.ListEventsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicehealth.v1.ListEventsResponse 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.servicehealth.v1.ListEventsResponse 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; + } + /** Protobuf type {@code google.cloud.servicehealth.v1.ListEventsResponse} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicehealth.v1.ListEventsResponse) + com.google.cloud.servicehealth.v1.ListEventsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_ListEventsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_ListEventsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicehealth.v1.ListEventsResponse.class, + com.google.cloud.servicehealth.v1.ListEventsResponse.Builder.class); + } + + // Construct using com.google.cloud.servicehealth.v1.ListEventsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (eventsBuilder_ == null) { + events_ = java.util.Collections.emptyList(); + } else { + events_ = null; + eventsBuilder_.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.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_ListEventsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicehealth.v1.ListEventsResponse getDefaultInstanceForType() { + return com.google.cloud.servicehealth.v1.ListEventsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicehealth.v1.ListEventsResponse build() { + com.google.cloud.servicehealth.v1.ListEventsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicehealth.v1.ListEventsResponse buildPartial() { + com.google.cloud.servicehealth.v1.ListEventsResponse result = + new com.google.cloud.servicehealth.v1.ListEventsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.servicehealth.v1.ListEventsResponse result) { + if (eventsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + events_ = java.util.Collections.unmodifiableList(events_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.events_ = events_; + } else { + result.events_ = eventsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.servicehealth.v1.ListEventsResponse 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.servicehealth.v1.ListEventsResponse) { + return mergeFrom((com.google.cloud.servicehealth.v1.ListEventsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.servicehealth.v1.ListEventsResponse other) { + if (other == com.google.cloud.servicehealth.v1.ListEventsResponse.getDefaultInstance()) + return this; + if (eventsBuilder_ == null) { + if (!other.events_.isEmpty()) { + if (events_.isEmpty()) { + events_ = other.events_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureEventsIsMutable(); + events_.addAll(other.events_); + } + onChanged(); + } + } else { + if (!other.events_.isEmpty()) { + if (eventsBuilder_.isEmpty()) { + eventsBuilder_.dispose(); + eventsBuilder_ = null; + events_ = other.events_; + bitField0_ = (bitField0_ & ~0x00000001); + eventsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getEventsFieldBuilder() + : null; + } else { + eventsBuilder_.addAllMessages(other.events_); + } + } + } + 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 10: + { + com.google.cloud.servicehealth.v1.Event m = + input.readMessage( + com.google.cloud.servicehealth.v1.Event.parser(), extensionRegistry); + if (eventsBuilder_ == null) { + ensureEventsIsMutable(); + events_.add(m); + } else { + eventsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureUnreachableIsMutable(); + unreachable_.add(s); + 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.util.List events_ = + java.util.Collections.emptyList(); + + private void ensureEventsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + events_ = new java.util.ArrayList(events_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.servicehealth.v1.Event, + com.google.cloud.servicehealth.v1.Event.Builder, + com.google.cloud.servicehealth.v1.EventOrBuilder> + eventsBuilder_; + + /** + * + * + *
+     * Output only. List of events.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.Event events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getEventsList() { + if (eventsBuilder_ == null) { + return java.util.Collections.unmodifiableList(events_); + } else { + return eventsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Output only. List of events.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.Event events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getEventsCount() { + if (eventsBuilder_ == null) { + return events_.size(); + } else { + return eventsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Output only. List of events.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.Event events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.servicehealth.v1.Event getEvents(int index) { + if (eventsBuilder_ == null) { + return events_.get(index); + } else { + return eventsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Output only. List of events.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.Event events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEvents(int index, com.google.cloud.servicehealth.v1.Event value) { + if (eventsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEventsIsMutable(); + events_.set(index, value); + onChanged(); + } else { + eventsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. List of events.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.Event events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEvents( + int index, com.google.cloud.servicehealth.v1.Event.Builder builderForValue) { + if (eventsBuilder_ == null) { + ensureEventsIsMutable(); + events_.set(index, builderForValue.build()); + onChanged(); + } else { + eventsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. List of events.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.Event events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addEvents(com.google.cloud.servicehealth.v1.Event value) { + if (eventsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEventsIsMutable(); + events_.add(value); + onChanged(); + } else { + eventsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Output only. List of events.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.Event events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addEvents(int index, com.google.cloud.servicehealth.v1.Event value) { + if (eventsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEventsIsMutable(); + events_.add(index, value); + onChanged(); + } else { + eventsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. List of events.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.Event events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addEvents(com.google.cloud.servicehealth.v1.Event.Builder builderForValue) { + if (eventsBuilder_ == null) { + ensureEventsIsMutable(); + events_.add(builderForValue.build()); + onChanged(); + } else { + eventsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. List of events.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.Event events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addEvents( + int index, com.google.cloud.servicehealth.v1.Event.Builder builderForValue) { + if (eventsBuilder_ == null) { + ensureEventsIsMutable(); + events_.add(index, builderForValue.build()); + onChanged(); + } else { + eventsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. List of events.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.Event events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllEvents( + java.lang.Iterable values) { + if (eventsBuilder_ == null) { + ensureEventsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, events_); + onChanged(); + } else { + eventsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Output only. List of events.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.Event events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearEvents() { + if (eventsBuilder_ == null) { + events_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + eventsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. List of events.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.Event events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeEvents(int index) { + if (eventsBuilder_ == null) { + ensureEventsIsMutable(); + events_.remove(index); + onChanged(); + } else { + eventsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Output only. List of events.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.Event events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.servicehealth.v1.Event.Builder getEventsBuilder(int index) { + return getEventsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Output only. List of events.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.Event events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.servicehealth.v1.EventOrBuilder getEventsOrBuilder(int index) { + if (eventsBuilder_ == null) { + return events_.get(index); + } else { + return eventsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Output only. List of events.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.Event events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getEventsOrBuilderList() { + if (eventsBuilder_ != null) { + return eventsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(events_); + } + } + /** + * + * + *
+     * Output only. List of events.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.Event events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.servicehealth.v1.Event.Builder addEventsBuilder() { + return getEventsFieldBuilder() + .addBuilder(com.google.cloud.servicehealth.v1.Event.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. List of events.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.Event events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.servicehealth.v1.Event.Builder addEventsBuilder(int index) { + return getEventsFieldBuilder() + .addBuilder(index, com.google.cloud.servicehealth.v1.Event.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. List of events.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.Event events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getEventsBuilderList() { + return getEventsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.servicehealth.v1.Event, + com.google.cloud.servicehealth.v1.Event.Builder, + com.google.cloud.servicehealth.v1.EventOrBuilder> + getEventsFieldBuilder() { + if (eventsBuilder_ == null) { + eventsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.servicehealth.v1.Event, + com.google.cloud.servicehealth.v1.Event.Builder, + com.google.cloud.servicehealth.v1.EventOrBuilder>( + events_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + events_ = null; + } + return eventsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * Output only. The continuation token, used to page through large result
+     * sets. Provide this value in a subsequent request as page_token to retrieve
+     * the next page.
+     *
+     * If this field is not present, there are no subsequent results.
+     * 
+ * + * string next_page_token = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. The continuation token, used to page through large result
+     * sets. Provide this value in a subsequent request as page_token to retrieve
+     * the next page.
+     *
+     * If this field is not present, there are no subsequent results.
+     * 
+ * + * string next_page_token = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. The continuation token, used to page through large result
+     * sets. Provide this value in a subsequent request as page_token to retrieve
+     * the next page.
+     *
+     * If this field is not present, there are no subsequent results.
+     * 
+ * + * string next_page_token = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + /** + * + * + *
+     * Output only. The continuation token, used to page through large result
+     * sets. Provide this value in a subsequent request as page_token to retrieve
+     * the next page.
+     *
+     * If this field is not present, there are no subsequent results.
+     * 
+ * + * string next_page_token = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The continuation token, used to page through large result
+     * sets. Provide this value in a subsequent request as page_token to retrieve
+     * the next page.
+     *
+     * If this field is not present, there are no subsequent results.
+     * 
+ * + * string next_page_token = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + /** + * + * + *
+     * Output only. Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + unreachable_.makeImmutable(); + return unreachable_; + } + /** + * + * + *
+     * Output only. Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+     * Output only. Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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); + } + /** + * + * + *
+     * Output only. Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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); + } + /** + * + * + *
+     * Output only. Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + /** + * + * + *
+     * Output only. Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + /** + * + * + *
+     * Output only. Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + /** + * + * + *
+     * Output only. Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearUnreachable() { + unreachable_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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.servicehealth.v1.ListEventsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicehealth.v1.ListEventsResponse) + private static final com.google.cloud.servicehealth.v1.ListEventsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicehealth.v1.ListEventsResponse(); + } + + public static com.google.cloud.servicehealth.v1.ListEventsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListEventsResponse 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.servicehealth.v1.ListEventsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/ListEventsResponseOrBuilder.java b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/ListEventsResponseOrBuilder.java new file mode 100644 index 000000000000..107cf6f1b7bf --- /dev/null +++ b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/ListEventsResponseOrBuilder.java @@ -0,0 +1,171 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/servicehealth/v1/event_resources.proto + +package com.google.cloud.servicehealth.v1; + +public interface ListEventsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicehealth.v1.ListEventsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. List of events.
+   * 
+ * + * + * repeated .google.cloud.servicehealth.v1.Event events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getEventsList(); + /** + * + * + *
+   * Output only. List of events.
+   * 
+ * + * + * repeated .google.cloud.servicehealth.v1.Event events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.servicehealth.v1.Event getEvents(int index); + /** + * + * + *
+   * Output only. List of events.
+   * 
+ * + * + * repeated .google.cloud.servicehealth.v1.Event events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getEventsCount(); + /** + * + * + *
+   * Output only. List of events.
+   * 
+ * + * + * repeated .google.cloud.servicehealth.v1.Event events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getEventsOrBuilderList(); + /** + * + * + *
+   * Output only. List of events.
+   * 
+ * + * + * repeated .google.cloud.servicehealth.v1.Event events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.servicehealth.v1.EventOrBuilder getEventsOrBuilder(int index); + + /** + * + * + *
+   * Output only. The continuation token, used to page through large result
+   * sets. Provide this value in a subsequent request as page_token to retrieve
+   * the next page.
+   *
+   * If this field is not present, there are no subsequent results.
+   * 
+ * + * string next_page_token = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Output only. The continuation token, used to page through large result
+   * sets. Provide this value in a subsequent request as page_token to retrieve
+   * the next page.
+   *
+   * If this field is not present, there are no subsequent results.
+   * 
+ * + * string next_page_token = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * Output only. Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return A list containing the unreachable. + */ + java.util.List getUnreachableList(); + /** + * + * + *
+   * Output only. Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The count of unreachable. + */ + int getUnreachableCount(); + /** + * + * + *
+   * Output only. Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + java.lang.String getUnreachable(int index); + /** + * + * + *
+   * Output only. Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/ListOrganizationEventsRequest.java b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/ListOrganizationEventsRequest.java new file mode 100644 index 000000000000..82676590e171 --- /dev/null +++ b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/ListOrganizationEventsRequest.java @@ -0,0 +1,1485 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/servicehealth/v1/event_resources.proto + +package com.google.cloud.servicehealth.v1; + +/** Protobuf type {@code google.cloud.servicehealth.v1.ListOrganizationEventsRequest} */ +public final class ListOrganizationEventsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicehealth.v1.ListOrganizationEventsRequest) + ListOrganizationEventsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListOrganizationEventsRequest.newBuilder() to construct. + private ListOrganizationEventsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListOrganizationEventsRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + view_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListOrganizationEventsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_ListOrganizationEventsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_ListOrganizationEventsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicehealth.v1.ListOrganizationEventsRequest.class, + com.google.cloud.servicehealth.v1.ListOrganizationEventsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. Parent value using the form
+   * `organizations/{organization_id}/locations/{location}/organizationEvents`.
+   *
+   * `organization_id` - ID (number) of the project that contains the event. To
+   * get your `organization_id`, see
+   * [Getting your organization resource
+   * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).<br>
+   * `location` - The location to get the service health events from. To
+   * retrieve service health events of category = INCIDENT, use `location` =
+   * `global`.
+   * 
+ * + * + * string parent = 1 [(.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. Parent value using the form
+   * `organizations/{organization_id}/locations/{location}/organizationEvents`.
+   *
+   * `organization_id` - ID (number) of the project that contains the event. To
+   * get your `organization_id`, see
+   * [Getting your organization resource
+   * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).<br>
+   * `location` - The location to get the service health events from. To
+   * retrieve service health events of category = INCIDENT, use `location` =
+   * `global`.
+   * 
+ * + * + * string parent = 1 [(.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 = 2; + private int pageSize_ = 0; + /** + * + * + *
+   * Optional. The maximum number of events that should be returned.  Acceptable
+   * values are `1` to `100`, inclusive. (The default value is `10`.) If more
+   * results are available, the service returns a `next_page_token` that you can
+   * use to get the next page of results in subsequent list requests. The
+   * service may return fewer events than the requested `page_size`.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   *
+   * Provide Page token returned by a previous `ListOrganizationEvents` call to
+   * retrieve the next page of results.
+   *
+   * When paginating, all other parameters provided to
+   * `ListOrganizationEvents` must match the call that provided the page token.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   *
+   * Provide Page token returned by a previous `ListOrganizationEvents` call to
+   * retrieve the next page of results.
+   *
+   * When paginating, all other parameters provided to
+   * `ListOrganizationEvents` must match the call that provided the page token.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + /** + * + * + *
+   * Optional. A filter expression that filters resources listed in the
+   * response. The expression takes the following forms:
+   *
+   * *   field=value for `category` and `state`
+   * *   field &lt;, >, &lt;=, or >= value for `update_time`
+   *
+   * Examples: `category=INCIDENT`, `update_time>=2000-01-01T11:30:00-04:00`
+   *
+   * Multiple filter queries are space-separated. Example:
+   * `category=INCIDENT state=ACTIVE`.
+   *
+   * By default, each expression is an AND expression. However, you can include
+   * AND and OR expressions explicitly.
+   *
+   * Filter is supported for the following fields: `category`, `state`,
+   * `update_time`
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. A filter expression that filters resources listed in the
+   * response. The expression takes the following forms:
+   *
+   * *   field=value for `category` and `state`
+   * *   field &lt;, >, &lt;=, or >= value for `update_time`
+   *
+   * Examples: `category=INCIDENT`, `update_time>=2000-01-01T11:30:00-04:00`
+   *
+   * Multiple filter queries are space-separated. Example:
+   * `category=INCIDENT state=ACTIVE`.
+   *
+   * By default, each expression is an AND expression. However, you can include
+   * AND and OR expressions explicitly.
+   *
+   * Filter is supported for the following fields: `category`, `state`,
+   * `update_time`
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 VIEW_FIELD_NUMBER = 6; + private int view_ = 0; + /** + * + * + *
+   * Optional. OrganizationEvent fields to include in response.
+   * 
+ * + * + * .google.cloud.servicehealth.v1.OrganizationEventView view = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for view. + */ + @java.lang.Override + public int getViewValue() { + return view_; + } + /** + * + * + *
+   * Optional. OrganizationEvent fields to include in response.
+   * 
+ * + * + * .google.cloud.servicehealth.v1.OrganizationEventView view = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The view. + */ + @java.lang.Override + public com.google.cloud.servicehealth.v1.OrganizationEventView getView() { + com.google.cloud.servicehealth.v1.OrganizationEventView result = + com.google.cloud.servicehealth.v1.OrganizationEventView.forNumber(view_); + return result == null + ? com.google.cloud.servicehealth.v1.OrganizationEventView.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(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, filter_); + } + if (view_ + != com.google.cloud.servicehealth.v1.OrganizationEventView + .ORGANIZATION_EVENT_VIEW_UNSPECIFIED + .getNumber()) { + output.writeEnum(6, view_); + } + 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(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, filter_); + } + if (view_ + != com.google.cloud.servicehealth.v1.OrganizationEventView + .ORGANIZATION_EVENT_VIEW_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(6, view_); + } + 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.servicehealth.v1.ListOrganizationEventsRequest)) { + return super.equals(obj); + } + com.google.cloud.servicehealth.v1.ListOrganizationEventsRequest other = + (com.google.cloud.servicehealth.v1.ListOrganizationEventsRequest) 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 (view_ != other.view_) 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) + VIEW_FIELD_NUMBER; + hash = (53 * hash) + view_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.servicehealth.v1.ListOrganizationEventsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicehealth.v1.ListOrganizationEventsRequest 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.servicehealth.v1.ListOrganizationEventsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicehealth.v1.ListOrganizationEventsRequest 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.servicehealth.v1.ListOrganizationEventsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicehealth.v1.ListOrganizationEventsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.servicehealth.v1.ListOrganizationEventsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicehealth.v1.ListOrganizationEventsRequest 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.servicehealth.v1.ListOrganizationEventsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicehealth.v1.ListOrganizationEventsRequest 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.servicehealth.v1.ListOrganizationEventsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicehealth.v1.ListOrganizationEventsRequest 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.servicehealth.v1.ListOrganizationEventsRequest 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; + } + /** Protobuf type {@code google.cloud.servicehealth.v1.ListOrganizationEventsRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicehealth.v1.ListOrganizationEventsRequest) + com.google.cloud.servicehealth.v1.ListOrganizationEventsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_ListOrganizationEventsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_ListOrganizationEventsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicehealth.v1.ListOrganizationEventsRequest.class, + com.google.cloud.servicehealth.v1.ListOrganizationEventsRequest.Builder.class); + } + + // Construct using com.google.cloud.servicehealth.v1.ListOrganizationEventsRequest.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_ = ""; + view_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_ListOrganizationEventsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicehealth.v1.ListOrganizationEventsRequest + getDefaultInstanceForType() { + return com.google.cloud.servicehealth.v1.ListOrganizationEventsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicehealth.v1.ListOrganizationEventsRequest build() { + com.google.cloud.servicehealth.v1.ListOrganizationEventsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicehealth.v1.ListOrganizationEventsRequest buildPartial() { + com.google.cloud.servicehealth.v1.ListOrganizationEventsRequest result = + new com.google.cloud.servicehealth.v1.ListOrganizationEventsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.servicehealth.v1.ListOrganizationEventsRequest 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.view_ = view_; + } + } + + @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.servicehealth.v1.ListOrganizationEventsRequest) { + return mergeFrom((com.google.cloud.servicehealth.v1.ListOrganizationEventsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.servicehealth.v1.ListOrganizationEventsRequest other) { + if (other + == com.google.cloud.servicehealth.v1.ListOrganizationEventsRequest.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.view_ != 0) { + setViewValue(other.getViewValue()); + } + 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: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 48: + { + view_ = input.readEnum(); + bitField0_ |= 0x00000010; + break; + } // case 48 + 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. Parent value using the form
+     * `organizations/{organization_id}/locations/{location}/organizationEvents`.
+     *
+     * `organization_id` - ID (number) of the project that contains the event. To
+     * get your `organization_id`, see
+     * [Getting your organization resource
+     * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).<br>
+     * `location` - The location to get the service health events from. To
+     * retrieve service health events of category = INCIDENT, use `location` =
+     * `global`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Parent value using the form
+     * `organizations/{organization_id}/locations/{location}/organizationEvents`.
+     *
+     * `organization_id` - ID (number) of the project that contains the event. To
+     * get your `organization_id`, see
+     * [Getting your organization resource
+     * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).<br>
+     * `location` - The location to get the service health events from. To
+     * retrieve service health events of category = INCIDENT, use `location` =
+     * `global`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Parent value using the form
+     * `organizations/{organization_id}/locations/{location}/organizationEvents`.
+     *
+     * `organization_id` - ID (number) of the project that contains the event. To
+     * get your `organization_id`, see
+     * [Getting your organization resource
+     * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).<br>
+     * `location` - The location to get the service health events from. To
+     * retrieve service health events of category = INCIDENT, use `location` =
+     * `global`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Parent value using the form
+     * `organizations/{organization_id}/locations/{location}/organizationEvents`.
+     *
+     * `organization_id` - ID (number) of the project that contains the event. To
+     * get your `organization_id`, see
+     * [Getting your organization resource
+     * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).<br>
+     * `location` - The location to get the service health events from. To
+     * retrieve service health events of category = INCIDENT, use `location` =
+     * `global`.
+     * 
+ * + * + * string parent = 1 [(.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. Parent value using the form
+     * `organizations/{organization_id}/locations/{location}/organizationEvents`.
+     *
+     * `organization_id` - ID (number) of the project that contains the event. To
+     * get your `organization_id`, see
+     * [Getting your organization resource
+     * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).<br>
+     * `location` - The location to get the service health events from. To
+     * retrieve service health events of category = INCIDENT, use `location` =
+     * `global`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Optional. The maximum number of events that should be returned.  Acceptable
+     * values are `1` to `100`, inclusive. (The default value is `10`.) If more
+     * results are available, the service returns a `next_page_token` that you can
+     * use to get the next page of results in subsequent list requests. The
+     * service may return fewer events than the requested `page_size`.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Optional. The maximum number of events that should be returned.  Acceptable
+     * values are `1` to `100`, inclusive. (The default value is `10`.) If more
+     * results are available, the service returns a `next_page_token` that you can
+     * use to get the next page of results in subsequent list requests. The
+     * service may return fewer events than the requested `page_size`.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The maximum number of events that should be returned.  Acceptable
+     * values are `1` to `100`, inclusive. (The default value is `10`.) If more
+     * results are available, the service returns a `next_page_token` that you can
+     * use to get the next page of results in subsequent list requests. The
+     * service may return fewer events than the requested `page_size`.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     *
+     * Provide Page token returned by a previous `ListOrganizationEvents` call to
+     * retrieve the next page of results.
+     *
+     * When paginating, all other parameters provided to
+     * `ListOrganizationEvents` must match the call that provided the page token.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     *
+     * Provide Page token returned by a previous `ListOrganizationEvents` call to
+     * retrieve the next page of results.
+     *
+     * When paginating, all other parameters provided to
+     * `ListOrganizationEvents` must match the call that provided the page token.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     *
+     * Provide Page token returned by a previous `ListOrganizationEvents` call to
+     * retrieve the next page of results.
+     *
+     * When paginating, all other parameters provided to
+     * `ListOrganizationEvents` must match the call that provided the page token.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     *
+     * Provide Page token returned by a previous `ListOrganizationEvents` call to
+     * retrieve the next page of results.
+     *
+     * When paginating, all other parameters provided to
+     * `ListOrganizationEvents` must match the call that provided the page token.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     *
+     * Provide Page token returned by a previous `ListOrganizationEvents` call to
+     * retrieve the next page of results.
+     *
+     * When paginating, all other parameters provided to
+     * `ListOrganizationEvents` must match the call that provided the page token.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Optional. A filter expression that filters resources listed in the
+     * response. The expression takes the following forms:
+     *
+     * *   field=value for `category` and `state`
+     * *   field &lt;, >, &lt;=, or >= value for `update_time`
+     *
+     * Examples: `category=INCIDENT`, `update_time>=2000-01-01T11:30:00-04:00`
+     *
+     * Multiple filter queries are space-separated. Example:
+     * `category=INCIDENT state=ACTIVE`.
+     *
+     * By default, each expression is an AND expression. However, you can include
+     * AND and OR expressions explicitly.
+     *
+     * Filter is supported for the following fields: `category`, `state`,
+     * `update_time`
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. A filter expression that filters resources listed in the
+     * response. The expression takes the following forms:
+     *
+     * *   field=value for `category` and `state`
+     * *   field &lt;, >, &lt;=, or >= value for `update_time`
+     *
+     * Examples: `category=INCIDENT`, `update_time>=2000-01-01T11:30:00-04:00`
+     *
+     * Multiple filter queries are space-separated. Example:
+     * `category=INCIDENT state=ACTIVE`.
+     *
+     * By default, each expression is an AND expression. However, you can include
+     * AND and OR expressions explicitly.
+     *
+     * Filter is supported for the following fields: `category`, `state`,
+     * `update_time`
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. A filter expression that filters resources listed in the
+     * response. The expression takes the following forms:
+     *
+     * *   field=value for `category` and `state`
+     * *   field &lt;, >, &lt;=, or >= value for `update_time`
+     *
+     * Examples: `category=INCIDENT`, `update_time>=2000-01-01T11:30:00-04:00`
+     *
+     * Multiple filter queries are space-separated. Example:
+     * `category=INCIDENT state=ACTIVE`.
+     *
+     * By default, each expression is an AND expression. However, you can include
+     * AND and OR expressions explicitly.
+     *
+     * Filter is supported for the following fields: `category`, `state`,
+     * `update_time`
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + /** + * + * + *
+     * Optional. A filter expression that filters resources listed in the
+     * response. The expression takes the following forms:
+     *
+     * *   field=value for `category` and `state`
+     * *   field &lt;, >, &lt;=, or >= value for `update_time`
+     *
+     * Examples: `category=INCIDENT`, `update_time>=2000-01-01T11:30:00-04:00`
+     *
+     * Multiple filter queries are space-separated. Example:
+     * `category=INCIDENT state=ACTIVE`.
+     *
+     * By default, each expression is an AND expression. However, you can include
+     * AND and OR expressions explicitly.
+     *
+     * Filter is supported for the following fields: `category`, `state`,
+     * `update_time`
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A filter expression that filters resources listed in the
+     * response. The expression takes the following forms:
+     *
+     * *   field=value for `category` and `state`
+     * *   field &lt;, >, &lt;=, or >= value for `update_time`
+     *
+     * Examples: `category=INCIDENT`, `update_time>=2000-01-01T11:30:00-04:00`
+     *
+     * Multiple filter queries are space-separated. Example:
+     * `category=INCIDENT state=ACTIVE`.
+     *
+     * By default, each expression is an AND expression. However, you can include
+     * AND and OR expressions explicitly.
+     *
+     * Filter is supported for the following fields: `category`, `state`,
+     * `update_time`
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 int view_ = 0; + /** + * + * + *
+     * Optional. OrganizationEvent fields to include in response.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.OrganizationEventView view = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for view. + */ + @java.lang.Override + public int getViewValue() { + return view_; + } + /** + * + * + *
+     * Optional. OrganizationEvent fields to include in response.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.OrganizationEventView view = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for view to set. + * @return This builder for chaining. + */ + public Builder setViewValue(int value) { + view_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. OrganizationEvent fields to include in response.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.OrganizationEventView view = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The view. + */ + @java.lang.Override + public com.google.cloud.servicehealth.v1.OrganizationEventView getView() { + com.google.cloud.servicehealth.v1.OrganizationEventView result = + com.google.cloud.servicehealth.v1.OrganizationEventView.forNumber(view_); + return result == null + ? com.google.cloud.servicehealth.v1.OrganizationEventView.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Optional. OrganizationEvent fields to include in response.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.OrganizationEventView view = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The view to set. + * @return This builder for chaining. + */ + public Builder setView(com.google.cloud.servicehealth.v1.OrganizationEventView value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + view_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. OrganizationEvent fields to include in response.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.OrganizationEventView view = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearView() { + bitField0_ = (bitField0_ & ~0x00000010); + view_ = 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.servicehealth.v1.ListOrganizationEventsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicehealth.v1.ListOrganizationEventsRequest) + private static final com.google.cloud.servicehealth.v1.ListOrganizationEventsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicehealth.v1.ListOrganizationEventsRequest(); + } + + public static com.google.cloud.servicehealth.v1.ListOrganizationEventsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListOrganizationEventsRequest 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.servicehealth.v1.ListOrganizationEventsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/ListOrganizationEventsRequestOrBuilder.java b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/ListOrganizationEventsRequestOrBuilder.java new file mode 100644 index 000000000000..d24711ac321d --- /dev/null +++ b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/ListOrganizationEventsRequestOrBuilder.java @@ -0,0 +1,210 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/servicehealth/v1/event_resources.proto + +package com.google.cloud.servicehealth.v1; + +public interface ListOrganizationEventsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicehealth.v1.ListOrganizationEventsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Parent value using the form
+   * `organizations/{organization_id}/locations/{location}/organizationEvents`.
+   *
+   * `organization_id` - ID (number) of the project that contains the event. To
+   * get your `organization_id`, see
+   * [Getting your organization resource
+   * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).<br>
+   * `location` - The location to get the service health events from. To
+   * retrieve service health events of category = INCIDENT, use `location` =
+   * `global`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Parent value using the form
+   * `organizations/{organization_id}/locations/{location}/organizationEvents`.
+   *
+   * `organization_id` - ID (number) of the project that contains the event. To
+   * get your `organization_id`, see
+   * [Getting your organization resource
+   * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).<br>
+   * `location` - The location to get the service health events from. To
+   * retrieve service health events of category = INCIDENT, use `location` =
+   * `global`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. The maximum number of events that should be returned.  Acceptable
+   * values are `1` to `100`, inclusive. (The default value is `10`.) If more
+   * results are available, the service returns a `next_page_token` that you can
+   * use to get the next page of results in subsequent list requests. The
+   * service may return fewer events than the requested `page_size`.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   *
+   * Provide Page token returned by a previous `ListOrganizationEvents` call to
+   * retrieve the next page of results.
+   *
+   * When paginating, all other parameters provided to
+   * `ListOrganizationEvents` must match the call that provided the page token.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   *
+   * Provide Page token returned by a previous `ListOrganizationEvents` call to
+   * retrieve the next page of results.
+   *
+   * When paginating, all other parameters provided to
+   * `ListOrganizationEvents` must match the call that provided the page token.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. A filter expression that filters resources listed in the
+   * response. The expression takes the following forms:
+   *
+   * *   field=value for `category` and `state`
+   * *   field &lt;, >, &lt;=, or >= value for `update_time`
+   *
+   * Examples: `category=INCIDENT`, `update_time>=2000-01-01T11:30:00-04:00`
+   *
+   * Multiple filter queries are space-separated. Example:
+   * `category=INCIDENT state=ACTIVE`.
+   *
+   * By default, each expression is an AND expression. However, you can include
+   * AND and OR expressions explicitly.
+   *
+   * Filter is supported for the following fields: `category`, `state`,
+   * `update_time`
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Optional. A filter expression that filters resources listed in the
+   * response. The expression takes the following forms:
+   *
+   * *   field=value for `category` and `state`
+   * *   field &lt;, >, &lt;=, or >= value for `update_time`
+   *
+   * Examples: `category=INCIDENT`, `update_time>=2000-01-01T11:30:00-04:00`
+   *
+   * Multiple filter queries are space-separated. Example:
+   * `category=INCIDENT state=ACTIVE`.
+   *
+   * By default, each expression is an AND expression. However, you can include
+   * AND and OR expressions explicitly.
+   *
+   * Filter is supported for the following fields: `category`, `state`,
+   * `update_time`
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Optional. OrganizationEvent fields to include in response.
+   * 
+ * + * + * .google.cloud.servicehealth.v1.OrganizationEventView view = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for view. + */ + int getViewValue(); + /** + * + * + *
+   * Optional. OrganizationEvent fields to include in response.
+   * 
+ * + * + * .google.cloud.servicehealth.v1.OrganizationEventView view = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The view. + */ + com.google.cloud.servicehealth.v1.OrganizationEventView getView(); +} diff --git a/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/ListOrganizationEventsResponse.java b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/ListOrganizationEventsResponse.java new file mode 100644 index 000000000000..67f4ee4a330a --- /dev/null +++ b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/ListOrganizationEventsResponse.java @@ -0,0 +1,1480 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/servicehealth/v1/event_resources.proto + +package com.google.cloud.servicehealth.v1; + +/** Protobuf type {@code google.cloud.servicehealth.v1.ListOrganizationEventsResponse} */ +public final class ListOrganizationEventsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicehealth.v1.ListOrganizationEventsResponse) + ListOrganizationEventsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListOrganizationEventsResponse.newBuilder() to construct. + private ListOrganizationEventsResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListOrganizationEventsResponse() { + organizationEvents_ = 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 ListOrganizationEventsResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_ListOrganizationEventsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_ListOrganizationEventsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicehealth.v1.ListOrganizationEventsResponse.class, + com.google.cloud.servicehealth.v1.ListOrganizationEventsResponse.Builder.class); + } + + public static final int ORGANIZATION_EVENTS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List organizationEvents_; + /** + * + * + *
+   * Output only. List of organization events affecting an organization.
+   * 
+ * + * + * repeated .google.cloud.servicehealth.v1.OrganizationEvent organization_events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getOrganizationEventsList() { + return organizationEvents_; + } + /** + * + * + *
+   * Output only. List of organization events affecting an organization.
+   * 
+ * + * + * repeated .google.cloud.servicehealth.v1.OrganizationEvent organization_events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getOrganizationEventsOrBuilderList() { + return organizationEvents_; + } + /** + * + * + *
+   * Output only. List of organization events affecting an organization.
+   * 
+ * + * + * repeated .google.cloud.servicehealth.v1.OrganizationEvent organization_events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getOrganizationEventsCount() { + return organizationEvents_.size(); + } + /** + * + * + *
+   * Output only. List of organization events affecting an organization.
+   * 
+ * + * + * repeated .google.cloud.servicehealth.v1.OrganizationEvent organization_events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.servicehealth.v1.OrganizationEvent getOrganizationEvents(int index) { + return organizationEvents_.get(index); + } + /** + * + * + *
+   * Output only. List of organization events affecting an organization.
+   * 
+ * + * + * repeated .google.cloud.servicehealth.v1.OrganizationEvent organization_events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.servicehealth.v1.OrganizationEventOrBuilder + getOrganizationEventsOrBuilder(int index) { + return organizationEvents_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * Output only. The continuation token, used to page through large result
+   * sets. Provide this value in a subsequent request as `page_token` to
+   * retrieve the next page.
+   *
+   * If this field is not present, there are no subsequent results.
+   * 
+ * + * string next_page_token = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+   * Output only. The continuation token, used to page through large result
+   * sets. Provide this value in a subsequent request as `page_token` to
+   * retrieve the next page.
+   *
+   * If this field is not present, there are no subsequent results.
+   * 
+ * + * string next_page_token = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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 = 3; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList unreachable_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * Output only. Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_; + } + /** + * + * + *
+   * Output only. Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+   * Output only. Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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); + } + /** + * + * + *
+   * Output only. Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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 < organizationEvents_.size(); i++) { + output.writeMessage(1, organizationEvents_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + for (int i = 0; i < unreachable_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, 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 < organizationEvents_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(1, organizationEvents_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + { + int dataSize = 0; + for (int i = 0; i < unreachable_.size(); i++) { + dataSize += computeStringSizeNoTag(unreachable_.getRaw(i)); + } + size += dataSize; + size += 1 * 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.servicehealth.v1.ListOrganizationEventsResponse)) { + return super.equals(obj); + } + com.google.cloud.servicehealth.v1.ListOrganizationEventsResponse other = + (com.google.cloud.servicehealth.v1.ListOrganizationEventsResponse) obj; + + if (!getOrganizationEventsList().equals(other.getOrganizationEventsList())) 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 (getOrganizationEventsCount() > 0) { + hash = (37 * hash) + ORGANIZATION_EVENTS_FIELD_NUMBER; + hash = (53 * hash) + getOrganizationEventsList().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.servicehealth.v1.ListOrganizationEventsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicehealth.v1.ListOrganizationEventsResponse 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.servicehealth.v1.ListOrganizationEventsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicehealth.v1.ListOrganizationEventsResponse 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.servicehealth.v1.ListOrganizationEventsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicehealth.v1.ListOrganizationEventsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.servicehealth.v1.ListOrganizationEventsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicehealth.v1.ListOrganizationEventsResponse 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.servicehealth.v1.ListOrganizationEventsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicehealth.v1.ListOrganizationEventsResponse 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.servicehealth.v1.ListOrganizationEventsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicehealth.v1.ListOrganizationEventsResponse 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.servicehealth.v1.ListOrganizationEventsResponse 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; + } + /** Protobuf type {@code google.cloud.servicehealth.v1.ListOrganizationEventsResponse} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicehealth.v1.ListOrganizationEventsResponse) + com.google.cloud.servicehealth.v1.ListOrganizationEventsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_ListOrganizationEventsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_ListOrganizationEventsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicehealth.v1.ListOrganizationEventsResponse.class, + com.google.cloud.servicehealth.v1.ListOrganizationEventsResponse.Builder.class); + } + + // Construct using com.google.cloud.servicehealth.v1.ListOrganizationEventsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (organizationEventsBuilder_ == null) { + organizationEvents_ = java.util.Collections.emptyList(); + } else { + organizationEvents_ = null; + organizationEventsBuilder_.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.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_ListOrganizationEventsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicehealth.v1.ListOrganizationEventsResponse + getDefaultInstanceForType() { + return com.google.cloud.servicehealth.v1.ListOrganizationEventsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicehealth.v1.ListOrganizationEventsResponse build() { + com.google.cloud.servicehealth.v1.ListOrganizationEventsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicehealth.v1.ListOrganizationEventsResponse buildPartial() { + com.google.cloud.servicehealth.v1.ListOrganizationEventsResponse result = + new com.google.cloud.servicehealth.v1.ListOrganizationEventsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.servicehealth.v1.ListOrganizationEventsResponse result) { + if (organizationEventsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + organizationEvents_ = java.util.Collections.unmodifiableList(organizationEvents_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.organizationEvents_ = organizationEvents_; + } else { + result.organizationEvents_ = organizationEventsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.servicehealth.v1.ListOrganizationEventsResponse 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.servicehealth.v1.ListOrganizationEventsResponse) { + return mergeFrom((com.google.cloud.servicehealth.v1.ListOrganizationEventsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.servicehealth.v1.ListOrganizationEventsResponse other) { + if (other + == com.google.cloud.servicehealth.v1.ListOrganizationEventsResponse.getDefaultInstance()) + return this; + if (organizationEventsBuilder_ == null) { + if (!other.organizationEvents_.isEmpty()) { + if (organizationEvents_.isEmpty()) { + organizationEvents_ = other.organizationEvents_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureOrganizationEventsIsMutable(); + organizationEvents_.addAll(other.organizationEvents_); + } + onChanged(); + } + } else { + if (!other.organizationEvents_.isEmpty()) { + if (organizationEventsBuilder_.isEmpty()) { + organizationEventsBuilder_.dispose(); + organizationEventsBuilder_ = null; + organizationEvents_ = other.organizationEvents_; + bitField0_ = (bitField0_ & ~0x00000001); + organizationEventsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getOrganizationEventsFieldBuilder() + : null; + } else { + organizationEventsBuilder_.addAllMessages(other.organizationEvents_); + } + } + } + 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 10: + { + com.google.cloud.servicehealth.v1.OrganizationEvent m = + input.readMessage( + com.google.cloud.servicehealth.v1.OrganizationEvent.parser(), + extensionRegistry); + if (organizationEventsBuilder_ == null) { + ensureOrganizationEventsIsMutable(); + organizationEvents_.add(m); + } else { + organizationEventsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureUnreachableIsMutable(); + unreachable_.add(s); + 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.util.List + organizationEvents_ = java.util.Collections.emptyList(); + + private void ensureOrganizationEventsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + organizationEvents_ = + new java.util.ArrayList( + organizationEvents_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.servicehealth.v1.OrganizationEvent, + com.google.cloud.servicehealth.v1.OrganizationEvent.Builder, + com.google.cloud.servicehealth.v1.OrganizationEventOrBuilder> + organizationEventsBuilder_; + + /** + * + * + *
+     * Output only. List of organization events affecting an organization.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.OrganizationEvent organization_events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getOrganizationEventsList() { + if (organizationEventsBuilder_ == null) { + return java.util.Collections.unmodifiableList(organizationEvents_); + } else { + return organizationEventsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Output only. List of organization events affecting an organization.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.OrganizationEvent organization_events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getOrganizationEventsCount() { + if (organizationEventsBuilder_ == null) { + return organizationEvents_.size(); + } else { + return organizationEventsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Output only. List of organization events affecting an organization.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.OrganizationEvent organization_events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.servicehealth.v1.OrganizationEvent getOrganizationEvents(int index) { + if (organizationEventsBuilder_ == null) { + return organizationEvents_.get(index); + } else { + return organizationEventsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Output only. List of organization events affecting an organization.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.OrganizationEvent organization_events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setOrganizationEvents( + int index, com.google.cloud.servicehealth.v1.OrganizationEvent value) { + if (organizationEventsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOrganizationEventsIsMutable(); + organizationEvents_.set(index, value); + onChanged(); + } else { + organizationEventsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. List of organization events affecting an organization.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.OrganizationEvent organization_events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setOrganizationEvents( + int index, com.google.cloud.servicehealth.v1.OrganizationEvent.Builder builderForValue) { + if (organizationEventsBuilder_ == null) { + ensureOrganizationEventsIsMutable(); + organizationEvents_.set(index, builderForValue.build()); + onChanged(); + } else { + organizationEventsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. List of organization events affecting an organization.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.OrganizationEvent organization_events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addOrganizationEvents( + com.google.cloud.servicehealth.v1.OrganizationEvent value) { + if (organizationEventsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOrganizationEventsIsMutable(); + organizationEvents_.add(value); + onChanged(); + } else { + organizationEventsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Output only. List of organization events affecting an organization.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.OrganizationEvent organization_events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addOrganizationEvents( + int index, com.google.cloud.servicehealth.v1.OrganizationEvent value) { + if (organizationEventsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOrganizationEventsIsMutable(); + organizationEvents_.add(index, value); + onChanged(); + } else { + organizationEventsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. List of organization events affecting an organization.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.OrganizationEvent organization_events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addOrganizationEvents( + com.google.cloud.servicehealth.v1.OrganizationEvent.Builder builderForValue) { + if (organizationEventsBuilder_ == null) { + ensureOrganizationEventsIsMutable(); + organizationEvents_.add(builderForValue.build()); + onChanged(); + } else { + organizationEventsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. List of organization events affecting an organization.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.OrganizationEvent organization_events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addOrganizationEvents( + int index, com.google.cloud.servicehealth.v1.OrganizationEvent.Builder builderForValue) { + if (organizationEventsBuilder_ == null) { + ensureOrganizationEventsIsMutable(); + organizationEvents_.add(index, builderForValue.build()); + onChanged(); + } else { + organizationEventsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. List of organization events affecting an organization.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.OrganizationEvent organization_events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllOrganizationEvents( + java.lang.Iterable values) { + if (organizationEventsBuilder_ == null) { + ensureOrganizationEventsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, organizationEvents_); + onChanged(); + } else { + organizationEventsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Output only. List of organization events affecting an organization.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.OrganizationEvent organization_events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearOrganizationEvents() { + if (organizationEventsBuilder_ == null) { + organizationEvents_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + organizationEventsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. List of organization events affecting an organization.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.OrganizationEvent organization_events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeOrganizationEvents(int index) { + if (organizationEventsBuilder_ == null) { + ensureOrganizationEventsIsMutable(); + organizationEvents_.remove(index); + onChanged(); + } else { + organizationEventsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Output only. List of organization events affecting an organization.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.OrganizationEvent organization_events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.servicehealth.v1.OrganizationEvent.Builder getOrganizationEventsBuilder( + int index) { + return getOrganizationEventsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Output only. List of organization events affecting an organization.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.OrganizationEvent organization_events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.servicehealth.v1.OrganizationEventOrBuilder + getOrganizationEventsOrBuilder(int index) { + if (organizationEventsBuilder_ == null) { + return organizationEvents_.get(index); + } else { + return organizationEventsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Output only. List of organization events affecting an organization.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.OrganizationEvent organization_events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getOrganizationEventsOrBuilderList() { + if (organizationEventsBuilder_ != null) { + return organizationEventsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(organizationEvents_); + } + } + /** + * + * + *
+     * Output only. List of organization events affecting an organization.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.OrganizationEvent organization_events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.servicehealth.v1.OrganizationEvent.Builder + addOrganizationEventsBuilder() { + return getOrganizationEventsFieldBuilder() + .addBuilder(com.google.cloud.servicehealth.v1.OrganizationEvent.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. List of organization events affecting an organization.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.OrganizationEvent organization_events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.servicehealth.v1.OrganizationEvent.Builder addOrganizationEventsBuilder( + int index) { + return getOrganizationEventsFieldBuilder() + .addBuilder( + index, com.google.cloud.servicehealth.v1.OrganizationEvent.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. List of organization events affecting an organization.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.OrganizationEvent organization_events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getOrganizationEventsBuilderList() { + return getOrganizationEventsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.servicehealth.v1.OrganizationEvent, + com.google.cloud.servicehealth.v1.OrganizationEvent.Builder, + com.google.cloud.servicehealth.v1.OrganizationEventOrBuilder> + getOrganizationEventsFieldBuilder() { + if (organizationEventsBuilder_ == null) { + organizationEventsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.servicehealth.v1.OrganizationEvent, + com.google.cloud.servicehealth.v1.OrganizationEvent.Builder, + com.google.cloud.servicehealth.v1.OrganizationEventOrBuilder>( + organizationEvents_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + organizationEvents_ = null; + } + return organizationEventsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * Output only. The continuation token, used to page through large result
+     * sets. Provide this value in a subsequent request as `page_token` to
+     * retrieve the next page.
+     *
+     * If this field is not present, there are no subsequent results.
+     * 
+ * + * string next_page_token = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. The continuation token, used to page through large result
+     * sets. Provide this value in a subsequent request as `page_token` to
+     * retrieve the next page.
+     *
+     * If this field is not present, there are no subsequent results.
+     * 
+ * + * string next_page_token = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. The continuation token, used to page through large result
+     * sets. Provide this value in a subsequent request as `page_token` to
+     * retrieve the next page.
+     *
+     * If this field is not present, there are no subsequent results.
+     * 
+ * + * string next_page_token = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + /** + * + * + *
+     * Output only. The continuation token, used to page through large result
+     * sets. Provide this value in a subsequent request as `page_token` to
+     * retrieve the next page.
+     *
+     * If this field is not present, there are no subsequent results.
+     * 
+ * + * string next_page_token = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The continuation token, used to page through large result
+     * sets. Provide this value in a subsequent request as `page_token` to
+     * retrieve the next page.
+     *
+     * If this field is not present, there are no subsequent results.
+     * 
+ * + * string next_page_token = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + /** + * + * + *
+     * Output only. Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + unreachable_.makeImmutable(); + return unreachable_; + } + /** + * + * + *
+     * Output only. Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+     * Output only. Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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); + } + /** + * + * + *
+     * Output only. Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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); + } + /** + * + * + *
+     * Output only. Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + /** + * + * + *
+     * Output only. Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + /** + * + * + *
+     * Output only. Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + /** + * + * + *
+     * Output only. Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearUnreachable() { + unreachable_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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.servicehealth.v1.ListOrganizationEventsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicehealth.v1.ListOrganizationEventsResponse) + private static final com.google.cloud.servicehealth.v1.ListOrganizationEventsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicehealth.v1.ListOrganizationEventsResponse(); + } + + public static com.google.cloud.servicehealth.v1.ListOrganizationEventsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListOrganizationEventsResponse 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.servicehealth.v1.ListOrganizationEventsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/ListOrganizationEventsResponseOrBuilder.java b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/ListOrganizationEventsResponseOrBuilder.java new file mode 100644 index 000000000000..aa8affd9dcd3 --- /dev/null +++ b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/ListOrganizationEventsResponseOrBuilder.java @@ -0,0 +1,172 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/servicehealth/v1/event_resources.proto + +package com.google.cloud.servicehealth.v1; + +public interface ListOrganizationEventsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicehealth.v1.ListOrganizationEventsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. List of organization events affecting an organization.
+   * 
+ * + * + * repeated .google.cloud.servicehealth.v1.OrganizationEvent organization_events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getOrganizationEventsList(); + /** + * + * + *
+   * Output only. List of organization events affecting an organization.
+   * 
+ * + * + * repeated .google.cloud.servicehealth.v1.OrganizationEvent organization_events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.servicehealth.v1.OrganizationEvent getOrganizationEvents(int index); + /** + * + * + *
+   * Output only. List of organization events affecting an organization.
+   * 
+ * + * + * repeated .google.cloud.servicehealth.v1.OrganizationEvent organization_events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getOrganizationEventsCount(); + /** + * + * + *
+   * Output only. List of organization events affecting an organization.
+   * 
+ * + * + * repeated .google.cloud.servicehealth.v1.OrganizationEvent organization_events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getOrganizationEventsOrBuilderList(); + /** + * + * + *
+   * Output only. List of organization events affecting an organization.
+   * 
+ * + * + * repeated .google.cloud.servicehealth.v1.OrganizationEvent organization_events = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.servicehealth.v1.OrganizationEventOrBuilder getOrganizationEventsOrBuilder( + int index); + + /** + * + * + *
+   * Output only. The continuation token, used to page through large result
+   * sets. Provide this value in a subsequent request as `page_token` to
+   * retrieve the next page.
+   *
+   * If this field is not present, there are no subsequent results.
+   * 
+ * + * string next_page_token = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Output only. The continuation token, used to page through large result
+   * sets. Provide this value in a subsequent request as `page_token` to
+   * retrieve the next page.
+   *
+   * If this field is not present, there are no subsequent results.
+   * 
+ * + * string next_page_token = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * Output only. Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return A list containing the unreachable. + */ + java.util.List getUnreachableList(); + /** + * + * + *
+   * Output only. Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The count of unreachable. + */ + int getUnreachableCount(); + /** + * + * + *
+   * Output only. Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + java.lang.String getUnreachable(int index); + /** + * + * + *
+   * Output only. Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/ListOrganizationImpactsRequest.java b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/ListOrganizationImpactsRequest.java new file mode 100644 index 000000000000..87b568bae6cf --- /dev/null +++ b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/ListOrganizationImpactsRequest.java @@ -0,0 +1,1321 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/servicehealth/v1/event_resources.proto + +package com.google.cloud.servicehealth.v1; + +/** + * + * + *
+ * Message for requesting list of OrganizationImpacts
+ * 
+ * + * Protobuf type {@code google.cloud.servicehealth.v1.ListOrganizationImpactsRequest} + */ +public final class ListOrganizationImpactsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicehealth.v1.ListOrganizationImpactsRequest) + ListOrganizationImpactsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListOrganizationImpactsRequest.newBuilder() to construct. + private ListOrganizationImpactsRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListOrganizationImpactsRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListOrganizationImpactsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_ListOrganizationImpactsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_ListOrganizationImpactsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicehealth.v1.ListOrganizationImpactsRequest.class, + com.google.cloud.servicehealth.v1.ListOrganizationImpactsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. Parent value using the form
+   * `organizations/{organization_id}/locations/{location}/organizationImpacts`.
+   *
+   * `organization_id` - ID (number) of the project that contains the event. To
+   * get your `organization_id`, see
+   * [Getting your organization resource
+   * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).
+   * 
+ * + * + * string parent = 1 [(.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. Parent value using the form
+   * `organizations/{organization_id}/locations/{location}/organizationImpacts`.
+   *
+   * `organization_id` - ID (number) of the project that contains the event. To
+   * get your `organization_id`, see
+   * [Getting your organization resource
+   * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).
+   * 
+ * + * + * string parent = 1 [(.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 = 2; + private int pageSize_ = 0; + /** + * + * + *
+   * Optional. The maximum number of events that should be returned. Acceptable
+   * values are `1` to `100`, inclusive. The default value is `10`.
+   *
+   *  If more results are available, the service returns a
+   * `next_page_token` that can be used to get the next page of results in
+   * subsequent list requests. The service may return fewer
+   * [impacts](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact)
+   * than the requested `page_size`.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   *
+   * Provide `page_token` returned by a previous `ListOrganizationImpacts` call
+   * to retrieve the next page of results.
+   *
+   * When paginating, all other parameters provided to `ListOrganizationImpacts`
+   * must match the call that provided the page token.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   *
+   * Provide `page_token` returned by a previous `ListOrganizationImpacts` call
+   * to retrieve the next page of results.
+   *
+   * When paginating, all other parameters provided to `ListOrganizationImpacts`
+   * must match the call that provided the page token.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + /** + * + * + *
+   * Optional. A filter expression that filters resources listed in the
+   * response. The expression is in the form of `field:value` for checking if a
+   * repeated field contains a value.
+   *
+   * Example:
+   * `events:organizations%2F{organization_id}%2Flocations%2Fglobal%2ForganizationEvents%2Fevent-id`
+   *
+   * To get your `{organization_id}`, see
+   * [Getting your organization resource
+   * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).
+   *
+   * Multiple filter queries are separated by spaces.
+   *
+   * By default, each expression is an AND expression. However, you can include
+   * AND and OR expressions explicitly.
+   * Filter is supported for the following fields: `events`.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. A filter expression that filters resources listed in the
+   * response. The expression is in the form of `field:value` for checking if a
+   * repeated field contains a value.
+   *
+   * Example:
+   * `events:organizations%2F{organization_id}%2Flocations%2Fglobal%2ForganizationEvents%2Fevent-id`
+   *
+   * To get your `{organization_id}`, see
+   * [Getting your organization resource
+   * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).
+   *
+   * Multiple filter queries are separated by spaces.
+   *
+   * By default, each expression is an AND expression. However, you can include
+   * AND and OR expressions explicitly.
+   * Filter is supported for the following fields: `events`.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + + 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, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, filter_); + } + 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(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, filter_); + } + 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.servicehealth.v1.ListOrganizationImpactsRequest)) { + return super.equals(obj); + } + com.google.cloud.servicehealth.v1.ListOrganizationImpactsRequest other = + (com.google.cloud.servicehealth.v1.ListOrganizationImpactsRequest) 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 (!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 = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.servicehealth.v1.ListOrganizationImpactsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicehealth.v1.ListOrganizationImpactsRequest 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.servicehealth.v1.ListOrganizationImpactsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicehealth.v1.ListOrganizationImpactsRequest 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.servicehealth.v1.ListOrganizationImpactsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicehealth.v1.ListOrganizationImpactsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.servicehealth.v1.ListOrganizationImpactsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicehealth.v1.ListOrganizationImpactsRequest 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.servicehealth.v1.ListOrganizationImpactsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicehealth.v1.ListOrganizationImpactsRequest 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.servicehealth.v1.ListOrganizationImpactsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicehealth.v1.ListOrganizationImpactsRequest 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.servicehealth.v1.ListOrganizationImpactsRequest 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; + } + /** + * + * + *
+   * Message for requesting list of OrganizationImpacts
+   * 
+ * + * Protobuf type {@code google.cloud.servicehealth.v1.ListOrganizationImpactsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicehealth.v1.ListOrganizationImpactsRequest) + com.google.cloud.servicehealth.v1.ListOrganizationImpactsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_ListOrganizationImpactsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_ListOrganizationImpactsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicehealth.v1.ListOrganizationImpactsRequest.class, + com.google.cloud.servicehealth.v1.ListOrganizationImpactsRequest.Builder.class); + } + + // Construct using com.google.cloud.servicehealth.v1.ListOrganizationImpactsRequest.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_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_ListOrganizationImpactsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicehealth.v1.ListOrganizationImpactsRequest + getDefaultInstanceForType() { + return com.google.cloud.servicehealth.v1.ListOrganizationImpactsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicehealth.v1.ListOrganizationImpactsRequest build() { + com.google.cloud.servicehealth.v1.ListOrganizationImpactsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicehealth.v1.ListOrganizationImpactsRequest buildPartial() { + com.google.cloud.servicehealth.v1.ListOrganizationImpactsRequest result = + new com.google.cloud.servicehealth.v1.ListOrganizationImpactsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.servicehealth.v1.ListOrganizationImpactsRequest 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_; + } + } + + @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.servicehealth.v1.ListOrganizationImpactsRequest) { + return mergeFrom((com.google.cloud.servicehealth.v1.ListOrganizationImpactsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.servicehealth.v1.ListOrganizationImpactsRequest other) { + if (other + == com.google.cloud.servicehealth.v1.ListOrganizationImpactsRequest.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(); + } + 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: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + 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. Parent value using the form
+     * `organizations/{organization_id}/locations/{location}/organizationImpacts`.
+     *
+     * `organization_id` - ID (number) of the project that contains the event. To
+     * get your `organization_id`, see
+     * [Getting your organization resource
+     * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Parent value using the form
+     * `organizations/{organization_id}/locations/{location}/organizationImpacts`.
+     *
+     * `organization_id` - ID (number) of the project that contains the event. To
+     * get your `organization_id`, see
+     * [Getting your organization resource
+     * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Parent value using the form
+     * `organizations/{organization_id}/locations/{location}/organizationImpacts`.
+     *
+     * `organization_id` - ID (number) of the project that contains the event. To
+     * get your `organization_id`, see
+     * [Getting your organization resource
+     * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Parent value using the form
+     * `organizations/{organization_id}/locations/{location}/organizationImpacts`.
+     *
+     * `organization_id` - ID (number) of the project that contains the event. To
+     * get your `organization_id`, see
+     * [Getting your organization resource
+     * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).
+     * 
+ * + * + * string parent = 1 [(.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. Parent value using the form
+     * `organizations/{organization_id}/locations/{location}/organizationImpacts`.
+     *
+     * `organization_id` - ID (number) of the project that contains the event. To
+     * get your `organization_id`, see
+     * [Getting your organization resource
+     * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Optional. The maximum number of events that should be returned. Acceptable
+     * values are `1` to `100`, inclusive. The default value is `10`.
+     *
+     *  If more results are available, the service returns a
+     * `next_page_token` that can be used to get the next page of results in
+     * subsequent list requests. The service may return fewer
+     * [impacts](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact)
+     * than the requested `page_size`.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Optional. The maximum number of events that should be returned. Acceptable
+     * values are `1` to `100`, inclusive. The default value is `10`.
+     *
+     *  If more results are available, the service returns a
+     * `next_page_token` that can be used to get the next page of results in
+     * subsequent list requests. The service may return fewer
+     * [impacts](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact)
+     * than the requested `page_size`.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The maximum number of events that should be returned. Acceptable
+     * values are `1` to `100`, inclusive. The default value is `10`.
+     *
+     *  If more results are available, the service returns a
+     * `next_page_token` that can be used to get the next page of results in
+     * subsequent list requests. The service may return fewer
+     * [impacts](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact)
+     * than the requested `page_size`.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     *
+     * Provide `page_token` returned by a previous `ListOrganizationImpacts` call
+     * to retrieve the next page of results.
+     *
+     * When paginating, all other parameters provided to `ListOrganizationImpacts`
+     * must match the call that provided the page token.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     *
+     * Provide `page_token` returned by a previous `ListOrganizationImpacts` call
+     * to retrieve the next page of results.
+     *
+     * When paginating, all other parameters provided to `ListOrganizationImpacts`
+     * must match the call that provided the page token.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     *
+     * Provide `page_token` returned by a previous `ListOrganizationImpacts` call
+     * to retrieve the next page of results.
+     *
+     * When paginating, all other parameters provided to `ListOrganizationImpacts`
+     * must match the call that provided the page token.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     *
+     * Provide `page_token` returned by a previous `ListOrganizationImpacts` call
+     * to retrieve the next page of results.
+     *
+     * When paginating, all other parameters provided to `ListOrganizationImpacts`
+     * must match the call that provided the page token.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     *
+     * Provide `page_token` returned by a previous `ListOrganizationImpacts` call
+     * to retrieve the next page of results.
+     *
+     * When paginating, all other parameters provided to `ListOrganizationImpacts`
+     * must match the call that provided the page token.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Optional. A filter expression that filters resources listed in the
+     * response. The expression is in the form of `field:value` for checking if a
+     * repeated field contains a value.
+     *
+     * Example:
+     * `events:organizations%2F{organization_id}%2Flocations%2Fglobal%2ForganizationEvents%2Fevent-id`
+     *
+     * To get your `{organization_id}`, see
+     * [Getting your organization resource
+     * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).
+     *
+     * Multiple filter queries are separated by spaces.
+     *
+     * By default, each expression is an AND expression. However, you can include
+     * AND and OR expressions explicitly.
+     * Filter is supported for the following fields: `events`.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. A filter expression that filters resources listed in the
+     * response. The expression is in the form of `field:value` for checking if a
+     * repeated field contains a value.
+     *
+     * Example:
+     * `events:organizations%2F{organization_id}%2Flocations%2Fglobal%2ForganizationEvents%2Fevent-id`
+     *
+     * To get your `{organization_id}`, see
+     * [Getting your organization resource
+     * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).
+     *
+     * Multiple filter queries are separated by spaces.
+     *
+     * By default, each expression is an AND expression. However, you can include
+     * AND and OR expressions explicitly.
+     * Filter is supported for the following fields: `events`.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. A filter expression that filters resources listed in the
+     * response. The expression is in the form of `field:value` for checking if a
+     * repeated field contains a value.
+     *
+     * Example:
+     * `events:organizations%2F{organization_id}%2Flocations%2Fglobal%2ForganizationEvents%2Fevent-id`
+     *
+     * To get your `{organization_id}`, see
+     * [Getting your organization resource
+     * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).
+     *
+     * Multiple filter queries are separated by spaces.
+     *
+     * By default, each expression is an AND expression. However, you can include
+     * AND and OR expressions explicitly.
+     * Filter is supported for the following fields: `events`.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + /** + * + * + *
+     * Optional. A filter expression that filters resources listed in the
+     * response. The expression is in the form of `field:value` for checking if a
+     * repeated field contains a value.
+     *
+     * Example:
+     * `events:organizations%2F{organization_id}%2Flocations%2Fglobal%2ForganizationEvents%2Fevent-id`
+     *
+     * To get your `{organization_id}`, see
+     * [Getting your organization resource
+     * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).
+     *
+     * Multiple filter queries are separated by spaces.
+     *
+     * By default, each expression is an AND expression. However, you can include
+     * AND and OR expressions explicitly.
+     * Filter is supported for the following fields: `events`.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A filter expression that filters resources listed in the
+     * response. The expression is in the form of `field:value` for checking if a
+     * repeated field contains a value.
+     *
+     * Example:
+     * `events:organizations%2F{organization_id}%2Flocations%2Fglobal%2ForganizationEvents%2Fevent-id`
+     *
+     * To get your `{organization_id}`, see
+     * [Getting your organization resource
+     * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).
+     *
+     * Multiple filter queries are separated by spaces.
+     *
+     * By default, each expression is an AND expression. However, you can include
+     * AND and OR expressions explicitly.
+     * Filter is supported for the following fields: `events`.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + + @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.servicehealth.v1.ListOrganizationImpactsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicehealth.v1.ListOrganizationImpactsRequest) + private static final com.google.cloud.servicehealth.v1.ListOrganizationImpactsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicehealth.v1.ListOrganizationImpactsRequest(); + } + + public static com.google.cloud.servicehealth.v1.ListOrganizationImpactsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListOrganizationImpactsRequest 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.servicehealth.v1.ListOrganizationImpactsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/ListOrganizationImpactsRequestOrBuilder.java b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/ListOrganizationImpactsRequestOrBuilder.java new file mode 100644 index 000000000000..da8189a2de20 --- /dev/null +++ b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/ListOrganizationImpactsRequestOrBuilder.java @@ -0,0 +1,178 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/servicehealth/v1/event_resources.proto + +package com.google.cloud.servicehealth.v1; + +public interface ListOrganizationImpactsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicehealth.v1.ListOrganizationImpactsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Parent value using the form
+   * `organizations/{organization_id}/locations/{location}/organizationImpacts`.
+   *
+   * `organization_id` - ID (number) of the project that contains the event. To
+   * get your `organization_id`, see
+   * [Getting your organization resource
+   * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Parent value using the form
+   * `organizations/{organization_id}/locations/{location}/organizationImpacts`.
+   *
+   * `organization_id` - ID (number) of the project that contains the event. To
+   * get your `organization_id`, see
+   * [Getting your organization resource
+   * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. The maximum number of events that should be returned. Acceptable
+   * values are `1` to `100`, inclusive. The default value is `10`.
+   *
+   *  If more results are available, the service returns a
+   * `next_page_token` that can be used to get the next page of results in
+   * subsequent list requests. The service may return fewer
+   * [impacts](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact)
+   * than the requested `page_size`.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   *
+   * Provide `page_token` returned by a previous `ListOrganizationImpacts` call
+   * to retrieve the next page of results.
+   *
+   * When paginating, all other parameters provided to `ListOrganizationImpacts`
+   * must match the call that provided the page token.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   *
+   * Provide `page_token` returned by a previous `ListOrganizationImpacts` call
+   * to retrieve the next page of results.
+   *
+   * When paginating, all other parameters provided to `ListOrganizationImpacts`
+   * must match the call that provided the page token.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. A filter expression that filters resources listed in the
+   * response. The expression is in the form of `field:value` for checking if a
+   * repeated field contains a value.
+   *
+   * Example:
+   * `events:organizations%2F{organization_id}%2Flocations%2Fglobal%2ForganizationEvents%2Fevent-id`
+   *
+   * To get your `{organization_id}`, see
+   * [Getting your organization resource
+   * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).
+   *
+   * Multiple filter queries are separated by spaces.
+   *
+   * By default, each expression is an AND expression. However, you can include
+   * AND and OR expressions explicitly.
+   * Filter is supported for the following fields: `events`.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Optional. A filter expression that filters resources listed in the
+   * response. The expression is in the form of `field:value` for checking if a
+   * repeated field contains a value.
+   *
+   * Example:
+   * `events:organizations%2F{organization_id}%2Flocations%2Fglobal%2ForganizationEvents%2Fevent-id`
+   *
+   * To get your `{organization_id}`, see
+   * [Getting your organization resource
+   * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).
+   *
+   * Multiple filter queries are separated by spaces.
+   *
+   * By default, each expression is an AND expression. However, you can include
+   * AND and OR expressions explicitly.
+   * Filter is supported for the following fields: `events`.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); +} diff --git a/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/ListOrganizationImpactsResponse.java b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/ListOrganizationImpactsResponse.java new file mode 100644 index 000000000000..0b18059f8ccf --- /dev/null +++ b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/ListOrganizationImpactsResponse.java @@ -0,0 +1,1528 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/servicehealth/v1/event_resources.proto + +package com.google.cloud.servicehealth.v1; + +/** Protobuf type {@code google.cloud.servicehealth.v1.ListOrganizationImpactsResponse} */ +public final class ListOrganizationImpactsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicehealth.v1.ListOrganizationImpactsResponse) + ListOrganizationImpactsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListOrganizationImpactsResponse.newBuilder() to construct. + private ListOrganizationImpactsResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListOrganizationImpactsResponse() { + organizationImpacts_ = 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 ListOrganizationImpactsResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_ListOrganizationImpactsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_ListOrganizationImpactsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicehealth.v1.ListOrganizationImpactsResponse.class, + com.google.cloud.servicehealth.v1.ListOrganizationImpactsResponse.Builder.class); + } + + public static final int ORGANIZATION_IMPACTS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List organizationImpacts_; + /** + * + * + *
+   * Output only. List of
+   * [impacts](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact)
+   * for an organization affected by service health events.
+   * 
+ * + * + * repeated .google.cloud.servicehealth.v1.OrganizationImpact organization_impacts = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getOrganizationImpactsList() { + return organizationImpacts_; + } + /** + * + * + *
+   * Output only. List of
+   * [impacts](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact)
+   * for an organization affected by service health events.
+   * 
+ * + * + * repeated .google.cloud.servicehealth.v1.OrganizationImpact organization_impacts = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getOrganizationImpactsOrBuilderList() { + return organizationImpacts_; + } + /** + * + * + *
+   * Output only. List of
+   * [impacts](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact)
+   * for an organization affected by service health events.
+   * 
+ * + * + * repeated .google.cloud.servicehealth.v1.OrganizationImpact organization_impacts = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getOrganizationImpactsCount() { + return organizationImpacts_.size(); + } + /** + * + * + *
+   * Output only. List of
+   * [impacts](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact)
+   * for an organization affected by service health events.
+   * 
+ * + * + * repeated .google.cloud.servicehealth.v1.OrganizationImpact organization_impacts = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.servicehealth.v1.OrganizationImpact getOrganizationImpacts(int index) { + return organizationImpacts_.get(index); + } + /** + * + * + *
+   * Output only. List of
+   * [impacts](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact)
+   * for an organization affected by service health events.
+   * 
+ * + * + * repeated .google.cloud.servicehealth.v1.OrganizationImpact organization_impacts = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.servicehealth.v1.OrganizationImpactOrBuilder + getOrganizationImpactsOrBuilder(int index) { + return organizationImpacts_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * Output only. The continuation token, used to page through large result
+   * sets. Provide this value in a subsequent request as `page_token` to
+   * retrieve the next page.
+   *
+   * If this field is not present, there are no subsequent results.
+   * 
+ * + * string next_page_token = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+   * Output only. The continuation token, used to page through large result
+   * sets. Provide this value in a subsequent request as `page_token` to
+   * retrieve the next page.
+   *
+   * If this field is not present, there are no subsequent results.
+   * 
+ * + * string next_page_token = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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 = 3; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList unreachable_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * Output only. Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_; + } + /** + * + * + *
+   * Output only. Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+   * Output only. Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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); + } + /** + * + * + *
+   * Output only. Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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 < organizationImpacts_.size(); i++) { + output.writeMessage(1, organizationImpacts_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + for (int i = 0; i < unreachable_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, 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 < organizationImpacts_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(1, organizationImpacts_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + { + int dataSize = 0; + for (int i = 0; i < unreachable_.size(); i++) { + dataSize += computeStringSizeNoTag(unreachable_.getRaw(i)); + } + size += dataSize; + size += 1 * 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.servicehealth.v1.ListOrganizationImpactsResponse)) { + return super.equals(obj); + } + com.google.cloud.servicehealth.v1.ListOrganizationImpactsResponse other = + (com.google.cloud.servicehealth.v1.ListOrganizationImpactsResponse) obj; + + if (!getOrganizationImpactsList().equals(other.getOrganizationImpactsList())) 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 (getOrganizationImpactsCount() > 0) { + hash = (37 * hash) + ORGANIZATION_IMPACTS_FIELD_NUMBER; + hash = (53 * hash) + getOrganizationImpactsList().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.servicehealth.v1.ListOrganizationImpactsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicehealth.v1.ListOrganizationImpactsResponse 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.servicehealth.v1.ListOrganizationImpactsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicehealth.v1.ListOrganizationImpactsResponse 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.servicehealth.v1.ListOrganizationImpactsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicehealth.v1.ListOrganizationImpactsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.servicehealth.v1.ListOrganizationImpactsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicehealth.v1.ListOrganizationImpactsResponse 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.servicehealth.v1.ListOrganizationImpactsResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicehealth.v1.ListOrganizationImpactsResponse + 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.servicehealth.v1.ListOrganizationImpactsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicehealth.v1.ListOrganizationImpactsResponse 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.servicehealth.v1.ListOrganizationImpactsResponse 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; + } + /** Protobuf type {@code google.cloud.servicehealth.v1.ListOrganizationImpactsResponse} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicehealth.v1.ListOrganizationImpactsResponse) + com.google.cloud.servicehealth.v1.ListOrganizationImpactsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_ListOrganizationImpactsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_ListOrganizationImpactsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicehealth.v1.ListOrganizationImpactsResponse.class, + com.google.cloud.servicehealth.v1.ListOrganizationImpactsResponse.Builder.class); + } + + // Construct using + // com.google.cloud.servicehealth.v1.ListOrganizationImpactsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (organizationImpactsBuilder_ == null) { + organizationImpacts_ = java.util.Collections.emptyList(); + } else { + organizationImpacts_ = null; + organizationImpactsBuilder_.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.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_ListOrganizationImpactsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicehealth.v1.ListOrganizationImpactsResponse + getDefaultInstanceForType() { + return com.google.cloud.servicehealth.v1.ListOrganizationImpactsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicehealth.v1.ListOrganizationImpactsResponse build() { + com.google.cloud.servicehealth.v1.ListOrganizationImpactsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicehealth.v1.ListOrganizationImpactsResponse buildPartial() { + com.google.cloud.servicehealth.v1.ListOrganizationImpactsResponse result = + new com.google.cloud.servicehealth.v1.ListOrganizationImpactsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.servicehealth.v1.ListOrganizationImpactsResponse result) { + if (organizationImpactsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + organizationImpacts_ = java.util.Collections.unmodifiableList(organizationImpacts_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.organizationImpacts_ = organizationImpacts_; + } else { + result.organizationImpacts_ = organizationImpactsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.servicehealth.v1.ListOrganizationImpactsResponse 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.servicehealth.v1.ListOrganizationImpactsResponse) { + return mergeFrom((com.google.cloud.servicehealth.v1.ListOrganizationImpactsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.servicehealth.v1.ListOrganizationImpactsResponse other) { + if (other + == com.google.cloud.servicehealth.v1.ListOrganizationImpactsResponse.getDefaultInstance()) + return this; + if (organizationImpactsBuilder_ == null) { + if (!other.organizationImpacts_.isEmpty()) { + if (organizationImpacts_.isEmpty()) { + organizationImpacts_ = other.organizationImpacts_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureOrganizationImpactsIsMutable(); + organizationImpacts_.addAll(other.organizationImpacts_); + } + onChanged(); + } + } else { + if (!other.organizationImpacts_.isEmpty()) { + if (organizationImpactsBuilder_.isEmpty()) { + organizationImpactsBuilder_.dispose(); + organizationImpactsBuilder_ = null; + organizationImpacts_ = other.organizationImpacts_; + bitField0_ = (bitField0_ & ~0x00000001); + organizationImpactsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getOrganizationImpactsFieldBuilder() + : null; + } else { + organizationImpactsBuilder_.addAllMessages(other.organizationImpacts_); + } + } + } + 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 10: + { + com.google.cloud.servicehealth.v1.OrganizationImpact m = + input.readMessage( + com.google.cloud.servicehealth.v1.OrganizationImpact.parser(), + extensionRegistry); + if (organizationImpactsBuilder_ == null) { + ensureOrganizationImpactsIsMutable(); + organizationImpacts_.add(m); + } else { + organizationImpactsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureUnreachableIsMutable(); + unreachable_.add(s); + 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.util.List + organizationImpacts_ = java.util.Collections.emptyList(); + + private void ensureOrganizationImpactsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + organizationImpacts_ = + new java.util.ArrayList( + organizationImpacts_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.servicehealth.v1.OrganizationImpact, + com.google.cloud.servicehealth.v1.OrganizationImpact.Builder, + com.google.cloud.servicehealth.v1.OrganizationImpactOrBuilder> + organizationImpactsBuilder_; + + /** + * + * + *
+     * Output only. List of
+     * [impacts](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact)
+     * for an organization affected by service health events.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.OrganizationImpact organization_impacts = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getOrganizationImpactsList() { + if (organizationImpactsBuilder_ == null) { + return java.util.Collections.unmodifiableList(organizationImpacts_); + } else { + return organizationImpactsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Output only. List of
+     * [impacts](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact)
+     * for an organization affected by service health events.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.OrganizationImpact organization_impacts = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getOrganizationImpactsCount() { + if (organizationImpactsBuilder_ == null) { + return organizationImpacts_.size(); + } else { + return organizationImpactsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Output only. List of
+     * [impacts](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact)
+     * for an organization affected by service health events.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.OrganizationImpact organization_impacts = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.servicehealth.v1.OrganizationImpact getOrganizationImpacts(int index) { + if (organizationImpactsBuilder_ == null) { + return organizationImpacts_.get(index); + } else { + return organizationImpactsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Output only. List of
+     * [impacts](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact)
+     * for an organization affected by service health events.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.OrganizationImpact organization_impacts = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setOrganizationImpacts( + int index, com.google.cloud.servicehealth.v1.OrganizationImpact value) { + if (organizationImpactsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOrganizationImpactsIsMutable(); + organizationImpacts_.set(index, value); + onChanged(); + } else { + organizationImpactsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. List of
+     * [impacts](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact)
+     * for an organization affected by service health events.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.OrganizationImpact organization_impacts = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setOrganizationImpacts( + int index, com.google.cloud.servicehealth.v1.OrganizationImpact.Builder builderForValue) { + if (organizationImpactsBuilder_ == null) { + ensureOrganizationImpactsIsMutable(); + organizationImpacts_.set(index, builderForValue.build()); + onChanged(); + } else { + organizationImpactsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. List of
+     * [impacts](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact)
+     * for an organization affected by service health events.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.OrganizationImpact organization_impacts = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addOrganizationImpacts( + com.google.cloud.servicehealth.v1.OrganizationImpact value) { + if (organizationImpactsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOrganizationImpactsIsMutable(); + organizationImpacts_.add(value); + onChanged(); + } else { + organizationImpactsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Output only. List of
+     * [impacts](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact)
+     * for an organization affected by service health events.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.OrganizationImpact organization_impacts = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addOrganizationImpacts( + int index, com.google.cloud.servicehealth.v1.OrganizationImpact value) { + if (organizationImpactsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOrganizationImpactsIsMutable(); + organizationImpacts_.add(index, value); + onChanged(); + } else { + organizationImpactsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. List of
+     * [impacts](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact)
+     * for an organization affected by service health events.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.OrganizationImpact organization_impacts = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addOrganizationImpacts( + com.google.cloud.servicehealth.v1.OrganizationImpact.Builder builderForValue) { + if (organizationImpactsBuilder_ == null) { + ensureOrganizationImpactsIsMutable(); + organizationImpacts_.add(builderForValue.build()); + onChanged(); + } else { + organizationImpactsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. List of
+     * [impacts](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact)
+     * for an organization affected by service health events.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.OrganizationImpact organization_impacts = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addOrganizationImpacts( + int index, com.google.cloud.servicehealth.v1.OrganizationImpact.Builder builderForValue) { + if (organizationImpactsBuilder_ == null) { + ensureOrganizationImpactsIsMutable(); + organizationImpacts_.add(index, builderForValue.build()); + onChanged(); + } else { + organizationImpactsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. List of
+     * [impacts](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact)
+     * for an organization affected by service health events.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.OrganizationImpact organization_impacts = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllOrganizationImpacts( + java.lang.Iterable values) { + if (organizationImpactsBuilder_ == null) { + ensureOrganizationImpactsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, organizationImpacts_); + onChanged(); + } else { + organizationImpactsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Output only. List of
+     * [impacts](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact)
+     * for an organization affected by service health events.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.OrganizationImpact organization_impacts = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearOrganizationImpacts() { + if (organizationImpactsBuilder_ == null) { + organizationImpacts_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + organizationImpactsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. List of
+     * [impacts](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact)
+     * for an organization affected by service health events.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.OrganizationImpact organization_impacts = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeOrganizationImpacts(int index) { + if (organizationImpactsBuilder_ == null) { + ensureOrganizationImpactsIsMutable(); + organizationImpacts_.remove(index); + onChanged(); + } else { + organizationImpactsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Output only. List of
+     * [impacts](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact)
+     * for an organization affected by service health events.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.OrganizationImpact organization_impacts = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.servicehealth.v1.OrganizationImpact.Builder + getOrganizationImpactsBuilder(int index) { + return getOrganizationImpactsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Output only. List of
+     * [impacts](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact)
+     * for an organization affected by service health events.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.OrganizationImpact organization_impacts = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.servicehealth.v1.OrganizationImpactOrBuilder + getOrganizationImpactsOrBuilder(int index) { + if (organizationImpactsBuilder_ == null) { + return organizationImpacts_.get(index); + } else { + return organizationImpactsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Output only. List of
+     * [impacts](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact)
+     * for an organization affected by service health events.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.OrganizationImpact organization_impacts = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getOrganizationImpactsOrBuilderList() { + if (organizationImpactsBuilder_ != null) { + return organizationImpactsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(organizationImpacts_); + } + } + /** + * + * + *
+     * Output only. List of
+     * [impacts](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact)
+     * for an organization affected by service health events.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.OrganizationImpact organization_impacts = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.servicehealth.v1.OrganizationImpact.Builder + addOrganizationImpactsBuilder() { + return getOrganizationImpactsFieldBuilder() + .addBuilder(com.google.cloud.servicehealth.v1.OrganizationImpact.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. List of
+     * [impacts](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact)
+     * for an organization affected by service health events.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.OrganizationImpact organization_impacts = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.servicehealth.v1.OrganizationImpact.Builder + addOrganizationImpactsBuilder(int index) { + return getOrganizationImpactsFieldBuilder() + .addBuilder( + index, com.google.cloud.servicehealth.v1.OrganizationImpact.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. List of
+     * [impacts](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact)
+     * for an organization affected by service health events.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.OrganizationImpact organization_impacts = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getOrganizationImpactsBuilderList() { + return getOrganizationImpactsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.servicehealth.v1.OrganizationImpact, + com.google.cloud.servicehealth.v1.OrganizationImpact.Builder, + com.google.cloud.servicehealth.v1.OrganizationImpactOrBuilder> + getOrganizationImpactsFieldBuilder() { + if (organizationImpactsBuilder_ == null) { + organizationImpactsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.servicehealth.v1.OrganizationImpact, + com.google.cloud.servicehealth.v1.OrganizationImpact.Builder, + com.google.cloud.servicehealth.v1.OrganizationImpactOrBuilder>( + organizationImpacts_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + organizationImpacts_ = null; + } + return organizationImpactsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * Output only. The continuation token, used to page through large result
+     * sets. Provide this value in a subsequent request as `page_token` to
+     * retrieve the next page.
+     *
+     * If this field is not present, there are no subsequent results.
+     * 
+ * + * string next_page_token = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. The continuation token, used to page through large result
+     * sets. Provide this value in a subsequent request as `page_token` to
+     * retrieve the next page.
+     *
+     * If this field is not present, there are no subsequent results.
+     * 
+ * + * string next_page_token = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. The continuation token, used to page through large result
+     * sets. Provide this value in a subsequent request as `page_token` to
+     * retrieve the next page.
+     *
+     * If this field is not present, there are no subsequent results.
+     * 
+ * + * string next_page_token = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + /** + * + * + *
+     * Output only. The continuation token, used to page through large result
+     * sets. Provide this value in a subsequent request as `page_token` to
+     * retrieve the next page.
+     *
+     * If this field is not present, there are no subsequent results.
+     * 
+ * + * string next_page_token = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The continuation token, used to page through large result
+     * sets. Provide this value in a subsequent request as `page_token` to
+     * retrieve the next page.
+     *
+     * If this field is not present, there are no subsequent results.
+     * 
+ * + * string next_page_token = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + /** + * + * + *
+     * Output only. Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + unreachable_.makeImmutable(); + return unreachable_; + } + /** + * + * + *
+     * Output only. Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+     * Output only. Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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); + } + /** + * + * + *
+     * Output only. Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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); + } + /** + * + * + *
+     * Output only. Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + /** + * + * + *
+     * Output only. Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + /** + * + * + *
+     * Output only. Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + /** + * + * + *
+     * Output only. Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearUnreachable() { + unreachable_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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.servicehealth.v1.ListOrganizationImpactsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicehealth.v1.ListOrganizationImpactsResponse) + private static final com.google.cloud.servicehealth.v1.ListOrganizationImpactsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicehealth.v1.ListOrganizationImpactsResponse(); + } + + public static com.google.cloud.servicehealth.v1.ListOrganizationImpactsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListOrganizationImpactsResponse 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.servicehealth.v1.ListOrganizationImpactsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/ListOrganizationImpactsResponseOrBuilder.java b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/ListOrganizationImpactsResponseOrBuilder.java new file mode 100644 index 000000000000..bc0669cad150 --- /dev/null +++ b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/ListOrganizationImpactsResponseOrBuilder.java @@ -0,0 +1,182 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/servicehealth/v1/event_resources.proto + +package com.google.cloud.servicehealth.v1; + +public interface ListOrganizationImpactsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicehealth.v1.ListOrganizationImpactsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. List of
+   * [impacts](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact)
+   * for an organization affected by service health events.
+   * 
+ * + * + * repeated .google.cloud.servicehealth.v1.OrganizationImpact organization_impacts = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getOrganizationImpactsList(); + /** + * + * + *
+   * Output only. List of
+   * [impacts](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact)
+   * for an organization affected by service health events.
+   * 
+ * + * + * repeated .google.cloud.servicehealth.v1.OrganizationImpact organization_impacts = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.servicehealth.v1.OrganizationImpact getOrganizationImpacts(int index); + /** + * + * + *
+   * Output only. List of
+   * [impacts](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact)
+   * for an organization affected by service health events.
+   * 
+ * + * + * repeated .google.cloud.servicehealth.v1.OrganizationImpact organization_impacts = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getOrganizationImpactsCount(); + /** + * + * + *
+   * Output only. List of
+   * [impacts](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact)
+   * for an organization affected by service health events.
+   * 
+ * + * + * repeated .google.cloud.servicehealth.v1.OrganizationImpact organization_impacts = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getOrganizationImpactsOrBuilderList(); + /** + * + * + *
+   * Output only. List of
+   * [impacts](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact)
+   * for an organization affected by service health events.
+   * 
+ * + * + * repeated .google.cloud.servicehealth.v1.OrganizationImpact organization_impacts = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.servicehealth.v1.OrganizationImpactOrBuilder getOrganizationImpactsOrBuilder( + int index); + + /** + * + * + *
+   * Output only. The continuation token, used to page through large result
+   * sets. Provide this value in a subsequent request as `page_token` to
+   * retrieve the next page.
+   *
+   * If this field is not present, there are no subsequent results.
+   * 
+ * + * string next_page_token = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Output only. The continuation token, used to page through large result
+   * sets. Provide this value in a subsequent request as `page_token` to
+   * retrieve the next page.
+   *
+   * If this field is not present, there are no subsequent results.
+   * 
+ * + * string next_page_token = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * Output only. Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return A list containing the unreachable. + */ + java.util.List getUnreachableList(); + /** + * + * + *
+   * Output only. Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The count of unreachable. + */ + int getUnreachableCount(); + /** + * + * + *
+   * Output only. Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + java.lang.String getUnreachable(int index); + /** + * + * + *
+   * Output only. Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/Location.java b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/Location.java new file mode 100644 index 000000000000..f1aec1dab6e9 --- /dev/null +++ b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/Location.java @@ -0,0 +1,623 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/servicehealth/v1/event_resources.proto + +package com.google.cloud.servicehealth.v1; + +/** + * + * + *
+ * Represents the locations impacted by the event.
+ * 
+ * + * Protobuf type {@code google.cloud.servicehealth.v1.Location} + */ +public final class Location extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicehealth.v1.Location) + LocationOrBuilder { + private static final long serialVersionUID = 0L; + // Use Location.newBuilder() to construct. + private Location(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Location() { + locationName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Location(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_Location_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_Location_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicehealth.v1.Location.class, + com.google.cloud.servicehealth.v1.Location.Builder.class); + } + + public static final int LOCATION_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object locationName_ = ""; + /** + * + * + *
+   * Location impacted by the event. Example: `"us-central1"`
+   * 
+ * + * string location_name = 1; + * + * @return The locationName. + */ + @java.lang.Override + public java.lang.String getLocationName() { + java.lang.Object ref = locationName_; + 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(); + locationName_ = s; + return s; + } + } + /** + * + * + *
+   * Location impacted by the event. Example: `"us-central1"`
+   * 
+ * + * string location_name = 1; + * + * @return The bytes for locationName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLocationNameBytes() { + java.lang.Object ref = locationName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + locationName_ = 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(locationName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, locationName_); + } + 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(locationName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, locationName_); + } + 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.servicehealth.v1.Location)) { + return super.equals(obj); + } + com.google.cloud.servicehealth.v1.Location other = + (com.google.cloud.servicehealth.v1.Location) obj; + + if (!getLocationName().equals(other.getLocationName())) 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) + LOCATION_NAME_FIELD_NUMBER; + hash = (53 * hash) + getLocationName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.servicehealth.v1.Location parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicehealth.v1.Location 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.servicehealth.v1.Location parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicehealth.v1.Location 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.servicehealth.v1.Location parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicehealth.v1.Location parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.servicehealth.v1.Location parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicehealth.v1.Location 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.servicehealth.v1.Location parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicehealth.v1.Location 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.servicehealth.v1.Location parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicehealth.v1.Location 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.servicehealth.v1.Location 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; + } + /** + * + * + *
+   * Represents the locations impacted by the event.
+   * 
+ * + * Protobuf type {@code google.cloud.servicehealth.v1.Location} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicehealth.v1.Location) + com.google.cloud.servicehealth.v1.LocationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_Location_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_Location_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicehealth.v1.Location.class, + com.google.cloud.servicehealth.v1.Location.Builder.class); + } + + // Construct using com.google.cloud.servicehealth.v1.Location.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + locationName_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_Location_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicehealth.v1.Location getDefaultInstanceForType() { + return com.google.cloud.servicehealth.v1.Location.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicehealth.v1.Location build() { + com.google.cloud.servicehealth.v1.Location result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicehealth.v1.Location buildPartial() { + com.google.cloud.servicehealth.v1.Location result = + new com.google.cloud.servicehealth.v1.Location(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.servicehealth.v1.Location result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.locationName_ = locationName_; + } + } + + @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.servicehealth.v1.Location) { + return mergeFrom((com.google.cloud.servicehealth.v1.Location) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.servicehealth.v1.Location other) { + if (other == com.google.cloud.servicehealth.v1.Location.getDefaultInstance()) return this; + if (!other.getLocationName().isEmpty()) { + locationName_ = other.locationName_; + 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 10: + { + locationName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + 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 locationName_ = ""; + /** + * + * + *
+     * Location impacted by the event. Example: `"us-central1"`
+     * 
+ * + * string location_name = 1; + * + * @return The locationName. + */ + public java.lang.String getLocationName() { + java.lang.Object ref = locationName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + locationName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Location impacted by the event. Example: `"us-central1"`
+     * 
+ * + * string location_name = 1; + * + * @return The bytes for locationName. + */ + public com.google.protobuf.ByteString getLocationNameBytes() { + java.lang.Object ref = locationName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + locationName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Location impacted by the event. Example: `"us-central1"`
+     * 
+ * + * string location_name = 1; + * + * @param value The locationName to set. + * @return This builder for chaining. + */ + public Builder setLocationName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + locationName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Location impacted by the event. Example: `"us-central1"`
+     * 
+ * + * string location_name = 1; + * + * @return This builder for chaining. + */ + public Builder clearLocationName() { + locationName_ = getDefaultInstance().getLocationName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Location impacted by the event. Example: `"us-central1"`
+     * 
+ * + * string location_name = 1; + * + * @param value The bytes for locationName to set. + * @return This builder for chaining. + */ + public Builder setLocationNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + locationName_ = 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.servicehealth.v1.Location) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicehealth.v1.Location) + private static final com.google.cloud.servicehealth.v1.Location DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicehealth.v1.Location(); + } + + public static com.google.cloud.servicehealth.v1.Location getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Location 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.servicehealth.v1.Location getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/LocationName.java b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/LocationName.java new file mode 100644 index 000000000000..30d9fc29aba0 --- /dev/null +++ b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/LocationName.java @@ -0,0 +1,192 @@ +/* + * Copyright 2023 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.servicehealth.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-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/LocationOrBuilder.java b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/LocationOrBuilder.java new file mode 100644 index 000000000000..4a32ddcdd3a2 --- /dev/null +++ b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/LocationOrBuilder.java @@ -0,0 +1,50 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/servicehealth/v1/event_resources.proto + +package com.google.cloud.servicehealth.v1; + +public interface LocationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicehealth.v1.Location) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Location impacted by the event. Example: `"us-central1"`
+   * 
+ * + * string location_name = 1; + * + * @return The locationName. + */ + java.lang.String getLocationName(); + /** + * + * + *
+   * Location impacted by the event. Example: `"us-central1"`
+   * 
+ * + * string location_name = 1; + * + * @return The bytes for locationName. + */ + com.google.protobuf.ByteString getLocationNameBytes(); +} diff --git a/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/OrganizationEvent.java b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/OrganizationEvent.java new file mode 100644 index 000000000000..0dc66df72da9 --- /dev/null +++ b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/OrganizationEvent.java @@ -0,0 +1,4926 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/servicehealth/v1/event_resources.proto + +package com.google.cloud.servicehealth.v1; + +/** + * + * + *
+ * Represents service health events that may affect Google Cloud products used
+ * across the organization. It is a read-only view and does not allow any
+ * modifications.
+ * 
+ * + * Protobuf type {@code google.cloud.servicehealth.v1.OrganizationEvent} + */ +public final class OrganizationEvent extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicehealth.v1.OrganizationEvent) + OrganizationEventOrBuilder { + private static final long serialVersionUID = 0L; + // Use OrganizationEvent.newBuilder() to construct. + private OrganizationEvent(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private OrganizationEvent() { + name_ = ""; + title_ = ""; + description_ = ""; + category_ = 0; + detailedCategory_ = 0; + state_ = 0; + detailedState_ = 0; + eventImpacts_ = java.util.Collections.emptyList(); + updates_ = java.util.Collections.emptyList(); + parentEvent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new OrganizationEvent(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_OrganizationEvent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_OrganizationEvent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicehealth.v1.OrganizationEvent.class, + com.google.cloud.servicehealth.v1.OrganizationEvent.Builder.class); + } + + /** + * + * + *
+   * The category of the event. This enum lists all possible categories of
+   * event.
+   * 
+ * + * Protobuf enum {@code google.cloud.servicehealth.v1.OrganizationEvent.EventCategory} + */ + public enum EventCategory implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified category.
+     * 
+ * + * EVENT_CATEGORY_UNSPECIFIED = 0; + */ + EVENT_CATEGORY_UNSPECIFIED(0), + /** + * + * + *
+     * Event category for service outage or degradation.
+     * 
+ * + * INCIDENT = 2; + */ + INCIDENT(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified category.
+     * 
+ * + * EVENT_CATEGORY_UNSPECIFIED = 0; + */ + public static final int EVENT_CATEGORY_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Event category for service outage or degradation.
+     * 
+ * + * INCIDENT = 2; + */ + public static final int INCIDENT_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static EventCategory 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 EventCategory forNumber(int value) { + switch (value) { + case 0: + return EVENT_CATEGORY_UNSPECIFIED; + case 2: + return INCIDENT; + 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 EventCategory findValueByNumber(int number) { + return EventCategory.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.servicehealth.v1.OrganizationEvent.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final EventCategory[] VALUES = values(); + + public static EventCategory 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 EventCategory(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.servicehealth.v1.OrganizationEvent.EventCategory) + } + + /** + * + * + *
+   * The detailed category of an event. Contains all possible states for all
+   * event categories.
+   * 
+ * + * Protobuf enum {@code google.cloud.servicehealth.v1.OrganizationEvent.DetailedCategory} + */ + public enum DetailedCategory implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified detailed category.
+     * 
+ * + * DETAILED_CATEGORY_UNSPECIFIED = 0; + */ + DETAILED_CATEGORY_UNSPECIFIED(0), + /** + * + * + *
+     * Indicates an event with category INCIDENT has a confirmed impact to at
+     * least one Google Cloud product.
+     * 
+ * + * CONFIRMED_INCIDENT = 1; + */ + CONFIRMED_INCIDENT(1), + /** + * + * + *
+     * Indicates an event with category INCIDENT is under investigation to
+     * determine if it has a confirmed impact on any Google Cloud products.
+     * 
+ * + * EMERGING_INCIDENT = 2; + */ + EMERGING_INCIDENT(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified detailed category.
+     * 
+ * + * DETAILED_CATEGORY_UNSPECIFIED = 0; + */ + public static final int DETAILED_CATEGORY_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Indicates an event with category INCIDENT has a confirmed impact to at
+     * least one Google Cloud product.
+     * 
+ * + * CONFIRMED_INCIDENT = 1; + */ + public static final int CONFIRMED_INCIDENT_VALUE = 1; + /** + * + * + *
+     * Indicates an event with category INCIDENT is under investigation to
+     * determine if it has a confirmed impact on any Google Cloud products.
+     * 
+ * + * EMERGING_INCIDENT = 2; + */ + public static final int EMERGING_INCIDENT_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static DetailedCategory 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 DetailedCategory forNumber(int value) { + switch (value) { + case 0: + return DETAILED_CATEGORY_UNSPECIFIED; + case 1: + return CONFIRMED_INCIDENT; + case 2: + return EMERGING_INCIDENT; + 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 DetailedCategory findValueByNumber(int number) { + return DetailedCategory.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.servicehealth.v1.OrganizationEvent.getDescriptor() + .getEnumTypes() + .get(1); + } + + private static final DetailedCategory[] VALUES = values(); + + public static DetailedCategory 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 DetailedCategory(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.servicehealth.v1.OrganizationEvent.DetailedCategory) + } + + /** + * + * + *
+   * The state of the organization event. This enum lists all possible states of
+   * event.
+   * 
+ * + * Protobuf enum {@code google.cloud.servicehealth.v1.OrganizationEvent.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified state.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * Event is actively affecting a Google Cloud product and will continue to
+     * receive updates.
+     * 
+ * + * ACTIVE = 1; + */ + ACTIVE(1), + /** + * + * + *
+     * Event is no longer affecting the Google Cloud product or has been merged
+     * with another event.
+     * 
+ * + * CLOSED = 2; + */ + CLOSED(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified state.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Event is actively affecting a Google Cloud product and will continue to
+     * receive updates.
+     * 
+ * + * ACTIVE = 1; + */ + public static final int ACTIVE_VALUE = 1; + /** + * + * + *
+     * Event is no longer affecting the Google Cloud product or has been merged
+     * with another event.
+     * 
+ * + * CLOSED = 2; + */ + public static final int CLOSED_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static 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 ACTIVE; + case 2: + return CLOSED; + 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.servicehealth.v1.OrganizationEvent.getDescriptor() + .getEnumTypes() + .get(2); + } + + 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.servicehealth.v1.OrganizationEvent.State) + } + + /** + * + * + *
+   * The detailed state of the incident. This enum lists all possible detailed
+   * states of an incident.
+   * 
+ * + * Protobuf enum {@code google.cloud.servicehealth.v1.OrganizationEvent.DetailedState} + */ + public enum DetailedState implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified detail state.
+     * 
+ * + * DETAILED_STATE_UNSPECIFIED = 0; + */ + DETAILED_STATE_UNSPECIFIED(0), + /** + * + * + *
+     * Google engineers are actively investigating the incident to determine the
+     * impact.
+     * 
+ * + * EMERGING = 1; + */ + EMERGING(1), + /** + * + * + *
+     * The incident is confirmed and impacting at least one Google Cloud
+     * product. Ongoing status updates will be provided until it is resolved.
+     * 
+ * + * CONFIRMED = 2; + */ + CONFIRMED(2), + /** + * + * + *
+     * The incident is no longer affecting any Google Cloud product, and there
+     * will be no further updates.
+     * 
+ * + * RESOLVED = 3; + */ + RESOLVED(3), + /** + * + * + *
+     * The incident was merged into a parent event. All further updates will be
+     * published to the parent only. The `parent_event` contains the name of the
+     * parent.
+     * 
+ * + * MERGED = 4; + */ + MERGED(4), + /** + * + * + *
+     * The incident was automatically closed because the issues couldn’t be
+     * confirmed or is no longer impacting Google Cloud Products and/or
+     * Locations.
+     * 
+ * + * AUTO_CLOSED = 9; + */ + AUTO_CLOSED(9), + /** + * + * + *
+     * The incident was verified as non-impactful. No further action required.
+     * 
+ * + * FALSE_POSITIVE = 10; + */ + FALSE_POSITIVE(10), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified detail state.
+     * 
+ * + * DETAILED_STATE_UNSPECIFIED = 0; + */ + public static final int DETAILED_STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Google engineers are actively investigating the incident to determine the
+     * impact.
+     * 
+ * + * EMERGING = 1; + */ + public static final int EMERGING_VALUE = 1; + /** + * + * + *
+     * The incident is confirmed and impacting at least one Google Cloud
+     * product. Ongoing status updates will be provided until it is resolved.
+     * 
+ * + * CONFIRMED = 2; + */ + public static final int CONFIRMED_VALUE = 2; + /** + * + * + *
+     * The incident is no longer affecting any Google Cloud product, and there
+     * will be no further updates.
+     * 
+ * + * RESOLVED = 3; + */ + public static final int RESOLVED_VALUE = 3; + /** + * + * + *
+     * The incident was merged into a parent event. All further updates will be
+     * published to the parent only. The `parent_event` contains the name of the
+     * parent.
+     * 
+ * + * MERGED = 4; + */ + public static final int MERGED_VALUE = 4; + /** + * + * + *
+     * The incident was automatically closed because the issues couldn’t be
+     * confirmed or is no longer impacting Google Cloud Products and/or
+     * Locations.
+     * 
+ * + * AUTO_CLOSED = 9; + */ + public static final int AUTO_CLOSED_VALUE = 9; + /** + * + * + *
+     * The incident was verified as non-impactful. No further action required.
+     * 
+ * + * FALSE_POSITIVE = 10; + */ + public static final int FALSE_POSITIVE_VALUE = 10; + + 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 DetailedState 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 DetailedState forNumber(int value) { + switch (value) { + case 0: + return DETAILED_STATE_UNSPECIFIED; + case 1: + return EMERGING; + case 2: + return CONFIRMED; + case 3: + return RESOLVED; + case 4: + return MERGED; + case 9: + return AUTO_CLOSED; + case 10: + return FALSE_POSITIVE; + 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 DetailedState findValueByNumber(int number) { + return DetailedState.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.servicehealth.v1.OrganizationEvent.getDescriptor() + .getEnumTypes() + .get(3); + } + + private static final DetailedState[] VALUES = values(); + + public static DetailedState 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 DetailedState(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.servicehealth.v1.OrganizationEvent.DetailedState) + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Output only. Identifier. Name of the event. Unique name of the event in
+   * this scope including organization ID and location using the form
+   * `organizations/{organization_id}/locations/{location}/organizationEvents/{event_id}`.
+   *
+   * `organization_id` - see [Getting your organization resource
+   * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).<br>
+   * `location` - The location to get the service health events from.<br>
+   * `event_id` - Organization event ID to retrieve.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.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; + } + } + /** + * + * + *
+   * Output only. Identifier. Name of the event. Unique name of the event in
+   * this scope including organization ID and location using the form
+   * `organizations/{organization_id}/locations/{location}/organizationEvents/{event_id}`.
+   *
+   * `organization_id` - see [Getting your organization resource
+   * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).<br>
+   * `location` - The location to get the service health events from.<br>
+   * `event_id` - Organization event ID to retrieve.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.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 TITLE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object title_ = ""; + /** + * + * + *
+   * Output only. Brief description for the event.
+   * 
+ * + * 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. Brief description for the event.
+   * 
+ * + * 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. Free-form, human-readable description.
+   * 
+ * + * 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. Free-form, human-readable description.
+   * 
+ * + * 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 event.
+   * 
+ * + * + * .google.cloud.servicehealth.v1.OrganizationEvent.EventCategory 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 event.
+   * 
+ * + * + * .google.cloud.servicehealth.v1.OrganizationEvent.EventCategory category = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The category. + */ + @java.lang.Override + public com.google.cloud.servicehealth.v1.OrganizationEvent.EventCategory getCategory() { + com.google.cloud.servicehealth.v1.OrganizationEvent.EventCategory result = + com.google.cloud.servicehealth.v1.OrganizationEvent.EventCategory.forNumber(category_); + return result == null + ? com.google.cloud.servicehealth.v1.OrganizationEvent.EventCategory.UNRECOGNIZED + : result; + } + + public static final int DETAILED_CATEGORY_FIELD_NUMBER = 17; + private int detailedCategory_ = 0; + /** + * + * + *
+   * Output only. The detailed category of the event.
+   * 
+ * + * + * .google.cloud.servicehealth.v1.OrganizationEvent.DetailedCategory detailed_category = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for detailedCategory. + */ + @java.lang.Override + public int getDetailedCategoryValue() { + return detailedCategory_; + } + /** + * + * + *
+   * Output only. The detailed category of the event.
+   * 
+ * + * + * .google.cloud.servicehealth.v1.OrganizationEvent.DetailedCategory detailed_category = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The detailedCategory. + */ + @java.lang.Override + public com.google.cloud.servicehealth.v1.OrganizationEvent.DetailedCategory + getDetailedCategory() { + com.google.cloud.servicehealth.v1.OrganizationEvent.DetailedCategory result = + com.google.cloud.servicehealth.v1.OrganizationEvent.DetailedCategory.forNumber( + detailedCategory_); + return result == null + ? com.google.cloud.servicehealth.v1.OrganizationEvent.DetailedCategory.UNRECOGNIZED + : result; + } + + public static final int STATE_FIELD_NUMBER = 5; + private int state_ = 0; + /** + * + * + *
+   * Output only. The current state of the event.
+   * 
+ * + * + * .google.cloud.servicehealth.v1.OrganizationEvent.State state = 5 [(.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 current state of the event.
+   * 
+ * + * + * .google.cloud.servicehealth.v1.OrganizationEvent.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.servicehealth.v1.OrganizationEvent.State getState() { + com.google.cloud.servicehealth.v1.OrganizationEvent.State result = + com.google.cloud.servicehealth.v1.OrganizationEvent.State.forNumber(state_); + return result == null + ? com.google.cloud.servicehealth.v1.OrganizationEvent.State.UNRECOGNIZED + : result; + } + + public static final int DETAILED_STATE_FIELD_NUMBER = 16; + private int detailedState_ = 0; + /** + * + * + *
+   * Output only. The current detailed state of the incident.
+   * 
+ * + * + * .google.cloud.servicehealth.v1.OrganizationEvent.DetailedState detailed_state = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for detailedState. + */ + @java.lang.Override + public int getDetailedStateValue() { + return detailedState_; + } + /** + * + * + *
+   * Output only. The current detailed state of the incident.
+   * 
+ * + * + * .google.cloud.servicehealth.v1.OrganizationEvent.DetailedState detailed_state = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The detailedState. + */ + @java.lang.Override + public com.google.cloud.servicehealth.v1.OrganizationEvent.DetailedState getDetailedState() { + com.google.cloud.servicehealth.v1.OrganizationEvent.DetailedState result = + com.google.cloud.servicehealth.v1.OrganizationEvent.DetailedState.forNumber(detailedState_); + return result == null + ? com.google.cloud.servicehealth.v1.OrganizationEvent.DetailedState.UNRECOGNIZED + : result; + } + + public static final int EVENT_IMPACTS_FIELD_NUMBER = 15; + + @SuppressWarnings("serial") + private java.util.List eventImpacts_; + /** + * + * + *
+   * Output only. Represents the Google Cloud products and locations impacted by
+   * the event.
+   * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventImpact event_impacts = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List getEventImpactsList() { + return eventImpacts_; + } + /** + * + * + *
+   * Output only. Represents the Google Cloud products and locations impacted by
+   * the event.
+   * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventImpact event_impacts = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getEventImpactsOrBuilderList() { + return eventImpacts_; + } + /** + * + * + *
+   * Output only. Represents the Google Cloud products and locations impacted by
+   * the event.
+   * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventImpact event_impacts = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getEventImpactsCount() { + return eventImpacts_.size(); + } + /** + * + * + *
+   * Output only. Represents the Google Cloud products and locations impacted by
+   * the event.
+   * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventImpact event_impacts = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.servicehealth.v1.EventImpact getEventImpacts(int index) { + return eventImpacts_.get(index); + } + /** + * + * + *
+   * Output only. Represents the Google Cloud products and locations impacted by
+   * the event.
+   * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventImpact event_impacts = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.servicehealth.v1.EventImpactOrBuilder getEventImpactsOrBuilder( + int index) { + return eventImpacts_.get(index); + } + + public static final int UPDATES_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private java.util.List updates_; + /** + * + * + *
+   * Output only. Incident-only field. Event updates are correspondence from
+   * Google.
+   * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventUpdate updates = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List getUpdatesList() { + return updates_; + } + /** + * + * + *
+   * Output only. Incident-only field. Event updates are correspondence from
+   * Google.
+   * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventUpdate updates = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getUpdatesOrBuilderList() { + return updates_; + } + /** + * + * + *
+   * Output only. Incident-only field. Event updates are correspondence from
+   * Google.
+   * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventUpdate updates = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getUpdatesCount() { + return updates_.size(); + } + /** + * + * + *
+   * Output only. Incident-only field. Event updates are correspondence from
+   * Google.
+   * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventUpdate updates = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.servicehealth.v1.EventUpdate getUpdates(int index) { + return updates_.get(index); + } + /** + * + * + *
+   * Output only. Incident-only field. Event updates are correspondence from
+   * Google.
+   * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventUpdate updates = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.servicehealth.v1.EventUpdateOrBuilder getUpdatesOrBuilder(int index) { + return updates_.get(index); + } + + public static final int PARENT_EVENT_FIELD_NUMBER = 9; + + @SuppressWarnings("serial") + private volatile java.lang.Object parentEvent_ = ""; + /** + * + * + *
+   * Output only. When `detailed_state`=`MERGED`, `parent_event` contains the
+   * name of the parent event. All further updates will be published to the
+   * parent event.
+   * 
+ * + * string parent_event = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The parentEvent. + */ + @java.lang.Override + public java.lang.String getParentEvent() { + java.lang.Object ref = parentEvent_; + 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(); + parentEvent_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. When `detailed_state`=`MERGED`, `parent_event` contains the
+   * name of the parent event. All further updates will be published to the
+   * parent event.
+   * 
+ * + * string parent_event = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for parentEvent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentEventBytes() { + java.lang.Object ref = parentEvent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parentEvent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 11; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. The time the update was posted.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Output only. The time the update was posted.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 11 [(.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 time the update was posted.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 11 [(.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 START_TIME_FIELD_NUMBER = 12; + private com.google.protobuf.Timestamp startTime_; + /** + * + * + *
+   * Output only. The start time of the event, if applicable.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the startTime field is set. + */ + @java.lang.Override + public boolean hasStartTime() { + return startTime_ != null; + } + /** + * + * + *
+   * Output only. The start time of the event, if applicable.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The startTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + /** + * + * + *
+   * Output only. The start time of the event, if applicable.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + public static final int END_TIME_FIELD_NUMBER = 13; + private com.google.protobuf.Timestamp endTime_; + /** + * + * + *
+   * Output only. The end time of the event, if applicable.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return endTime_ != null; + } + /** + * + * + *
+   * Output only. The end time of the event, if applicable.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + /** + * + * + *
+   * Output only. The end time of the event, if applicable.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + public static final int NEXT_UPDATE_TIME_FIELD_NUMBER = 14; + private com.google.protobuf.Timestamp nextUpdateTime_; + /** + * + * + *
+   * Output only. Incident-only field. The time when the next update can be
+   * expected.
+   * 
+ * + * + * .google.protobuf.Timestamp next_update_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the nextUpdateTime field is set. + */ + @java.lang.Override + public boolean hasNextUpdateTime() { + return nextUpdateTime_ != null; + } + /** + * + * + *
+   * Output only. Incident-only field. The time when the next update can be
+   * expected.
+   * 
+ * + * + * .google.protobuf.Timestamp next_update_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The nextUpdateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getNextUpdateTime() { + return nextUpdateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : nextUpdateTime_; + } + /** + * + * + *
+   * Output only. Incident-only field. The time when the next update can be
+   * expected.
+   * 
+ * + * + * .google.protobuf.Timestamp next_update_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getNextUpdateTimeOrBuilder() { + return nextUpdateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : nextUpdateTime_; + } + + 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 (!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.servicehealth.v1.OrganizationEvent.EventCategory + .EVENT_CATEGORY_UNSPECIFIED + .getNumber()) { + output.writeEnum(4, category_); + } + if (state_ + != com.google.cloud.servicehealth.v1.OrganizationEvent.State.STATE_UNSPECIFIED + .getNumber()) { + output.writeEnum(5, state_); + } + for (int i = 0; i < updates_.size(); i++) { + output.writeMessage(8, updates_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parentEvent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 9, parentEvent_); + } + if (updateTime_ != null) { + output.writeMessage(11, getUpdateTime()); + } + if (startTime_ != null) { + output.writeMessage(12, getStartTime()); + } + if (endTime_ != null) { + output.writeMessage(13, getEndTime()); + } + if (nextUpdateTime_ != null) { + output.writeMessage(14, getNextUpdateTime()); + } + for (int i = 0; i < eventImpacts_.size(); i++) { + output.writeMessage(15, eventImpacts_.get(i)); + } + if (detailedState_ + != com.google.cloud.servicehealth.v1.OrganizationEvent.DetailedState + .DETAILED_STATE_UNSPECIFIED + .getNumber()) { + output.writeEnum(16, detailedState_); + } + if (detailedCategory_ + != com.google.cloud.servicehealth.v1.OrganizationEvent.DetailedCategory + .DETAILED_CATEGORY_UNSPECIFIED + .getNumber()) { + output.writeEnum(17, detailedCategory_); + } + 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 (!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.servicehealth.v1.OrganizationEvent.EventCategory + .EVENT_CATEGORY_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, category_); + } + if (state_ + != com.google.cloud.servicehealth.v1.OrganizationEvent.State.STATE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, state_); + } + for (int i = 0; i < updates_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, updates_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parentEvent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, parentEvent_); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, getUpdateTime()); + } + if (startTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, getStartTime()); + } + if (endTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(13, getEndTime()); + } + if (nextUpdateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(14, getNextUpdateTime()); + } + for (int i = 0; i < eventImpacts_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(15, eventImpacts_.get(i)); + } + if (detailedState_ + != com.google.cloud.servicehealth.v1.OrganizationEvent.DetailedState + .DETAILED_STATE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(16, detailedState_); + } + if (detailedCategory_ + != com.google.cloud.servicehealth.v1.OrganizationEvent.DetailedCategory + .DETAILED_CATEGORY_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(17, detailedCategory_); + } + 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.servicehealth.v1.OrganizationEvent)) { + return super.equals(obj); + } + com.google.cloud.servicehealth.v1.OrganizationEvent other = + (com.google.cloud.servicehealth.v1.OrganizationEvent) obj; + + if (!getName().equals(other.getName())) return false; + if (!getTitle().equals(other.getTitle())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (category_ != other.category_) return false; + if (detailedCategory_ != other.detailedCategory_) return false; + if (state_ != other.state_) return false; + if (detailedState_ != other.detailedState_) return false; + if (!getEventImpactsList().equals(other.getEventImpactsList())) return false; + if (!getUpdatesList().equals(other.getUpdatesList())) return false; + if (!getParentEvent().equals(other.getParentEvent())) return false; + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (hasStartTime() != other.hasStartTime()) return false; + if (hasStartTime()) { + if (!getStartTime().equals(other.getStartTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (hasNextUpdateTime() != other.hasNextUpdateTime()) return false; + if (hasNextUpdateTime()) { + if (!getNextUpdateTime().equals(other.getNextUpdateTime())) 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 = (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 = (37 * hash) + DETAILED_CATEGORY_FIELD_NUMBER; + hash = (53 * hash) + detailedCategory_; + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + DETAILED_STATE_FIELD_NUMBER; + hash = (53 * hash) + detailedState_; + if (getEventImpactsCount() > 0) { + hash = (37 * hash) + EVENT_IMPACTS_FIELD_NUMBER; + hash = (53 * hash) + getEventImpactsList().hashCode(); + } + if (getUpdatesCount() > 0) { + hash = (37 * hash) + UPDATES_FIELD_NUMBER; + hash = (53 * hash) + getUpdatesList().hashCode(); + } + hash = (37 * hash) + PARENT_EVENT_FIELD_NUMBER; + hash = (53 * hash) + getParentEvent().hashCode(); + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + if (hasStartTime()) { + hash = (37 * hash) + START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStartTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + if (hasNextUpdateTime()) { + hash = (37 * hash) + NEXT_UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getNextUpdateTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.servicehealth.v1.OrganizationEvent parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicehealth.v1.OrganizationEvent 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.servicehealth.v1.OrganizationEvent parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicehealth.v1.OrganizationEvent 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.servicehealth.v1.OrganizationEvent parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicehealth.v1.OrganizationEvent parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.servicehealth.v1.OrganizationEvent parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicehealth.v1.OrganizationEvent 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.servicehealth.v1.OrganizationEvent parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicehealth.v1.OrganizationEvent 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.servicehealth.v1.OrganizationEvent parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicehealth.v1.OrganizationEvent 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.servicehealth.v1.OrganizationEvent 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; + } + /** + * + * + *
+   * Represents service health events that may affect Google Cloud products used
+   * across the organization. It is a read-only view and does not allow any
+   * modifications.
+   * 
+ * + * Protobuf type {@code google.cloud.servicehealth.v1.OrganizationEvent} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicehealth.v1.OrganizationEvent) + com.google.cloud.servicehealth.v1.OrganizationEventOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_OrganizationEvent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_OrganizationEvent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicehealth.v1.OrganizationEvent.class, + com.google.cloud.servicehealth.v1.OrganizationEvent.Builder.class); + } + + // Construct using com.google.cloud.servicehealth.v1.OrganizationEvent.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + title_ = ""; + description_ = ""; + category_ = 0; + detailedCategory_ = 0; + state_ = 0; + detailedState_ = 0; + if (eventImpactsBuilder_ == null) { + eventImpacts_ = java.util.Collections.emptyList(); + } else { + eventImpacts_ = null; + eventImpactsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000080); + if (updatesBuilder_ == null) { + updates_ = java.util.Collections.emptyList(); + } else { + updates_ = null; + updatesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000100); + parentEvent_ = ""; + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + nextUpdateTime_ = null; + if (nextUpdateTimeBuilder_ != null) { + nextUpdateTimeBuilder_.dispose(); + nextUpdateTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_OrganizationEvent_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicehealth.v1.OrganizationEvent getDefaultInstanceForType() { + return com.google.cloud.servicehealth.v1.OrganizationEvent.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicehealth.v1.OrganizationEvent build() { + com.google.cloud.servicehealth.v1.OrganizationEvent result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicehealth.v1.OrganizationEvent buildPartial() { + com.google.cloud.servicehealth.v1.OrganizationEvent result = + new com.google.cloud.servicehealth.v1.OrganizationEvent(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.servicehealth.v1.OrganizationEvent result) { + if (eventImpactsBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0)) { + eventImpacts_ = java.util.Collections.unmodifiableList(eventImpacts_); + bitField0_ = (bitField0_ & ~0x00000080); + } + result.eventImpacts_ = eventImpacts_; + } else { + result.eventImpacts_ = eventImpactsBuilder_.build(); + } + if (updatesBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0)) { + updates_ = java.util.Collections.unmodifiableList(updates_); + bitField0_ = (bitField0_ & ~0x00000100); + } + result.updates_ = updates_; + } else { + result.updates_ = updatesBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.servicehealth.v1.OrganizationEvent result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.title_ = title_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.description_ = description_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.category_ = category_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.detailedCategory_ = detailedCategory_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.state_ = state_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.detailedState_ = detailedState_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.parentEvent_ = parentEvent_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.startTime_ = startTimeBuilder_ == null ? startTime_ : startTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.endTime_ = endTimeBuilder_ == null ? endTime_ : endTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.nextUpdateTime_ = + nextUpdateTimeBuilder_ == null ? nextUpdateTime_ : nextUpdateTimeBuilder_.build(); + } + } + + @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.servicehealth.v1.OrganizationEvent) { + return mergeFrom((com.google.cloud.servicehealth.v1.OrganizationEvent) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.servicehealth.v1.OrganizationEvent other) { + if (other == com.google.cloud.servicehealth.v1.OrganizationEvent.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + 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.detailedCategory_ != 0) { + setDetailedCategoryValue(other.getDetailedCategoryValue()); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (other.detailedState_ != 0) { + setDetailedStateValue(other.getDetailedStateValue()); + } + if (eventImpactsBuilder_ == null) { + if (!other.eventImpacts_.isEmpty()) { + if (eventImpacts_.isEmpty()) { + eventImpacts_ = other.eventImpacts_; + bitField0_ = (bitField0_ & ~0x00000080); + } else { + ensureEventImpactsIsMutable(); + eventImpacts_.addAll(other.eventImpacts_); + } + onChanged(); + } + } else { + if (!other.eventImpacts_.isEmpty()) { + if (eventImpactsBuilder_.isEmpty()) { + eventImpactsBuilder_.dispose(); + eventImpactsBuilder_ = null; + eventImpacts_ = other.eventImpacts_; + bitField0_ = (bitField0_ & ~0x00000080); + eventImpactsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getEventImpactsFieldBuilder() + : null; + } else { + eventImpactsBuilder_.addAllMessages(other.eventImpacts_); + } + } + } + if (updatesBuilder_ == null) { + if (!other.updates_.isEmpty()) { + if (updates_.isEmpty()) { + updates_ = other.updates_; + bitField0_ = (bitField0_ & ~0x00000100); + } else { + ensureUpdatesIsMutable(); + updates_.addAll(other.updates_); + } + onChanged(); + } + } else { + if (!other.updates_.isEmpty()) { + if (updatesBuilder_.isEmpty()) { + updatesBuilder_.dispose(); + updatesBuilder_ = null; + updates_ = other.updates_; + bitField0_ = (bitField0_ & ~0x00000100); + updatesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getUpdatesFieldBuilder() + : null; + } else { + updatesBuilder_.addAllMessages(other.updates_); + } + } + } + if (!other.getParentEvent().isEmpty()) { + parentEvent_ = other.parentEvent_; + bitField0_ |= 0x00000200; + onChanged(); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + if (other.hasNextUpdateTime()) { + mergeNextUpdateTime(other.getNextUpdateTime()); + } + 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: + { + 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 + case 40: + { + state_ = input.readEnum(); + bitField0_ |= 0x00000020; + break; + } // case 40 + case 66: + { + com.google.cloud.servicehealth.v1.EventUpdate m = + input.readMessage( + com.google.cloud.servicehealth.v1.EventUpdate.parser(), extensionRegistry); + if (updatesBuilder_ == null) { + ensureUpdatesIsMutable(); + updates_.add(m); + } else { + updatesBuilder_.addMessage(m); + } + break; + } // case 66 + case 74: + { + parentEvent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000200; + break; + } // case 74 + case 90: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000400; + break; + } // case 90 + case 98: + { + input.readMessage(getStartTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000800; + break; + } // case 98 + case 106: + { + input.readMessage(getEndTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00001000; + break; + } // case 106 + case 114: + { + input.readMessage(getNextUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00002000; + break; + } // case 114 + case 122: + { + com.google.cloud.servicehealth.v1.EventImpact m = + input.readMessage( + com.google.cloud.servicehealth.v1.EventImpact.parser(), extensionRegistry); + if (eventImpactsBuilder_ == null) { + ensureEventImpactsIsMutable(); + eventImpacts_.add(m); + } else { + eventImpactsBuilder_.addMessage(m); + } + break; + } // case 122 + case 128: + { + detailedState_ = input.readEnum(); + bitField0_ |= 0x00000040; + break; + } // case 128 + case 136: + { + detailedCategory_ = input.readEnum(); + bitField0_ |= 0x00000010; + break; + } // case 136 + 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_ = ""; + /** + * + * + *
+     * Output only. Identifier. Name of the event. Unique name of the event in
+     * this scope including organization ID and location using the form
+     * `organizations/{organization_id}/locations/{location}/organizationEvents/{event_id}`.
+     *
+     * `organization_id` - see [Getting your organization resource
+     * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).<br>
+     * `location` - The location to get the service health events from.<br>
+     * `event_id` - Organization event ID to retrieve.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.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; + } + } + /** + * + * + *
+     * Output only. Identifier. Name of the event. Unique name of the event in
+     * this scope including organization ID and location using the form
+     * `organizations/{organization_id}/locations/{location}/organizationEvents/{event_id}`.
+     *
+     * `organization_id` - see [Getting your organization resource
+     * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).<br>
+     * `location` - The location to get the service health events from.<br>
+     * `event_id` - Organization event ID to retrieve.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.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; + } + } + /** + * + * + *
+     * Output only. Identifier. Name of the event. Unique name of the event in
+     * this scope including organization ID and location using the form
+     * `organizations/{organization_id}/locations/{location}/organizationEvents/{event_id}`.
+     *
+     * `organization_id` - see [Getting your organization resource
+     * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).<br>
+     * `location` - The location to get the service health events from.<br>
+     * `event_id` - Organization event ID to retrieve.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.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; + } + /** + * + * + *
+     * Output only. Identifier. Name of the event. Unique name of the event in
+     * this scope including organization ID and location using the form
+     * `organizations/{organization_id}/locations/{location}/organizationEvents/{event_id}`.
+     *
+     * `organization_id` - see [Getting your organization resource
+     * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).<br>
+     * `location` - The location to get the service health events from.<br>
+     * `event_id` - Organization event ID to retrieve.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Identifier. Name of the event. Unique name of the event in
+     * this scope including organization ID and location using the form
+     * `organizations/{organization_id}/locations/{location}/organizationEvents/{event_id}`.
+     *
+     * `organization_id` - see [Getting your organization resource
+     * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).<br>
+     * `location` - The location to get the service health events from.<br>
+     * `event_id` - Organization event ID to retrieve.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.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 java.lang.Object title_ = ""; + /** + * + * + *
+     * Output only. Brief description for the event.
+     * 
+ * + * 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. Brief description for the event.
+     * 
+ * + * 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. Brief description for the event.
+     * 
+ * + * 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. Brief description for the event.
+     * 
+ * + * 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. Brief description for the event.
+     * 
+ * + * 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. Free-form, human-readable description.
+     * 
+ * + * 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. Free-form, human-readable description.
+     * 
+ * + * 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. Free-form, human-readable description.
+     * 
+ * + * 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. Free-form, human-readable description.
+     * 
+ * + * 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. Free-form, human-readable description.
+     * 
+ * + * 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 event.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.OrganizationEvent.EventCategory 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 event.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.OrganizationEvent.EventCategory 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 event.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.OrganizationEvent.EventCategory category = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The category. + */ + @java.lang.Override + public com.google.cloud.servicehealth.v1.OrganizationEvent.EventCategory getCategory() { + com.google.cloud.servicehealth.v1.OrganizationEvent.EventCategory result = + com.google.cloud.servicehealth.v1.OrganizationEvent.EventCategory.forNumber(category_); + return result == null + ? com.google.cloud.servicehealth.v1.OrganizationEvent.EventCategory.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. The category of the event.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.OrganizationEvent.EventCategory 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.servicehealth.v1.OrganizationEvent.EventCategory value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + category_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The category of the event.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.OrganizationEvent.EventCategory category = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearCategory() { + bitField0_ = (bitField0_ & ~0x00000008); + category_ = 0; + onChanged(); + return this; + } + + private int detailedCategory_ = 0; + /** + * + * + *
+     * Output only. The detailed category of the event.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.OrganizationEvent.DetailedCategory detailed_category = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for detailedCategory. + */ + @java.lang.Override + public int getDetailedCategoryValue() { + return detailedCategory_; + } + /** + * + * + *
+     * Output only. The detailed category of the event.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.OrganizationEvent.DetailedCategory detailed_category = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for detailedCategory to set. + * @return This builder for chaining. + */ + public Builder setDetailedCategoryValue(int value) { + detailedCategory_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The detailed category of the event.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.OrganizationEvent.DetailedCategory detailed_category = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The detailedCategory. + */ + @java.lang.Override + public com.google.cloud.servicehealth.v1.OrganizationEvent.DetailedCategory + getDetailedCategory() { + com.google.cloud.servicehealth.v1.OrganizationEvent.DetailedCategory result = + com.google.cloud.servicehealth.v1.OrganizationEvent.DetailedCategory.forNumber( + detailedCategory_); + return result == null + ? com.google.cloud.servicehealth.v1.OrganizationEvent.DetailedCategory.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. The detailed category of the event.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.OrganizationEvent.DetailedCategory detailed_category = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The detailedCategory to set. + * @return This builder for chaining. + */ + public Builder setDetailedCategory( + com.google.cloud.servicehealth.v1.OrganizationEvent.DetailedCategory value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + detailedCategory_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The detailed category of the event.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.OrganizationEvent.DetailedCategory detailed_category = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearDetailedCategory() { + bitField0_ = (bitField0_ & ~0x00000010); + detailedCategory_ = 0; + onChanged(); + return this; + } + + private int state_ = 0; + /** + * + * + *
+     * Output only. The current state of the event.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.OrganizationEvent.State state = 5 [(.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 current state of the event.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.OrganizationEvent.State state = 5 [(.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_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The current state of the event.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.OrganizationEvent.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.servicehealth.v1.OrganizationEvent.State getState() { + com.google.cloud.servicehealth.v1.OrganizationEvent.State result = + com.google.cloud.servicehealth.v1.OrganizationEvent.State.forNumber(state_); + return result == null + ? com.google.cloud.servicehealth.v1.OrganizationEvent.State.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. The current state of the event.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.OrganizationEvent.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.servicehealth.v1.OrganizationEvent.State value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The current state of the event.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.OrganizationEvent.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + bitField0_ = (bitField0_ & ~0x00000020); + state_ = 0; + onChanged(); + return this; + } + + private int detailedState_ = 0; + /** + * + * + *
+     * Output only. The current detailed state of the incident.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.OrganizationEvent.DetailedState detailed_state = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for detailedState. + */ + @java.lang.Override + public int getDetailedStateValue() { + return detailedState_; + } + /** + * + * + *
+     * Output only. The current detailed state of the incident.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.OrganizationEvent.DetailedState detailed_state = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for detailedState to set. + * @return This builder for chaining. + */ + public Builder setDetailedStateValue(int value) { + detailedState_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The current detailed state of the incident.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.OrganizationEvent.DetailedState detailed_state = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The detailedState. + */ + @java.lang.Override + public com.google.cloud.servicehealth.v1.OrganizationEvent.DetailedState getDetailedState() { + com.google.cloud.servicehealth.v1.OrganizationEvent.DetailedState result = + com.google.cloud.servicehealth.v1.OrganizationEvent.DetailedState.forNumber( + detailedState_); + return result == null + ? com.google.cloud.servicehealth.v1.OrganizationEvent.DetailedState.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. The current detailed state of the incident.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.OrganizationEvent.DetailedState detailed_state = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The detailedState to set. + * @return This builder for chaining. + */ + public Builder setDetailedState( + com.google.cloud.servicehealth.v1.OrganizationEvent.DetailedState value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000040; + detailedState_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The current detailed state of the incident.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.OrganizationEvent.DetailedState detailed_state = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearDetailedState() { + bitField0_ = (bitField0_ & ~0x00000040); + detailedState_ = 0; + onChanged(); + return this; + } + + private java.util.List eventImpacts_ = + java.util.Collections.emptyList(); + + private void ensureEventImpactsIsMutable() { + if (!((bitField0_ & 0x00000080) != 0)) { + eventImpacts_ = + new java.util.ArrayList(eventImpacts_); + bitField0_ |= 0x00000080; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.servicehealth.v1.EventImpact, + com.google.cloud.servicehealth.v1.EventImpact.Builder, + com.google.cloud.servicehealth.v1.EventImpactOrBuilder> + eventImpactsBuilder_; + + /** + * + * + *
+     * Output only. Represents the Google Cloud products and locations impacted by
+     * the event.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventImpact event_impacts = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getEventImpactsList() { + if (eventImpactsBuilder_ == null) { + return java.util.Collections.unmodifiableList(eventImpacts_); + } else { + return eventImpactsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Output only. Represents the Google Cloud products and locations impacted by
+     * the event.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventImpact event_impacts = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getEventImpactsCount() { + if (eventImpactsBuilder_ == null) { + return eventImpacts_.size(); + } else { + return eventImpactsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Output only. Represents the Google Cloud products and locations impacted by
+     * the event.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventImpact event_impacts = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.servicehealth.v1.EventImpact getEventImpacts(int index) { + if (eventImpactsBuilder_ == null) { + return eventImpacts_.get(index); + } else { + return eventImpactsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Output only. Represents the Google Cloud products and locations impacted by
+     * the event.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventImpact event_impacts = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEventImpacts(int index, com.google.cloud.servicehealth.v1.EventImpact value) { + if (eventImpactsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEventImpactsIsMutable(); + eventImpacts_.set(index, value); + onChanged(); + } else { + eventImpactsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. Represents the Google Cloud products and locations impacted by
+     * the event.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventImpact event_impacts = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEventImpacts( + int index, com.google.cloud.servicehealth.v1.EventImpact.Builder builderForValue) { + if (eventImpactsBuilder_ == null) { + ensureEventImpactsIsMutable(); + eventImpacts_.set(index, builderForValue.build()); + onChanged(); + } else { + eventImpactsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Represents the Google Cloud products and locations impacted by
+     * the event.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventImpact event_impacts = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addEventImpacts(com.google.cloud.servicehealth.v1.EventImpact value) { + if (eventImpactsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEventImpactsIsMutable(); + eventImpacts_.add(value); + onChanged(); + } else { + eventImpactsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Output only. Represents the Google Cloud products and locations impacted by
+     * the event.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventImpact event_impacts = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addEventImpacts(int index, com.google.cloud.servicehealth.v1.EventImpact value) { + if (eventImpactsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEventImpactsIsMutable(); + eventImpacts_.add(index, value); + onChanged(); + } else { + eventImpactsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. Represents the Google Cloud products and locations impacted by
+     * the event.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventImpact event_impacts = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addEventImpacts( + com.google.cloud.servicehealth.v1.EventImpact.Builder builderForValue) { + if (eventImpactsBuilder_ == null) { + ensureEventImpactsIsMutable(); + eventImpacts_.add(builderForValue.build()); + onChanged(); + } else { + eventImpactsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Represents the Google Cloud products and locations impacted by
+     * the event.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventImpact event_impacts = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addEventImpacts( + int index, com.google.cloud.servicehealth.v1.EventImpact.Builder builderForValue) { + if (eventImpactsBuilder_ == null) { + ensureEventImpactsIsMutable(); + eventImpacts_.add(index, builderForValue.build()); + onChanged(); + } else { + eventImpactsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Represents the Google Cloud products and locations impacted by
+     * the event.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventImpact event_impacts = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllEventImpacts( + java.lang.Iterable values) { + if (eventImpactsBuilder_ == null) { + ensureEventImpactsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, eventImpacts_); + onChanged(); + } else { + eventImpactsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Output only. Represents the Google Cloud products and locations impacted by
+     * the event.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventImpact event_impacts = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearEventImpacts() { + if (eventImpactsBuilder_ == null) { + eventImpacts_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + } else { + eventImpactsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. Represents the Google Cloud products and locations impacted by
+     * the event.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventImpact event_impacts = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeEventImpacts(int index) { + if (eventImpactsBuilder_ == null) { + ensureEventImpactsIsMutable(); + eventImpacts_.remove(index); + onChanged(); + } else { + eventImpactsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Output only. Represents the Google Cloud products and locations impacted by
+     * the event.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventImpact event_impacts = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.servicehealth.v1.EventImpact.Builder getEventImpactsBuilder(int index) { + return getEventImpactsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Output only. Represents the Google Cloud products and locations impacted by
+     * the event.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventImpact event_impacts = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.servicehealth.v1.EventImpactOrBuilder getEventImpactsOrBuilder( + int index) { + if (eventImpactsBuilder_ == null) { + return eventImpacts_.get(index); + } else { + return eventImpactsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Output only. Represents the Google Cloud products and locations impacted by
+     * the event.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventImpact event_impacts = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getEventImpactsOrBuilderList() { + if (eventImpactsBuilder_ != null) { + return eventImpactsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(eventImpacts_); + } + } + /** + * + * + *
+     * Output only. Represents the Google Cloud products and locations impacted by
+     * the event.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventImpact event_impacts = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.servicehealth.v1.EventImpact.Builder addEventImpactsBuilder() { + return getEventImpactsFieldBuilder() + .addBuilder(com.google.cloud.servicehealth.v1.EventImpact.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. Represents the Google Cloud products and locations impacted by
+     * the event.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventImpact event_impacts = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.servicehealth.v1.EventImpact.Builder addEventImpactsBuilder(int index) { + return getEventImpactsFieldBuilder() + .addBuilder(index, com.google.cloud.servicehealth.v1.EventImpact.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. Represents the Google Cloud products and locations impacted by
+     * the event.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventImpact event_impacts = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getEventImpactsBuilderList() { + return getEventImpactsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.servicehealth.v1.EventImpact, + com.google.cloud.servicehealth.v1.EventImpact.Builder, + com.google.cloud.servicehealth.v1.EventImpactOrBuilder> + getEventImpactsFieldBuilder() { + if (eventImpactsBuilder_ == null) { + eventImpactsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.servicehealth.v1.EventImpact, + com.google.cloud.servicehealth.v1.EventImpact.Builder, + com.google.cloud.servicehealth.v1.EventImpactOrBuilder>( + eventImpacts_, ((bitField0_ & 0x00000080) != 0), getParentForChildren(), isClean()); + eventImpacts_ = null; + } + return eventImpactsBuilder_; + } + + private java.util.List updates_ = + java.util.Collections.emptyList(); + + private void ensureUpdatesIsMutable() { + if (!((bitField0_ & 0x00000100) != 0)) { + updates_ = new java.util.ArrayList(updates_); + bitField0_ |= 0x00000100; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.servicehealth.v1.EventUpdate, + com.google.cloud.servicehealth.v1.EventUpdate.Builder, + com.google.cloud.servicehealth.v1.EventUpdateOrBuilder> + updatesBuilder_; + + /** + * + * + *
+     * Output only. Incident-only field. Event updates are correspondence from
+     * Google.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventUpdate updates = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getUpdatesList() { + if (updatesBuilder_ == null) { + return java.util.Collections.unmodifiableList(updates_); + } else { + return updatesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Output only. Incident-only field. Event updates are correspondence from
+     * Google.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventUpdate updates = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getUpdatesCount() { + if (updatesBuilder_ == null) { + return updates_.size(); + } else { + return updatesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Output only. Incident-only field. Event updates are correspondence from
+     * Google.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventUpdate updates = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.servicehealth.v1.EventUpdate getUpdates(int index) { + if (updatesBuilder_ == null) { + return updates_.get(index); + } else { + return updatesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Output only. Incident-only field. Event updates are correspondence from
+     * Google.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventUpdate updates = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdates(int index, com.google.cloud.servicehealth.v1.EventUpdate value) { + if (updatesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureUpdatesIsMutable(); + updates_.set(index, value); + onChanged(); + } else { + updatesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. Incident-only field. Event updates are correspondence from
+     * Google.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventUpdate updates = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdates( + int index, com.google.cloud.servicehealth.v1.EventUpdate.Builder builderForValue) { + if (updatesBuilder_ == null) { + ensureUpdatesIsMutable(); + updates_.set(index, builderForValue.build()); + onChanged(); + } else { + updatesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Incident-only field. Event updates are correspondence from
+     * Google.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventUpdate updates = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addUpdates(com.google.cloud.servicehealth.v1.EventUpdate value) { + if (updatesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureUpdatesIsMutable(); + updates_.add(value); + onChanged(); + } else { + updatesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Output only. Incident-only field. Event updates are correspondence from
+     * Google.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventUpdate updates = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addUpdates(int index, com.google.cloud.servicehealth.v1.EventUpdate value) { + if (updatesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureUpdatesIsMutable(); + updates_.add(index, value); + onChanged(); + } else { + updatesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. Incident-only field. Event updates are correspondence from
+     * Google.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventUpdate updates = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addUpdates( + com.google.cloud.servicehealth.v1.EventUpdate.Builder builderForValue) { + if (updatesBuilder_ == null) { + ensureUpdatesIsMutable(); + updates_.add(builderForValue.build()); + onChanged(); + } else { + updatesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Incident-only field. Event updates are correspondence from
+     * Google.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventUpdate updates = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addUpdates( + int index, com.google.cloud.servicehealth.v1.EventUpdate.Builder builderForValue) { + if (updatesBuilder_ == null) { + ensureUpdatesIsMutable(); + updates_.add(index, builderForValue.build()); + onChanged(); + } else { + updatesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Incident-only field. Event updates are correspondence from
+     * Google.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventUpdate updates = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllUpdates( + java.lang.Iterable values) { + if (updatesBuilder_ == null) { + ensureUpdatesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, updates_); + onChanged(); + } else { + updatesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Output only. Incident-only field. Event updates are correspondence from
+     * Google.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventUpdate updates = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdates() { + if (updatesBuilder_ == null) { + updates_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000100); + onChanged(); + } else { + updatesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. Incident-only field. Event updates are correspondence from
+     * Google.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventUpdate updates = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeUpdates(int index) { + if (updatesBuilder_ == null) { + ensureUpdatesIsMutable(); + updates_.remove(index); + onChanged(); + } else { + updatesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Output only. Incident-only field. Event updates are correspondence from
+     * Google.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventUpdate updates = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.servicehealth.v1.EventUpdate.Builder getUpdatesBuilder(int index) { + return getUpdatesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Output only. Incident-only field. Event updates are correspondence from
+     * Google.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventUpdate updates = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.servicehealth.v1.EventUpdateOrBuilder getUpdatesOrBuilder(int index) { + if (updatesBuilder_ == null) { + return updates_.get(index); + } else { + return updatesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Output only. Incident-only field. Event updates are correspondence from
+     * Google.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventUpdate updates = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getUpdatesOrBuilderList() { + if (updatesBuilder_ != null) { + return updatesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(updates_); + } + } + /** + * + * + *
+     * Output only. Incident-only field. Event updates are correspondence from
+     * Google.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventUpdate updates = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.servicehealth.v1.EventUpdate.Builder addUpdatesBuilder() { + return getUpdatesFieldBuilder() + .addBuilder(com.google.cloud.servicehealth.v1.EventUpdate.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. Incident-only field. Event updates are correspondence from
+     * Google.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventUpdate updates = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.servicehealth.v1.EventUpdate.Builder addUpdatesBuilder(int index) { + return getUpdatesFieldBuilder() + .addBuilder(index, com.google.cloud.servicehealth.v1.EventUpdate.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. Incident-only field. Event updates are correspondence from
+     * Google.
+     * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventUpdate updates = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getUpdatesBuilderList() { + return getUpdatesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.servicehealth.v1.EventUpdate, + com.google.cloud.servicehealth.v1.EventUpdate.Builder, + com.google.cloud.servicehealth.v1.EventUpdateOrBuilder> + getUpdatesFieldBuilder() { + if (updatesBuilder_ == null) { + updatesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.servicehealth.v1.EventUpdate, + com.google.cloud.servicehealth.v1.EventUpdate.Builder, + com.google.cloud.servicehealth.v1.EventUpdateOrBuilder>( + updates_, ((bitField0_ & 0x00000100) != 0), getParentForChildren(), isClean()); + updates_ = null; + } + return updatesBuilder_; + } + + private java.lang.Object parentEvent_ = ""; + /** + * + * + *
+     * Output only. When `detailed_state`=`MERGED`, `parent_event` contains the
+     * name of the parent event. All further updates will be published to the
+     * parent event.
+     * 
+ * + * string parent_event = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The parentEvent. + */ + public java.lang.String getParentEvent() { + java.lang.Object ref = parentEvent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parentEvent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. When `detailed_state`=`MERGED`, `parent_event` contains the
+     * name of the parent event. All further updates will be published to the
+     * parent event.
+     * 
+ * + * string parent_event = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for parentEvent. + */ + public com.google.protobuf.ByteString getParentEventBytes() { + java.lang.Object ref = parentEvent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parentEvent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. When `detailed_state`=`MERGED`, `parent_event` contains the
+     * name of the parent event. All further updates will be published to the
+     * parent event.
+     * 
+ * + * string parent_event = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The parentEvent to set. + * @return This builder for chaining. + */ + public Builder setParentEvent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parentEvent_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. When `detailed_state`=`MERGED`, `parent_event` contains the
+     * name of the parent event. All further updates will be published to the
+     * parent event.
+     * 
+ * + * string parent_event = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearParentEvent() { + parentEvent_ = getDefaultInstance().getParentEvent(); + bitField0_ = (bitField0_ & ~0x00000200); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. When `detailed_state`=`MERGED`, `parent_event` contains the
+     * name of the parent event. All further updates will be published to the
+     * parent event.
+     * 
+ * + * string parent_event = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for parentEvent to set. + * @return This builder for chaining. + */ + public Builder setParentEventBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parentEvent_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + 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 time the update was posted.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000400) != 0); + } + /** + * + * + *
+     * Output only. The time the update was posted.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 11 [(.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 time the update was posted.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 11 [(.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_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the update was posted.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 11 [(.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_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the update was posted.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000400) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the update was posted.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000400); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the update was posted.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000400; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time the update was posted.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 11 [(.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 time the update was posted.
+     * 
+ * + * + * .google.protobuf.Timestamp update_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> + 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 startTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + startTimeBuilder_; + /** + * + * + *
+     * Output only. The start time of the event, if applicable.
+     * 
+ * + * + * .google.protobuf.Timestamp start_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the startTime field is set. + */ + public boolean hasStartTime() { + return ((bitField0_ & 0x00000800) != 0); + } + /** + * + * + *
+     * Output only. The start time of the event, if applicable.
+     * 
+ * + * + * .google.protobuf.Timestamp start_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The startTime. + */ + public com.google.protobuf.Timestamp getStartTime() { + if (startTimeBuilder_ == null) { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } else { + return startTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The start time of the event, if applicable.
+     * 
+ * + * + * .google.protobuf.Timestamp start_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + } else { + startTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The start time of the event, if applicable.
+     * 
+ * + * + * .google.protobuf.Timestamp start_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The start time of the event, if applicable.
+     * 
+ * + * + * .google.protobuf.Timestamp start_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (((bitField0_ & 0x00000800) != 0) + && startTime_ != null + && startTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getStartTimeBuilder().mergeFrom(value); + } else { + startTime_ = value; + } + } else { + startTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The start time of the event, if applicable.
+     * 
+ * + * + * .google.protobuf.Timestamp start_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearStartTime() { + bitField0_ = (bitField0_ & ~0x00000800); + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The start time of the event, if applicable.
+     * 
+ * + * + * .google.protobuf.Timestamp start_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + bitField0_ |= 0x00000800; + onChanged(); + return getStartTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The start time of the event, if applicable.
+     * 
+ * + * + * .google.protobuf.Timestamp start_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + } + /** + * + * + *
+     * Output only. The start time of the event, if applicable.
+     * 
+ * + * + * .google.protobuf.Timestamp start_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + startTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getStartTime(), getParentForChildren(), isClean()); + startTime_ = null; + } + return startTimeBuilder_; + } + + private com.google.protobuf.Timestamp endTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + /** + * + * + *
+     * Output only. The end time of the event, if applicable.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return ((bitField0_ & 0x00001000) != 0); + } + /** + * + * + *
+     * Output only. The end time of the event, if applicable.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The end time of the event, if applicable.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + } else { + endTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The end time of the event, if applicable.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The end time of the event, if applicable.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (((bitField0_ & 0x00001000) != 0) + && endTime_ != null + && endTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEndTimeBuilder().mergeFrom(value); + } else { + endTime_ = value; + } + } else { + endTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The end time of the event, if applicable.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearEndTime() { + bitField0_ = (bitField0_ & ~0x00001000); + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The end time of the event, if applicable.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + bitField0_ |= 0x00001000; + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The end time of the event, if applicable.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + /** + * + * + *
+     * Output only. The end time of the event, if applicable.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + private com.google.protobuf.Timestamp nextUpdateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + nextUpdateTimeBuilder_; + /** + * + * + *
+     * Output only. Incident-only field. The time when the next update can be
+     * expected.
+     * 
+ * + * + * .google.protobuf.Timestamp next_update_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the nextUpdateTime field is set. + */ + public boolean hasNextUpdateTime() { + return ((bitField0_ & 0x00002000) != 0); + } + /** + * + * + *
+     * Output only. Incident-only field. The time when the next update can be
+     * expected.
+     * 
+ * + * + * .google.protobuf.Timestamp next_update_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The nextUpdateTime. + */ + public com.google.protobuf.Timestamp getNextUpdateTime() { + if (nextUpdateTimeBuilder_ == null) { + return nextUpdateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : nextUpdateTime_; + } else { + return nextUpdateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Incident-only field. The time when the next update can be
+     * expected.
+     * 
+ * + * + * .google.protobuf.Timestamp next_update_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setNextUpdateTime(com.google.protobuf.Timestamp value) { + if (nextUpdateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + nextUpdateTime_ = value; + } else { + nextUpdateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Incident-only field. The time when the next update can be
+     * expected.
+     * 
+ * + * + * .google.protobuf.Timestamp next_update_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setNextUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (nextUpdateTimeBuilder_ == null) { + nextUpdateTime_ = builderForValue.build(); + } else { + nextUpdateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Incident-only field. The time when the next update can be
+     * expected.
+     * 
+ * + * + * .google.protobuf.Timestamp next_update_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeNextUpdateTime(com.google.protobuf.Timestamp value) { + if (nextUpdateTimeBuilder_ == null) { + if (((bitField0_ & 0x00002000) != 0) + && nextUpdateTime_ != null + && nextUpdateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getNextUpdateTimeBuilder().mergeFrom(value); + } else { + nextUpdateTime_ = value; + } + } else { + nextUpdateTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Incident-only field. The time when the next update can be
+     * expected.
+     * 
+ * + * + * .google.protobuf.Timestamp next_update_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearNextUpdateTime() { + bitField0_ = (bitField0_ & ~0x00002000); + nextUpdateTime_ = null; + if (nextUpdateTimeBuilder_ != null) { + nextUpdateTimeBuilder_.dispose(); + nextUpdateTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Incident-only field. The time when the next update can be
+     * expected.
+     * 
+ * + * + * .google.protobuf.Timestamp next_update_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getNextUpdateTimeBuilder() { + bitField0_ |= 0x00002000; + onChanged(); + return getNextUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Incident-only field. The time when the next update can be
+     * expected.
+     * 
+ * + * + * .google.protobuf.Timestamp next_update_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getNextUpdateTimeOrBuilder() { + if (nextUpdateTimeBuilder_ != null) { + return nextUpdateTimeBuilder_.getMessageOrBuilder(); + } else { + return nextUpdateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : nextUpdateTime_; + } + } + /** + * + * + *
+     * Output only. Incident-only field. The time when the next update can be
+     * expected.
+     * 
+ * + * + * .google.protobuf.Timestamp next_update_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getNextUpdateTimeFieldBuilder() { + if (nextUpdateTimeBuilder_ == null) { + nextUpdateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getNextUpdateTime(), getParentForChildren(), isClean()); + nextUpdateTime_ = null; + } + return nextUpdateTimeBuilder_; + } + + @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.servicehealth.v1.OrganizationEvent) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicehealth.v1.OrganizationEvent) + private static final com.google.cloud.servicehealth.v1.OrganizationEvent DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicehealth.v1.OrganizationEvent(); + } + + public static com.google.cloud.servicehealth.v1.OrganizationEvent getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OrganizationEvent 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.servicehealth.v1.OrganizationEvent getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/OrganizationEventName.java b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/OrganizationEventName.java new file mode 100644 index 000000000000..99dea3f0fe92 --- /dev/null +++ b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/OrganizationEventName.java @@ -0,0 +1,223 @@ +/* + * Copyright 2023 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.servicehealth.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 OrganizationEventName implements ResourceName { + private static final PathTemplate ORGANIZATION_LOCATION_EVENT = + PathTemplate.createWithoutUrlEncoding( + "organizations/{organization}/locations/{location}/organizationEvents/{event}"); + private volatile Map fieldValuesMap; + private final String organization; + private final String location; + private final String event; + + @Deprecated + protected OrganizationEventName() { + organization = null; + location = null; + event = null; + } + + private OrganizationEventName(Builder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + location = Preconditions.checkNotNull(builder.getLocation()); + event = Preconditions.checkNotNull(builder.getEvent()); + } + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getEvent() { + return event; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static OrganizationEventName of(String organization, String location, String event) { + return newBuilder().setOrganization(organization).setLocation(location).setEvent(event).build(); + } + + public static String format(String organization, String location, String event) { + return newBuilder() + .setOrganization(organization) + .setLocation(location) + .setEvent(event) + .build() + .toString(); + } + + public static OrganizationEventName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + ORGANIZATION_LOCATION_EVENT.validatedMatch( + formattedString, "OrganizationEventName.parse: formattedString not in valid format"); + return of(matchMap.get("organization"), matchMap.get("location"), matchMap.get("event")); + } + + 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 (OrganizationEventName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return ORGANIZATION_LOCATION_EVENT.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (event != null) { + fieldMapBuilder.put("event", event); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return ORGANIZATION_LOCATION_EVENT.instantiate( + "organization", organization, "location", location, "event", event); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + OrganizationEventName that = ((OrganizationEventName) o); + return Objects.equals(this.organization, that.organization) + && Objects.equals(this.location, that.location) + && Objects.equals(this.event, that.event); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(organization); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(event); + return h; + } + + /** Builder for organizations/{organization}/locations/{location}/organizationEvents/{event}. */ + public static class Builder { + private String organization; + private String location; + private String event; + + protected Builder() {} + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getEvent() { + return event; + } + + public Builder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setEvent(String event) { + this.event = event; + return this; + } + + private Builder(OrganizationEventName organizationEventName) { + this.organization = organizationEventName.organization; + this.location = organizationEventName.location; + this.event = organizationEventName.event; + } + + public OrganizationEventName build() { + return new OrganizationEventName(this); + } + } +} diff --git a/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/OrganizationEventOrBuilder.java b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/OrganizationEventOrBuilder.java new file mode 100644 index 000000000000..21b0bbae13af --- /dev/null +++ b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/OrganizationEventOrBuilder.java @@ -0,0 +1,555 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/servicehealth/v1/event_resources.proto + +package com.google.cloud.servicehealth.v1; + +public interface OrganizationEventOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicehealth.v1.OrganizationEvent) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Identifier. Name of the event. Unique name of the event in
+   * this scope including organization ID and location using the form
+   * `organizations/{organization_id}/locations/{location}/organizationEvents/{event_id}`.
+   *
+   * `organization_id` - see [Getting your organization resource
+   * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).<br>
+   * `location` - The location to get the service health events from.<br>
+   * `event_id` - Organization event ID to retrieve.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. Identifier. Name of the event. Unique name of the event in
+   * this scope including organization ID and location using the form
+   * `organizations/{organization_id}/locations/{location}/organizationEvents/{event_id}`.
+   *
+   * `organization_id` - see [Getting your organization resource
+   * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).<br>
+   * `location` - The location to get the service health events from.<br>
+   * `event_id` - Organization event ID to retrieve.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. Brief description for the event.
+   * 
+ * + * string title = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The title. + */ + java.lang.String getTitle(); + /** + * + * + *
+   * Output only. Brief description for the event.
+   * 
+ * + * string title = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for title. + */ + com.google.protobuf.ByteString getTitleBytes(); + + /** + * + * + *
+   * Output only. Free-form, human-readable description.
+   * 
+ * + * string description = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * Output only. Free-form, human-readable description.
+   * 
+ * + * 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 event.
+   * 
+ * + * + * .google.cloud.servicehealth.v1.OrganizationEvent.EventCategory 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 event.
+   * 
+ * + * + * .google.cloud.servicehealth.v1.OrganizationEvent.EventCategory category = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The category. + */ + com.google.cloud.servicehealth.v1.OrganizationEvent.EventCategory getCategory(); + + /** + * + * + *
+   * Output only. The detailed category of the event.
+   * 
+ * + * + * .google.cloud.servicehealth.v1.OrganizationEvent.DetailedCategory detailed_category = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for detailedCategory. + */ + int getDetailedCategoryValue(); + /** + * + * + *
+   * Output only. The detailed category of the event.
+   * 
+ * + * + * .google.cloud.servicehealth.v1.OrganizationEvent.DetailedCategory detailed_category = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The detailedCategory. + */ + com.google.cloud.servicehealth.v1.OrganizationEvent.DetailedCategory getDetailedCategory(); + + /** + * + * + *
+   * Output only. The current state of the event.
+   * 
+ * + * + * .google.cloud.servicehealth.v1.OrganizationEvent.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Output only. The current state of the event.
+   * 
+ * + * + * .google.cloud.servicehealth.v1.OrganizationEvent.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.servicehealth.v1.OrganizationEvent.State getState(); + + /** + * + * + *
+   * Output only. The current detailed state of the incident.
+   * 
+ * + * + * .google.cloud.servicehealth.v1.OrganizationEvent.DetailedState detailed_state = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for detailedState. + */ + int getDetailedStateValue(); + /** + * + * + *
+   * Output only. The current detailed state of the incident.
+   * 
+ * + * + * .google.cloud.servicehealth.v1.OrganizationEvent.DetailedState detailed_state = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The detailedState. + */ + com.google.cloud.servicehealth.v1.OrganizationEvent.DetailedState getDetailedState(); + + /** + * + * + *
+   * Output only. Represents the Google Cloud products and locations impacted by
+   * the event.
+   * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventImpact event_impacts = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getEventImpactsList(); + /** + * + * + *
+   * Output only. Represents the Google Cloud products and locations impacted by
+   * the event.
+   * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventImpact event_impacts = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.servicehealth.v1.EventImpact getEventImpacts(int index); + /** + * + * + *
+   * Output only. Represents the Google Cloud products and locations impacted by
+   * the event.
+   * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventImpact event_impacts = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getEventImpactsCount(); + /** + * + * + *
+   * Output only. Represents the Google Cloud products and locations impacted by
+   * the event.
+   * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventImpact event_impacts = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getEventImpactsOrBuilderList(); + /** + * + * + *
+   * Output only. Represents the Google Cloud products and locations impacted by
+   * the event.
+   * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventImpact event_impacts = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.servicehealth.v1.EventImpactOrBuilder getEventImpactsOrBuilder(int index); + + /** + * + * + *
+   * Output only. Incident-only field. Event updates are correspondence from
+   * Google.
+   * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventUpdate updates = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getUpdatesList(); + /** + * + * + *
+   * Output only. Incident-only field. Event updates are correspondence from
+   * Google.
+   * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventUpdate updates = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.servicehealth.v1.EventUpdate getUpdates(int index); + /** + * + * + *
+   * Output only. Incident-only field. Event updates are correspondence from
+   * Google.
+   * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventUpdate updates = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getUpdatesCount(); + /** + * + * + *
+   * Output only. Incident-only field. Event updates are correspondence from
+   * Google.
+   * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventUpdate updates = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getUpdatesOrBuilderList(); + /** + * + * + *
+   * Output only. Incident-only field. Event updates are correspondence from
+   * Google.
+   * 
+ * + * + * repeated .google.cloud.servicehealth.v1.EventUpdate updates = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.servicehealth.v1.EventUpdateOrBuilder getUpdatesOrBuilder(int index); + + /** + * + * + *
+   * Output only. When `detailed_state`=`MERGED`, `parent_event` contains the
+   * name of the parent event. All further updates will be published to the
+   * parent event.
+   * 
+ * + * string parent_event = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The parentEvent. + */ + java.lang.String getParentEvent(); + /** + * + * + *
+   * Output only. When `detailed_state`=`MERGED`, `parent_event` contains the
+   * name of the parent event. All further updates will be published to the
+   * parent event.
+   * 
+ * + * string parent_event = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for parentEvent. + */ + com.google.protobuf.ByteString getParentEventBytes(); + + /** + * + * + *
+   * Output only. The time the update was posted.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. The time the update was posted.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. The time the update was posted.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The start time of the event, if applicable.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the startTime field is set. + */ + boolean hasStartTime(); + /** + * + * + *
+   * Output only. The start time of the event, if applicable.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The startTime. + */ + com.google.protobuf.Timestamp getStartTime(); + /** + * + * + *
+   * Output only. The start time of the event, if applicable.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The end time of the event, if applicable.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + /** + * + * + *
+   * Output only. The end time of the event, if applicable.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + /** + * + * + *
+   * Output only. The end time of the event, if applicable.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Incident-only field. The time when the next update can be
+   * expected.
+   * 
+ * + * + * .google.protobuf.Timestamp next_update_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the nextUpdateTime field is set. + */ + boolean hasNextUpdateTime(); + /** + * + * + *
+   * Output only. Incident-only field. The time when the next update can be
+   * expected.
+   * 
+ * + * + * .google.protobuf.Timestamp next_update_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The nextUpdateTime. + */ + com.google.protobuf.Timestamp getNextUpdateTime(); + /** + * + * + *
+   * Output only. Incident-only field. The time when the next update can be
+   * expected.
+   * 
+ * + * + * .google.protobuf.Timestamp next_update_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getNextUpdateTimeOrBuilder(); +} diff --git a/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/OrganizationEventView.java b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/OrganizationEventView.java new file mode 100644 index 000000000000..271694a37fb3 --- /dev/null +++ b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/OrganizationEventView.java @@ -0,0 +1,184 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/servicehealth/v1/event_resources.proto + +package com.google.cloud.servicehealth.v1; + +/** + * + * + *
+ * The organization event fields to include in ListOrganizationEvents API
+ * response. This enum lists all possible organization event views.
+ * 
+ * + * Protobuf enum {@code google.cloud.servicehealth.v1.OrganizationEventView} + */ +public enum OrganizationEventView implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Unspecified event view. Default to `ORGANIZATION_EVENT_VIEW_BASIC`.
+   * 
+ * + * ORGANIZATION_EVENT_VIEW_UNSPECIFIED = 0; + */ + ORGANIZATION_EVENT_VIEW_UNSPECIFIED(0), + /** + * + * + *
+   * Includes all organization event fields except `updates`. This view is the
+   * default for ListOrganizationEvents API.
+   * 
+ * + * ORGANIZATION_EVENT_VIEW_BASIC = 1; + */ + ORGANIZATION_EVENT_VIEW_BASIC(1), + /** + * + * + *
+   * Includes all organization event fields.
+   * 
+ * + * ORGANIZATION_EVENT_VIEW_FULL = 2; + */ + ORGANIZATION_EVENT_VIEW_FULL(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * Unspecified event view. Default to `ORGANIZATION_EVENT_VIEW_BASIC`.
+   * 
+ * + * ORGANIZATION_EVENT_VIEW_UNSPECIFIED = 0; + */ + public static final int ORGANIZATION_EVENT_VIEW_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * Includes all organization event fields except `updates`. This view is the
+   * default for ListOrganizationEvents API.
+   * 
+ * + * ORGANIZATION_EVENT_VIEW_BASIC = 1; + */ + public static final int ORGANIZATION_EVENT_VIEW_BASIC_VALUE = 1; + /** + * + * + *
+   * Includes all organization event fields.
+   * 
+ * + * ORGANIZATION_EVENT_VIEW_FULL = 2; + */ + public static final int ORGANIZATION_EVENT_VIEW_FULL_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static OrganizationEventView 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 OrganizationEventView forNumber(int value) { + switch (value) { + case 0: + return ORGANIZATION_EVENT_VIEW_UNSPECIFIED; + case 1: + return ORGANIZATION_EVENT_VIEW_BASIC; + case 2: + return ORGANIZATION_EVENT_VIEW_FULL; + 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 OrganizationEventView findValueByNumber(int number) { + return OrganizationEventView.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.servicehealth.v1.EventResourcesProto.getDescriptor() + .getEnumTypes() + .get(1); + } + + private static final OrganizationEventView[] VALUES = values(); + + public static OrganizationEventView 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 OrganizationEventView(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.servicehealth.v1.OrganizationEventView) +} diff --git a/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/OrganizationImpact.java b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/OrganizationImpact.java new file mode 100644 index 000000000000..bd3ff363d225 --- /dev/null +++ b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/OrganizationImpact.java @@ -0,0 +1,1571 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/servicehealth/v1/event_resources.proto + +package com.google.cloud.servicehealth.v1; + +/** + * + * + *
+ * Represents impact to assets at organizational level. It is a read-only view
+ * and does not allow any modifications.
+ * 
+ * + * Protobuf type {@code google.cloud.servicehealth.v1.OrganizationImpact} + */ +public final class OrganizationImpact extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicehealth.v1.OrganizationImpact) + OrganizationImpactOrBuilder { + private static final long serialVersionUID = 0L; + // Use OrganizationImpact.newBuilder() to construct. + private OrganizationImpact(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private OrganizationImpact() { + name_ = ""; + events_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new OrganizationImpact(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_OrganizationImpact_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_OrganizationImpact_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicehealth.v1.OrganizationImpact.class, + com.google.cloud.servicehealth.v1.OrganizationImpact.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Output only. Identifier. Unique name of the organization impact in this
+   * scope including organization and location using the form
+   * `organizations/{organization_id}/locations/{location}/organizationImpacts/{organization_impact_id}`.
+   *
+   * `organization_id` - ID (number) of the organization that contains the
+   * event. To get your `organization_id`, see
+   * [Getting your organization resource
+   * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).<br>
+   * `organization_impact_id` - ID of the [OrganizationImpact
+   * resource](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact).
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.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; + } + } + /** + * + * + *
+   * Output only. Identifier. Unique name of the organization impact in this
+   * scope including organization and location using the form
+   * `organizations/{organization_id}/locations/{location}/organizationImpacts/{organization_impact_id}`.
+   *
+   * `organization_id` - ID (number) of the organization that contains the
+   * event. To get your `organization_id`, see
+   * [Getting your organization resource
+   * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).<br>
+   * `organization_impact_id` - ID of the [OrganizationImpact
+   * resource](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact).
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.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 EVENTS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList events_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * Output only. A list of event names impacting the asset.
+   * 
+ * + * + * repeated string events = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return A list containing the events. + */ + public com.google.protobuf.ProtocolStringList getEventsList() { + return events_; + } + /** + * + * + *
+   * Output only. A list of event names impacting the asset.
+   * 
+ * + * + * repeated string events = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The count of events. + */ + public int getEventsCount() { + return events_.size(); + } + /** + * + * + *
+   * Output only. A list of event names impacting the asset.
+   * 
+ * + * + * repeated string events = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the element to return. + * @return The events at the given index. + */ + public java.lang.String getEvents(int index) { + return events_.get(index); + } + /** + * + * + *
+   * Output only. A list of event names impacting the asset.
+   * 
+ * + * + * repeated string events = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the value to return. + * @return The bytes of the events at the given index. + */ + public com.google.protobuf.ByteString getEventsBytes(int index) { + return events_.getByteString(index); + } + + public static final int ASSET_FIELD_NUMBER = 3; + private com.google.cloud.servicehealth.v1.Asset asset_; + /** + * + * + *
+   * Output only. Google Cloud asset possibly impacted by the specified events.
+   * 
+ * + * + * .google.cloud.servicehealth.v1.Asset asset = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the asset field is set. + */ + @java.lang.Override + public boolean hasAsset() { + return asset_ != null; + } + /** + * + * + *
+   * Output only. Google Cloud asset possibly impacted by the specified events.
+   * 
+ * + * + * .google.cloud.servicehealth.v1.Asset asset = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The asset. + */ + @java.lang.Override + public com.google.cloud.servicehealth.v1.Asset getAsset() { + return asset_ == null ? com.google.cloud.servicehealth.v1.Asset.getDefaultInstance() : asset_; + } + /** + * + * + *
+   * Output only. Google Cloud asset possibly impacted by the specified events.
+   * 
+ * + * + * .google.cloud.servicehealth.v1.Asset asset = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.servicehealth.v1.AssetOrBuilder getAssetOrBuilder() { + return asset_ == null ? com.google.cloud.servicehealth.v1.Asset.getDefaultInstance() : asset_; + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. The time when the affected project was last modified.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Output only. The time when the affected project was last modified.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4 [(.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 time when the affected project was last modified.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + 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_); + } + for (int i = 0; i < events_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, events_.getRaw(i)); + } + if (asset_ != null) { + output.writeMessage(3, getAsset()); + } + if (updateTime_ != null) { + output.writeMessage(4, getUpdateTime()); + } + 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_); + } + { + int dataSize = 0; + for (int i = 0; i < events_.size(); i++) { + dataSize += computeStringSizeNoTag(events_.getRaw(i)); + } + size += dataSize; + size += 1 * getEventsList().size(); + } + if (asset_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getAsset()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getUpdateTime()); + } + 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.servicehealth.v1.OrganizationImpact)) { + return super.equals(obj); + } + com.google.cloud.servicehealth.v1.OrganizationImpact other = + (com.google.cloud.servicehealth.v1.OrganizationImpact) obj; + + if (!getName().equals(other.getName())) return false; + if (!getEventsList().equals(other.getEventsList())) return false; + if (hasAsset() != other.hasAsset()) return false; + if (hasAsset()) { + if (!getAsset().equals(other.getAsset())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) 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 (getEventsCount() > 0) { + hash = (37 * hash) + EVENTS_FIELD_NUMBER; + hash = (53 * hash) + getEventsList().hashCode(); + } + if (hasAsset()) { + hash = (37 * hash) + ASSET_FIELD_NUMBER; + hash = (53 * hash) + getAsset().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.servicehealth.v1.OrganizationImpact parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicehealth.v1.OrganizationImpact 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.servicehealth.v1.OrganizationImpact parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicehealth.v1.OrganizationImpact 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.servicehealth.v1.OrganizationImpact parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicehealth.v1.OrganizationImpact parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.servicehealth.v1.OrganizationImpact parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicehealth.v1.OrganizationImpact 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.servicehealth.v1.OrganizationImpact parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicehealth.v1.OrganizationImpact 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.servicehealth.v1.OrganizationImpact parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicehealth.v1.OrganizationImpact 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.servicehealth.v1.OrganizationImpact 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; + } + /** + * + * + *
+   * Represents impact to assets at organizational level. It is a read-only view
+   * and does not allow any modifications.
+   * 
+ * + * Protobuf type {@code google.cloud.servicehealth.v1.OrganizationImpact} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicehealth.v1.OrganizationImpact) + com.google.cloud.servicehealth.v1.OrganizationImpactOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_OrganizationImpact_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_OrganizationImpact_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicehealth.v1.OrganizationImpact.class, + com.google.cloud.servicehealth.v1.OrganizationImpact.Builder.class); + } + + // Construct using com.google.cloud.servicehealth.v1.OrganizationImpact.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + events_ = com.google.protobuf.LazyStringArrayList.emptyList(); + asset_ = null; + if (assetBuilder_ != null) { + assetBuilder_.dispose(); + assetBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_OrganizationImpact_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicehealth.v1.OrganizationImpact getDefaultInstanceForType() { + return com.google.cloud.servicehealth.v1.OrganizationImpact.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicehealth.v1.OrganizationImpact build() { + com.google.cloud.servicehealth.v1.OrganizationImpact result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicehealth.v1.OrganizationImpact buildPartial() { + com.google.cloud.servicehealth.v1.OrganizationImpact result = + new com.google.cloud.servicehealth.v1.OrganizationImpact(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.servicehealth.v1.OrganizationImpact result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + events_.makeImmutable(); + result.events_ = events_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.asset_ = assetBuilder_ == null ? asset_ : assetBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + } + } + + @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.servicehealth.v1.OrganizationImpact) { + return mergeFrom((com.google.cloud.servicehealth.v1.OrganizationImpact) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.servicehealth.v1.OrganizationImpact other) { + if (other == com.google.cloud.servicehealth.v1.OrganizationImpact.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.events_.isEmpty()) { + if (events_.isEmpty()) { + events_ = other.events_; + bitField0_ |= 0x00000002; + } else { + ensureEventsIsMutable(); + events_.addAll(other.events_); + } + onChanged(); + } + if (other.hasAsset()) { + mergeAsset(other.getAsset()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + 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: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureEventsIsMutable(); + events_.add(s); + break; + } // case 18 + case 26: + { + input.readMessage(getAssetFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + 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_ = ""; + /** + * + * + *
+     * Output only. Identifier. Unique name of the organization impact in this
+     * scope including organization and location using the form
+     * `organizations/{organization_id}/locations/{location}/organizationImpacts/{organization_impact_id}`.
+     *
+     * `organization_id` - ID (number) of the organization that contains the
+     * event. To get your `organization_id`, see
+     * [Getting your organization resource
+     * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).<br>
+     * `organization_impact_id` - ID of the [OrganizationImpact
+     * resource](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact).
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.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; + } + } + /** + * + * + *
+     * Output only. Identifier. Unique name of the organization impact in this
+     * scope including organization and location using the form
+     * `organizations/{organization_id}/locations/{location}/organizationImpacts/{organization_impact_id}`.
+     *
+     * `organization_id` - ID (number) of the organization that contains the
+     * event. To get your `organization_id`, see
+     * [Getting your organization resource
+     * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).<br>
+     * `organization_impact_id` - ID of the [OrganizationImpact
+     * resource](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact).
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.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; + } + } + /** + * + * + *
+     * Output only. Identifier. Unique name of the organization impact in this
+     * scope including organization and location using the form
+     * `organizations/{organization_id}/locations/{location}/organizationImpacts/{organization_impact_id}`.
+     *
+     * `organization_id` - ID (number) of the organization that contains the
+     * event. To get your `organization_id`, see
+     * [Getting your organization resource
+     * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).<br>
+     * `organization_impact_id` - ID of the [OrganizationImpact
+     * resource](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact).
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.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; + } + /** + * + * + *
+     * Output only. Identifier. Unique name of the organization impact in this
+     * scope including organization and location using the form
+     * `organizations/{organization_id}/locations/{location}/organizationImpacts/{organization_impact_id}`.
+     *
+     * `organization_id` - ID (number) of the organization that contains the
+     * event. To get your `organization_id`, see
+     * [Getting your organization resource
+     * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).<br>
+     * `organization_impact_id` - ID of the [OrganizationImpact
+     * resource](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact).
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Identifier. Unique name of the organization impact in this
+     * scope including organization and location using the form
+     * `organizations/{organization_id}/locations/{location}/organizationImpacts/{organization_impact_id}`.
+     *
+     * `organization_id` - ID (number) of the organization that contains the
+     * event. To get your `organization_id`, see
+     * [Getting your organization resource
+     * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).<br>
+     * `organization_impact_id` - ID of the [OrganizationImpact
+     * resource](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact).
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.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.protobuf.LazyStringArrayList events_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureEventsIsMutable() { + if (!events_.isModifiable()) { + events_ = new com.google.protobuf.LazyStringArrayList(events_); + } + bitField0_ |= 0x00000002; + } + /** + * + * + *
+     * Output only. A list of event names impacting the asset.
+     * 
+ * + * + * repeated string events = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return A list containing the events. + */ + public com.google.protobuf.ProtocolStringList getEventsList() { + events_.makeImmutable(); + return events_; + } + /** + * + * + *
+     * Output only. A list of event names impacting the asset.
+     * 
+ * + * + * repeated string events = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The count of events. + */ + public int getEventsCount() { + return events_.size(); + } + /** + * + * + *
+     * Output only. A list of event names impacting the asset.
+     * 
+ * + * + * repeated string events = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the element to return. + * @return The events at the given index. + */ + public java.lang.String getEvents(int index) { + return events_.get(index); + } + /** + * + * + *
+     * Output only. A list of event names impacting the asset.
+     * 
+ * + * + * repeated string events = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the value to return. + * @return The bytes of the events at the given index. + */ + public com.google.protobuf.ByteString getEventsBytes(int index) { + return events_.getByteString(index); + } + /** + * + * + *
+     * Output only. A list of event names impacting the asset.
+     * 
+ * + * + * repeated string events = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index to set the value at. + * @param value The events to set. + * @return This builder for chaining. + */ + public Builder setEvents(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureEventsIsMutable(); + events_.set(index, value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. A list of event names impacting the asset.
+     * 
+ * + * + * repeated string events = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The events to add. + * @return This builder for chaining. + */ + public Builder addEvents(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureEventsIsMutable(); + events_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. A list of event names impacting the asset.
+     * 
+ * + * + * repeated string events = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param values The events to add. + * @return This builder for chaining. + */ + public Builder addAllEvents(java.lang.Iterable values) { + ensureEventsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, events_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. A list of event names impacting the asset.
+     * 
+ * + * + * repeated string events = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearEvents() { + events_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. A list of event names impacting the asset.
+     * 
+ * + * + * repeated string events = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes of the events to add. + * @return This builder for chaining. + */ + public Builder addEventsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureEventsIsMutable(); + events_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.servicehealth.v1.Asset asset_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.servicehealth.v1.Asset, + com.google.cloud.servicehealth.v1.Asset.Builder, + com.google.cloud.servicehealth.v1.AssetOrBuilder> + assetBuilder_; + /** + * + * + *
+     * Output only. Google Cloud asset possibly impacted by the specified events.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.Asset asset = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the asset field is set. + */ + public boolean hasAsset() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Output only. Google Cloud asset possibly impacted by the specified events.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.Asset asset = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The asset. + */ + public com.google.cloud.servicehealth.v1.Asset getAsset() { + if (assetBuilder_ == null) { + return asset_ == null + ? com.google.cloud.servicehealth.v1.Asset.getDefaultInstance() + : asset_; + } else { + return assetBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Google Cloud asset possibly impacted by the specified events.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.Asset asset = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setAsset(com.google.cloud.servicehealth.v1.Asset value) { + if (assetBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + asset_ = value; + } else { + assetBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Google Cloud asset possibly impacted by the specified events.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.Asset asset = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setAsset(com.google.cloud.servicehealth.v1.Asset.Builder builderForValue) { + if (assetBuilder_ == null) { + asset_ = builderForValue.build(); + } else { + assetBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Google Cloud asset possibly impacted by the specified events.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.Asset asset = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeAsset(com.google.cloud.servicehealth.v1.Asset value) { + if (assetBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && asset_ != null + && asset_ != com.google.cloud.servicehealth.v1.Asset.getDefaultInstance()) { + getAssetBuilder().mergeFrom(value); + } else { + asset_ = value; + } + } else { + assetBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Google Cloud asset possibly impacted by the specified events.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.Asset asset = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearAsset() { + bitField0_ = (bitField0_ & ~0x00000004); + asset_ = null; + if (assetBuilder_ != null) { + assetBuilder_.dispose(); + assetBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Google Cloud asset possibly impacted by the specified events.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.Asset asset = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.servicehealth.v1.Asset.Builder getAssetBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getAssetFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Google Cloud asset possibly impacted by the specified events.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.Asset asset = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.servicehealth.v1.AssetOrBuilder getAssetOrBuilder() { + if (assetBuilder_ != null) { + return assetBuilder_.getMessageOrBuilder(); + } else { + return asset_ == null + ? com.google.cloud.servicehealth.v1.Asset.getDefaultInstance() + : asset_; + } + } + /** + * + * + *
+     * Output only. Google Cloud asset possibly impacted by the specified events.
+     * 
+ * + * + * .google.cloud.servicehealth.v1.Asset asset = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.servicehealth.v1.Asset, + com.google.cloud.servicehealth.v1.Asset.Builder, + com.google.cloud.servicehealth.v1.AssetOrBuilder> + getAssetFieldBuilder() { + if (assetBuilder_ == null) { + assetBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.servicehealth.v1.Asset, + com.google.cloud.servicehealth.v1.Asset.Builder, + com.google.cloud.servicehealth.v1.AssetOrBuilder>( + getAsset(), getParentForChildren(), isClean()); + asset_ = null; + } + return assetBuilder_; + } + + 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 time when the affected project was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Output only. The time when the affected project was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.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 time when the affected project was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.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_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time when the affected project was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.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_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time when the affected project was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time when the affected project was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000008); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time when the affected project was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time when the affected project was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.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 time when the affected project was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + 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_; + } + + @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.servicehealth.v1.OrganizationImpact) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicehealth.v1.OrganizationImpact) + private static final com.google.cloud.servicehealth.v1.OrganizationImpact DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicehealth.v1.OrganizationImpact(); + } + + public static com.google.cloud.servicehealth.v1.OrganizationImpact getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OrganizationImpact 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.servicehealth.v1.OrganizationImpact getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/OrganizationImpactName.java b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/OrganizationImpactName.java new file mode 100644 index 000000000000..aa15d4d8a694 --- /dev/null +++ b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/OrganizationImpactName.java @@ -0,0 +1,239 @@ +/* + * Copyright 2023 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.servicehealth.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 OrganizationImpactName implements ResourceName { + private static final PathTemplate ORGANIZATION_LOCATION_ORGANIZATION_IMPACT = + PathTemplate.createWithoutUrlEncoding( + "organizations/{organization}/locations/{location}/organizationImpacts/{organization_impact}"); + private volatile Map fieldValuesMap; + private final String organization; + private final String location; + private final String organizationImpact; + + @Deprecated + protected OrganizationImpactName() { + organization = null; + location = null; + organizationImpact = null; + } + + private OrganizationImpactName(Builder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + location = Preconditions.checkNotNull(builder.getLocation()); + organizationImpact = Preconditions.checkNotNull(builder.getOrganizationImpact()); + } + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getOrganizationImpact() { + return organizationImpact; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static OrganizationImpactName of( + String organization, String location, String organizationImpact) { + return newBuilder() + .setOrganization(organization) + .setLocation(location) + .setOrganizationImpact(organizationImpact) + .build(); + } + + public static String format(String organization, String location, String organizationImpact) { + return newBuilder() + .setOrganization(organization) + .setLocation(location) + .setOrganizationImpact(organizationImpact) + .build() + .toString(); + } + + public static OrganizationImpactName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + ORGANIZATION_LOCATION_ORGANIZATION_IMPACT.validatedMatch( + formattedString, "OrganizationImpactName.parse: formattedString not in valid format"); + return of( + matchMap.get("organization"), + matchMap.get("location"), + matchMap.get("organization_impact")); + } + + 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 (OrganizationImpactName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return ORGANIZATION_LOCATION_ORGANIZATION_IMPACT.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (organizationImpact != null) { + fieldMapBuilder.put("organization_impact", organizationImpact); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return ORGANIZATION_LOCATION_ORGANIZATION_IMPACT.instantiate( + "organization", + organization, + "location", + location, + "organization_impact", + organizationImpact); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + OrganizationImpactName that = ((OrganizationImpactName) o); + return Objects.equals(this.organization, that.organization) + && Objects.equals(this.location, that.location) + && Objects.equals(this.organizationImpact, that.organizationImpact); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(organization); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(organizationImpact); + return h; + } + + /** + * Builder for + * organizations/{organization}/locations/{location}/organizationImpacts/{organization_impact}. + */ + public static class Builder { + private String organization; + private String location; + private String organizationImpact; + + protected Builder() {} + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getOrganizationImpact() { + return organizationImpact; + } + + public Builder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setOrganizationImpact(String organizationImpact) { + this.organizationImpact = organizationImpact; + return this; + } + + private Builder(OrganizationImpactName organizationImpactName) { + this.organization = organizationImpactName.organization; + this.location = organizationImpactName.location; + this.organizationImpact = organizationImpactName.organizationImpact; + } + + public OrganizationImpactName build() { + return new OrganizationImpactName(this); + } + } +} diff --git a/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/OrganizationImpactOrBuilder.java b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/OrganizationImpactOrBuilder.java new file mode 100644 index 000000000000..571dfeb19a1d --- /dev/null +++ b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/OrganizationImpactOrBuilder.java @@ -0,0 +1,210 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/servicehealth/v1/event_resources.proto + +package com.google.cloud.servicehealth.v1; + +public interface OrganizationImpactOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicehealth.v1.OrganizationImpact) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Identifier. Unique name of the organization impact in this
+   * scope including organization and location using the form
+   * `organizations/{organization_id}/locations/{location}/organizationImpacts/{organization_impact_id}`.
+   *
+   * `organization_id` - ID (number) of the organization that contains the
+   * event. To get your `organization_id`, see
+   * [Getting your organization resource
+   * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).<br>
+   * `organization_impact_id` - ID of the [OrganizationImpact
+   * resource](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact).
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. Identifier. Unique name of the organization impact in this
+   * scope including organization and location using the form
+   * `organizations/{organization_id}/locations/{location}/organizationImpacts/{organization_impact_id}`.
+   *
+   * `organization_id` - ID (number) of the organization that contains the
+   * event. To get your `organization_id`, see
+   * [Getting your organization resource
+   * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).<br>
+   * `organization_impact_id` - ID of the [OrganizationImpact
+   * resource](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact).
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. A list of event names impacting the asset.
+   * 
+ * + * + * repeated string events = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return A list containing the events. + */ + java.util.List getEventsList(); + /** + * + * + *
+   * Output only. A list of event names impacting the asset.
+   * 
+ * + * + * repeated string events = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The count of events. + */ + int getEventsCount(); + /** + * + * + *
+   * Output only. A list of event names impacting the asset.
+   * 
+ * + * + * repeated string events = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the element to return. + * @return The events at the given index. + */ + java.lang.String getEvents(int index); + /** + * + * + *
+   * Output only. A list of event names impacting the asset.
+   * 
+ * + * + * repeated string events = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the value to return. + * @return The bytes of the events at the given index. + */ + com.google.protobuf.ByteString getEventsBytes(int index); + + /** + * + * + *
+   * Output only. Google Cloud asset possibly impacted by the specified events.
+   * 
+ * + * + * .google.cloud.servicehealth.v1.Asset asset = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the asset field is set. + */ + boolean hasAsset(); + /** + * + * + *
+   * Output only. Google Cloud asset possibly impacted by the specified events.
+   * 
+ * + * + * .google.cloud.servicehealth.v1.Asset asset = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The asset. + */ + com.google.cloud.servicehealth.v1.Asset getAsset(); + /** + * + * + *
+   * Output only. Google Cloud asset possibly impacted by the specified events.
+   * 
+ * + * + * .google.cloud.servicehealth.v1.Asset asset = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.servicehealth.v1.AssetOrBuilder getAssetOrBuilder(); + + /** + * + * + *
+   * Output only. The time when the affected project was last modified.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. The time when the affected project was last modified.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. The time when the affected project was last modified.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); +} diff --git a/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/OrganizationLocationName.java b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/OrganizationLocationName.java new file mode 100644 index 000000000000..5de752238b64 --- /dev/null +++ b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/OrganizationLocationName.java @@ -0,0 +1,192 @@ +/* + * Copyright 2023 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.servicehealth.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 OrganizationLocationName implements ResourceName { + private static final PathTemplate ORGANIZATION_LOCATION = + PathTemplate.createWithoutUrlEncoding("organizations/{organization}/locations/{location}"); + private volatile Map fieldValuesMap; + private final String organization; + private final String location; + + @Deprecated + protected OrganizationLocationName() { + organization = null; + location = null; + } + + private OrganizationLocationName(Builder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + location = Preconditions.checkNotNull(builder.getLocation()); + } + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static OrganizationLocationName of(String organization, String location) { + return newBuilder().setOrganization(organization).setLocation(location).build(); + } + + public static String format(String organization, String location) { + return newBuilder().setOrganization(organization).setLocation(location).build().toString(); + } + + public static OrganizationLocationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + ORGANIZATION_LOCATION.validatedMatch( + formattedString, "OrganizationLocationName.parse: formattedString not in valid format"); + return of(matchMap.get("organization"), 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 (OrganizationLocationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return ORGANIZATION_LOCATION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + 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 ORGANIZATION_LOCATION.instantiate("organization", organization, "location", location); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + OrganizationLocationName that = ((OrganizationLocationName) o); + return Objects.equals(this.organization, that.organization) + && Objects.equals(this.location, that.location); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(organization); + h *= 1000003; + h ^= Objects.hashCode(location); + return h; + } + + /** Builder for organizations/{organization}/locations/{location}. */ + public static class Builder { + private String organization; + private String location; + + protected Builder() {} + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public Builder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + private Builder(OrganizationLocationName organizationLocationName) { + this.organization = organizationLocationName.organization; + this.location = organizationLocationName.location; + } + + public OrganizationLocationName build() { + return new OrganizationLocationName(this); + } + } +} diff --git a/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/Product.java b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/Product.java new file mode 100644 index 000000000000..1347e5b71ff0 --- /dev/null +++ b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/Product.java @@ -0,0 +1,623 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/servicehealth/v1/event_resources.proto + +package com.google.cloud.servicehealth.v1; + +/** + * + * + *
+ * Represents the Google Cloud product impacted by the event.
+ * 
+ * + * Protobuf type {@code google.cloud.servicehealth.v1.Product} + */ +public final class Product extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicehealth.v1.Product) + ProductOrBuilder { + private static final long serialVersionUID = 0L; + // Use Product.newBuilder() to construct. + private Product(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Product() { + productName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Product(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_Product_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_Product_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicehealth.v1.Product.class, + com.google.cloud.servicehealth.v1.Product.Builder.class); + } + + public static final int PRODUCT_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object productName_ = ""; + /** + * + * + *
+   * Google Cloud product impacted by the event. Example: `"Google Cloud SQL"`
+   * 
+ * + * string product_name = 1; + * + * @return The productName. + */ + @java.lang.Override + public java.lang.String getProductName() { + java.lang.Object ref = productName_; + 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(); + productName_ = s; + return s; + } + } + /** + * + * + *
+   * Google Cloud product impacted by the event. Example: `"Google Cloud SQL"`
+   * 
+ * + * string product_name = 1; + * + * @return The bytes for productName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProductNameBytes() { + java.lang.Object ref = productName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + productName_ = 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(productName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, productName_); + } + 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(productName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, productName_); + } + 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.servicehealth.v1.Product)) { + return super.equals(obj); + } + com.google.cloud.servicehealth.v1.Product other = + (com.google.cloud.servicehealth.v1.Product) obj; + + if (!getProductName().equals(other.getProductName())) 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) + PRODUCT_NAME_FIELD_NUMBER; + hash = (53 * hash) + getProductName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.servicehealth.v1.Product parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicehealth.v1.Product 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.servicehealth.v1.Product parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicehealth.v1.Product 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.servicehealth.v1.Product parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicehealth.v1.Product parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.servicehealth.v1.Product parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicehealth.v1.Product 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.servicehealth.v1.Product parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicehealth.v1.Product 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.servicehealth.v1.Product parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicehealth.v1.Product 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.servicehealth.v1.Product 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; + } + /** + * + * + *
+   * Represents the Google Cloud product impacted by the event.
+   * 
+ * + * Protobuf type {@code google.cloud.servicehealth.v1.Product} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicehealth.v1.Product) + com.google.cloud.servicehealth.v1.ProductOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_Product_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_Product_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicehealth.v1.Product.class, + com.google.cloud.servicehealth.v1.Product.Builder.class); + } + + // Construct using com.google.cloud.servicehealth.v1.Product.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + productName_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.servicehealth.v1.EventResourcesProto + .internal_static_google_cloud_servicehealth_v1_Product_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicehealth.v1.Product getDefaultInstanceForType() { + return com.google.cloud.servicehealth.v1.Product.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicehealth.v1.Product build() { + com.google.cloud.servicehealth.v1.Product result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicehealth.v1.Product buildPartial() { + com.google.cloud.servicehealth.v1.Product result = + new com.google.cloud.servicehealth.v1.Product(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.servicehealth.v1.Product result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.productName_ = productName_; + } + } + + @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.servicehealth.v1.Product) { + return mergeFrom((com.google.cloud.servicehealth.v1.Product) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.servicehealth.v1.Product other) { + if (other == com.google.cloud.servicehealth.v1.Product.getDefaultInstance()) return this; + if (!other.getProductName().isEmpty()) { + productName_ = other.productName_; + 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 10: + { + productName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + 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 productName_ = ""; + /** + * + * + *
+     * Google Cloud product impacted by the event. Example: `"Google Cloud SQL"`
+     * 
+ * + * string product_name = 1; + * + * @return The productName. + */ + public java.lang.String getProductName() { + java.lang.Object ref = productName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + productName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Google Cloud product impacted by the event. Example: `"Google Cloud SQL"`
+     * 
+ * + * string product_name = 1; + * + * @return The bytes for productName. + */ + public com.google.protobuf.ByteString getProductNameBytes() { + java.lang.Object ref = productName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + productName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Google Cloud product impacted by the event. Example: `"Google Cloud SQL"`
+     * 
+ * + * string product_name = 1; + * + * @param value The productName to set. + * @return This builder for chaining. + */ + public Builder setProductName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + productName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Google Cloud product impacted by the event. Example: `"Google Cloud SQL"`
+     * 
+ * + * string product_name = 1; + * + * @return This builder for chaining. + */ + public Builder clearProductName() { + productName_ = getDefaultInstance().getProductName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Google Cloud product impacted by the event. Example: `"Google Cloud SQL"`
+     * 
+ * + * string product_name = 1; + * + * @param value The bytes for productName to set. + * @return This builder for chaining. + */ + public Builder setProductNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + productName_ = 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.servicehealth.v1.Product) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicehealth.v1.Product) + private static final com.google.cloud.servicehealth.v1.Product DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicehealth.v1.Product(); + } + + public static com.google.cloud.servicehealth.v1.Product getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Product 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.servicehealth.v1.Product getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/ProductOrBuilder.java b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/ProductOrBuilder.java new file mode 100644 index 000000000000..ebd506c39791 --- /dev/null +++ b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/java/com/google/cloud/servicehealth/v1/ProductOrBuilder.java @@ -0,0 +1,50 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/servicehealth/v1/event_resources.proto + +package com.google.cloud.servicehealth.v1; + +public interface ProductOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicehealth.v1.Product) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Google Cloud product impacted by the event. Example: `"Google Cloud SQL"`
+   * 
+ * + * string product_name = 1; + * + * @return The productName. + */ + java.lang.String getProductName(); + /** + * + * + *
+   * Google Cloud product impacted by the event. Example: `"Google Cloud SQL"`
+   * 
+ * + * string product_name = 1; + * + * @return The bytes for productName. + */ + com.google.protobuf.ByteString getProductNameBytes(); +} diff --git a/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/proto/google/cloud/servicehealth/v1/event_resources.proto b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/proto/google/cloud/servicehealth/v1/event_resources.proto new file mode 100644 index 000000000000..e8caa03a5335 --- /dev/null +++ b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/proto/google/cloud/servicehealth/v1/event_resources.proto @@ -0,0 +1,730 @@ +// Copyright 2023 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.servicehealth.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.ServiceHealth.V1"; +option go_package = "cloud.google.com/go/servicehealth/apiv1/servicehealthpb;servicehealthpb"; +option java_multiple_files = true; +option java_outer_classname = "EventResourcesProto"; +option java_package = "com.google.cloud.servicehealth.v1"; +option php_namespace = "Google\\Cloud\\ServiceHealth\\V1"; +option ruby_package = "Google::Cloud::ServiceHealth::V1"; +option (google.api.resource_definition) = { + type: "servicehealth.googleapis.com/OrganizationLocation" + pattern: "organizations/{organization}/locations/{location}" +}; + +// Represents service health events that may affect Google Cloud products. +// Event resource is a read-only view and does not allow any modifications. All +// fields are output only. +message Event { + option (google.api.resource) = { + type: "servicehealth.googleapis.com/Event" + pattern: "projects/{project}/locations/{location}/events/{event}" + plural: "events" + singular: "event" + }; + + // The category of the event. This enum lists all possible categories of + // event. + enum EventCategory { + // Unspecified category. + EVENT_CATEGORY_UNSPECIFIED = 0; + + // Event category for service outage or degradation. + INCIDENT = 2; + } + + // The detailed category of an event. Contains all possible states for all + // event categories. + enum DetailedCategory { + // Unspecified detailed category. + DETAILED_CATEGORY_UNSPECIFIED = 0; + + // Indicates an event with category INCIDENT has a confirmed impact to at + // least one Google Cloud product. + CONFIRMED_INCIDENT = 1; + + // Indicates an event with category INCIDENT is under investigation to + // determine if it has a confirmed impact on any Google Cloud products. + EMERGING_INCIDENT = 2; + } + + // The state of the event. This enum lists all possible states of event. + enum State { + // Unspecified state. + STATE_UNSPECIFIED = 0; + + // Event is actively affecting a Google Cloud product and will continue to + // receive updates. + ACTIVE = 1; + + // Event is no longer affecting the Google Cloud product or has been merged + // with another event. + CLOSED = 2; + } + + // The detailed state of the incident. This enum lists all possible detailed + // states of an incident. + enum DetailedState { + // Unspecified detail state. + DETAILED_STATE_UNSPECIFIED = 0; + + // Google engineers are actively investigating the event to determine the + // impact. + EMERGING = 1; + + // The incident is confirmed and impacting at least one Google Cloud + // product. Ongoing status updates will be provided until it is resolved. + CONFIRMED = 2; + + // The incident is no longer affecting any Google Cloud product, and there + // will be no further updates. + RESOLVED = 3; + + // The incident was merged into a parent incident. All further updates will + // be published to the parent only. The `parent_event` field contains the + // name of the parent. + MERGED = 4; + + // The incident was automatically closed because the issues couldn’t be + // confirmed or is no longer impacting Google Cloud Products and/or + // Locations. + AUTO_CLOSED = 9; + + // The incident was verified as non-impactful. No further action required. + FALSE_POSITIVE = 10; + } + + // Communicates why a given incident is deemed relevant in the context of a + // given project. This enum lists all possible detailed states of relevance. + enum Relevance { + // Unspecified relevance. + RELEVANCE_UNSPECIFIED = 0; + + // The relevance of the incident to the project is unknown. + UNKNOWN = 2; + + // The incident does not impact the project. + NOT_IMPACTED = 6; + + // The incident is associated with a Google Cloud product your project uses, + // but the incident may not be impacting your project. For example, the + // incident may be impacting a Google Cloud product that your project uses, + // but in a location that your project does not use. + PARTIALLY_RELATED = 7; + + // The incident has a direct connection with your project and impacts a + // Google Cloud product in a location your project uses. + RELATED = 8; + + // The incident is verified to be impacting your project. + IMPACTED = 9; + } + + // Output only. Identifier. Name of the event. Unique name of the event in + // this scope including project and location using the form + // `projects/{project_id}/locations/{location}/events/{event_id}`. + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = IDENTIFIER + ]; + + // Output only. Brief description for the event. + string title = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Free-form, human-readable description. + string description = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The category of the event. + EventCategory category = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The detailed category of the event. + DetailedCategory detailed_category = 21 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current state of the event. + State state = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current detailed state of the incident. + DetailedState detailed_state = 19 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Google Cloud products and locations impacted by the event. + repeated EventImpact event_impacts = 20; + + // Output only. Communicates why a given event is deemed relevant in the + // context of a given project. + Relevance relevance = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Event updates are correspondence from Google. + repeated EventUpdate updates = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. When `detailed_state`=`MERGED`, `parent_event` contains the + // name of the parent event. All further updates will be published to the + // parent event. + string parent_event = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the event was last modified. + google.protobuf.Timestamp update_time = 12 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The start time of the event, if applicable. + google.protobuf.Timestamp start_time = 13 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The end time of the event, if applicable. + google.protobuf.Timestamp end_time = 14 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the next update can be expected. + google.protobuf.Timestamp next_update_time = 15 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Represents service health events that may affect Google Cloud products used +// across the organization. It is a read-only view and does not allow any +// modifications. +message OrganizationEvent { + option (google.api.resource) = { + type: "servicehealth.googleapis.com/OrganizationEvent" + pattern: "organizations/{organization}/locations/{location}/organizationEvents/{event}" + plural: "organizationEvents" + singular: "organizationEvent" + }; + + // The category of the event. This enum lists all possible categories of + // event. + enum EventCategory { + // Unspecified category. + EVENT_CATEGORY_UNSPECIFIED = 0; + + // Event category for service outage or degradation. + INCIDENT = 2; + } + + // The detailed category of an event. Contains all possible states for all + // event categories. + enum DetailedCategory { + // Unspecified detailed category. + DETAILED_CATEGORY_UNSPECIFIED = 0; + + // Indicates an event with category INCIDENT has a confirmed impact to at + // least one Google Cloud product. + CONFIRMED_INCIDENT = 1; + + // Indicates an event with category INCIDENT is under investigation to + // determine if it has a confirmed impact on any Google Cloud products. + EMERGING_INCIDENT = 2; + } + + // The state of the organization event. This enum lists all possible states of + // event. + enum State { + // Unspecified state. + STATE_UNSPECIFIED = 0; + + // Event is actively affecting a Google Cloud product and will continue to + // receive updates. + ACTIVE = 1; + + // Event is no longer affecting the Google Cloud product or has been merged + // with another event. + CLOSED = 2; + } + + // The detailed state of the incident. This enum lists all possible detailed + // states of an incident. + enum DetailedState { + // Unspecified detail state. + DETAILED_STATE_UNSPECIFIED = 0; + + // Google engineers are actively investigating the incident to determine the + // impact. + EMERGING = 1; + + // The incident is confirmed and impacting at least one Google Cloud + // product. Ongoing status updates will be provided until it is resolved. + CONFIRMED = 2; + + // The incident is no longer affecting any Google Cloud product, and there + // will be no further updates. + RESOLVED = 3; + + // The incident was merged into a parent event. All further updates will be + // published to the parent only. The `parent_event` contains the name of the + // parent. + MERGED = 4; + + // The incident was automatically closed because the issues couldn’t be + // confirmed or is no longer impacting Google Cloud Products and/or + // Locations. + AUTO_CLOSED = 9; + + // The incident was verified as non-impactful. No further action required. + FALSE_POSITIVE = 10; + } + + // Output only. Identifier. Name of the event. Unique name of the event in + // this scope including organization ID and location using the form + // `organizations/{organization_id}/locations/{location}/organizationEvents/{event_id}`. + // + // `organization_id` - see [Getting your organization resource + // ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).
+ // `location` - The location to get the service health events from.
+ // `event_id` - Organization event ID to retrieve. + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = IDENTIFIER + ]; + + // Output only. Brief description for the event. + string title = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Free-form, human-readable description. + string description = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The category of the event. + EventCategory category = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The detailed category of the event. + DetailedCategory detailed_category = 17 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current state of the event. + State state = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current detailed state of the incident. + DetailedState detailed_state = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Represents the Google Cloud products and locations impacted by + // the event. + repeated EventImpact event_impacts = 15 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Incident-only field. Event updates are correspondence from + // Google. + repeated EventUpdate updates = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. When `detailed_state`=`MERGED`, `parent_event` contains the + // name of the parent event. All further updates will be published to the + // parent event. + string parent_event = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the update was posted. + google.protobuf.Timestamp update_time = 11 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The start time of the event, if applicable. + google.protobuf.Timestamp start_time = 12 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The end time of the event, if applicable. + google.protobuf.Timestamp end_time = 13 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Incident-only field. The time when the next update can be + // expected. + google.protobuf.Timestamp next_update_time = 14 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Records an update made to the event. +message EventUpdate { + // Output only. The time the update was posted. + google.protobuf.Timestamp update_time = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Brief title for the event. + string title = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Free-form, human-readable description. + string description = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Symptoms of the event, if available. + string symptom = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Workaround steps to remediate the event impact, if available. + string workaround = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Represents the locations impacted by the event. +message Location { + // Location impacted by the event. Example: `"us-central1"` + string location_name = 1; +} + +// Represents the Google Cloud product impacted by the event. +message Product { + // Google Cloud product impacted by the event. Example: `"Google Cloud SQL"` + string product_name = 1; +} + +// Represents the Google Cloud products and locations impacted by the event. +message EventImpact { + // Google Cloud product impacted by the event. + Product product = 1; + + // Location impacted by the event. + Location location = 2; +} + +// Represents impact to assets at organizational level. It is a read-only view +// and does not allow any modifications. +message OrganizationImpact { + option (google.api.resource) = { + type: "servicehealth.googleapis.com/OrganizationImpact" + pattern: "organizations/{organization}/locations/{location}/organizationImpacts/{organization_impact}" + plural: "organizationImpacts" + singular: "organizationImpact" + }; + + // Output only. Identifier. Unique name of the organization impact in this + // scope including organization and location using the form + // `organizations/{organization_id}/locations/{location}/organizationImpacts/{organization_impact_id}`. + // + // `organization_id` - ID (number) of the organization that contains the + // event. To get your `organization_id`, see + // [Getting your organization resource + // ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).
+ // `organization_impact_id` - ID of the [OrganizationImpact + // resource](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact). + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = IDENTIFIER + ]; + + // Output only. A list of event names impacting the asset. + repeated string events = 2 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "servicehealth.googleapis.com/Event" + } + ]; + + // Output only. Google Cloud asset possibly impacted by the specified events. + Asset asset = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the affected project was last modified. + google.protobuf.Timestamp update_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Represents the asset impacted by the events. +message Asset { + // Output only. Full name of the resource as defined in + // [Resource + // Names](https://cloud.google.com/apis/design/resource_names#full_resource_name). + string asset_name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Type of the asset. Example: + // `"cloudresourcemanager.googleapis.com/Project"` + string asset_type = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +message ListEventsRequest { + // Required. Parent value using the form + // `projects/{project_id}/locations/{location}/events`. + // + // `project_id` - ID of the project for which to list service health + // events. + // `location` - The location to get the service health events from. + // To retrieve service health events of category = INCIDENT, use `location` = + // `global`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "servicehealth.googleapis.com/Event" + } + ]; + + // Optional. The maximum number of events that should be returned. Acceptable + // values are 1 to 100, inclusive. (The default value is 10.) If more results + // are available, the service returns a next_page_token that you can use to + // get the next page of results in subsequent list requests. The service may + // return fewer events than the requested page_size. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results the server should return. + // Provide Page token returned by a previous `ListEvents` call to retrieve the + // next page of results. When paginating, all other parameters provided to + // `ListEvents` must match the call that provided the page token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A filter expression that filters resources listed in the + // response. The expression takes the following forms:
+ // * field=value for `category` and `state`
+ // * field <, >, <=, or >= value for `update_time`
+ // Examples: `category=INCIDENT`, `update_time>=2000-01-01T11:30:00-04:00` + //
+ // + // Multiple filter queries are separated by spaces. Example: + // `category=INCIDENT state=ACTIVE`. + // + // By default, each expression is an AND expression. However, you can include + // AND and OR expressions explicitly. + // + // Filter is supported for the following fields: `category`, `state`, + // `update_time` + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Event fields to include in response. + EventView view = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +message ListEventsResponse { + // Output only. List of events. + repeated Event events = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The continuation token, used to page through large result + // sets. Provide this value in a subsequent request as page_token to retrieve + // the next page. + // + // If this field is not present, there are no subsequent results. + string next_page_token = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Locations that could not be reached. + repeated string unreachable = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Message for getting an event +message GetEventRequest { + // Required. Unique name of the event in this scope including project + // and location using the form + // `projects/{project_id}/locations/{location}/events/{event_id}`. + // + // `project_id` - Project ID of the project that contains the event.
+ // `location` - The location to get the service health events from.
+ // `event_id` - Event ID to retrieve. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "servicehealth.googleapis.com/Event" + } + ]; +} + +message ListOrganizationEventsRequest { + // Required. Parent value using the form + // `organizations/{organization_id}/locations/{location}/organizationEvents`. + // + // `organization_id` - ID (number) of the project that contains the event. To + // get your `organization_id`, see + // [Getting your organization resource + // ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).
+ // `location` - The location to get the service health events from. To + // retrieve service health events of category = INCIDENT, use `location` = + // `global`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "servicehealth.googleapis.com/OrganizationEvent" + } + ]; + + // Optional. The maximum number of events that should be returned. Acceptable + // values are `1` to `100`, inclusive. (The default value is `10`.) If more + // results are available, the service returns a `next_page_token` that you can + // use to get the next page of results in subsequent list requests. The + // service may return fewer events than the requested `page_size`. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results the server should return. + // + // Provide Page token returned by a previous `ListOrganizationEvents` call to + // retrieve the next page of results. + // + // When paginating, all other parameters provided to + // `ListOrganizationEvents` must match the call that provided the page token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A filter expression that filters resources listed in the + // response. The expression takes the following forms: + // + // * field=value for `category` and `state` + // * field <, >, <=, or >= value for `update_time` + // + // Examples: `category=INCIDENT`, `update_time>=2000-01-01T11:30:00-04:00` + // + // Multiple filter queries are space-separated. Example: + // `category=INCIDENT state=ACTIVE`. + // + // By default, each expression is an AND expression. However, you can include + // AND and OR expressions explicitly. + // + // Filter is supported for the following fields: `category`, `state`, + // `update_time` + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. OrganizationEvent fields to include in response. + OrganizationEventView view = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +message ListOrganizationEventsResponse { + // Output only. List of organization events affecting an organization. + repeated OrganizationEvent organization_events = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The continuation token, used to page through large result + // sets. Provide this value in a subsequent request as `page_token` to + // retrieve the next page. + // + // If this field is not present, there are no subsequent results. + string next_page_token = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Locations that could not be reached. + repeated string unreachable = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +message GetOrganizationEventRequest { + // Required. Unique name of the event in this scope including organization and + // event ID using the form + // `organizations/{organization_id}/locations/locations/global/organizationEvents/{event_id}`. + // + // `organization_id` - ID (number) of the project that contains the event. To + // get your `organization_id`, see + // [Getting your organization resource + // ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).
+ // `event_id` - Organization event ID to retrieve. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "servicehealth.googleapis.com/OrganizationEvent" + } + ]; +} + +// Message for requesting list of OrganizationImpacts +message ListOrganizationImpactsRequest { + // Required. Parent value using the form + // `organizations/{organization_id}/locations/{location}/organizationImpacts`. + // + // `organization_id` - ID (number) of the project that contains the event. To + // get your `organization_id`, see + // [Getting your organization resource + // ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id). + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "servicehealth.googleapis.com/OrganizationImpact" + } + ]; + + // Optional. The maximum number of events that should be returned. Acceptable + // values are `1` to `100`, inclusive. The default value is `10`. + // + // If more results are available, the service returns a + // `next_page_token` that can be used to get the next page of results in + // subsequent list requests. The service may return fewer + // [impacts](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact) + // than the requested `page_size`. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results the server should return. + // + // Provide `page_token` returned by a previous `ListOrganizationImpacts` call + // to retrieve the next page of results. + // + // When paginating, all other parameters provided to `ListOrganizationImpacts` + // must match the call that provided the page token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A filter expression that filters resources listed in the + // response. The expression is in the form of `field:value` for checking if a + // repeated field contains a value. + // + // Example: + // `events:organizations%2F{organization_id}%2Flocations%2Fglobal%2ForganizationEvents%2Fevent-id` + // + // To get your `{organization_id}`, see + // [Getting your organization resource + // ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id). + // + // Multiple filter queries are separated by spaces. + // + // By default, each expression is an AND expression. However, you can include + // AND and OR expressions explicitly. + // Filter is supported for the following fields: `events`. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +message ListOrganizationImpactsResponse { + // Output only. List of + // [impacts](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact) + // for an organization affected by service health events. + repeated OrganizationImpact organization_impacts = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The continuation token, used to page through large result + // sets. Provide this value in a subsequent request as `page_token` to + // retrieve the next page. + // + // If this field is not present, there are no subsequent results. + string next_page_token = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Locations that could not be reached. + repeated string unreachable = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +message GetOrganizationImpactRequest { + // Required. Name of the resource using the form + // `organizations/{organization_id}/locations/global/organizationImpacts/{organization_impact_id}`. + // + // `organization_id` - ID (number) of the organization that contains the + // event. To get your `organization_id`, see + // [Getting your organization resource + // ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).
+ // `organization_impact_id` - ID of the [OrganizationImpact + // resource](/service-health/docs/reference/rest/v1beta/organizations.locations.organizationImpacts#OrganizationImpact). + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "servicehealth.googleapis.com/OrganizationImpact" + } + ]; +} + +// The event fields to include in ListEvents API response. This enum lists all +// possible event views. +enum EventView { + // Unspecified event view. Default to `EVENT_VIEW_BASIC`. + EVENT_VIEW_UNSPECIFIED = 0; + + // Includes all fields except `updates`. This view is the default for + // ListEvents API. + EVENT_VIEW_BASIC = 1; + + // Includes all event fields. + EVENT_VIEW_FULL = 2; +} + +// The organization event fields to include in ListOrganizationEvents API +// response. This enum lists all possible organization event views. +enum OrganizationEventView { + // Unspecified event view. Default to `ORGANIZATION_EVENT_VIEW_BASIC`. + ORGANIZATION_EVENT_VIEW_UNSPECIFIED = 0; + + // Includes all organization event fields except `updates`. This view is the + // default for ListOrganizationEvents API. + ORGANIZATION_EVENT_VIEW_BASIC = 1; + + // Includes all organization event fields. + ORGANIZATION_EVENT_VIEW_FULL = 2; +} diff --git a/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/proto/google/cloud/servicehealth/v1/event_service.proto b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/proto/google/cloud/servicehealth/v1/event_service.proto new file mode 100644 index 000000000000..8670c83a12c2 --- /dev/null +++ b/java-servicehealth/proto-google-cloud-servicehealth-v1/src/main/proto/google/cloud/servicehealth/v1/event_service.proto @@ -0,0 +1,91 @@ +// Copyright 2023 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.servicehealth.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/cloud/servicehealth/v1/event_resources.proto"; + +option csharp_namespace = "Google.Cloud.ServiceHealth.V1"; +option go_package = "cloud.google.com/go/servicehealth/apiv1/servicehealthpb;servicehealthpb"; +option java_multiple_files = true; +option java_outer_classname = "EventServiceProto"; +option java_package = "com.google.cloud.servicehealth.v1"; +option php_namespace = "Google\\Cloud\\ServiceHealth\\V1"; +option ruby_package = "Google::Cloud::ServiceHealth::V1"; + +// Request service health events relevant to your Google Cloud project. +service ServiceHealth { + option (google.api.default_host) = "servicehealth.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Lists events under a given project and location. + rpc ListEvents(ListEventsRequest) returns (ListEventsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/events" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves a resource containing information about an event. + rpc GetEvent(GetEventRequest) returns (Event) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/events/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists organization events under a given organization and location. + rpc ListOrganizationEvents(ListOrganizationEventsRequest) + returns (ListOrganizationEventsResponse) { + option (google.api.http) = { + get: "/v1/{parent=organizations/*/locations/*}/organizationEvents" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves a resource containing information about an event affecting an + // organization . + rpc GetOrganizationEvent(GetOrganizationEventRequest) + returns (OrganizationEvent) { + option (google.api.http) = { + get: "/v1/{name=organizations/*/locations/*/organizationEvents/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists assets impacted by organization events under a given organization and + // location. + rpc ListOrganizationImpacts(ListOrganizationImpactsRequest) + returns (ListOrganizationImpactsResponse) { + option (google.api.http) = { + get: "/v1/{parent=organizations/*/locations/*}/organizationImpacts" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves a resource containing information about impact to an asset under + // an organization affected by a service health event. + rpc GetOrganizationImpact(GetOrganizationImpactRequest) + returns (OrganizationImpact) { + option (google.api.http) = { + get: "/v1/{name=organizations/*/locations/*/organizationImpacts/*}" + }; + option (google.api.method_signature) = "name"; + } +} diff --git a/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/create/SyncCreateSetCredentialsProvider.java b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..5636195130ab --- /dev/null +++ b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,44 @@ +/* + * Copyright 2023 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.servicehealth.v1.samples; + +// [START servicehealth_v1_generated_ServiceHealth_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.servicehealth.v1.ServiceHealthClient; +import com.google.cloud.servicehealth.v1.ServiceHealthSettings; +import com.google.cloud.servicehealth.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 + ServiceHealthSettings serviceHealthSettings = + ServiceHealthSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + ServiceHealthClient serviceHealthClient = ServiceHealthClient.create(serviceHealthSettings); + } +} +// [END servicehealth_v1_generated_ServiceHealth_Create_SetCredentialsProvider_sync] diff --git a/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/create/SyncCreateSetCredentialsProvider1.java b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..8fb368e8fbe1 --- /dev/null +++ b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,40 @@ +/* + * Copyright 2023 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.servicehealth.v1.samples; + +// [START servicehealth_v1_generated_ServiceHealth_Create_SetCredentialsProvider1_sync] +import com.google.cloud.servicehealth.v1.ServiceHealthClient; +import com.google.cloud.servicehealth.v1.ServiceHealthSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() 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 + ServiceHealthSettings serviceHealthSettings = + ServiceHealthSettings.newHttpJsonBuilder().build(); + ServiceHealthClient serviceHealthClient = ServiceHealthClient.create(serviceHealthSettings); + } +} +// [END servicehealth_v1_generated_ServiceHealth_Create_SetCredentialsProvider1_sync] diff --git a/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/create/SyncCreateSetEndpoint.java b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..618c19902b24 --- /dev/null +++ b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/create/SyncCreateSetEndpoint.java @@ -0,0 +1,41 @@ +/* + * Copyright 2023 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.servicehealth.v1.samples; + +// [START servicehealth_v1_generated_ServiceHealth_Create_SetEndpoint_sync] +import com.google.cloud.servicehealth.v1.ServiceHealthClient; +import com.google.cloud.servicehealth.v1.ServiceHealthSettings; +import com.google.cloud.servicehealth.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 + ServiceHealthSettings serviceHealthSettings = + ServiceHealthSettings.newBuilder().setEndpoint(myEndpoint).build(); + ServiceHealthClient serviceHealthClient = ServiceHealthClient.create(serviceHealthSettings); + } +} +// [END servicehealth_v1_generated_ServiceHealth_Create_SetEndpoint_sync] diff --git a/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/getevent/AsyncGetEvent.java b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/getevent/AsyncGetEvent.java new file mode 100644 index 000000000000..56c61ef8de7f --- /dev/null +++ b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/getevent/AsyncGetEvent.java @@ -0,0 +1,49 @@ +/* + * Copyright 2023 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.servicehealth.v1.samples; + +// [START servicehealth_v1_generated_ServiceHealth_GetEvent_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.servicehealth.v1.Event; +import com.google.cloud.servicehealth.v1.EventName; +import com.google.cloud.servicehealth.v1.GetEventRequest; +import com.google.cloud.servicehealth.v1.ServiceHealthClient; + +public class AsyncGetEvent { + + public static void main(String[] args) throws Exception { + asyncGetEvent(); + } + + public static void asyncGetEvent() 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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) { + GetEventRequest request = + GetEventRequest.newBuilder() + .setName(EventName.of("[PROJECT]", "[LOCATION]", "[EVENT]").toString()) + .build(); + ApiFuture future = serviceHealthClient.getEventCallable().futureCall(request); + // Do something. + Event response = future.get(); + } + } +} +// [END servicehealth_v1_generated_ServiceHealth_GetEvent_async] diff --git a/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/getevent/SyncGetEvent.java b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/getevent/SyncGetEvent.java new file mode 100644 index 000000000000..765cd2dcf784 --- /dev/null +++ b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/getevent/SyncGetEvent.java @@ -0,0 +1,46 @@ +/* + * Copyright 2023 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.servicehealth.v1.samples; + +// [START servicehealth_v1_generated_ServiceHealth_GetEvent_sync] +import com.google.cloud.servicehealth.v1.Event; +import com.google.cloud.servicehealth.v1.EventName; +import com.google.cloud.servicehealth.v1.GetEventRequest; +import com.google.cloud.servicehealth.v1.ServiceHealthClient; + +public class SyncGetEvent { + + public static void main(String[] args) throws Exception { + syncGetEvent(); + } + + public static void syncGetEvent() 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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) { + GetEventRequest request = + GetEventRequest.newBuilder() + .setName(EventName.of("[PROJECT]", "[LOCATION]", "[EVENT]").toString()) + .build(); + Event response = serviceHealthClient.getEvent(request); + } + } +} +// [END servicehealth_v1_generated_ServiceHealth_GetEvent_sync] diff --git a/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/getevent/SyncGetEventEventname.java b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/getevent/SyncGetEventEventname.java new file mode 100644 index 000000000000..8c8bd92614e8 --- /dev/null +++ b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/getevent/SyncGetEventEventname.java @@ -0,0 +1,42 @@ +/* + * Copyright 2023 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.servicehealth.v1.samples; + +// [START servicehealth_v1_generated_ServiceHealth_GetEvent_Eventname_sync] +import com.google.cloud.servicehealth.v1.Event; +import com.google.cloud.servicehealth.v1.EventName; +import com.google.cloud.servicehealth.v1.ServiceHealthClient; + +public class SyncGetEventEventname { + + public static void main(String[] args) throws Exception { + syncGetEventEventname(); + } + + public static void syncGetEventEventname() 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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) { + EventName name = EventName.of("[PROJECT]", "[LOCATION]", "[EVENT]"); + Event response = serviceHealthClient.getEvent(name); + } + } +} +// [END servicehealth_v1_generated_ServiceHealth_GetEvent_Eventname_sync] diff --git a/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/getevent/SyncGetEventString.java b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/getevent/SyncGetEventString.java new file mode 100644 index 000000000000..8a454610156b --- /dev/null +++ b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/getevent/SyncGetEventString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2023 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.servicehealth.v1.samples; + +// [START servicehealth_v1_generated_ServiceHealth_GetEvent_String_sync] +import com.google.cloud.servicehealth.v1.Event; +import com.google.cloud.servicehealth.v1.EventName; +import com.google.cloud.servicehealth.v1.ServiceHealthClient; + +public class SyncGetEventString { + + public static void main(String[] args) throws Exception { + syncGetEventString(); + } + + public static void syncGetEventString() 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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) { + String name = EventName.of("[PROJECT]", "[LOCATION]", "[EVENT]").toString(); + Event response = serviceHealthClient.getEvent(name); + } + } +} +// [END servicehealth_v1_generated_ServiceHealth_GetEvent_String_sync] diff --git a/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/getlocation/AsyncGetLocation.java b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/getlocation/AsyncGetLocation.java new file mode 100644 index 000000000000..a53a163da835 --- /dev/null +++ b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/getlocation/AsyncGetLocation.java @@ -0,0 +1,45 @@ +/* + * Copyright 2023 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.servicehealth.v1.samples; + +// [START servicehealth_v1_generated_ServiceHealth_GetLocation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; +import com.google.cloud.servicehealth.v1.ServiceHealthClient; + +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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + ApiFuture future = serviceHealthClient.getLocationCallable().futureCall(request); + // Do something. + Location response = future.get(); + } + } +} +// [END servicehealth_v1_generated_ServiceHealth_GetLocation_async] diff --git a/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/getlocation/SyncGetLocation.java b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/getlocation/SyncGetLocation.java new file mode 100644 index 000000000000..a3c308829a15 --- /dev/null +++ b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/getlocation/SyncGetLocation.java @@ -0,0 +1,42 @@ +/* + * Copyright 2023 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.servicehealth.v1.samples; + +// [START servicehealth_v1_generated_ServiceHealth_GetLocation_sync] +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; +import com.google.cloud.servicehealth.v1.ServiceHealthClient; + +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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + Location response = serviceHealthClient.getLocation(request); + } + } +} +// [END servicehealth_v1_generated_ServiceHealth_GetLocation_sync] diff --git a/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/getorganizationevent/AsyncGetOrganizationEvent.java b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/getorganizationevent/AsyncGetOrganizationEvent.java new file mode 100644 index 000000000000..dc14f7f96485 --- /dev/null +++ b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/getorganizationevent/AsyncGetOrganizationEvent.java @@ -0,0 +1,51 @@ +/* + * Copyright 2023 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.servicehealth.v1.samples; + +// [START servicehealth_v1_generated_ServiceHealth_GetOrganizationEvent_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.servicehealth.v1.GetOrganizationEventRequest; +import com.google.cloud.servicehealth.v1.OrganizationEvent; +import com.google.cloud.servicehealth.v1.OrganizationEventName; +import com.google.cloud.servicehealth.v1.ServiceHealthClient; + +public class AsyncGetOrganizationEvent { + + public static void main(String[] args) throws Exception { + asyncGetOrganizationEvent(); + } + + public static void asyncGetOrganizationEvent() 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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) { + GetOrganizationEventRequest request = + GetOrganizationEventRequest.newBuilder() + .setName( + OrganizationEventName.of("[ORGANIZATION]", "[LOCATION]", "[EVENT]").toString()) + .build(); + ApiFuture future = + serviceHealthClient.getOrganizationEventCallable().futureCall(request); + // Do something. + OrganizationEvent response = future.get(); + } + } +} +// [END servicehealth_v1_generated_ServiceHealth_GetOrganizationEvent_async] diff --git a/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/getorganizationevent/SyncGetOrganizationEvent.java b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/getorganizationevent/SyncGetOrganizationEvent.java new file mode 100644 index 000000000000..4718b71d30f4 --- /dev/null +++ b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/getorganizationevent/SyncGetOrganizationEvent.java @@ -0,0 +1,47 @@ +/* + * Copyright 2023 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.servicehealth.v1.samples; + +// [START servicehealth_v1_generated_ServiceHealth_GetOrganizationEvent_sync] +import com.google.cloud.servicehealth.v1.GetOrganizationEventRequest; +import com.google.cloud.servicehealth.v1.OrganizationEvent; +import com.google.cloud.servicehealth.v1.OrganizationEventName; +import com.google.cloud.servicehealth.v1.ServiceHealthClient; + +public class SyncGetOrganizationEvent { + + public static void main(String[] args) throws Exception { + syncGetOrganizationEvent(); + } + + public static void syncGetOrganizationEvent() 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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) { + GetOrganizationEventRequest request = + GetOrganizationEventRequest.newBuilder() + .setName( + OrganizationEventName.of("[ORGANIZATION]", "[LOCATION]", "[EVENT]").toString()) + .build(); + OrganizationEvent response = serviceHealthClient.getOrganizationEvent(request); + } + } +} +// [END servicehealth_v1_generated_ServiceHealth_GetOrganizationEvent_sync] diff --git a/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/getorganizationevent/SyncGetOrganizationEventOrganizationeventname.java b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/getorganizationevent/SyncGetOrganizationEventOrganizationeventname.java new file mode 100644 index 000000000000..e5acc2a61c5a --- /dev/null +++ b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/getorganizationevent/SyncGetOrganizationEventOrganizationeventname.java @@ -0,0 +1,43 @@ +/* + * Copyright 2023 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.servicehealth.v1.samples; + +// [START servicehealth_v1_generated_ServiceHealth_GetOrganizationEvent_Organizationeventname_sync] +import com.google.cloud.servicehealth.v1.OrganizationEvent; +import com.google.cloud.servicehealth.v1.OrganizationEventName; +import com.google.cloud.servicehealth.v1.ServiceHealthClient; + +public class SyncGetOrganizationEventOrganizationeventname { + + public static void main(String[] args) throws Exception { + syncGetOrganizationEventOrganizationeventname(); + } + + public static void syncGetOrganizationEventOrganizationeventname() 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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) { + OrganizationEventName name = + OrganizationEventName.of("[ORGANIZATION]", "[LOCATION]", "[EVENT]"); + OrganizationEvent response = serviceHealthClient.getOrganizationEvent(name); + } + } +} +// [END servicehealth_v1_generated_ServiceHealth_GetOrganizationEvent_Organizationeventname_sync] diff --git a/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/getorganizationevent/SyncGetOrganizationEventString.java b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/getorganizationevent/SyncGetOrganizationEventString.java new file mode 100644 index 000000000000..03967c60df84 --- /dev/null +++ b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/getorganizationevent/SyncGetOrganizationEventString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2023 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.servicehealth.v1.samples; + +// [START servicehealth_v1_generated_ServiceHealth_GetOrganizationEvent_String_sync] +import com.google.cloud.servicehealth.v1.OrganizationEvent; +import com.google.cloud.servicehealth.v1.OrganizationEventName; +import com.google.cloud.servicehealth.v1.ServiceHealthClient; + +public class SyncGetOrganizationEventString { + + public static void main(String[] args) throws Exception { + syncGetOrganizationEventString(); + } + + public static void syncGetOrganizationEventString() 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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) { + String name = OrganizationEventName.of("[ORGANIZATION]", "[LOCATION]", "[EVENT]").toString(); + OrganizationEvent response = serviceHealthClient.getOrganizationEvent(name); + } + } +} +// [END servicehealth_v1_generated_ServiceHealth_GetOrganizationEvent_String_sync] diff --git a/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/getorganizationimpact/AsyncGetOrganizationImpact.java b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/getorganizationimpact/AsyncGetOrganizationImpact.java new file mode 100644 index 000000000000..84def5cae841 --- /dev/null +++ b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/getorganizationimpact/AsyncGetOrganizationImpact.java @@ -0,0 +1,52 @@ +/* + * Copyright 2023 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.servicehealth.v1.samples; + +// [START servicehealth_v1_generated_ServiceHealth_GetOrganizationImpact_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.servicehealth.v1.GetOrganizationImpactRequest; +import com.google.cloud.servicehealth.v1.OrganizationImpact; +import com.google.cloud.servicehealth.v1.OrganizationImpactName; +import com.google.cloud.servicehealth.v1.ServiceHealthClient; + +public class AsyncGetOrganizationImpact { + + public static void main(String[] args) throws Exception { + asyncGetOrganizationImpact(); + } + + public static void asyncGetOrganizationImpact() 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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) { + GetOrganizationImpactRequest request = + GetOrganizationImpactRequest.newBuilder() + .setName( + OrganizationImpactName.of("[ORGANIZATION]", "[LOCATION]", "[ORGANIZATION_IMPACT]") + .toString()) + .build(); + ApiFuture future = + serviceHealthClient.getOrganizationImpactCallable().futureCall(request); + // Do something. + OrganizationImpact response = future.get(); + } + } +} +// [END servicehealth_v1_generated_ServiceHealth_GetOrganizationImpact_async] diff --git a/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/getorganizationimpact/SyncGetOrganizationImpact.java b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/getorganizationimpact/SyncGetOrganizationImpact.java new file mode 100644 index 000000000000..ae79fbd14d23 --- /dev/null +++ b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/getorganizationimpact/SyncGetOrganizationImpact.java @@ -0,0 +1,48 @@ +/* + * Copyright 2023 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.servicehealth.v1.samples; + +// [START servicehealth_v1_generated_ServiceHealth_GetOrganizationImpact_sync] +import com.google.cloud.servicehealth.v1.GetOrganizationImpactRequest; +import com.google.cloud.servicehealth.v1.OrganizationImpact; +import com.google.cloud.servicehealth.v1.OrganizationImpactName; +import com.google.cloud.servicehealth.v1.ServiceHealthClient; + +public class SyncGetOrganizationImpact { + + public static void main(String[] args) throws Exception { + syncGetOrganizationImpact(); + } + + public static void syncGetOrganizationImpact() 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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) { + GetOrganizationImpactRequest request = + GetOrganizationImpactRequest.newBuilder() + .setName( + OrganizationImpactName.of("[ORGANIZATION]", "[LOCATION]", "[ORGANIZATION_IMPACT]") + .toString()) + .build(); + OrganizationImpact response = serviceHealthClient.getOrganizationImpact(request); + } + } +} +// [END servicehealth_v1_generated_ServiceHealth_GetOrganizationImpact_sync] diff --git a/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/getorganizationimpact/SyncGetOrganizationImpactOrganizationimpactname.java b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/getorganizationimpact/SyncGetOrganizationImpactOrganizationimpactname.java new file mode 100644 index 000000000000..25a26398650c --- /dev/null +++ b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/getorganizationimpact/SyncGetOrganizationImpactOrganizationimpactname.java @@ -0,0 +1,43 @@ +/* + * Copyright 2023 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.servicehealth.v1.samples; + +// [START servicehealth_v1_generated_ServiceHealth_GetOrganizationImpact_Organizationimpactname_sync] +import com.google.cloud.servicehealth.v1.OrganizationImpact; +import com.google.cloud.servicehealth.v1.OrganizationImpactName; +import com.google.cloud.servicehealth.v1.ServiceHealthClient; + +public class SyncGetOrganizationImpactOrganizationimpactname { + + public static void main(String[] args) throws Exception { + syncGetOrganizationImpactOrganizationimpactname(); + } + + public static void syncGetOrganizationImpactOrganizationimpactname() 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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) { + OrganizationImpactName name = + OrganizationImpactName.of("[ORGANIZATION]", "[LOCATION]", "[ORGANIZATION_IMPACT]"); + OrganizationImpact response = serviceHealthClient.getOrganizationImpact(name); + } + } +} +// [END servicehealth_v1_generated_ServiceHealth_GetOrganizationImpact_Organizationimpactname_sync] diff --git a/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/getorganizationimpact/SyncGetOrganizationImpactString.java b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/getorganizationimpact/SyncGetOrganizationImpactString.java new file mode 100644 index 000000000000..1f0f0b28d3a5 --- /dev/null +++ b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/getorganizationimpact/SyncGetOrganizationImpactString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2023 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.servicehealth.v1.samples; + +// [START servicehealth_v1_generated_ServiceHealth_GetOrganizationImpact_String_sync] +import com.google.cloud.servicehealth.v1.OrganizationImpact; +import com.google.cloud.servicehealth.v1.OrganizationImpactName; +import com.google.cloud.servicehealth.v1.ServiceHealthClient; + +public class SyncGetOrganizationImpactString { + + public static void main(String[] args) throws Exception { + syncGetOrganizationImpactString(); + } + + public static void syncGetOrganizationImpactString() 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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) { + String name = + OrganizationImpactName.of("[ORGANIZATION]", "[LOCATION]", "[ORGANIZATION_IMPACT]") + .toString(); + OrganizationImpact response = serviceHealthClient.getOrganizationImpact(name); + } + } +} +// [END servicehealth_v1_generated_ServiceHealth_GetOrganizationImpact_String_sync] diff --git a/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/listevents/AsyncListEvents.java b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/listevents/AsyncListEvents.java new file mode 100644 index 000000000000..ceb2f445065a --- /dev/null +++ b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/listevents/AsyncListEvents.java @@ -0,0 +1,56 @@ +/* + * Copyright 2023 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.servicehealth.v1.samples; + +// [START servicehealth_v1_generated_ServiceHealth_ListEvents_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.servicehealth.v1.Event; +import com.google.cloud.servicehealth.v1.EventView; +import com.google.cloud.servicehealth.v1.ListEventsRequest; +import com.google.cloud.servicehealth.v1.LocationName; +import com.google.cloud.servicehealth.v1.ServiceHealthClient; + +public class AsyncListEvents { + + public static void main(String[] args) throws Exception { + asyncListEvents(); + } + + public static void asyncListEvents() 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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) { + ListEventsRequest request = + ListEventsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setView(EventView.forNumber(0)) + .build(); + ApiFuture future = serviceHealthClient.listEventsPagedCallable().futureCall(request); + // Do something. + for (Event element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END servicehealth_v1_generated_ServiceHealth_ListEvents_async] diff --git a/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/listevents/AsyncListEventsPaged.java b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/listevents/AsyncListEventsPaged.java new file mode 100644 index 000000000000..06b8a77165b1 --- /dev/null +++ b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/listevents/AsyncListEventsPaged.java @@ -0,0 +1,64 @@ +/* + * Copyright 2023 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.servicehealth.v1.samples; + +// [START servicehealth_v1_generated_ServiceHealth_ListEvents_Paged_async] +import com.google.cloud.servicehealth.v1.Event; +import com.google.cloud.servicehealth.v1.EventView; +import com.google.cloud.servicehealth.v1.ListEventsRequest; +import com.google.cloud.servicehealth.v1.ListEventsResponse; +import com.google.cloud.servicehealth.v1.LocationName; +import com.google.cloud.servicehealth.v1.ServiceHealthClient; +import com.google.common.base.Strings; + +public class AsyncListEventsPaged { + + public static void main(String[] args) throws Exception { + asyncListEventsPaged(); + } + + public static void asyncListEventsPaged() 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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) { + ListEventsRequest request = + ListEventsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setView(EventView.forNumber(0)) + .build(); + while (true) { + ListEventsResponse response = serviceHealthClient.listEventsCallable().call(request); + for (Event element : response.getEventsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END servicehealth_v1_generated_ServiceHealth_ListEvents_Paged_async] diff --git a/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/listevents/SyncListEvents.java b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/listevents/SyncListEvents.java new file mode 100644 index 000000000000..392e7e1a2e4d --- /dev/null +++ b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/listevents/SyncListEvents.java @@ -0,0 +1,53 @@ +/* + * Copyright 2023 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.servicehealth.v1.samples; + +// [START servicehealth_v1_generated_ServiceHealth_ListEvents_sync] +import com.google.cloud.servicehealth.v1.Event; +import com.google.cloud.servicehealth.v1.EventView; +import com.google.cloud.servicehealth.v1.ListEventsRequest; +import com.google.cloud.servicehealth.v1.LocationName; +import com.google.cloud.servicehealth.v1.ServiceHealthClient; + +public class SyncListEvents { + + public static void main(String[] args) throws Exception { + syncListEvents(); + } + + public static void syncListEvents() 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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) { + ListEventsRequest request = + ListEventsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setView(EventView.forNumber(0)) + .build(); + for (Event element : serviceHealthClient.listEvents(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END servicehealth_v1_generated_ServiceHealth_ListEvents_sync] diff --git a/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/listevents/SyncListEventsLocationname.java b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/listevents/SyncListEventsLocationname.java new file mode 100644 index 000000000000..988835e9baea --- /dev/null +++ b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/listevents/SyncListEventsLocationname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2023 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.servicehealth.v1.samples; + +// [START servicehealth_v1_generated_ServiceHealth_ListEvents_Locationname_sync] +import com.google.cloud.servicehealth.v1.Event; +import com.google.cloud.servicehealth.v1.LocationName; +import com.google.cloud.servicehealth.v1.ServiceHealthClient; + +public class SyncListEventsLocationname { + + public static void main(String[] args) throws Exception { + syncListEventsLocationname(); + } + + public static void syncListEventsLocationname() 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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + for (Event element : serviceHealthClient.listEvents(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END servicehealth_v1_generated_ServiceHealth_ListEvents_Locationname_sync] diff --git a/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/listevents/SyncListEventsString.java b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/listevents/SyncListEventsString.java new file mode 100644 index 000000000000..63051543d8cf --- /dev/null +++ b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/listevents/SyncListEventsString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2023 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.servicehealth.v1.samples; + +// [START servicehealth_v1_generated_ServiceHealth_ListEvents_String_sync] +import com.google.cloud.servicehealth.v1.Event; +import com.google.cloud.servicehealth.v1.LocationName; +import com.google.cloud.servicehealth.v1.ServiceHealthClient; + +public class SyncListEventsString { + + public static void main(String[] args) throws Exception { + syncListEventsString(); + } + + public static void syncListEventsString() 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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + for (Event element : serviceHealthClient.listEvents(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END servicehealth_v1_generated_ServiceHealth_ListEvents_String_sync] diff --git a/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/listlocations/AsyncListLocations.java b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/listlocations/AsyncListLocations.java new file mode 100644 index 000000000000..dda35b5593cf --- /dev/null +++ b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/listlocations/AsyncListLocations.java @@ -0,0 +1,54 @@ +/* + * Copyright 2023 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.servicehealth.v1.samples; + +// [START servicehealth_v1_generated_ServiceHealth_ListLocations_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.cloud.servicehealth.v1.ServiceHealthClient; + +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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + serviceHealthClient.listLocationsPagedCallable().futureCall(request); + // Do something. + for (Location element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END servicehealth_v1_generated_ServiceHealth_ListLocations_async] diff --git a/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/listlocations/AsyncListLocationsPaged.java b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/listlocations/AsyncListLocationsPaged.java new file mode 100644 index 000000000000..0d9e9b65741b --- /dev/null +++ b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/listlocations/AsyncListLocationsPaged.java @@ -0,0 +1,61 @@ +/* + * Copyright 2023 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.servicehealth.v1.samples; + +// [START servicehealth_v1_generated_ServiceHealth_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.servicehealth.v1.ServiceHealthClient; +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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListLocationsResponse response = serviceHealthClient.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 servicehealth_v1_generated_ServiceHealth_ListLocations_Paged_async] diff --git a/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/listlocations/SyncListLocations.java b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/listlocations/SyncListLocations.java new file mode 100644 index 000000000000..33ed623637b0 --- /dev/null +++ b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/listlocations/SyncListLocations.java @@ -0,0 +1,50 @@ +/* + * Copyright 2023 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.servicehealth.v1.samples; + +// [START servicehealth_v1_generated_ServiceHealth_ListLocations_sync] +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.cloud.servicehealth.v1.ServiceHealthClient; + +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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Location element : serviceHealthClient.listLocations(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END servicehealth_v1_generated_ServiceHealth_ListLocations_sync] diff --git a/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/listorganizationevents/AsyncListOrganizationEvents.java b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/listorganizationevents/AsyncListOrganizationEvents.java new file mode 100644 index 000000000000..c11a1eac464b --- /dev/null +++ b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/listorganizationevents/AsyncListOrganizationEvents.java @@ -0,0 +1,57 @@ +/* + * Copyright 2023 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.servicehealth.v1.samples; + +// [START servicehealth_v1_generated_ServiceHealth_ListOrganizationEvents_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.servicehealth.v1.ListOrganizationEventsRequest; +import com.google.cloud.servicehealth.v1.OrganizationEvent; +import com.google.cloud.servicehealth.v1.OrganizationEventView; +import com.google.cloud.servicehealth.v1.OrganizationLocationName; +import com.google.cloud.servicehealth.v1.ServiceHealthClient; + +public class AsyncListOrganizationEvents { + + public static void main(String[] args) throws Exception { + asyncListOrganizationEvents(); + } + + public static void asyncListOrganizationEvents() 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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) { + ListOrganizationEventsRequest request = + ListOrganizationEventsRequest.newBuilder() + .setParent(OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setView(OrganizationEventView.forNumber(0)) + .build(); + ApiFuture future = + serviceHealthClient.listOrganizationEventsPagedCallable().futureCall(request); + // Do something. + for (OrganizationEvent element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END servicehealth_v1_generated_ServiceHealth_ListOrganizationEvents_async] diff --git a/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/listorganizationevents/AsyncListOrganizationEventsPaged.java b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/listorganizationevents/AsyncListOrganizationEventsPaged.java new file mode 100644 index 000000000000..35d2b7df7415 --- /dev/null +++ b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/listorganizationevents/AsyncListOrganizationEventsPaged.java @@ -0,0 +1,65 @@ +/* + * Copyright 2023 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.servicehealth.v1.samples; + +// [START servicehealth_v1_generated_ServiceHealth_ListOrganizationEvents_Paged_async] +import com.google.cloud.servicehealth.v1.ListOrganizationEventsRequest; +import com.google.cloud.servicehealth.v1.ListOrganizationEventsResponse; +import com.google.cloud.servicehealth.v1.OrganizationEvent; +import com.google.cloud.servicehealth.v1.OrganizationEventView; +import com.google.cloud.servicehealth.v1.OrganizationLocationName; +import com.google.cloud.servicehealth.v1.ServiceHealthClient; +import com.google.common.base.Strings; + +public class AsyncListOrganizationEventsPaged { + + public static void main(String[] args) throws Exception { + asyncListOrganizationEventsPaged(); + } + + public static void asyncListOrganizationEventsPaged() 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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) { + ListOrganizationEventsRequest request = + ListOrganizationEventsRequest.newBuilder() + .setParent(OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setView(OrganizationEventView.forNumber(0)) + .build(); + while (true) { + ListOrganizationEventsResponse response = + serviceHealthClient.listOrganizationEventsCallable().call(request); + for (OrganizationEvent element : response.getOrganizationEventsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END servicehealth_v1_generated_ServiceHealth_ListOrganizationEvents_Paged_async] diff --git a/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/listorganizationevents/SyncListOrganizationEvents.java b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/listorganizationevents/SyncListOrganizationEvents.java new file mode 100644 index 000000000000..88ed71fb0860 --- /dev/null +++ b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/listorganizationevents/SyncListOrganizationEvents.java @@ -0,0 +1,54 @@ +/* + * Copyright 2023 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.servicehealth.v1.samples; + +// [START servicehealth_v1_generated_ServiceHealth_ListOrganizationEvents_sync] +import com.google.cloud.servicehealth.v1.ListOrganizationEventsRequest; +import com.google.cloud.servicehealth.v1.OrganizationEvent; +import com.google.cloud.servicehealth.v1.OrganizationEventView; +import com.google.cloud.servicehealth.v1.OrganizationLocationName; +import com.google.cloud.servicehealth.v1.ServiceHealthClient; + +public class SyncListOrganizationEvents { + + public static void main(String[] args) throws Exception { + syncListOrganizationEvents(); + } + + public static void syncListOrganizationEvents() 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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) { + ListOrganizationEventsRequest request = + ListOrganizationEventsRequest.newBuilder() + .setParent(OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setView(OrganizationEventView.forNumber(0)) + .build(); + for (OrganizationEvent element : + serviceHealthClient.listOrganizationEvents(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END servicehealth_v1_generated_ServiceHealth_ListOrganizationEvents_sync] diff --git a/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/listorganizationevents/SyncListOrganizationEventsOrganizationlocationname.java b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/listorganizationevents/SyncListOrganizationEventsOrganizationlocationname.java new file mode 100644 index 000000000000..c7d82772eabb --- /dev/null +++ b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/listorganizationevents/SyncListOrganizationEventsOrganizationlocationname.java @@ -0,0 +1,45 @@ +/* + * Copyright 2023 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.servicehealth.v1.samples; + +// [START servicehealth_v1_generated_ServiceHealth_ListOrganizationEvents_Organizationlocationname_sync] +import com.google.cloud.servicehealth.v1.OrganizationEvent; +import com.google.cloud.servicehealth.v1.OrganizationLocationName; +import com.google.cloud.servicehealth.v1.ServiceHealthClient; + +public class SyncListOrganizationEventsOrganizationlocationname { + + public static void main(String[] args) throws Exception { + syncListOrganizationEventsOrganizationlocationname(); + } + + public static void syncListOrganizationEventsOrganizationlocationname() 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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) { + OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]"); + for (OrganizationEvent element : + serviceHealthClient.listOrganizationEvents(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END servicehealth_v1_generated_ServiceHealth_ListOrganizationEvents_Organizationlocationname_sync] diff --git a/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/listorganizationevents/SyncListOrganizationEventsString.java b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/listorganizationevents/SyncListOrganizationEventsString.java new file mode 100644 index 000000000000..9286a1f88f64 --- /dev/null +++ b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/listorganizationevents/SyncListOrganizationEventsString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2023 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.servicehealth.v1.samples; + +// [START servicehealth_v1_generated_ServiceHealth_ListOrganizationEvents_String_sync] +import com.google.cloud.servicehealth.v1.OrganizationEvent; +import com.google.cloud.servicehealth.v1.OrganizationLocationName; +import com.google.cloud.servicehealth.v1.ServiceHealthClient; + +public class SyncListOrganizationEventsString { + + public static void main(String[] args) throws Exception { + syncListOrganizationEventsString(); + } + + public static void syncListOrganizationEventsString() 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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) { + String parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString(); + for (OrganizationEvent element : + serviceHealthClient.listOrganizationEvents(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END servicehealth_v1_generated_ServiceHealth_ListOrganizationEvents_String_sync] diff --git a/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/listorganizationimpacts/AsyncListOrganizationImpacts.java b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/listorganizationimpacts/AsyncListOrganizationImpacts.java new file mode 100644 index 000000000000..5b32029a1a32 --- /dev/null +++ b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/listorganizationimpacts/AsyncListOrganizationImpacts.java @@ -0,0 +1,55 @@ +/* + * Copyright 2023 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.servicehealth.v1.samples; + +// [START servicehealth_v1_generated_ServiceHealth_ListOrganizationImpacts_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.servicehealth.v1.ListOrganizationImpactsRequest; +import com.google.cloud.servicehealth.v1.OrganizationImpact; +import com.google.cloud.servicehealth.v1.OrganizationLocationName; +import com.google.cloud.servicehealth.v1.ServiceHealthClient; + +public class AsyncListOrganizationImpacts { + + public static void main(String[] args) throws Exception { + asyncListOrganizationImpacts(); + } + + public static void asyncListOrganizationImpacts() 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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) { + ListOrganizationImpactsRequest request = + ListOrganizationImpactsRequest.newBuilder() + .setParent(OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .build(); + ApiFuture future = + serviceHealthClient.listOrganizationImpactsPagedCallable().futureCall(request); + // Do something. + for (OrganizationImpact element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END servicehealth_v1_generated_ServiceHealth_ListOrganizationImpacts_async] diff --git a/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/listorganizationimpacts/AsyncListOrganizationImpactsPaged.java b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/listorganizationimpacts/AsyncListOrganizationImpactsPaged.java new file mode 100644 index 000000000000..55f826c3cdae --- /dev/null +++ b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/listorganizationimpacts/AsyncListOrganizationImpactsPaged.java @@ -0,0 +1,63 @@ +/* + * Copyright 2023 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.servicehealth.v1.samples; + +// [START servicehealth_v1_generated_ServiceHealth_ListOrganizationImpacts_Paged_async] +import com.google.cloud.servicehealth.v1.ListOrganizationImpactsRequest; +import com.google.cloud.servicehealth.v1.ListOrganizationImpactsResponse; +import com.google.cloud.servicehealth.v1.OrganizationImpact; +import com.google.cloud.servicehealth.v1.OrganizationLocationName; +import com.google.cloud.servicehealth.v1.ServiceHealthClient; +import com.google.common.base.Strings; + +public class AsyncListOrganizationImpactsPaged { + + public static void main(String[] args) throws Exception { + asyncListOrganizationImpactsPaged(); + } + + public static void asyncListOrganizationImpactsPaged() 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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) { + ListOrganizationImpactsRequest request = + ListOrganizationImpactsRequest.newBuilder() + .setParent(OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .build(); + while (true) { + ListOrganizationImpactsResponse response = + serviceHealthClient.listOrganizationImpactsCallable().call(request); + for (OrganizationImpact element : response.getOrganizationImpactsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END servicehealth_v1_generated_ServiceHealth_ListOrganizationImpacts_Paged_async] diff --git a/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/listorganizationimpacts/SyncListOrganizationImpacts.java b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/listorganizationimpacts/SyncListOrganizationImpacts.java new file mode 100644 index 000000000000..bf75e60e54d2 --- /dev/null +++ b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/listorganizationimpacts/SyncListOrganizationImpacts.java @@ -0,0 +1,52 @@ +/* + * Copyright 2023 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.servicehealth.v1.samples; + +// [START servicehealth_v1_generated_ServiceHealth_ListOrganizationImpacts_sync] +import com.google.cloud.servicehealth.v1.ListOrganizationImpactsRequest; +import com.google.cloud.servicehealth.v1.OrganizationImpact; +import com.google.cloud.servicehealth.v1.OrganizationLocationName; +import com.google.cloud.servicehealth.v1.ServiceHealthClient; + +public class SyncListOrganizationImpacts { + + public static void main(String[] args) throws Exception { + syncListOrganizationImpacts(); + } + + public static void syncListOrganizationImpacts() 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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) { + ListOrganizationImpactsRequest request = + ListOrganizationImpactsRequest.newBuilder() + .setParent(OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .build(); + for (OrganizationImpact element : + serviceHealthClient.listOrganizationImpacts(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END servicehealth_v1_generated_ServiceHealth_ListOrganizationImpacts_sync] diff --git a/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/listorganizationimpacts/SyncListOrganizationImpactsOrganizationlocationname.java b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/listorganizationimpacts/SyncListOrganizationImpactsOrganizationlocationname.java new file mode 100644 index 000000000000..75f7be01cb7c --- /dev/null +++ b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/listorganizationimpacts/SyncListOrganizationImpactsOrganizationlocationname.java @@ -0,0 +1,45 @@ +/* + * Copyright 2023 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.servicehealth.v1.samples; + +// [START servicehealth_v1_generated_ServiceHealth_ListOrganizationImpacts_Organizationlocationname_sync] +import com.google.cloud.servicehealth.v1.OrganizationImpact; +import com.google.cloud.servicehealth.v1.OrganizationLocationName; +import com.google.cloud.servicehealth.v1.ServiceHealthClient; + +public class SyncListOrganizationImpactsOrganizationlocationname { + + public static void main(String[] args) throws Exception { + syncListOrganizationImpactsOrganizationlocationname(); + } + + public static void syncListOrganizationImpactsOrganizationlocationname() 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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) { + OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]"); + for (OrganizationImpact element : + serviceHealthClient.listOrganizationImpacts(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END servicehealth_v1_generated_ServiceHealth_ListOrganizationImpacts_Organizationlocationname_sync] diff --git a/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/listorganizationimpacts/SyncListOrganizationImpactsString.java b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/listorganizationimpacts/SyncListOrganizationImpactsString.java new file mode 100644 index 000000000000..f056c22d2d74 --- /dev/null +++ b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealth/listorganizationimpacts/SyncListOrganizationImpactsString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2023 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.servicehealth.v1.samples; + +// [START servicehealth_v1_generated_ServiceHealth_ListOrganizationImpacts_String_sync] +import com.google.cloud.servicehealth.v1.OrganizationImpact; +import com.google.cloud.servicehealth.v1.OrganizationLocationName; +import com.google.cloud.servicehealth.v1.ServiceHealthClient; + +public class SyncListOrganizationImpactsString { + + public static void main(String[] args) throws Exception { + syncListOrganizationImpactsString(); + } + + public static void syncListOrganizationImpactsString() 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 (ServiceHealthClient serviceHealthClient = ServiceHealthClient.create()) { + String parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString(); + for (OrganizationImpact element : + serviceHealthClient.listOrganizationImpacts(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END servicehealth_v1_generated_ServiceHealth_ListOrganizationImpacts_String_sync] diff --git a/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealthsettings/getevent/SyncGetEvent.java b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealthsettings/getevent/SyncGetEvent.java new file mode 100644 index 000000000000..07f6ed3a3bf8 --- /dev/null +++ b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/servicehealthsettings/getevent/SyncGetEvent.java @@ -0,0 +1,48 @@ +/* + * Copyright 2023 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.servicehealth.v1.samples; + +// [START servicehealth_v1_generated_ServiceHealthSettings_GetEvent_sync] +import com.google.cloud.servicehealth.v1.ServiceHealthSettings; +import java.time.Duration; + +public class SyncGetEvent { + + public static void main(String[] args) throws Exception { + syncGetEvent(); + } + + public static void syncGetEvent() 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 + ServiceHealthSettings.Builder serviceHealthSettingsBuilder = ServiceHealthSettings.newBuilder(); + serviceHealthSettingsBuilder + .getEventSettings() + .setRetrySettings( + serviceHealthSettingsBuilder + .getEventSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + ServiceHealthSettings serviceHealthSettings = serviceHealthSettingsBuilder.build(); + } +} +// [END servicehealth_v1_generated_ServiceHealthSettings_GetEvent_sync] diff --git a/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/stub/servicehealthstubsettings/getevent/SyncGetEvent.java b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/stub/servicehealthstubsettings/getevent/SyncGetEvent.java new file mode 100644 index 000000000000..b2b8c6d4c13f --- /dev/null +++ b/java-servicehealth/samples/snippets/generated/com/google/cloud/servicehealth/v1/stub/servicehealthstubsettings/getevent/SyncGetEvent.java @@ -0,0 +1,49 @@ +/* + * Copyright 2023 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.servicehealth.v1.stub.samples; + +// [START servicehealth_v1_generated_ServiceHealthStubSettings_GetEvent_sync] +import com.google.cloud.servicehealth.v1.stub.ServiceHealthStubSettings; +import java.time.Duration; + +public class SyncGetEvent { + + public static void main(String[] args) throws Exception { + syncGetEvent(); + } + + public static void syncGetEvent() 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 + ServiceHealthStubSettings.Builder serviceHealthSettingsBuilder = + ServiceHealthStubSettings.newBuilder(); + serviceHealthSettingsBuilder + .getEventSettings() + .setRetrySettings( + serviceHealthSettingsBuilder + .getEventSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + ServiceHealthStubSettings serviceHealthSettings = serviceHealthSettingsBuilder.build(); + } +} +// [END servicehealth_v1_generated_ServiceHealthStubSettings_GetEvent_sync] diff --git a/pom.xml b/pom.xml index 1287ec79f2f9..7230ece85ef9 100644 --- a/pom.xml +++ b/pom.xml @@ -155,6 +155,7 @@ java-security-private-ca java-service-control java-servicedirectory + java-servicehealth java-service-management java-service-usage java-shell diff --git a/versions.txt b/versions.txt index 8ebd7d9f953c..f4ab41abc2c8 100644 --- a/versions.txt +++ b/versions.txt @@ -722,3 +722,6 @@ grpc-google-shopping-css-v1:0.1.0:0.2.0-SNAPSHOT google-cloud-meet:0.0.0:0.0.1-SNAPSHOT proto-google-cloud-meet-v2beta:0.0.0:0.0.1-SNAPSHOT grpc-google-cloud-meet-v2beta:0.0.0:0.0.1-SNAPSHOT +google-cloud-servicehealth:0.0.0:0.0.1-SNAPSHOT +proto-google-cloud-servicehealth-v1:0.0.0:0.0.1-SNAPSHOT +grpc-google-cloud-servicehealth-v1:0.0.0:0.0.1-SNAPSHOT